From patchwork Tue May 28 13:00:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 13676624 X-Patchwork-Delegate: kw@linux.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 13E6216D9AC for ; Tue, 28 May 2024 13:00:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716901253; cv=none; b=kN3YjBpaGAl2/eAx7A7doNBkPqG1xzcZ4sdePhZJiAdOgNgjwW9fToJuW8/4LUp6egcTkFBoVH7oxywaGSlfU4WzGPTxDr3xKjSNpGiYLN6quV9Dj1aBhYxwaRH1xwcmLRU3eDU3MMIL5CWIvbcQOMVDfufy7g2uVt7aRJzjAiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716901253; c=relaxed/simple; bh=rTKDOORCHsiuFawhjGRKxRI14XmNpYQLaB2TyDJOugg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GqFylcdc2FU/keX0uAY2WA0cbc96QjpLZetPGrHjNR6+qCktaITMD1ejLJ1oepFKUnxmrOyuqBFIKPQTfMAT71bP2cAdcikpAqzoHz3F5SdEplLZo0YmVb9k1G7ClestR5jUtvq3hW5J/aAdisX2NrE3ovdHnfPQ/1RvaPqCaWw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DvuTwEpP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DvuTwEpP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9939CC4AF12; Tue, 28 May 2024 13:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716901252; bh=rTKDOORCHsiuFawhjGRKxRI14XmNpYQLaB2TyDJOugg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DvuTwEpPNllONSJXNQGvh+VjoW2+QSDLbe01iEyKBmwK2yM9NPWYsF/aGW09tPJqY zfYyd8Lt7w0fw6dTp6TNpOPTHGeYIB9McMtxw9CHpPznWRnImbUDLSSkrosueN0EQu bbdaMi0Dhi430DiGuwMrL737XDaCx0ic0YJ4eFQIFs2tlLYMji5qcyoip0IqoT8Cj9 TPvNuu75uBsHAw9ju/9XTe9HwFNAb+aB6lB9etTwTQz1sr7P7zbmHy0wg48tpLAVl0 V2lFyo3sI8Jr4Dv4jfaiICvwoJfk9LZoMClFgJ2sVXKBGgo4kkZ1OhRdeh4tCWvNPB DzCte/Wvx72oQ== From: Niklas Cassel To: Jingoo Han , Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas Cc: Damien Le Moal , Niklas Cassel , linux-pci@vger.kernel.org Subject: [PATCH 1/3] PCI: dwc: ep: Add dw_pcie_ep_deinit_notify() Date: Tue, 28 May 2024 15:00:37 +0200 Message-ID: <20240528130035.1472871-6-cassel@kernel.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240528130035.1472871-5-cassel@kernel.org> References: <20240528130035.1472871-5-cassel@kernel.org> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2320; i=cassel@kernel.org; h=from:subject; bh=rTKDOORCHsiuFawhjGRKxRI14XmNpYQLaB2TyDJOugg=; b=owGbwMvMwCV2MsVw8cxjvkWMp9WSGNJCr5YcFtda8fo8z6Pjmxxeemaqxq7J9hP7OWfW9I7fb G+/Sqzz6ShlYRDjYpAVU2Tx/eGyv7jbfcpxxTs2MHNYmUCGMHBxCsBE0n8x/C+r2vkoQdgnbOW+ 8rjXDxUeRZ2TEnBLv39dT0Dl9V4OvlUM/2vbt82+z+65RystfmGM/mmbqMn8BU1/08WvPfy9SGu xAR8A X-Developer-Key: i=cassel@kernel.org; a=openpgp; fpr=5ADE635C0E631CBBD5BE065A352FE6582ED9B5DA Add a DWC specific wrapper function (dw_pcie_ep_deinit_notify()) around pci_epc_deinit_notify(), similar to how we have a wrapper function (dw_pcie_ep_init_notify()) around pci_epc_init_notify(). This will allow the DWC glue drivers to use the same API layer for init and deinit notification. Signed-off-by: Niklas Cassel --- drivers/pci/controller/dwc/pcie-designware-ep.c | 13 +++++++++++++ drivers/pci/controller/dwc/pcie-designware.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 2063cf2049e5..3c9079651dff 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -39,6 +39,19 @@ void dw_pcie_ep_init_notify(struct dw_pcie_ep *ep) } EXPORT_SYMBOL_GPL(dw_pcie_ep_init_notify); +/** + * dw_pcie_ep_deinit_notify - Notify EPF drivers about EPC deinitialization + * complete + * @ep: DWC EP device + */ +void dw_pcie_ep_deinit_notify(struct dw_pcie_ep *ep) +{ + struct pci_epc *epc = ep->epc; + + pci_epc_deinit_notify(epc); +} +EXPORT_SYMBOL_GPL(dw_pcie_ep_deinit_notify); + /** * dw_pcie_ep_get_func_from_ep - Get the struct dw_pcie_ep_func corresponding to * the endpoint function diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h index f8e5431a207b..dc63f764b8ba 100644 --- a/drivers/pci/controller/dwc/pcie-designware.h +++ b/drivers/pci/controller/dwc/pcie-designware.h @@ -672,6 +672,7 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep); int dw_pcie_ep_init_registers(struct dw_pcie_ep *ep); void dw_pcie_ep_init_notify(struct dw_pcie_ep *ep); void dw_pcie_ep_deinit(struct dw_pcie_ep *ep); +void dw_pcie_ep_deinit_notify(struct dw_pcie_ep *ep); void dw_pcie_ep_cleanup(struct dw_pcie_ep *ep); int dw_pcie_ep_raise_intx_irq(struct dw_pcie_ep *ep, u8 func_no); int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no, @@ -706,6 +707,10 @@ static inline void dw_pcie_ep_deinit(struct dw_pcie_ep *ep) { } +static inline void dw_pcie_ep_deinit_notify(struct dw_pcie_ep *ep) +{ +} + static inline void dw_pcie_ep_cleanup(struct dw_pcie_ep *ep) { } From patchwork Tue May 28 13:00:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 13676625 X-Patchwork-Delegate: kw@linux.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB69A16D9AC; Tue, 28 May 2024 13:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716901255; cv=none; b=rIZ6oW/Joqs/jk69bqCTcn6zkJAVutDXGt3sIJidJcOTF7PNW/X2eQOOlUPZHVz8+GD0tm0uv2wNxY/OO46k0nL42nuJrz2YI4RmdpVyJQjyA/DH7uEO65ugD2lI0f+wswI6nC6tEpnSu12FP74msSqwUT6YokWBrxmtFKhiaL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716901255; c=relaxed/simple; bh=o5YaV/F8okH3+THu/qvPwFBoRhLEWm6VUfwNDyMYEKI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c0zXZ8frjzxFGRs91GyinaJ5L/SE0sRLW+zHDyXIuDPKzrQHBvw4Rs9PoqcxBnglZZdxZ3V1pVAn524epf7s82AWrUUbvU7AC7RxFxmhPb2x0XA4CBwpH6fWj9it8qHP51EvQdfG1XOVRgS3ow7DeFRM7gE5VqqtTpx2a7Wn2is= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aGazNDdL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aGazNDdL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 587BBC3277B; Tue, 28 May 2024 13:00:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716901255; bh=o5YaV/F8okH3+THu/qvPwFBoRhLEWm6VUfwNDyMYEKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aGazNDdL2OCx9AsxfndwJOeTFQIRvuAMMrjm1yMwbFNaiYPbsFlM9DGTAHazC/RHh H4rvHdcSUOcitAsglzj90rMz7kjxZ4QdLYORqe/OfRQUsHUqx5eO7zLzI+TLJgpQSJ aR/jTzJUisAjfjUldVkkSGMwbVBgkkR0Mtkm34HFwTuBOljY4sRkVMRLIjJFagis2l a82qytHg+gpwI7lagzL+e0q1U270hZa69Ah/3UEfCcsqEdQG2n1iIZl6ZtBP0wFu4z wHVdnfHFtOHNwEZZoMxh5thm0qb+KWB5FNcFMoXlfk5r8XNEYJ/ACWnNlG2LKAYGHs BS/6oM0R7atGA== From: Niklas Cassel To: Manivannan Sadhasivam , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas Cc: Damien Le Moal , Niklas Cassel , linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: [PATCH 2/3] PCI: qcom-ep: Make use of dw_pcie_ep_deinit_notify() Date: Tue, 28 May 2024 15:00:38 +0200 Message-ID: <20240528130035.1472871-7-cassel@kernel.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240528130035.1472871-5-cassel@kernel.org> References: <20240528130035.1472871-5-cassel@kernel.org> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=863; i=cassel@kernel.org; h=from:subject; bh=o5YaV/F8okH3+THu/qvPwFBoRhLEWm6VUfwNDyMYEKI=; b=owGbwMvMwCV2MsVw8cxjvkWMp9WSGNJCr5bMOniD3YDVY6GSWo0sc8/9j0tOnnihfeWSntuUx JWTMi887ChlYRDjYpAVU2Tx/eGyv7jbfcpxxTs2MHNYmUCGMHBxCsBENO0ZGVb9lwtQ6lq16lec 1EeVigb71mDN3PV9pUpLG5851zI3ZTP801z/L8VsKbt0+4d/iz+edDP327+A18H3wP9Ua/nrOvU NrAA= X-Developer-Key: i=cassel@kernel.org; a=openpgp; fpr=5ADE635C0E631CBBD5BE065A352FE6582ED9B5DA By using dw_pcie_ep_deinit_notify(), the init and deinit notification is performed using the same API layer. This makes the driver more consistent. Signed-off-by: Niklas Cassel --- drivers/pci/controller/dwc/pcie-qcom-ep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c index b6a5010cc1a7..25bf790e9725 100644 --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c @@ -507,7 +507,7 @@ static void qcom_pcie_perst_assert(struct dw_pcie *pci) return; } - pci_epc_deinit_notify(pci->ep.epc); + dw_pcie_ep_deinit_notify(&pci->ep); dw_pcie_ep_cleanup(&pci->ep); qcom_pcie_disable_resources(pcie_ep); pcie_ep->link_status = QCOM_PCIE_EP_LINK_DISABLED; From patchwork Tue May 28 13:00:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 13676626 X-Patchwork-Delegate: kw@linux.com Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4ECDB16D9AC; Tue, 28 May 2024 13:00:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716901259; cv=none; b=rdgv7i0f5Sri+KEU77lZFUhtwFWvFmEenwF8Ch8rvbH+irC4H3PYpsR1O25G/mr9nElMF+bTiuYw204mWwc2Xp9Ib6eIA7V231ycjobkT+EiNy76BjJNgWesEsVqhcOmSqk0sxKSrd6SUbn8CKECjbQbGICFQNrN2r+/h+EdzIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716901259; c=relaxed/simple; bh=NcRAmy3b90mQ51Kyo7/npjFxFXRRqDagv1+GRNTpMO8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mu8WHiDSL7BEjzT/Gm+QYQqu73D0rhTnkW6Qvb3GgCusox8p6MfcGqRi6DTGtYWQVTt6Lf5/EPoKtlL7HT+bYdkk2bynDmsqqwHGivQ8/aQt8ZIdev54Y8IFjQDdsaL47N6J3XMmrtEVA1YzeLXqayLvfrNx1e/GBrd+CPTo9D8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jmtS5UpB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jmtS5UpB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24B89C4AF0C; Tue, 28 May 2024 13:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716901258; bh=NcRAmy3b90mQ51Kyo7/npjFxFXRRqDagv1+GRNTpMO8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jmtS5UpBTS7r+WNcz4Xm8wGmNHPhe4RDv5V2xBSZyZ+uE/uDkz5j+33aPZz3bJxG0 VGX0jatdIc0whlbEkfU0sYhdN7OISdRm8bJ/LJUEUCQ7wZy6O2isu6RW40Pw9g9D9J X56la93TXUqC9UB+Kyaw05kxRFTDB0ijLI+5MMN5Bw/5Eh1TrLUsIZosDkr4EyYPa/ m4aqVBqUNel//4OG+7hY/r+spGO/DfB3X322ihUrKOoRwWI+mYm+wDCAMsttufsehP QHHAYvKbc0CUJDhL0LpemxrJkdQgAsnCoWRimjdivlfhOtwmP7C39+kTf8r7p+SvBV d7t9YsaS9O4nA== From: Niklas Cassel To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Rob Herring , Bjorn Helgaas , Thierry Reding , Jonathan Hunter , Niklas Cassel , Manivannan Sadhasivam Cc: Damien Le Moal , kernel test robot , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 3/3] PCI: tegra194: Make use of dw_pcie_ep_deinit_notify() Date: Tue, 28 May 2024 15:00:39 +0200 Message-ID: <20240528130035.1472871-8-cassel@kernel.org> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240528130035.1472871-5-cassel@kernel.org> References: <20240528130035.1472871-5-cassel@kernel.org> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1327; i=cassel@kernel.org; h=from:subject; bh=NcRAmy3b90mQ51Kyo7/npjFxFXRRqDagv1+GRNTpMO8=; b=owGbwMvMwCV2MsVw8cxjvkWMp9WSGNJCr5Z0xEbIpFyvkIs6lsac79XOs7bWXYufJbDY2ehT0 Nsb5ikdpSwMYlwMsmKKLL4/XPYXd7tPOa54xwZmDisTyBAGLk4BmIinI8NfETOVo7oK/C8XS+mv z0m70VbPv2Zmrtofh63HY/Q/l0dtZfjDr7h7xhaJD8v81r8sUp4r/ktzgtL8xC6m+sc9N2YtKnj JBgA= X-Developer-Key: i=cassel@kernel.org; a=openpgp; fpr=5ADE635C0E631CBBD5BE065A352FE6582ED9B5DA By using dw_pcie_ep_deinit_notify(), the init and deinit notification is performed using the same API layer. This makes the driver more consistent. It also fixes a linker error where pci_epc_deinit_notify() would fail to link in certain Kconfig combinations, because the PCI endpoint API layer does not provide any dummy implementations. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202405130815.BwBrIepL-lkp@intel.com Fixes: f94f2844f28c ("PCI: endpoint: Introduce 'epc_deinit' event and notify the EPF drivers") Signed-off-by: Niklas Cassel --- drivers/pci/controller/dwc/pcie-tegra194.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 4b28f8beedfe..be1f10cadf1d 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -1715,7 +1715,7 @@ static void pex_ep_event_pex_rst_assert(struct tegra_pcie_dw *pcie) if (ret) dev_err(pcie->dev, "Failed to go Detect state: %d\n", ret); - pci_epc_deinit_notify(pcie->pci.ep.epc); + dw_pcie_ep_deinit_notify(&pcie->pci.ep); dw_pcie_ep_cleanup(&pcie->pci.ep); reset_control_assert(pcie->core_rst);