diff mbox

PCI/portdrv: Fix regression introduced by commit 2dcfaf85

Message ID 20121031095148.75dbb6e8.izumi.taku@jp.fujitsu.com
State Accepted
Headers show

Commit Message

Taku Izumi Oct. 31, 2012, 12:51 a.m. UTC
PCI/portdrv: Fix regression introduced by commit 2dcfaf85

After commit 2dcfaf85, hotplug slots for port devices 
w/o slot implementation come to be created.  
This patch fixes this problem.

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
---
 drivers/pci/pcie/portdrv_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


--
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

Yinghai Lu Oct. 31, 2012, 1:34 a.m. UTC | #1
On Tue, Oct 30, 2012 at 5:51 PM, Taku Izumi <izumi.taku@jp.fujitsu.com> wrote:
>
> PCI/portdrv: Fix regression introduced by commit 2dcfaf85
>
> After commit 2dcfaf85, hotplug slots for port devices
> w/o slot implementation come to be created.
> This patch fixes this problem.
>
> Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
> ---
>  drivers/pci/pcie/portdrv_core.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> Index: pci/drivers/pci/pcie/portdrv_core.c
> ===================================================================
> --- pci.orig/drivers/pci/pcie/portdrv_core.c
> +++ pci/drivers/pci/pcie/portdrv_core.c
> @@ -272,7 +272,8 @@ static int get_port_device_capability(st
>         }
>
>         /* Hot-Plug Capable */
> -       if (cap_mask & PCIE_PORT_SERVICE_HP) {
> +       if ((cap_mask & PCIE_PORT_SERVICE_HP) &&
> +           dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT) {
>                 pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32);
>                 if (reg32 & PCI_EXP_SLTCAP_HPC) {
>                         services |= PCIE_PORT_SERVICE_HP;
>

Acked-by: Yinghai Lu <yinghai@kernel.org>
--
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
Jiang Liu Nov. 1, 2012, 12:53 p.m. UTC | #2
Hi Taku,
	It's a mistake introduced by that patch, thanks for fix it.
	Reviewed-by: <jiang.liu@huawei.com>

On 2012-10-31 8:51, Taku Izumi wrote:
> 
> PCI/portdrv: Fix regression introduced by commit 2dcfaf85
> 
> After commit 2dcfaf85, hotplug slots for port devices 
> w/o slot implementation come to be created.  
> This patch fixes this problem.
> 
> Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
> ---
>  drivers/pci/pcie/portdrv_core.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Index: pci/drivers/pci/pcie/portdrv_core.c
> ===================================================================
> --- pci.orig/drivers/pci/pcie/portdrv_core.c
> +++ pci/drivers/pci/pcie/portdrv_core.c
> @@ -272,7 +272,8 @@ static int get_port_device_capability(st
>  	}
>  
>  	/* Hot-Plug Capable */
> -	if (cap_mask & PCIE_PORT_SERVICE_HP) {
> +	if ((cap_mask & PCIE_PORT_SERVICE_HP) &&
> +	    dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT) {
>  		pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32);
>  		if (reg32 & PCI_EXP_SLTCAP_HPC) {
>  			services |= PCIE_PORT_SERVICE_HP;
> 
> 
> 


--
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. 5, 2012, 10:08 p.m. UTC | #3
On Thu, Nov 1, 2012 at 6:53 AM, Jiang Liu <jiang.liu@huawei.com> wrote:
> Hi Taku,
>         It's a mistake introduced by that patch, thanks for fix it.
>         Reviewed-by: <jiang.liu@huawei.com>
>
> On 2012-10-31 8:51, Taku Izumi wrote:
>>
>> PCI/portdrv: Fix regression introduced by commit 2dcfaf85
>>
>> After commit 2dcfaf85, hotplug slots for port devices
>> w/o slot implementation come to be created.
>> This patch fixes this problem.

I applied this to my for-linus branch as v3.7 material.  Thanks!

>> Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
>> ---
>>  drivers/pci/pcie/portdrv_core.c |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> Index: pci/drivers/pci/pcie/portdrv_core.c
>> ===================================================================
>> --- pci.orig/drivers/pci/pcie/portdrv_core.c
>> +++ pci/drivers/pci/pcie/portdrv_core.c
>> @@ -272,7 +272,8 @@ static int get_port_device_capability(st
>>       }
>>
>>       /* Hot-Plug Capable */
>> -     if (cap_mask & PCIE_PORT_SERVICE_HP) {
>> +     if ((cap_mask & PCIE_PORT_SERVICE_HP) &&
>> +         dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT) {
>>               pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32);
>>               if (reg32 & PCI_EXP_SLTCAP_HPC) {
>>                       services |= PCIE_PORT_SERVICE_HP;
>>
>>
>>
>
>
--
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

Index: pci/drivers/pci/pcie/portdrv_core.c
===================================================================
--- pci.orig/drivers/pci/pcie/portdrv_core.c
+++ pci/drivers/pci/pcie/portdrv_core.c
@@ -272,7 +272,8 @@  static int get_port_device_capability(st
 	}
 
 	/* Hot-Plug Capable */
-	if (cap_mask & PCIE_PORT_SERVICE_HP) {
+	if ((cap_mask & PCIE_PORT_SERVICE_HP) &&
+	    dev->pcie_flags_reg & PCI_EXP_FLAGS_SLOT) {
 		pcie_capability_read_dword(dev, PCI_EXP_SLTCAP, &reg32);
 		if (reg32 & PCI_EXP_SLTCAP_HPC) {
 			services |= PCIE_PORT_SERVICE_HP;