diff mbox

[v2,1/9] PCI/PME: Drop unused support for PMEs from Root Complex Event Collectors

Message ID 20161121214519.21036.33519.stgit@bhelgaas-glaptop.roam.corp.google.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Bjorn Helgaas Nov. 21, 2016, 9:45 p.m. UTC
Since we register pcie_pme_driver only for PCI_EXP_TYPE_ROOT_PORT, the PME
driver never claims Root Complex Event Collectors.

Remove unused code related to Root Complex Event Collectors.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
 drivers/pci/pcie/pme.c |   17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Rafael J. Wysocki Nov. 21, 2016, 10:28 p.m. UTC | #1
On Monday, November 21, 2016 03:45:19 PM Bjorn Helgaas wrote:
> Since we register pcie_pme_driver only for PCI_EXP_TYPE_ROOT_PORT, the PME
> driver never claims Root Complex Event Collectors.
> 
> Remove unused code related to Root Complex Event Collectors.
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
>  drivers/pci/pcie/pme.c |   17 +----------------
>  1 file changed, 1 insertion(+), 16 deletions(-)
> 
> diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
> index 884bad5..9e8aa9d 100644
> --- a/drivers/pci/pcie/pme.c
> +++ b/drivers/pci/pcie/pme.c
> @@ -319,23 +319,8 @@ static int pcie_pme_set_native(struct pci_dev *dev, void *ign)
>  static void pcie_pme_mark_devices(struct pci_dev *port)
>  {
>  	pcie_pme_set_native(port, NULL);
> -	if (port->subordinate) {
> +	if (port->subordinate)
>  		pci_walk_bus(port->subordinate, pcie_pme_set_native, NULL);
> -	} else {
> -		struct pci_bus *bus = port->bus;
> -		struct pci_dev *dev;
> -
> -		/* Check if this is a root port event collector. */
> -		if (pci_pcie_type(port) != PCI_EXP_TYPE_RC_EC || !bus)
> -			return;
> -
> -		down_read(&pci_bus_sem);
> -		list_for_each_entry(dev, &bus->devices, bus_list)
> -			if (pci_is_pcie(dev)
> -			    && pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END)
> -				pcie_pme_set_native(dev, NULL);
> -		up_read(&pci_bus_sem);
> -	}
>  }
>  
>  /**

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Nov. 21, 2016, 10:42 p.m. UTC | #2
On Mon, Nov 21, 2016 at 11:28:56PM +0100, Rafael J. Wysocki wrote:
> On Monday, November 21, 2016 03:45:19 PM Bjorn Helgaas wrote:
> > Since we register pcie_pme_driver only for PCI_EXP_TYPE_ROOT_PORT, the PME
> > driver never claims Root Complex Event Collectors.
> > 
> > Remove unused code related to Root Complex Event Collectors.
> > 
> > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> > ---
> >  drivers/pci/pcie/pme.c |   17 +----------------
> >  1 file changed, 1 insertion(+), 16 deletions(-)
> > 
> > diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
> > index 884bad5..9e8aa9d 100644
> > --- a/drivers/pci/pcie/pme.c
> > +++ b/drivers/pci/pcie/pme.c
> > @@ -319,23 +319,8 @@ static int pcie_pme_set_native(struct pci_dev *dev, void *ign)
> >  static void pcie_pme_mark_devices(struct pci_dev *port)
> >  {
> >  	pcie_pme_set_native(port, NULL);
> > -	if (port->subordinate) {
> > +	if (port->subordinate)
> >  		pci_walk_bus(port->subordinate, pcie_pme_set_native, NULL);
> > -	} else {
> > -		struct pci_bus *bus = port->bus;
> > -		struct pci_dev *dev;
> > -
> > -		/* Check if this is a root port event collector. */
> > -		if (pci_pcie_type(port) != PCI_EXP_TYPE_RC_EC || !bus)
> > -			return;
> > -
> > -		down_read(&pci_bus_sem);
> > -		list_for_each_entry(dev, &bus->devices, bus_list)
> > -			if (pci_is_pcie(dev)
> > -			    && pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END)
> > -				pcie_pme_set_native(dev, NULL);
> > -		up_read(&pci_bus_sem);
> > -	}
> >  }
> >  
> >  /**
> 
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

I'm shocked :)  You mean we really don't care about PME from RC event
collectors?  Without the RCEC support, we won't see any PMEs from RC
integrated devices.  I mean, I don't think we see those PMEs today, but I
thought maybe we would *want* to.  No?

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki Nov. 21, 2016, 10:58 p.m. UTC | #3
On Monday, November 21, 2016 04:42:10 PM Bjorn Helgaas wrote:
> On Mon, Nov 21, 2016 at 11:28:56PM +0100, Rafael J. Wysocki wrote:
> > On Monday, November 21, 2016 03:45:19 PM Bjorn Helgaas wrote:
> > > Since we register pcie_pme_driver only for PCI_EXP_TYPE_ROOT_PORT, the PME
> > > driver never claims Root Complex Event Collectors.
> > > 
> > > Remove unused code related to Root Complex Event Collectors.
> > > 
> > > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> > > ---
> > >  drivers/pci/pcie/pme.c |   17 +----------------
> > >  1 file changed, 1 insertion(+), 16 deletions(-)
> > > 
> > > diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
> > > index 884bad5..9e8aa9d 100644
> > > --- a/drivers/pci/pcie/pme.c
> > > +++ b/drivers/pci/pcie/pme.c
> > > @@ -319,23 +319,8 @@ static int pcie_pme_set_native(struct pci_dev *dev, void *ign)
> > >  static void pcie_pme_mark_devices(struct pci_dev *port)
> > >  {
> > >  	pcie_pme_set_native(port, NULL);
> > > -	if (port->subordinate) {
> > > +	if (port->subordinate)
> > >  		pci_walk_bus(port->subordinate, pcie_pme_set_native, NULL);
> > > -	} else {
> > > -		struct pci_bus *bus = port->bus;
> > > -		struct pci_dev *dev;
> > > -
> > > -		/* Check if this is a root port event collector. */
> > > -		if (pci_pcie_type(port) != PCI_EXP_TYPE_RC_EC || !bus)
> > > -			return;
> > > -
> > > -		down_read(&pci_bus_sem);
> > > -		list_for_each_entry(dev, &bus->devices, bus_list)
> > > -			if (pci_is_pcie(dev)
> > > -			    && pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END)
> > > -				pcie_pme_set_native(dev, NULL);
> > > -		up_read(&pci_bus_sem);
> > > -	}
> > >  }
> > >  
> > >  /**
> > 
> > Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> I'm shocked :)

Well, the code is not used as a matter of fact and it can be added back
when needed, can't it?

> You mean we really don't care about PME from RC event
> collectors?  Without the RCEC support, we won't see any PMEs from RC
> integrated devices.  I mean, I don't think we see those PMEs today, but I
> thought maybe we would *want* to.  No?

In the majority of cases those are signaled via ACPI GPEs anyway.  I'm not
sure why, but event collectors have not been extremely popular for the last
several years.  I haven't seen a single one with native PME handling so far
and I kind of don't expect to see any.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas Nov. 21, 2016, 11 p.m. UTC | #4
On Mon, Nov 21, 2016 at 11:58:09PM +0100, Rafael J. Wysocki wrote:
> On Monday, November 21, 2016 04:42:10 PM Bjorn Helgaas wrote:
> > On Mon, Nov 21, 2016 at 11:28:56PM +0100, Rafael J. Wysocki wrote:
> > > On Monday, November 21, 2016 03:45:19 PM Bjorn Helgaas wrote:
> > > > Since we register pcie_pme_driver only for PCI_EXP_TYPE_ROOT_PORT, the PME
> > > > driver never claims Root Complex Event Collectors.
> > > > 
> > > > Remove unused code related to Root Complex Event Collectors.
> > > > 
> > > > Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> > > > ---
> > > >  drivers/pci/pcie/pme.c |   17 +----------------
> > > >  1 file changed, 1 insertion(+), 16 deletions(-)
> > > > 
> > > > diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
> > > > index 884bad5..9e8aa9d 100644
> > > > --- a/drivers/pci/pcie/pme.c
> > > > +++ b/drivers/pci/pcie/pme.c
> > > > @@ -319,23 +319,8 @@ static int pcie_pme_set_native(struct pci_dev *dev, void *ign)
> > > >  static void pcie_pme_mark_devices(struct pci_dev *port)
> > > >  {
> > > >  	pcie_pme_set_native(port, NULL);
> > > > -	if (port->subordinate) {
> > > > +	if (port->subordinate)
> > > >  		pci_walk_bus(port->subordinate, pcie_pme_set_native, NULL);
> > > > -	} else {
> > > > -		struct pci_bus *bus = port->bus;
> > > > -		struct pci_dev *dev;
> > > > -
> > > > -		/* Check if this is a root port event collector. */
> > > > -		if (pci_pcie_type(port) != PCI_EXP_TYPE_RC_EC || !bus)
> > > > -			return;
> > > > -
> > > > -		down_read(&pci_bus_sem);
> > > > -		list_for_each_entry(dev, &bus->devices, bus_list)
> > > > -			if (pci_is_pcie(dev)
> > > > -			    && pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END)
> > > > -				pcie_pme_set_native(dev, NULL);
> > > > -		up_read(&pci_bus_sem);
> > > > -	}
> > > >  }
> > > >  
> > > >  /**
> > > 
> > > Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > 
> > I'm shocked :)
> 
> Well, the code is not used as a matter of fact and it can be added back
> when needed, can't it?

Indeed.

> > You mean we really don't care about PME from RC event
> > collectors?  Without the RCEC support, we won't see any PMEs from RC
> > integrated devices.  I mean, I don't think we see those PMEs today, but I
> > thought maybe we would *want* to.  No?
> 
> In the majority of cases those are signaled via ACPI GPEs anyway.  I'm not
> sure why, but event collectors have not been extremely popular for the last
> several years.  I haven't seen a single one with native PME handling so far
> and I kind of don't expect to see any.

Ok, great.  We'll just remove it until we need it then.

Thanks!

Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pci/pcie/pme.c b/drivers/pci/pcie/pme.c
index 884bad5..9e8aa9d 100644
--- a/drivers/pci/pcie/pme.c
+++ b/drivers/pci/pcie/pme.c
@@ -319,23 +319,8 @@  static int pcie_pme_set_native(struct pci_dev *dev, void *ign)
 static void pcie_pme_mark_devices(struct pci_dev *port)
 {
 	pcie_pme_set_native(port, NULL);
-	if (port->subordinate) {
+	if (port->subordinate)
 		pci_walk_bus(port->subordinate, pcie_pme_set_native, NULL);
-	} else {
-		struct pci_bus *bus = port->bus;
-		struct pci_dev *dev;
-
-		/* Check if this is a root port event collector. */
-		if (pci_pcie_type(port) != PCI_EXP_TYPE_RC_EC || !bus)
-			return;
-
-		down_read(&pci_bus_sem);
-		list_for_each_entry(dev, &bus->devices, bus_list)
-			if (pci_is_pcie(dev)
-			    && pci_pcie_type(dev) == PCI_EXP_TYPE_RC_END)
-				pcie_pme_set_native(dev, NULL);
-		up_read(&pci_bus_sem);
-	}
 }
 
 /**