All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: "Frank Li" <Frank.Li@nxp.com>, "Jon Mason" <jdmason@kudzu.us>,
	"Dave Jiang" <dave.jiang@intel.com>,
	"Allen Hubbe" <allenbh@gmail.com>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	ntb@lists.linux.dev, linux-pci@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: endpoint: Fix epf_ntb_epc_cleanup() a bit
Date: Fri, 14 Jun 2024 16:01:01 +0300 (EEST)	[thread overview]
Message-ID: <7ae11357-6284-9afa-2272-19e796bc2018@linux.intel.com> (raw)
In-Reply-To: <aaffbe8d-7094-4083-8146-185f4a84e8a1@moroto.mountain>

[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]

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@linaro.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@linux.intel.com>

-- 
 i.

  reply	other threads:[~2024-06-14 13:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10  9:32 [PATCH 0/2] PCI: endpoint: fix a couple error handling bugs Dan Carpenter
2024-06-10  9:33 ` [PATCH 1/2] PCI: endpoint: Clean up error handling in vpci_scan_bus() Dan Carpenter
2024-06-14 12:57   ` Ilpo Järvinen
2024-06-10  9:33 ` [PATCH 2/2] PCI: endpoint: Fix epf_ntb_epc_cleanup() a bit Dan Carpenter
2024-06-14 13:01   ` Ilpo Järvinen [this message]
2024-07-01 20:34 ` [PATCH 0/2] PCI: endpoint: fix a couple error handling bugs Krzysztof Wilczyński

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ae11357-6284-9afa-2272-19e796bc2018@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=Frank.Li@nxp.com \
    --cc=allenbh@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=dan.carpenter@linaro.org \
    --cc=dave.jiang@intel.com \
    --cc=jdmason@kudzu.us \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=ntb@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.