PCI/X86: increase info->res_num before checking pci_use_crs return
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.
--- arch/x86/pci/acpi.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
arch/x86/pci/acpi.c +2 -5
@@ -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
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_numbefore we checkingpci_use_crsreturn when pci=nocrs set.
there is no function change or issue here.
Quoted 21 lines
Signed-off-by Yijing Wang <[email protected]>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@@ -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
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_numbefore we checkingpci_use_crsreturn 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
Signed-off-by Yijing Wang <[email protected]>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@@ -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_numis not used afterprobe_pci_root_infoforpci_nocrscase.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
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_numbefore we checkingpci_use_crsreturn 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. Becausefree_pci_root_info_res()will free allinfo->resandinfo->res_offset. So I think move info->res_num++ beforepci_use_crscheck is better, better readability.
sure.
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_numbefore we checkingpci_use_crsreturn when pci=nocrs set.
Quoted 8 lines
Signed-off-by Yijing Wang <[email protected]>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@@ -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