[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180701171443.GA28249@wunner.de>
Date: Sun, 1 Jul 2018 19:14:43 +0200
From: Lukas Wunner <lukas@...ner.de>
To: Sinan Kaya <okaya@...eaurora.org>
Cc: linux-pci@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Bjorn Helgaas <bhelgaas@...gle.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Oza Pawandeep <poza@...eaurora.org>,
Keith Busch <keith.busch@...el.com>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V4 7/7] PCI: Handle link reset via hotplug if supported
On Thu, Jun 28, 2018 at 03:31:05PM -0400, Sinan Kaya wrote:
> +static pci_ers_result_t pciehp_reset_link(struct pci_dev *pdev)
> +{
> + struct pcie_device *pciedev;
> + struct controller *ctrl;
> + struct device *devhp;
> + struct slot *slot;
> + int rc;
> +
> + devhp = pcie_port_find_device(pdev, PCIE_PORT_SERVICE_HP);
> + pciedev = to_pcie_device(devhp);
> + ctrl = get_service_data(pciedev);
> + slot = ctrl->slot;
> +
> + rc = reset_slot(slot->hotplug_slot, 0);
> +
> + return !rc ? PCI_ERS_RESULT_RECOVERED : PCI_ERS_RESULT_DISCONNECT;
> +}
This looks like a bit of a detour. There's a "struct pci_slot *slot"
pointer in struct pci_dev. Any reason not to simply call:
rc = reset_slot(pdev->slot->hotplug_slot)
Lukas
Powered by blists - more mailing lists