All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Deucher, Alexander" <Alexander.Deucher@amd.com>
To: Bjorn Helgaas <helgaas@kernel.org>, Lukas Wunner <lukas@wunner.de>
Cc: Huacai Chen <chenhc@lemote.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	Huacai Chen <chenhuacai@gmail.com>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: RE: [PATCH 1/2] PCI/portdrv: Remove the .remove() method in pcie_portdriver
Date: Mon, 14 Sep 2020 20:34:03 +0000	[thread overview]
Message-ID: <MN2PR12MB44881AF114C47613285A083BF7230@MN2PR12MB4488.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20200913154235.GA1188391@bjorn-Precision-5520>

[AMD Public Use]

> -----Original Message-----
> From: Bjorn Helgaas <helgaas@kernel.org>
> Sent: Sunday, September 13, 2020 11:43 AM
> To: Lukas Wunner <lukas@wunner.de>
> Cc: Huacai Chen <chenhc@lemote.com>; Bjorn Helgaas
> <bhelgaas@google.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; linux-pci@vger.kernel.org; Huacai Chen
> <chenhuacai@gmail.com>; Jiaxun Yang <jiaxun.yang@flygoat.com>
> Subject: Re: [PATCH 1/2] PCI/portdrv: Remove the .remove() method in
> pcie_portdriver
> 
> On Sun, Sep 13, 2020 at 07:01:29AM +0200, Lukas Wunner wrote:
> > On Fri, Sep 11, 2020 at 06:09:36PM +0800, Huacai Chen wrote:
> > > As Bjorn Helgaas said, portdrv can only be built statically (not as
> > > a module), so the .remove() method in pcie_portdriver is useless. So
> > > just remove it.
> >
> > No, PCIe switches (containing upstream and downstream PCIe ports) can
> > be hot-plugged and hot-removed at runtime.  Every Thunderbolt device
> > contains a PCIe switch and is hot-pluggable.  We do want to clean up a
> > hot-removed PCIe port properly.
> 
> Right, sorry, I was thinking only of driver unbinding, not of device removal.
> Sorry to have wasted your time.
> 

FWIW, our newer GPUs have both upstream and downstream ports that are part of the device.

Slightly off topic, but does the current pm code handle these cases correctly?  ACPI related power handling doesn't seem to work correctly for these devices in laptops where the GPU power control is handled by ACPI.

Alex

> > > --- a/drivers/pci/pcie/portdrv_pci.c
> > > +++ b/drivers/pci/pcie/portdrv_pci.c
> > > @@ -134,7 +134,7 @@ static int pcie_portdrv_probe(struct pci_dev *dev,
> > >  	return 0;
> > >  }
> > >
> > > -static void pcie_portdrv_remove(struct pci_dev *dev)
> > > +static void pcie_portdrv_shutdown(struct pci_dev *dev)
> > >  {
> > >  	if (pci_bridge_d3_possible(dev)) {
> > >  		pm_runtime_forbid(&dev->dev);
> > > @@ -210,8 +210,7 @@ static struct pci_driver pcie_portdriver = {
> > >  	.id_table	= &port_pci_ids[0],
> > >
> > >  	.probe		= pcie_portdrv_probe,
> > > -	.remove		= pcie_portdrv_remove,
> > > -	.shutdown	= pcie_portdrv_remove,
> > > +	.shutdown	= pcie_portdrv_shutdown,
> > >
> > >  	.err_handler	= &pcie_portdrv_err_handler,

  reply	other threads:[~2020-09-14 20:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 10:09 [PATCH 1/2] PCI/portdrv: Remove the .remove() method in pcie_portdriver Huacai Chen
2020-09-11 10:09 ` [PATCH 2/2] PCI/portdrv: Don't disable pci device during shutdown Huacai Chen
2020-09-13 16:04   ` Bjorn Helgaas
2020-09-14 20:43     ` Deucher, Alexander
2020-09-13  5:01 ` [PATCH 1/2] PCI/portdrv: Remove the .remove() method in pcie_portdriver Lukas Wunner
2020-09-13 15:42   ` Bjorn Helgaas
2020-09-14 20:34     ` Deucher, Alexander [this message]
2020-09-14 22:03       ` Bjorn Helgaas
2020-09-15  2:50       ` Lukas Wunner

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=MN2PR12MB44881AF114C47613285A083BF7230@MN2PR12MB4488.namprd12.prod.outlook.com \
    --to=alexander.deucher@amd.com \
    --cc=bhelgaas@google.com \
    --cc=chenhc@lemote.com \
    --cc=chenhuacai@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    /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.