All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] PCI/X86: increase info->res_num before checking pci_use_crs return
@ 2013-05-28  2:55 Yijing Wang
  2013-05-28  4:35 ` Yinghai Lu
  2013-05-28 17:24 ` Bjorn Helgaas
  0 siblings, 2 replies; 5+ messages in thread
From: Yijing Wang @ 2013-05-28  2:55 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, Hanjun Guo, Yijing Wang, Yinghai Lu, Jiang Liu,
	Rafael J. Wysocki, Feng Tang

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.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Jiang Liu <liuj97@gmail.com>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Feng Tang <feng.tang@intel.com>
---
 arch/x86/pci/acpi.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 3e72425..662dfdf 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -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



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI/X86: increase info->res_num before checking pci_use_crs return
  2013-05-28  2:55 [PATCH] PCI/X86: increase info->res_num before checking pci_use_crs return Yijing Wang
@ 2013-05-28  4:35 ` Yinghai Lu
  2013-05-28  4:50   ` Yijing Wang
  2013-05-28 17:24 ` Bjorn Helgaas
  1 sibling, 1 reply; 5+ messages in thread
From: Yinghai Lu @ 2013-05-28  4:35 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, linux-pci@vger.kernel.org, Hanjun Guo, Jiang Liu,
	Rafael J. Wysocki, Feng Tang

On Mon, May 27, 2013 at 7:55 PM, Yijing Wang <wangyijing@huawei.com> wrote:
> 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.

>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> Cc: Yinghai Lu <yinghai@kernel.org>
> Cc: Jiang Liu <liuj97@gmail.com>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> Cc: Feng Tang <feng.tang@intel.com>
> ---
>  arch/x86/pci/acpi.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
> index 3e72425..662dfdf 100644
> --- a/arch/x86/pci/acpi.c
> +++ b/arch/x86/pci/acpi.c
> @@ -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;
>  }

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

Thanks

Yinghai

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI/X86: increase info->res_num before checking pci_use_crs return
  2013-05-28  4:35 ` Yinghai Lu
@ 2013-05-28  4:50   ` Yijing Wang
  2013-05-28  4:54     ` Yinghai Lu
  0 siblings, 1 reply; 5+ messages in thread
From: Yijing Wang @ 2013-05-28  4:50 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Bjorn Helgaas, linux-pci@vger.kernel.org, Hanjun Guo, Jiang Liu,
	Rafael J. Wysocki, Feng Tang

On 2013/5/28 12:35, Yinghai Lu wrote:
> On Mon, May 27, 2013 at 7:55 PM, Yijing Wang <wangyijing@huawei.com> wrote:
>> 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.

> 
>>
>> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
>> Cc: Yinghai Lu <yinghai@kernel.org>
>> Cc: Jiang Liu <liuj97@gmail.com>
>> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
>> Cc: Feng Tang <feng.tang@intel.com>
>> ---
>>  arch/x86/pci/acpi.c |    7 ++-----
>>  1 files changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
>> index 3e72425..662dfdf 100644
>> --- a/arch/x86/pci/acpi.c
>> +++ b/arch/x86/pci/acpi.c
>> @@ -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;
>>  }
> 
> 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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


-- 
Thanks!
Yijing


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI/X86: increase info->res_num before checking pci_use_crs return
  2013-05-28  4:50   ` Yijing Wang
@ 2013-05-28  4:54     ` Yinghai Lu
  0 siblings, 0 replies; 5+ messages in thread
From: Yinghai Lu @ 2013-05-28  4:54 UTC (permalink / raw)
  To: Yijing Wang
  Cc: Bjorn Helgaas, linux-pci@vger.kernel.org, Hanjun Guo, Jiang Liu,
	Rafael J. Wysocki, Feng Tang

On Mon, May 27, 2013 at 9:50 PM, Yijing Wang <wangyijing@huawei.com> wrote:
> On 2013/5/28 12:35, Yinghai Lu wrote:
>> On Mon, May 27, 2013 at 7:55 PM, Yijing Wang <wangyijing@huawei.com> wrote:
>>> 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.

sure.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] PCI/X86: increase info->res_num before checking pci_use_crs return
  2013-05-28  2:55 [PATCH] PCI/X86: increase info->res_num before checking pci_use_crs return Yijing Wang
  2013-05-28  4:35 ` Yinghai Lu
@ 2013-05-28 17:24 ` Bjorn Helgaas
  1 sibling, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2013-05-28 17:24 UTC (permalink / raw)
  To: Yijing Wang
  Cc: linux-pci@vger.kernel.org, Hanjun Guo, Yinghai Lu, Jiang Liu,
	Rafael J. Wysocki, Feng Tang

On Mon, May 27, 2013 at 8:55 PM, Yijing Wang <wangyijing@huawei.com> wrote:
> 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.
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> Cc: Yinghai Lu <yinghai@kernel.org>
> Cc: Jiang Liu <liuj97@gmail.com>
> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> Cc: Feng Tang <feng.tang@intel.com>
> ---
>  arch/x86/pci/acpi.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)

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

> diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
> index 3e72425..662dfdf 100644
> --- a/arch/x86/pci/acpi.c
> +++ b/arch/x86/pci/acpi.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-28 17:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-28  2:55 [PATCH] PCI/X86: increase info->res_num before checking pci_use_crs return Yijing Wang
2013-05-28  4:35 ` Yinghai Lu
2013-05-28  4:50   ` Yijing Wang
2013-05-28  4:54     ` Yinghai Lu
2013-05-28 17:24 ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.