Skip to contentSkip to conversation

PCI/X86: increase info->res_num before checking pci_use_crs return

PATCH Applied Yijing Wang 3 participants 5 messages May 28, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI/X86: increase info->res_num before checking pci_use_crs return

I separate this patch from patchset "Add hostbridge resource release to support root bus hotplug in IA64", because it's a Separate issue.

We should increase info->res_num before we checking pci_use_crs return when pci=nocrs set.

Cc Yinghai Lu <[email protected]>
Cc Jiang Liu <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Feng Tang <[email protected]>
---
 arch/x86/pci/acpi.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
arch/x86/pci/acpi.c +2 -5
index 3e72425..662dfdf 100644
@@ -324,14 +324,11 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
 	res->start = start;
 	res->end = end;
 	info->res_offset[info->res_num] = addr.translation_offset;
+	info->res_num++;
 
-	if (!pci_use_crs) {
+	if (!pci_use_crs)
 		dev_printk(KERN_DEBUG, &info->bridge->dev,
 			   "host bridge window %pR (ignored)\n", res);
-		return AE_OK;
-	}
-
-	info->res_num++;
 
 	return AE_OK;
 }
Signature · 1 line
1.7.1
#1 lore raw
Quoted 5 lines · Yijing Wang

I separate this patch from patchset "Add hostbridge resource release to support root bus hotplug in IA64", because it's a Separate issue.

We should increase info->res_num before we checking pci_use_crs return when pci=nocrs set.

there is no function change or issue here.

Quoted 21 lines
Cc Yinghai Lu <[email protected]>
Cc Jiang Liu <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Feng Tang <[email protected]>
---
 arch/x86/pci/acpi.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
arch/x86/pci/acpi.c +1 -1
index 3e72425..662dfdf 100644
@@ -324,14 +324,11 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
        res->start = start;
        res->end = end;
        info->res_offset[info->res_num] = addr.translation_offset;
+       info->res_num++;
 
-       if (!pci_use_crs) {

arch/x86/pci/acpi.c setup_resource(struct acpi_resource *acpi_res, void *data) · line 334

Quoted 10 lines
arch/x86/pci/acpi.c +1 -4
+       if (!pci_use_crs)
                dev_printk(KERN_DEBUG, &info->bridge->dev,
                           "host bridge window %pR (ignored)\n", res);
-               return AE_OK;
-       }
-
-       info->res_num++;
 
        return AE_OK;
 }

info->res_num is not used after probe_pci_root_info for pci_nocrs case.

Thanks

Yinghai

#2 lore raw
Quoted 8 lines · Yinghai Lu
Quoted 5 lines · Yijing Wang

I separate this patch from patchset "Add hostbridge resource release to support root bus hotplug in IA64", because it's a Separate issue.

We should increase info->res_num before we checking pci_use_crs return when pci=nocrs set.

there is no function change or issue here.

Hi Yinghai,
Thanks for review and comments!
Yes, this patch is no functional change. I just sent this patch for make code flow more clearly. Because free_pci_root_info_res() will free all info->res and info->res_offset. So I think move info->res_num++ before pci_use_crs check is better, better readability.

Quoted 44 lines
Quoted 22 lines
Cc Yinghai Lu <[email protected]>
Cc Jiang Liu <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Feng Tang <[email protected]>
---
 arch/x86/pci/acpi.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
arch/x86/pci/acpi.c +1 -1
index 3e72425..662dfdf 100644
@@ -324,14 +324,11 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
        res->start = start;
        res->end = end;
        info->res_offset[info->res_num] = addr.translation_offset;
+       info->res_num++;
 
-       if (!pci_use_crs) {

arch/x86/pci/acpi.c setup_resource(struct acpi_resource *acpi_res, void *data) · line 334

Quoted 10 lines
arch/x86/pci/acpi.c +1 -4
+       if (!pci_use_crs)
                dev_printk(KERN_DEBUG, &info->bridge->dev,
                           "host bridge window %pR (ignored)\n", res);
-               return AE_OK;
-       }
-
-       info->res_num++;
 
        return AE_OK;
 }

info->res_num is not used after probe_pci_root_info for pci_nocrs case.

Thanks

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

Signature · 2 lines
Thanks!
Yijing
#3 lore raw
Quoted 8 lines · Yijing Wang
Quoted 7 lines · Yinghai Lu
Quoted 5 lines · Yijing Wang

I separate this patch from patchset "Add hostbridge resource release to support root bus hotplug in IA64", because it's a Separate issue.

We should increase info->res_num before we checking pci_use_crs return when pci=nocrs set.

Quoted 7 lines
Quoted 1 line

there is no function change or issue here.

Hi Yinghai,
Thanks for review and comments!
Yes, this patch is no functional change. I just sent this patch for make code flow more clearly. Because free_pci_root_info_res() will free all info->res and info->res_offset. So I think move info->res_num++ before pci_use_crs check is better, better readability.

sure.

maintainer Applied
#4 lore raw
In reply to Yijing Wang
Quoted 6 lines · Yijing Wang

I separate this patch from patchset "Add hostbridge resource release to support root bus hotplug in IA64", because it's a Separate issue.

We should increase info->res_num before we checking pci_use_crs return when pci=nocrs set.

Quoted 8 lines
Cc Yinghai Lu <[email protected]>
Cc Jiang Liu <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Feng Tang <[email protected]>
---
 arch/x86/pci/acpi.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

Applied to pci/misc for v3.11, thanks!

Quoted 29 lines
arch/x86/pci/acpi.c +2 -6
index 3e72425..662dfdf 100644
@@ -324,14 +324,11 @@ setup_resource(struct acpi_resource *acpi_res, void *data)
        res->start = start;
        res->end = end;
        info->res_offset[info->res_num] = addr.translation_offset;
+       info->res_num++;
 
-       if (!pci_use_crs) {
+       if (!pci_use_crs)
                dev_printk(KERN_DEBUG, &info->bridge->dev,
                           "host bridge window %pR (ignored)\n", res);
-               return AE_OK;
-       }
-
-       info->res_num++;
 
        return AE_OK;
 }
--

1.7.1

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