Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp834536rwd; Thu, 15 Jun 2023 02:43:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77WQjxTEQpGPK0Y0nsd1d0AZj1SOT3ZSzA5a4Gm3of5WGA3xP9JczQiEHdKLFSjhKhLveF X-Received: by 2002:a9d:7408:0:b0:6ac:8801:24d6 with SMTP id n8-20020a9d7408000000b006ac880124d6mr15907725otk.26.1686822237664; Thu, 15 Jun 2023 02:43:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686822237; cv=none; d=google.com; s=arc-20160816; b=EgPgM7UmHyG91oZqA6/jao5/TFNzmSS6jOqm2/BSF4G6TwxmVRTDCbiMXfQ42pgBwL U7iOz3X0Nt62MqrlnfbX5OrVcze8R2P6g5+z1h22k8jVZ7FE8n7Y+JONH9Bf5Oz/zQ0z o6h0K4aVJ1U3hdlsTKo9bBfSRFjHqGFvoQynj3f79IsFK+k7IwFSpFm7eN/MVXVbKFP/ j6J2ITSBjDtmZ9J+kK7lPIWh73iCqtO/KGJ1fQYN8qK0dByc8gVzxSoPGnpgCrWIe6EP IA0/4Ako+opSauqUaONnH8ywn66ioV3u0eVeK8WeTgnMuGEvDXS4lwq99OGhGriIm9Nl 2+SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YzoRM1g1BfI9MnBB08CDwkG8AHGMKRSS788lXSXjecw=; b=vKKFrUpkdS4mxAxyd8X4csMBLSY9ykYYIVNDcPE8x8jFvM6F0061GDIs+3zEbKMrFd 62wGLDQr4p0MKjY+G5uYP5yATBNZ6FF3CIk+APN3n4qW9yy/NO2VBy50Dp4ZQbm7TSfR IMRoSq1U4ir2s0wvwBfmoSwVAN2vTmC9icdq7XRTe+aDSHB0ZhyyUMiCKoenSrkXCLNO RHtFfY/dQ1kVX/gwo1kp5a7HUSoB9hQHQnf3ta+P0QJgVUAVVf0HJr67oel8vNrqnVHo u96VufSYIYX2lcnkAdaZHVSzLdwfIZzNrz/pqdQVTE2bb6LZ0QhTWXyUiWqjAyLDsqbc xyRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=nUR3E5hn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j69-20020a638048000000b0054fd0012d40si3479804pgd.316.2023.06.15.02.43.45; Thu, 15 Jun 2023 02:43:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=nUR3E5hn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245579AbjFOJd5 (ORCPT + 99 others); Thu, 15 Jun 2023 05:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243155AbjFOJdv (ORCPT ); Thu, 15 Jun 2023 05:33:51 -0400 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2620A2703; Thu, 15 Jun 2023 02:33:35 -0700 (PDT) Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35F8IT69007631; Thu, 15 Jun 2023 11:33:27 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=YzoRM1g1BfI9MnBB08CDwkG8AHGMKRSS788lXSXjecw=; b=nUR3E5hnlBrZqsJJkT3t4/7iH8fWx7QBNH+eiwEd/kwlFzZubambDIA9GNHAUqJGsyJS HyLi0r77FrdlM+8LYdJNtHBa+tkAZt6CcrpEeNfbczaDApFMlJHwXpIgP0hqm/ngLS1/ CUGvIDSWGVaZDTPFnqPmtVvdXOMDwKRpMVq0kJaSAcbVuWmcxKicfCFnuZ4I3RbgxZr9 1G71wrIekaSl1Km/6dADk3ytGXs1yX/Hf7tSL+SYepmh8/+v7AnPE80o+0tYwN6PkWZf EZDBAW57HD1QuYc8qRCNCgRE0EyB1jhZQ2sACyiqNqbRAlONp4dEHfFEHOo87OGvuzfA bQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3r7s1may1v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 15 Jun 2023 11:33:27 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3752610002A; Thu, 15 Jun 2023 11:33:26 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 2E58421A91B; Thu, 15 Jun 2023 11:33:26 +0200 (CEST) Received: from localhost (10.252.8.64) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 15 Jun 2023 11:33:25 +0200 From: Valentin Caron To: Alessandro Zummo , Alexandre Belloni CC: Alexandre Torgue , Antonio Borneo , Christophe Guibout , Gabriel Fernandez , , , , , Valentin Caron Subject: [PATCH 5/7] rtc: stm32: change PM callbacks to "_noirq()" Date: Thu, 15 Jun 2023 11:27:51 +0200 Message-ID: <20230615092753.323844-6-valentin.caron@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230615092753.323844-1-valentin.caron@foss.st.com> References: <20230615092753.323844-1-valentin.caron@foss.st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.252.8.64] X-ClientProxiedBy: SHFCAS1NODE2.st.com (10.75.129.73) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-15_06,2023-06-14_02,2023-05-22_02 X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gabriel Fernandez The RTC driver stops the RTCAPB clock during suspend, but the irq handler from RTC is called before starting clock. Then we are blocked while accessing RTC registers. We changes PM callbacks to '_no_irq()' to disable irq during resume callback and so irq handler will be called after the enable of RTCAPB clock. Signed-off-by: Gabriel Fernandez Signed-off-by: Valentin Caron --- drivers/rtc/rtc-stm32.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c index 5ebf0b8e75f9..17e549806784 100644 --- a/drivers/rtc/rtc-stm32.c +++ b/drivers/rtc/rtc-stm32.c @@ -919,8 +919,9 @@ static int stm32_rtc_resume(struct device *dev) } #endif -static SIMPLE_DEV_PM_OPS(stm32_rtc_pm_ops, - stm32_rtc_suspend, stm32_rtc_resume); +static const struct dev_pm_ops stm32_rtc_pm_ops = { + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(stm32_rtc_suspend, stm32_rtc_resume) +}; static struct platform_driver stm32_rtc_driver = { .probe = stm32_rtc_probe, -- 2.25.1