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 AC22CC7EE25 for ; Thu, 8 Jun 2023 17:15:36 +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: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:References: List-Owner; bh=5rES4IxU1uNL8C8D/6hT8fmgDSxAP17r3jps6En/0Fs=; b=RIlH539T4lpt1H geoAwEa1qztsdP/6tFWYMBN3eS2VmDpx/kSd5PKoDBDflFlbwo0jmmMKt4/fagshn3hFFcXacJRwG nqNVpfisGLw2KCLw4++L6aiF0GxQV/f3jGzUTNvreDBEqJntFIvuMINbaEeOJ0uCv8UVGB5Jzn3IE 9zx6KFMve1k/2aM/F3Q9bhASeFrEFsaqT9uwNejv7S4OGa5VfSdHHfMxwU0RZjBqQZaOnhpyAbHeN NP3yNklBtIATCr0QUGBQG/wwLycp3BtCqr0Kb7Lm6i8ywzwakvJT0QwEFYotKtfBK5k6GI0bOiCnz vXOttKGxjma2QcSdIk9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7JEA-00A0X4-2L; Thu, 08 Jun 2023 17:15:14 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7JE8-00A0Vo-0L; Thu, 08 Jun 2023 17:15: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 dfw.source.kernel.org (Postfix) with ESMTPS id BFD1664F78; Thu, 8 Jun 2023 17:15:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D494BC433EF; Thu, 8 Jun 2023 17:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686244509; bh=4wyq5feJyGC1xVBcTZ/Mti/s0RME8bXOsMag48IzS5g=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=XTu/6CbFHIlPGMsivoT/edMq3lP0JFtqLA2e4ijvZTyXI+rXPp30vZH5LPiAlfpWT ugJrxfdgowagoYMwEL/U9+Kg/EBvzLktvSgkh/LEkNCyopOwy3PKxXLtppLkmBlsBE UdSMxg86UJRbEhFWwiqyETZkIUd/+/UBqCVtGROzszLOA/BEkDSbtAgovo6eSjSGZI TJ1908tHQzPGj3lDCD9pebdDBwxu2F6b80AfEn/ZLa2SseYdN4tEaRSkjYf94bPayd 1S0JP5aOo2mZDEF3c0j4lfBEO0yx/fmTo1/iqDaEMdTeuNBVOS7JYXMrNDQq+b0Gtn xqUBgfOfFcFsA== Date: Thu, 8 Jun 2023 12:15:07 -0500 From: Bjorn Helgaas To: AngeloGioacchino Del Regno Cc: ryder.lee@mediatek.com, jianjun.wang@mediatek.com, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, p.zabel@pengutronix.de, matthias.bgg@gmail.com, linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/2] PCI: mediatek-gen3: Stop acquiring spinlocks in {suspend,resume}_noirq Message-ID: <20230608171507.GA1204894@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230504113509.184633-2-angelogioacchino.delregno@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230608_101512_209025_ECB7A836 X-CRM114-Status: GOOD ( 13.12 ) 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="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 04, 2023 at 01:35:08PM +0200, AngeloGioacchino Del Regno wrote: > In mtk_pcie_suspend_noirq() and mtk_pcie_resume_noirq() we are, > respectively, disabling and enabling generation of interrupts and > then saving and restoring the enabled interrupts register: since > we're using noirq PM callbacks, that can be safely done without > holding any spin lock. Tangent: it's annoying that pcie-mediatek.c and pcie-mediatek-gen3.c use identical "mtk_pcie_suspend_noirq()" names. That makes browsing harder than it needs to be. But I see that you refer to mediatek-gen3. > +++ b/drivers/pci/controller/pcie-mediatek-gen3.c > @@ -963,8 +963,6 @@ static void mtk_pcie_irq_save(struct mtk_gen3_pcie *pcie) > { > int i; > > - raw_spin_lock(&pcie->irq_lock); > - > pcie->saved_irq_state = readl_relaxed(pcie->base + PCIE_INT_ENABLE_REG); > > for (i = 0; i < PCIE_MSI_SET_NUM; i++) { > @@ -973,16 +971,12 @@ static void mtk_pcie_irq_save(struct mtk_gen3_pcie *pcie) > msi_set->saved_irq_state = readl_relaxed(msi_set->base + > PCIE_MSI_SET_ENABLE_OFFSET); > } > - > - raw_spin_unlock(&pcie->irq_lock); > } Jianjun added mtk_pcie_irq_save() and mtk_pcie_irq_restore() with d537dc125f07 ("PCI: mediatek-gen3: Add system PM support"). I suggest looking at other drivers and structuring mediatek-gen3 similarly, including using similar function names. No other drivers have a .*_pcie_irq_save() function. Several have .*_pcie_host_init(), and some of those do include some IRQ setup. Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel