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 5AAAEC7EE25 for ; Fri, 9 Jun 2023 07:30:07 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dqCYHLvFoeegAKQDKWpE7Z6VlqYvPQrGUu+doTYm238=; b=uDhAMPmOe9T5ZE CmW9HXZC09AyRoSNhHE1ZLxVx7Aw898I0ZPUUQM1hUSj64HpXY2owZ4EXXo4CHuIr+zm91QVhmALI RcaOmqIuLQr+cejH3XEKnvMS6b3HShNkYMiL2WydbB3bW5f3gOclQYOw+UBf18gCczq8Me1A1CZoL r8vHzst4kjsPWQIhGaBFNa3AAdxcqM+1uIip3P/SYowZAcx73iW2ithM6+QW4WrumM71/XxMh7t7s 6wYBTjcukhfA1GWWWSZsTYRGwg86D/PD2KtSOkLDZ03Sd98FruLYHk8xADjUqwug5evOzWTt8xOeW na6P4//ugsLRdD0W8cSA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7WZ8-00C2jZ-2d; Fri, 09 Jun 2023 07:29:46 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7WZ5-00C2gA-1k; Fri, 09 Jun 2023 07:29:44 +0000 Received: from [IPV6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab] (unknown [IPv6:2001:b07:2ed:14ed:a962:cd4d:a84:1eab]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 25C306606F2A; Fri, 9 Jun 2023 08:29:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686295779; bh=PRbx+c11bbggGiBNDUqRcT41XRfir2GfxWZ740uanE4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Y/M8YLKhHUIk0lyKmOMoE91zv+WLS+IQnS6wispM55ImFEp0zT5UzgR5IbvnTnUhy CddTUpyrCVBYfVL0rOuVNXGlMOgWVVMq+QFEtEABVtBYYCzET4nDTmS1FEw72EZ+Mk oDBKyS6Ytw8RThDhtyCYJhw7OsTICp7cLQqi72nHqc2ssXvB5z5hsf+OB10c8WgcaI 0FOPtxX+ZNKv7Uerz9tfRrm4lPokHlzTop0LIUKiqisDyw1eZRfza+Sc/ZhEfli4ay 5ki+YHL71d9WrP6+WzNxkOsxmdMcuG24srVT36XdSK31SKjbZilRJjGD8da16rf3Cw YNxIj97ttJFqw== Message-ID: Date: Fri, 9 Jun 2023 09:29:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH 1/2] PCI: mediatek-gen3: Stop acquiring spinlocks in {suspend,resume}_noirq To: Bjorn Helgaas 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 References: <20230608171507.GA1204894@bhelgaas> Content-Language: en-US From: AngeloGioacchino Del Regno In-Reply-To: <20230608171507.GA1204894@bhelgaas> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_002943_754645_F37D3325 X-CRM114-Status: GOOD ( 16.53 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Il 08/06/23 19:15, Bjorn Helgaas ha scritto: > 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 Hello Bjorn, thanks for the feedback! Yes, I of course refer to the Gen3 driver... I'll check other drivers and will try to improve the consistency of this one with the others as soon as I have some bandwidth to perform the job. Thanks again, Angelo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel