From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 065F0ECAAA1 for ; Fri, 9 Sep 2022 10:34:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=H4II+41094u0jc41ycIi9IS2U2OI85xJNJV/U4mj1+o=; b=N7x3TY0wrpLS/B 7le2tEqBmZ99MdO1SoqxIi4ThCKJt9oWmTrg5fdlkCL7wNLyL8KlHyy1jczo8aBnbodkD/SAPUnU3 8PqccU6+BuGzO520pVl8TdhYKP1UD9mjsm0biEur3a15DOHk5LVzhJBAATF20nSsyWb/AtEQVsBhh 6x/nnZzc6VeROpIbmAZfIOaLl99hiCS0IADtMxREWr+ri4dKC6+IC+/18+zusEQKOAAX6Oijn+wZg zv152aMqnxIcd7qU80AB1CB/uswLnhMtyAUm+bmT+1kLpeP5dX3o710tALy3NQTnnZ3WS3XKD36Au HJR+UFQwbVdB1kGmUL0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWbK0-00FNvj-CK; Fri, 09 Sep 2022 10:33:16 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWbJv-00FNtC-G4 for linux-arm-kernel@lists.infradead.org; Fri, 09 Sep 2022 10:33:13 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 870DCB82244; Fri, 9 Sep 2022 10:33:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 876BEC433C1; Fri, 9 Sep 2022 10:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662719588; bh=EfvzWZrKII824bXgNsNQt6eOqf8Mu/ndVvumX1L72VA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KHDVzHwUlbpyVoHOop4WXhtctVZzK/tobvkC1V4TCwVsCA4ZImB0wRXDzN83TJAzS +GLBdPgIscDFQjIAsu5c4NqQL6HfGLVY8gYKX6WxUygTvXLPhXqwq7BsdkVe2HCNDD vL1IEpdyfHjS+PyVbwFloEoDqMAsPDpozoqsP6fJNFl5CdMi/Lgj8h74iN1VCq1p2N S6VG6wU+/hXPypsy6Ge4b/miuU7Uap6E02ntgHtpnNvYdDwiYM3XIgZ+h3kIwpzqvM YYOjN5bSWpVNalICvqLhdSW8oOjN3UDa0U3KNdLTF+M1cZxxazUuYl8v+U9EtABDoU 4TQuTUgZy4LKQ== Date: Fri, 9 Sep 2022 12:33:01 +0200 From: Lorenzo Pieralisi To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: Lorenzo Pieralisi , Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , pali@kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Miquel Raynal Subject: Re: [PATCH 07/11] PCI: aardvark: Add suspend to RAM support Message-ID: References: <20220818135140.5996-1-kabel@kernel.org> <20220818135140.5996-8-kabel@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220818135140.5996-8-kabel@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220909_033311_881027_AE64993B X-CRM114-Status: GOOD ( 26.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 18, 2022 at 03:51:36PM +0200, Marek Beh=FAn wrote: > From: Miquel Raynal > = > Add suspend and resume callbacks. We need to use the NOIRQ variants to > ensure the controller's IRQ handlers are not run during suspend() / > resume(), which could cause races. Be more explicit please, which races, which IRQ handlers. This is useful information for future testers/reviewers in case something has to be changed, thanks. Lorenzo > Signed-off-by: Miquel Raynal > Signed-off-by: Pali Roh=E1r > Signed-off-by: Marek Beh=FAn > --- > Changes since batch 5: > - clarified commit message > - changed to new macro NOIRQ_SYSTEM_SLEEP_PM_OPS, as was done for many > PCI controller drivers with commit 19b7858c3357 ("PCI: Convert to new > *_PM_OPS macros") > --- > drivers/pci/controller/pci-aardvark.c | 34 +++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > = > diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controll= er/pci-aardvark.c > index 3beafc893969..e30a33a4ecc6 100644 > --- a/drivers/pci/controller/pci-aardvark.c > +++ b/drivers/pci/controller/pci-aardvark.c > @@ -1890,6 +1890,39 @@ static int advk_pcie_setup_phy(struct advk_pcie *p= cie) > return ret; > } > = > +static int advk_pcie_suspend(struct device *dev) > +{ > + struct advk_pcie *pcie =3D dev_get_drvdata(dev); > + > + advk_pcie_disable_phy(pcie); > + > + clk_disable_unprepare(pcie->clk); > + > + return 0; > +} > + > +static int advk_pcie_resume(struct device *dev) > +{ > + struct advk_pcie *pcie =3D dev_get_drvdata(dev); > + int ret; > + > + ret =3D clk_prepare_enable(pcie->clk); > + if (ret) > + return ret; > + > + ret =3D advk_pcie_enable_phy(pcie); > + if (ret) > + return ret; > + > + advk_pcie_setup_hw(pcie); > + > + return 0; > +} > + > +static const struct dev_pm_ops advk_pcie_dev_pm_ops =3D { > + NOIRQ_SYSTEM_SLEEP_PM_OPS(advk_pcie_suspend, advk_pcie_resume) > +}; > + > static int advk_pcie_probe(struct platform_device *pdev) > { > struct device *dev =3D &pdev->dev; > @@ -2167,6 +2200,7 @@ static struct platform_driver advk_pcie_driver =3D { > .driver =3D { > .name =3D "advk-pcie", > .of_match_table =3D advk_pcie_of_match_table, > + .pm =3D &advk_pcie_dev_pm_ops, > }, > .probe =3D advk_pcie_probe, > .remove =3D advk_pcie_remove, > -- = > 2.35.1 > = > = > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel