[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7ae11357-6284-9afa-2272-19e796bc2018@linux.intel.com>
Date: Fri, 14 Jun 2024 16:01:01 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
cc: Frank Li <Frank.Li@....com>, Jon Mason <jdmason@...zu.us>,
Dave Jiang <dave.jiang@...el.com>, Allen Hubbe <allenbh@...il.com>,
Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
Krzysztof Wilczyński <kw@...ux.com>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>, ntb@...ts.linux.dev,
linux-pci@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 2/2] PCI: endpoint: Fix epf_ntb_epc_cleanup() a bit
On Mon, 10 Jun 2024, Dan Carpenter wrote:
> There are two issues related to epf_ntb_epc_cleanup().
> 1) It should call epf_ntb_config_sspad_bar_clear().
> 2) The epf_ntb_bind() function should call epf_ntb_epc_cleanup()
> to cleanup.
>
> I also changed the ordering a bit. Unwinding should be done in the
> mirror order from how they are allocated.
>
> Fixes: e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and EP")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
> drivers/pci/endpoint/functions/pci-epf-vntb.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/endpoint/functions/pci-epf-vntb.c b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> index 7f05a44e9a9f..874cb097b093 100644
> --- a/drivers/pci/endpoint/functions/pci-epf-vntb.c
> +++ b/drivers/pci/endpoint/functions/pci-epf-vntb.c
> @@ -799,8 +799,9 @@ static int epf_ntb_epc_init(struct epf_ntb *ntb)
> */
> static void epf_ntb_epc_cleanup(struct epf_ntb *ntb)
> {
> - epf_ntb_db_bar_clear(ntb);
> epf_ntb_mw_bar_clear(ntb, ntb->num_mws);
> + epf_ntb_db_bar_clear(ntb);
> + epf_ntb_config_sspad_bar_clear(ntb);
> }
>
> #define EPF_NTB_R(_name) \
> @@ -1337,7 +1338,7 @@ static int epf_ntb_bind(struct pci_epf *epf)
> ret = pci_register_driver(&vntb_pci_driver);
> if (ret) {
> dev_err(dev, "failure register vntb pci driver\n");
> - goto err_bar_alloc;
> + goto err_epc_cleanup;
> }
>
> ret = vpci_scan_bus(ntb);
> @@ -1348,6 +1349,8 @@ static int epf_ntb_bind(struct pci_epf *epf)
>
> err_unregister:
> pci_unregister_driver(&vntb_pci_driver);
> +err_epc_cleanup:
> + epf_ntb_epc_cleanup(ntb);
> err_bar_alloc:
> epf_ntb_config_spad_bar_free(ntb);
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
--
i.
Powered by blists - more mailing lists