From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
Dennis Dalessandro <dennis.dalessandro@cornelisnetworks.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>,
linux-pci@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] IB/hfi1: Remove pci_parent_bus_reset() duplication
Date: Tue, 8 Aug 2023 19:51:40 +0300 (EEST) [thread overview]
Message-ID: <07d51c9-e651-2e8e-bf3c-8a3966d5eb@linux.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2306200235510.14084@angie.orcam.me.uk>
[-- Attachment #1: Type: text/plain, Size: 2045 bytes --]
On Tue, 20 Jun 2023, Maciej W. Rozycki wrote:
> Call pci_parent_bus_reset() rather than duplicating it in trigger_sbr().
> There are extra preparatory checks made by the former function, but they
> are supposed to be neutral to the HFI1 device.
>
> Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
> ---
> drivers/infiniband/hw/hfi1/pcie.c | 30 ++++--------------------------
> 1 file changed, 4 insertions(+), 26 deletions(-)
>
> linux-ib-hfi1-pcie-sbr-parent-bus-reset.diff
> Index: linux-macro/drivers/infiniband/hw/hfi1/pcie.c
> ===================================================================
> --- linux-macro.orig/drivers/infiniband/hw/hfi1/pcie.c
> +++ linux-macro/drivers/infiniband/hw/hfi1/pcie.c
> @@ -796,35 +796,13 @@ static void pcie_post_steps(struct hfi1_
> /*
> * Trigger a secondary bus reset (SBR) on ourselves using our parent.
> *
> - * Based on pci_parent_bus_reset() which is not exported by the
> - * kernel core.
> + * This is an end around to do an SBR during probe time. A new API
> + * needs to be implemented to have cleaner interface but this fixes
> + * the current brokenness.
> */
> static int trigger_sbr(struct hfi1_devdata *dd)
> {
> - struct pci_dev *dev = dd->pcidev;
> - struct pci_dev *pdev;
> -
> - /* need a parent */
> - if (!dev->bus->self) {
> - dd_dev_err(dd, "%s: no parent device\n", __func__);
> - return -ENOTTY;
> - }
> -
> - /* should not be anyone else on the bus */
> - list_for_each_entry(pdev, &dev->bus->devices, bus_list)
> - if (pdev != dev) {
> - dd_dev_err(dd,
> - "%s: another device is on the same bus\n",
> - __func__);
> - return -ENOTTY;
> - }
> -
> - /*
> - * This is an end around to do an SBR during probe time. A new API needs
> - * to be implemented to have cleaner interface but this fixes the
> - * current brokenness
> - */
> - return pci_bridge_secondary_bus_reset(dev->bus->self);
> + return pci_parent_bus_reset(dd->pcidev, PCI_RESET_DO_RESET);
> }
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
prev parent reply other threads:[~2023-08-08 18:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-20 9:49 [PATCH 0/2] PCI+IB/hfi1: Fold duplicate secondary bus reset code Maciej W. Rozycki
2023-06-20 9:49 ` [PATCH 1/2] PCI: Export pci_parent_bus_reset() for drivers to use Maciej W. Rozycki
2023-08-08 16:47 ` Ilpo Järvinen
2023-06-20 9:49 ` [PATCH 2/2] IB/hfi1: Remove pci_parent_bus_reset() duplication Maciej W. Rozycki
2023-08-08 16:51 ` Ilpo Järvinen [this message]
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=07d51c9-e651-2e8e-bf3c-8a3966d5eb@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=dennis.dalessandro@cornelisnetworks.com \
--cc=jgg@ziepe.ca \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=macro@orcam.me.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox