Message ID | 2faef6f884aae9ae92e57e7c6a88a6195553c684.1603766889.git.sathyanarayanan.kuppuswamy@linux.intel.com |
---|---|
State | New |
Headers | show |
Series | Simplify PCIe native ownership detection logic | expand |
On Tue, Oct 27, 2020 at 10:00 PM Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> wrote: > > In DPC service enable logic, check for > services & PCIE_PORT_SERVICE_AER implies pci_aer_available() How about PCIE_PORT_SERVICE_AER is not configured, but pcie_aer_disable == 0 ? > is true. So there is no need to explicitly check it again. > > Also, passing pcie_ports=dpc-native in kernel command line > implies DPC needs to be enabled in native mode irrespective > of AER ownership status. So checking for pci_aer_available() > without checking for pcie_ports status is incorrect. > > Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> > --- > drivers/pci/pcie/portdrv_core.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c > index 2c0278f0fdcc..e257a2ca3595 100644 > --- a/drivers/pci/pcie/portdrv_core.c > +++ b/drivers/pci/pcie/portdrv_core.c > @@ -252,7 +252,6 @@ static int get_port_device_capability(struct pci_dev *dev) > * permission to use AER. > */ > if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && > - pci_aer_available() && > (host->native_dpc || (services & PCIE_PORT_SERVICE_AER))) > services |= PCIE_PORT_SERVICE_DPC; > > -- > 2.17.1 >
On 10/27/20 11:00 PM, Ethan Zhao wrote: > On Tue, Oct 27, 2020 at 10:00 PM Kuppuswamy Sathyanarayanan > <sathyanarayanan.kuppuswamy@linux.intel.com> wrote: >> >> In DPC service enable logic, check for >> services & PCIE_PORT_SERVICE_AER implies pci_aer_available() > How about PCIE_PORT_SERVICE_AER is not configured, but > pcie_aer_disable == 0 ? Its not possible in current code flow. DPC service is configured following AER service configuration. >> is true. So there is no need to explicitly check it again. >> >> Also, passing pcie_ports=dpc-native in kernel command line >> implies DPC needs to be enabled in native mode irrespective >> of AER ownership status. So checking for pci_aer_available() >> without checking for pcie_ports status is incorrect. >> >> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> >> --- >> drivers/pci/pcie/portdrv_core.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c >> index 2c0278f0fdcc..e257a2ca3595 100644 >> --- a/drivers/pci/pcie/portdrv_core.c >> +++ b/drivers/pci/pcie/portdrv_core.c >> @@ -252,7 +252,6 @@ static int get_port_device_capability(struct pci_dev *dev) >> * permission to use AER. >> */ >> if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && >> - pci_aer_available() && >> (host->native_dpc || (services & PCIE_PORT_SERVICE_AER))) >> services |= PCIE_PORT_SERVICE_DPC; >> >> -- >> 2.17.1 >>
The current logic is if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && pci_aer_available() && (pcie_ports_dpc_native || (services & PCIE_PORT_SERVICE_AER))) services |= PCIE_PORT_SERVICE_DPC; if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && pci_aer_available() && (pcie_ports_dpc_native)) services |= PCIE_PORT_SERVICE_DPC; or if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && pci_aer_available() &&(services & PCIE_PORT_SERVICE_AER)) services |= PCIE_PORT_SERVICE_DPC; do you mean one of the possible is if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && (pcie_ports_dpc_native)) services |= PCIE_PORT_SERVICE_DPC; after your patch ? nothing about AER ? Thanks, Ethan On Thu, Oct 29, 2020 at 1:14 AM Kuppuswamy, Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> wrote: > > > > On 10/27/20 11:00 PM, Ethan Zhao wrote: > > On Tue, Oct 27, 2020 at 10:00 PM Kuppuswamy Sathyanarayanan > > <sathyanarayanan.kuppuswamy@linux.intel.com> wrote: > >> > >> In DPC service enable logic, check for > >> services & PCIE_PORT_SERVICE_AER implies pci_aer_available() > > How about PCIE_PORT_SERVICE_AER is not configured, but > > pcie_aer_disable == 0 ? > Its not possible in current code flow. DPC service is configured > following AER service configuration. > >> is true. So there is no need to explicitly check it again. > >> > >> Also, passing pcie_ports=dpc-native in kernel command line > >> implies DPC needs to be enabled in native mode irrespective > >> of AER ownership status. So checking for pci_aer_available() > >> without checking for pcie_ports status is incorrect. > >> > >> Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> > >> --- > >> drivers/pci/pcie/portdrv_core.c | 1 - > >> 1 file changed, 1 deletion(-) > >> > >> diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c > >> index 2c0278f0fdcc..e257a2ca3595 100644 > >> --- a/drivers/pci/pcie/portdrv_core.c > >> +++ b/drivers/pci/pcie/portdrv_core.c > >> @@ -252,7 +252,6 @@ static int get_port_device_capability(struct pci_dev *dev) > >> * permission to use AER. > >> */ > >> if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && > >> - pci_aer_available() && > >> (host->native_dpc || (services & PCIE_PORT_SERVICE_AER))) > >> services |= PCIE_PORT_SERVICE_DPC; > >> > >> -- > >> 2.17.1 > >> > > -- > Sathyanarayanan Kuppuswamy > Linux Kernel Developer
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 2c0278f0fdcc..e257a2ca3595 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -252,7 +252,6 @@ static int get_port_device_capability(struct pci_dev *dev) * permission to use AER. */ if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_DPC) && - pci_aer_available() && (host->native_dpc || (services & PCIE_PORT_SERVICE_AER))) services |= PCIE_PORT_SERVICE_DPC;
In DPC service enable logic, check for services & PCIE_PORT_SERVICE_AER implies pci_aer_available() is true. So there is no need to explicitly check it again. Also, passing pcie_ports=dpc-native in kernel command line implies DPC needs to be enabled in native mode irrespective of AER ownership status. So checking for pci_aer_available() without checking for pcie_ports status is incorrect. Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> --- drivers/pci/pcie/portdrv_core.c | 1 - 1 file changed, 1 deletion(-)