Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp29398777rwd; Wed, 5 Jul 2023 11:13:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4aziOuHOpVqKN5geM7//6BR66T6kbZJJZ+4goRuOt/k+WDV8Z6KtifER/mLRJxYCVhVema X-Received: by 2002:a05:6870:6718:b0:1b0:9d7d:3484 with SMTP id gb24-20020a056870671800b001b09d7d3484mr19494635oab.44.1688580782783; Wed, 05 Jul 2023 11:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688580782; cv=none; d=google.com; s=arc-20160816; b=I6AChE+VGyno2mBC3Mf/KPQPxf1K9qEzn5KTBMVR91V5LNR7zHgOAYXB4LGo4HR9Ip Num8764COS7l4oZ6eDZhtSKmYpWrFwba8HA5HPp6ymmtn1Ff1/qhX/5UcZyEpTAqcU9n rqgzJtSj74tEfaaxMTN9RzLUHoML0rGaRh0upk54cj6Mtzy3tpbi0E5ckJIBRiVyaqiO NtXgBvxj8FipfoZugc+r0KI0pLytEM9ZRvtPfPrUzett84vdKiwDXriBoQoGI5gjy2xZ 3kOoPjEL+XEZCbUfVfFH1t3EKp4YjK9ZQ8qjBTp0D8nQl8/I1hhPkuNBn46RfKTYzs4J song== 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=; fh=t403tOoFTuNw4M3DM83t4OMKFrci4/Cr3Y3LzjO+0ic=; b=o9GOvoiSAEpu0DeBHW4mNwWO6N8WP6t8SIes1yBsNzZlFYxmtIuONCVbaC24ERp85r EcbuRNdOi32vV8Y8qFeUriSvfzupVxy6bi9Ri11C0/e4b+uAMeQRirqM16kSBiAp0sZc imroqDzlducB7P+fL1oTor5RQsaS5LMy3dBB4iyx4Ei0QNAUqe3iwVCsBN0LcY48p/k7 GzbuxqopIuKREmYElc54c/XKq6VxGqzMe8Y6W3XSJQ2uiQ0DupIvY449wSj/NomcBuXJ SksAjkoSfDDnxcyVHu866qxfVJiihBuKFYbl3P8vw3b/4aw9VNqXRsdwsfiSNNs27cmS WXrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=aE2s2rAM; 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 y5-20020a17090aa40500b0025b8a96a363si2139109pjp.90.2023.07.05.11.12.45; Wed, 05 Jul 2023 11:13:02 -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=aE2s2rAM; 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 S232855AbjGERpW (ORCPT + 99 others); Wed, 5 Jul 2023 13:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232018AbjGERpR (ORCPT ); Wed, 5 Jul 2023 13:45:17 -0400 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D607A171A; Wed, 5 Jul 2023 10:45:12 -0700 (PDT) Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 365FkKtL003266; Wed, 5 Jul 2023 19:45:06 +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=aE2s2rAMYrl2V9Rp3K7wCgO4SG96Rny7oOj+3OvTZ/ZdHr++RMdIENMaL2l9/vR2d3de GhMejtuDl/MvdO7OHF/6afweuJl5ow4d6oZ9UFlA1Mutl+jjzqkilpvknILxWlbH5kVH 4ytJsEclMIj9GZulOMI+RPPVnOy/MxEDXR1tcRRweorivYl1OAh+hdRqA/i3vheviy0Z BGkMPSGTrab/tw4KRZrxkWhx3SKgBTCFuevq8mHV0nwG81FOTHmmkGhxyMqzKa1EWvjD J7eFpnGmCAL5RN38Rparrkq95J+mHX8eNbAQGF0MUrhEbWqTeXpbFUGYCm7h4wumrd2x 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 3rn8c9t535-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 Jul 2023 19:45:06 +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 ECB3B100057; Wed, 5 Jul 2023 19:45:05 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E5BD2252252; Wed, 5 Jul 2023 19:45:05 +0200 (CEST) Received: from localhost (10.201.20.168) 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; Wed, 5 Jul 2023 19:45:05 +0200 From: Valentin Caron To: Alexandre Belloni , Alessandro Zummo CC: Alexandre Torgue , Antonio Borneo , Christophe Guibout , Gabriel Fernandez , , , , , Valentin Caron Subject: [PATCH v2 5/7] rtc: stm32: change PM callbacks to "_noirq()" Date: Wed, 5 Jul 2023 19:43:55 +0200 Message-ID: <20230705174357.353616-6-valentin.caron@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230705174357.353616-1-valentin.caron@foss.st.com> References: <20230705174357.353616-1-valentin.caron@foss.st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.201.20.168] 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.591,FMLib:17.11.176.26 definitions=2023-07-05_09,2023-07-05_01,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,URIBL_BLOCKED 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