Patchwork [v8,02/22] PCI: Add root bus children dev's res to fail list

login
register
mail settings
Submitter Yinghai Lu
Date Jan. 11, 2013, 10:40 p.m.
Message ID <1357944049-29620-3-git-send-email-yinghai@kernel.org>
Download mbox | patch
Permalink /patch/211442/
State Superseded
Headers show

Comments

Yinghai Lu - Jan. 11, 2013, 10:40 p.m.
We can stop trying according to try number now and do not need to use
root_bus checking as stop sign anymore.

In extreme case we could need to reallocate resource for device just
under root bus.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 drivers/pci/setup-bus.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Rafael J. Wysocki - Jan. 12, 2013, 9:37 p.m.
On Friday, January 11, 2013 02:40:29 PM Yinghai Lu wrote:
> We can stop trying according to try number now and do not need to use
> root_bus checking as stop sign anymore.
> 
> In extreme case we could need to reallocate resource for device just
> under root bus.

Well, the above says that we _can_ do the change, but it doesn't explain why it
is needed.  So what's the reason why we need to do that?

Rafael


> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> ---
>  drivers/pci/setup-bus.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
> index 6d3591d..7e8739e 100644
> --- a/drivers/pci/setup-bus.c
> +++ b/drivers/pci/setup-bus.c
> @@ -283,7 +283,7 @@ static void assign_requested_resources_sorted(struct list_head *head,
>  		idx = res - &dev_res->dev->resource[0];
>  		if (resource_size(res) &&
>  		    pci_assign_resource(dev_res->dev, idx)) {
> -			if (fail_head && !pci_is_root_bus(dev_res->dev->bus)) {
> +			if (fail_head) {
>  				/*
>  				 * if the failed res is for ROM BAR, and it will
>  				 * be enabled later, don't add it to the list
>
Yinghai Lu - Jan. 15, 2013, 6:23 a.m.
On Sat, Jan 12, 2013 at 1:37 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Friday, January 11, 2013 02:40:29 PM Yinghai Lu wrote:
>> We can stop trying according to try number now and do not need to use
>> root_bus checking as stop sign anymore.
>>
>> In extreme case we could need to reallocate resource for device just
>> under root bus.
>
> Well, the above says that we _can_ do the change, but it doesn't explain why it
> is needed.  So what's the reason why we need to do that?

In extreme case we could need to reallocate resource for device just
under root bus.

otherwise, those devices just under root bus will not be assigned
resources again.
--
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
Rafael J. Wysocki - Jan. 15, 2013, 11:21 a.m.
On Monday, January 14, 2013 10:23:47 PM Yinghai Lu wrote:
> On Sat, Jan 12, 2013 at 1:37 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Friday, January 11, 2013 02:40:29 PM Yinghai Lu wrote:
> >> We can stop trying according to try number now and do not need to use
> >> root_bus checking as stop sign anymore.
> >>
> >> In extreme case we could need to reallocate resource for device just
> >> under root bus.
> >
> > Well, the above says that we _can_ do the change, but it doesn't explain why it
> > is needed.  So what's the reason why we need to do that?
> 
> In extreme case we could need to reallocate resource for device just
> under root bus.
> 
> otherwise, those devices just under root bus will not be assigned
> resources again.

IOW, our current code will not cover the case when we hot plug a host bridge
and need to reassign resources for devices integrated into it?

Rafael
Yinghai Lu - Jan. 15, 2013, 3:44 p.m.
On Tue, Jan 15, 2013 at 3:21 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Monday, January 14, 2013 10:23:47 PM Yinghai Lu wrote:
>> On Sat, Jan 12, 2013 at 1:37 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> > On Friday, January 11, 2013 02:40:29 PM Yinghai Lu wrote:
>> >> We can stop trying according to try number now and do not need to use
>> >> root_bus checking as stop sign anymore.
>> >>
>> >> In extreme case we could need to reallocate resource for device just
>> >> under root bus.
>> >
>> > Well, the above says that we _can_ do the change, but it doesn't explain why it
>> > is needed.  So what's the reason why we need to do that?
>>
>> In extreme case we could need to reallocate resource for device just
>> under root bus.
>>
>> otherwise, those devices just under root bus will not be assigned
>> resources again.
>
> IOW, our current code will not cover the case when we hot plug a host bridge
> and need to reassign resources for devices integrated into it?

yes. in extreme case if _CRS range is not big enough.
--
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
Rafael J. Wysocki - Jan. 15, 2013, 9:52 p.m.
On Tuesday, January 15, 2013 07:44:21 AM Yinghai Lu wrote:
> On Tue, Jan 15, 2013 at 3:21 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Monday, January 14, 2013 10:23:47 PM Yinghai Lu wrote:
> >> On Sat, Jan 12, 2013 at 1:37 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> >> > On Friday, January 11, 2013 02:40:29 PM Yinghai Lu wrote:
> >> >> We can stop trying according to try number now and do not need to use
> >> >> root_bus checking as stop sign anymore.
> >> >>
> >> >> In extreme case we could need to reallocate resource for device just
> >> >> under root bus.
> >> >
> >> > Well, the above says that we _can_ do the change, but it doesn't explain why it
> >> > is needed.  So what's the reason why we need to do that?
> >>
> >> In extreme case we could need to reallocate resource for device just
> >> under root bus.
> >>
> >> otherwise, those devices just under root bus will not be assigned
> >> resources again.
> >
> > IOW, our current code will not cover the case when we hot plug a host bridge
> > and need to reassign resources for devices integrated into it?
> 
> yes. in extreme case if _CRS range is not big enough.

It would be good to say that in the changelog too.  It's a clear justification
for the change if we're going to support root bridge hotplug (which we are).

Thanks,
Rafael
Yinghai Lu - Jan. 15, 2013, 10:03 p.m.
On Tue, Jan 15, 2013 at 1:52 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Tuesday, January 15, 2013 07:44:21 AM Yinghai Lu wrote:
>> On Tue, Jan 15, 2013 at 3:21 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> > On Monday, January 14, 2013 10:23:47 PM Yinghai Lu wrote:
>> >> On Sat, Jan 12, 2013 at 1:37 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> >> > On Friday, January 11, 2013 02:40:29 PM Yinghai Lu wrote:
>> >> >> We can stop trying according to try number now and do not need to use
>> >> >> root_bus checking as stop sign anymore.
>> >> >>
>> >> >> In extreme case we could need to reallocate resource for device just
>> >> >> under root bus.
>> >> >
>> >> > Well, the above says that we _can_ do the change, but it doesn't explain why it
>> >> > is needed.  So what's the reason why we need to do that?
>> >>
>> >> In extreme case we could need to reallocate resource for device just
>> >> under root bus.
>> >>
>> >> otherwise, those devices just under root bus will not be assigned
>> >> resources again.
>> >
>> > IOW, our current code will not cover the case when we hot plug a host bridge
>> > and need to reassign resources for devices integrated into it?
>>
>> yes. in extreme case if _CRS range is not big enough.
>
> It would be good to say that in the changelog too.  It's a clear justification
> for the change if we're going to support root bridge hotplug (which we are).
>

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

Patch

diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 6d3591d..7e8739e 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -283,7 +283,7 @@  static void assign_requested_resources_sorted(struct list_head *head,
 		idx = res - &dev_res->dev->resource[0];
 		if (resource_size(res) &&
 		    pci_assign_resource(dev_res->dev, idx)) {
-			if (fail_head && !pci_is_root_bus(dev_res->dev->bus)) {
+			if (fail_head) {
 				/*
 				 * if the failed res is for ROM BAR, and it will
 				 * be enabled later, don't add it to the list