diff mbox

[v8,14/22] ACPI: update ej_event interface to take acpi_device

Message ID 1357944049-29620-15-git-send-email-yinghai@kernel.org (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Yinghai Lu Jan. 11, 2013, 10:40 p.m. UTC
Should use acpi_device pointer directly instead of use handle and
get the device pointer again later.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
 drivers/acpi/acpi_memhotplug.c  |    2 +-
 drivers/acpi/processor_driver.c |    2 +-
 drivers/acpi/scan.c             |   14 ++++----------
 include/acpi/acpi_bus.h         |    2 +-
 4 files changed, 7 insertions(+), 13 deletions(-)

Comments

Rafael Wysocki Jan. 12, 2013, 11:40 p.m. UTC | #1
On Friday, January 11, 2013 02:40:41 PM Yinghai Lu wrote:
> Should use acpi_device pointer directly instead of use handle and
> get the device pointer again later.

Looks good.

I can take this one right now if you want.

Thanks,
Rafael


> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> ---
>  drivers/acpi/acpi_memhotplug.c  |    2 +-
>  drivers/acpi/processor_driver.c |    2 +-
>  drivers/acpi/scan.c             |   14 ++++----------
>  include/acpi/acpi_bus.h         |    2 +-
>  4 files changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
> index 327ab44..eaddb7a 100644
> --- a/drivers/acpi/acpi_memhotplug.c
> +++ b/drivers/acpi/acpi_memhotplug.c
> @@ -361,7 +361,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
>  			break;
>  		}
>  
> -		ej_event->handle = handle;
> +		ej_event->device = device;
>  		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
>  		acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
>  					(void *)ej_event);
> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
> index 0777663..a24ee43 100644
> --- a/drivers/acpi/processor_driver.c
> +++ b/drivers/acpi/processor_driver.c
> @@ -733,7 +733,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
>  			break;
>  		}
>  
> -		ej_event->handle = handle;
> +		ej_event->device = device;
>  		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
>  		acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
>  					(void *)ej_event);
> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> index 8883539..f4c6305 100644
> --- a/drivers/acpi/scan.c
> +++ b/drivers/acpi/scan.c
> @@ -116,20 +116,14 @@ static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
>  void acpi_bus_hot_remove_device(void *context)
>  {
>  	struct acpi_eject_event *ej_event = (struct acpi_eject_event *) context;
> -	struct acpi_device *device;
> -	acpi_handle handle = ej_event->handle;
> +	struct acpi_device *device = ej_event->device;
> +	acpi_handle handle = device->handle;
>  	acpi_handle temp;
>  	struct acpi_object_list arg_list;
>  	union acpi_object arg;
>  	acpi_status status = AE_OK;
>  	u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
>  
> -	if (acpi_bus_get_device(handle, &device))
> -		goto err_out;
> -
> -	if (!device)
> -		goto err_out;
> -
>  	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>  		"Hot-removing device %s...\n", dev_name(&device->dev)));
>  
> @@ -215,7 +209,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
>  		goto err;
>  	}
>  
> -	ej_event->handle = acpi_device->handle;
> +	ej_event->device = acpi_device;
>  	if (acpi_device->flags.eject_pending) {
>  		/* event originated from ACPI eject notification */
>  		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
> @@ -223,7 +217,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
>  	} else {
>  		/* event originated from user */
>  		ej_event->event = ACPI_OST_EC_OSPM_EJECT;
> -		(void) acpi_evaluate_hotplug_ost(ej_event->handle,
> +		(void) acpi_evaluate_hotplug_ost(acpi_device->handle,
>  			ej_event->event, ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
>  	}
>  
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index 2246ba9..181ff2d 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -309,7 +309,7 @@ struct acpi_bus_event {
>  };
>  
>  struct acpi_eject_event {
> -	acpi_handle	handle;
> +	struct acpi_device	*device;
>  	u32		event;
>  };
>  
>
Yinghai Lu Jan. 15, 2013, 6:55 a.m. UTC | #2
On Sat, Jan 12, 2013 at 3:40 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Friday, January 11, 2013 02:40:41 PM Yinghai Lu wrote:
>> Should use acpi_device pointer directly instead of use handle and
>> get the device pointer again later.
>
> Looks good.
>
> I can take this one right now if you want.

yes, in acpi-scan branch?

othewise i can not base on pci/next again.

>
> Thanks,
> Rafael
>
>
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>> ---
>>  drivers/acpi/acpi_memhotplug.c  |    2 +-
>>  drivers/acpi/processor_driver.c |    2 +-
>>  drivers/acpi/scan.c             |   14 ++++----------
>>  include/acpi/acpi_bus.h         |    2 +-
>>  4 files changed, 7 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
>> index 327ab44..eaddb7a 100644
>> --- a/drivers/acpi/acpi_memhotplug.c
>> +++ b/drivers/acpi/acpi_memhotplug.c
>> @@ -361,7 +361,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
>>                       break;
>>               }
>>
>> -             ej_event->handle = handle;
>> +             ej_event->device = device;
>>               ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
>>               acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
>>                                       (void *)ej_event);
>> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
>> index 0777663..a24ee43 100644
>> --- a/drivers/acpi/processor_driver.c
>> +++ b/drivers/acpi/processor_driver.c
>> @@ -733,7 +733,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
>>                       break;
>>               }
>>
>> -             ej_event->handle = handle;
>> +             ej_event->device = device;
>>               ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
>>               acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
>>                                       (void *)ej_event);
>> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
>> index 8883539..f4c6305 100644
>> --- a/drivers/acpi/scan.c
>> +++ b/drivers/acpi/scan.c
>> @@ -116,20 +116,14 @@ static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
>>  void acpi_bus_hot_remove_device(void *context)
>>  {
>>       struct acpi_eject_event *ej_event = (struct acpi_eject_event *) context;
>> -     struct acpi_device *device;
>> -     acpi_handle handle = ej_event->handle;
>> +     struct acpi_device *device = ej_event->device;
>> +     acpi_handle handle = device->handle;
>>       acpi_handle temp;
>>       struct acpi_object_list arg_list;
>>       union acpi_object arg;
>>       acpi_status status = AE_OK;
>>       u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
>>
>> -     if (acpi_bus_get_device(handle, &device))
>> -             goto err_out;
>> -
>> -     if (!device)
>> -             goto err_out;
>> -
>>       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>>               "Hot-removing device %s...\n", dev_name(&device->dev)));
>>
>> @@ -215,7 +209,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
>>               goto err;
>>       }
>>
>> -     ej_event->handle = acpi_device->handle;
>> +     ej_event->device = acpi_device;
>>       if (acpi_device->flags.eject_pending) {
>>               /* event originated from ACPI eject notification */
>>               ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
>> @@ -223,7 +217,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
>>       } else {
>>               /* event originated from user */
>>               ej_event->event = ACPI_OST_EC_OSPM_EJECT;
>> -             (void) acpi_evaluate_hotplug_ost(ej_event->handle,
>> +             (void) acpi_evaluate_hotplug_ost(acpi_device->handle,
>>                       ej_event->event, ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
>>       }
>>
>> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
>> index 2246ba9..181ff2d 100644
>> --- a/include/acpi/acpi_bus.h
>> +++ b/include/acpi/acpi_bus.h
>> @@ -309,7 +309,7 @@ struct acpi_bus_event {
>>  };
>>
>>  struct acpi_eject_event {
>> -     acpi_handle     handle;
>> +     struct acpi_device      *device;
>>       u32             event;
>>  };
>>
>>
> --
> I speak only for myself.
> Rafael J. Wysocki, Intel Open Source Technology Center.
--
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 Wysocki Jan. 15, 2013, 11:26 a.m. UTC | #3
On Monday, January 14, 2013 10:55:49 PM Yinghai Lu wrote:
> On Sat, Jan 12, 2013 at 3:40 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Friday, January 11, 2013 02:40:41 PM Yinghai Lu wrote:
> >> Should use acpi_device pointer directly instead of use handle and
> >> get the device pointer again later.
> >
> > Looks good.
> >
> > I can take this one right now if you want.
> 
> yes, in acpi-scan branch?
> 
> othewise i can not base on pci/next again.

OK

So I think there will be more patches in acpi-scan you'll need anyway, so
I'll put this one on that branch too.

Thanks,
Rafael


> >> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
> >> ---
> >>  drivers/acpi/acpi_memhotplug.c  |    2 +-
> >>  drivers/acpi/processor_driver.c |    2 +-
> >>  drivers/acpi/scan.c             |   14 ++++----------
> >>  include/acpi/acpi_bus.h         |    2 +-
> >>  4 files changed, 7 insertions(+), 13 deletions(-)
> >>
> >> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
> >> index 327ab44..eaddb7a 100644
> >> --- a/drivers/acpi/acpi_memhotplug.c
> >> +++ b/drivers/acpi/acpi_memhotplug.c
> >> @@ -361,7 +361,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
> >>                       break;
> >>               }
> >>
> >> -             ej_event->handle = handle;
> >> +             ej_event->device = device;
> >>               ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
> >>               acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
> >>                                       (void *)ej_event);
> >> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
> >> index 0777663..a24ee43 100644
> >> --- a/drivers/acpi/processor_driver.c
> >> +++ b/drivers/acpi/processor_driver.c
> >> @@ -733,7 +733,7 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
> >>                       break;
> >>               }
> >>
> >> -             ej_event->handle = handle;
> >> +             ej_event->device = device;
> >>               ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
> >>               acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
> >>                                       (void *)ej_event);
> >> diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
> >> index 8883539..f4c6305 100644
> >> --- a/drivers/acpi/scan.c
> >> +++ b/drivers/acpi/scan.c
> >> @@ -116,20 +116,14 @@ static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
> >>  void acpi_bus_hot_remove_device(void *context)
> >>  {
> >>       struct acpi_eject_event *ej_event = (struct acpi_eject_event *) context;
> >> -     struct acpi_device *device;
> >> -     acpi_handle handle = ej_event->handle;
> >> +     struct acpi_device *device = ej_event->device;
> >> +     acpi_handle handle = device->handle;
> >>       acpi_handle temp;
> >>       struct acpi_object_list arg_list;
> >>       union acpi_object arg;
> >>       acpi_status status = AE_OK;
> >>       u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
> >>
> >> -     if (acpi_bus_get_device(handle, &device))
> >> -             goto err_out;
> >> -
> >> -     if (!device)
> >> -             goto err_out;
> >> -
> >>       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
> >>               "Hot-removing device %s...\n", dev_name(&device->dev)));
> >>
> >> @@ -215,7 +209,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
> >>               goto err;
> >>       }
> >>
> >> -     ej_event->handle = acpi_device->handle;
> >> +     ej_event->device = acpi_device;
> >>       if (acpi_device->flags.eject_pending) {
> >>               /* event originated from ACPI eject notification */
> >>               ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
> >> @@ -223,7 +217,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
> >>       } else {
> >>               /* event originated from user */
> >>               ej_event->event = ACPI_OST_EC_OSPM_EJECT;
> >> -             (void) acpi_evaluate_hotplug_ost(ej_event->handle,
> >> +             (void) acpi_evaluate_hotplug_ost(acpi_device->handle,
> >>                       ej_event->event, ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
> >>       }
> >>
> >> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> >> index 2246ba9..181ff2d 100644
> >> --- a/include/acpi/acpi_bus.h
> >> +++ b/include/acpi/acpi_bus.h
> >> @@ -309,7 +309,7 @@ struct acpi_bus_event {
> >>  };
> >>
> >>  struct acpi_eject_event {
> >> -     acpi_handle     handle;
> >> +     struct acpi_device      *device;
> >>       u32             event;
> >>  };
> >>
> >>
> > --
> > I speak only for myself.
> > Rafael J. Wysocki, Intel Open Source Technology Center.
Yinghai Lu Jan. 15, 2013, 11:43 p.m. UTC | #4
On Tue, Jan 15, 2013 at 3:26 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Monday, January 14, 2013 10:55:49 PM Yinghai Lu wrote:
>> On Sat, Jan 12, 2013 at 3:40 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> > On Friday, January 11, 2013 02:40:41 PM Yinghai Lu wrote:
>> >> Should use acpi_device pointer directly instead of use handle and
>> >> get the device pointer again later.
>> >
>> > Looks good.
>> >
>> > I can take this one right now if you want.
>>
>> yes, in acpi-scan branch?
>>
>> othewise i can not base on pci/next again.
>
> OK
>
> So I think there will be more patches in acpi-scan you'll need anyway, so
> I'll put this one on that branch too.

after updating pci root bus hotplug patches against your linux-next,
got panic during removal:

echo "PCI0 3" > /sys/kernel/debug/acpi/sci_notify
[   55.223155] ACPI: ACPI device name is <PCI0>, event code is <3>
[   55.226746] ACPI: Notify event is queued
[   55.228648] _handle_hotplug_event_root: Device eject notify on \_SB_.PCI0
10:~ # [   55.340169] ACPI: Device 0000:00:03.0 -x-> \_SB_.PCI0.S03_
[   55.341040] ACPI: Device 0000:00:02.0 -x-> \_SB_.PCI0.VGA_
[   55.341711] i2c i2c-0: adapter [SMBus PIIX4 adapter at b100] unregistered
[   55.342585] i2c-dev: adapter [SMBus PIIX4 adapter at b100] unregistered
[   55.343522] ACPI: Device 0000:00:01.3 -x-> \_SB_.PCI0.PX13
[   55.344660] ata1.00: disabled
[   55.350377] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[   55.352729] sd 0:0:0:0: [sda]
[   55.353405] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[   55.354010] sd 0:0:0:0: [sda] Stopping disk
[   55.358144] sd 0:0:0:0: [sda] START_STOP FAILED
[   55.358660] sd 0:0:0:0: [sda]
[   55.359026] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[   55.361348] ata2.00: disabled
[   55.371548] ACPI: Device 0000:00:01.0 -x-> \_SB_.PCI0.ISA_
[   55.372268] ACPI: Device pci0000:00 -x-> \_SB_.PCI0
[   55.372747]   remove_bridge is called for \_SB_.PCI0 ffff8801964661e0
[   55.373581] acpiphp: Slot [31] unregistered
[   55.374110] pci_hotplug: pci_hp_deregister: Removed slot 31 from the list
[   55.374720] acpiphp: release_slot - physical_slot = 31
[   55.375195] pci_bus 0000:00: dev 1f, dec refcount to 0
[   55.375781] pci_bus 0000:00: dev 1f, released physical slot 31
[   55.376370] acpiphp: Slot [30] unregistered
[   55.376839] pci_hotplug: pci_hp_deregister: Removed slot 30 from the list
[   55.377512] acpiphp: release_slot - physical_slot = 30
[   55.377968] pci_bus 0000:00: dev 1e, dec refcount to 0
[   55.378432] pci_bus 0000:00: dev 1e, released physical slot 30
[   55.378976] acpiphp: Slot [29] unregistered
[   55.379375] pci_hotplug: pci_hp_deregister: Removed slot 29 from the list
[   55.379977] acpiphp: release_slot - physical_slot = 29
[   55.380479] pci_bus 0000:00: dev 1d, dec refcount to 0
[   55.380967] pci_bus 0000:00: dev 1d, released physical slot 29
[   55.381484] acpiphp: Slot [28] unregistered
[   55.381860] pci_hotplug: pci_hp_deregister: Removed slot 28 from the list
[   55.382485] acpiphp: release_slot - physical_slot = 28
[   55.383067] pci_bus 0000:00: dev 1c, dec refcount to 0
[   55.384426] pci_bus 0000:00: dev 1c, released physical slot 28
[   55.385830] acpiphp: Slot [27] unregistered
[   55.386852] pci_hotplug: pci_hp_deregister: Removed slot 27 from the list
[   55.388511] acpiphp: release_slot - physical_slot = 27
[   55.389750] pci_bus 0000:00: dev 1b, dec refcount to 0
[   55.390994] pci_bus 0000:00: dev 1b, released physical slot 27
[   55.392418] acpiphp: Slot [26] unregistered
[   55.393419] pci_hotplug: pci_hp_deregister: Removed slot 26 from the list
[   55.395034] acpiphp: release_slot - physical_slot = 26
[   55.396283] pci_bus 0000:00: dev 1a, dec refcount to 0
[   55.397514] pci_bus 0000:00: dev 1a, released physical slot 26
[   55.398901] acpiphp: Slot [25] unregistered
[   55.399927] pci_hotplug: pci_hp_deregister: Removed slot 25 from the list
[   55.401059] acpiphp: release_slot - physical_slot = 25
[   55.401761] pci_bus 0000:00: dev 19, dec refcount to 0
[   55.402715] pci_bus 0000:00: dev 19, released physical slot 25
[   55.403838] acpiphp: Slot [24] unregistered
[   55.404892] pci_hotplug: pci_hp_deregister: Removed slot 24 from the list
[   55.406501] acpiphp: release_slot - physical_slot = 24
[   55.407720] pci_bus 0000:00: dev 18, dec refcount to 0
[   55.409001] pci_bus 0000:00: dev 18, released physical slot 24
[   55.410220] acpiphp: Slot [23] unregistered
[   55.410951] pci_hotplug: pci_hp_deregister: Removed slot 23 from the list
[   55.412601] acpiphp: release_slot - physical_slot = 23
[   55.413840] pci_bus 0000:00: dev 17, dec refcount to 0
[   55.415092] pci_bus 0000:00: dev 17, released physical slot 23
[   55.416510] acpiphp: Slot [22] unregistered
[   55.417529] pci_hotplug: pci_hp_deregister: Removed slot 22 from the list
[   55.419153] acpiphp: release_slot - physical_slot = 22
[   55.420415] pci_bus 0000:00: dev 16, dec refcount to 0
[   55.421665] pci_bus 0000:00: dev 16, released physical slot 22
[   55.423069] acpiphp: Slot [21] unregistered
[   55.424110] pci_hotplug: pci_hp_deregister: Removed slot 21 from the list
[   55.425722] acpiphp: release_slot - physical_slot = 21
[   55.426952] pci_bus 0000:00: dev 15, dec refcount to 0
[   55.428209] pci_bus 0000:00: dev 15, released physical slot 21
[   55.429578] acpiphp: Slot [20] unregistered
[   55.430219] pci_hotplug: pci_hp_deregister: Removed slot 20 from the list
[   55.431123] acpiphp: release_slot - physical_slot = 20
[   55.431796] pci_bus 0000:00: dev 14, dec refcount to 0
[   55.432986] pci_bus 0000:00: dev 14, released physical slot 20
[   55.434392] acpiphp: Slot [19] unregistered
[   55.435411] pci_hotplug: pci_hp_deregister: Removed slot 19 from the list
[   55.437051] acpiphp: release_slot - physical_slot = 19
[   55.438309] pci_bus 0000:00: dev 13, dec refcount to 0
[   55.439556] pci_bus 0000:00: dev 13, released physical slot 19
[   55.440987] acpiphp: Slot [18] unregistered
[   55.441993] pci_hotplug: pci_hp_deregister: Removed slot 18 from the list
[   55.443511] acpiphp: release_slot - physical_slot = 18
[   55.444269] pci_bus 0000:00: dev 12, dec refcount to 0
[   55.445522] pci_bus 0000:00: dev 12, released physical slot 18
[   55.446949] acpiphp: Slot [17] unregistered
[   55.447961] pci_hotplug: pci_hp_deregister: Removed slot 17 from the list
[   55.449610] acpiphp: release_slot - physical_slot = 17
[   55.450839] pci_bus 0000:00: dev 11, dec refcount to 0
[   55.452097] pci_bus 0000:00: dev 11, released physical slot 17
[   55.453501] acpiphp: Slot [16] unregistered
[   55.454509] pci_hotplug: pci_hp_deregister: Removed slot 16 from the list
[   55.456151] acpiphp: release_slot - physical_slot = 16
[   55.457370] pci_bus 0000:00: dev 10, dec refcount to 0
[   55.458601] pci_bus 0000:00: dev 10, released physical slot 16
[   55.459775] acpiphp: Slot [15] unregistered
[   55.460444] pci_hotplug: pci_hp_deregister: Removed slot 15 from the list
[   55.461354] acpiphp: release_slot - physical_slot = 15
[   55.462059] pci_bus 0000:00: dev 0f, dec refcount to 0
[   55.462985] pci_bus 0000:00: dev 0f, released physical slot 15
[   55.464475] acpiphp: Slot [14] unregistered
[   55.465481] pci_hotplug: pci_hp_deregister: Removed slot 14 from the list
[   55.467089] acpiphp: release_slot - physical_slot = 14
[   55.468351] pci_bus 0000:00: dev 0e, dec refcount to 0
[   55.469597] pci_bus 0000:00: dev 0e, released physical slot 14
[   55.470994] acpiphp: Slot [13] unregistered
[   55.472033] pci_hotplug: pci_hp_deregister: Removed slot 13 from the list
[   55.473650] acpiphp: release_slot - physical_slot = 13
[   55.474878] pci_bus 0000:00: dev 0d, dec refcount to 0
[   55.476144] pci_bus 0000:00: dev 0d, released physical slot 13
[   55.477198] acpiphp: Slot [12] unregistered
[   55.477926] pci_hotplug: pci_hp_deregister: Removed slot 12 from the list
[   55.479561] acpiphp: release_slot - physical_slot = 12
[   55.480816] pci_bus 0000:00: dev 0c, dec refcount to 0
[   55.482073] pci_bus 0000:00: dev 0c, released physical slot 12
[   55.483475] acpiphp: Slot [11] unregistered
[   55.484515] pci_hotplug: pci_hp_deregister: Removed slot 11 from the list
[   55.486123] acpiphp: release_slot - physical_slot = 11
[   55.487338] pci_bus 0000:00: dev 0b, dec refcount to 0
[   55.488597] pci_bus 0000:00: dev 0b, released physical slot 11
[   55.489670] acpiphp: Slot [10] unregistered
[   55.490285] pci_hotplug: pci_hp_deregister: Removed slot 10 from the list
[   55.491700] acpiphp: release_slot - physical_slot = 10
[   55.492975] pci_bus 0000:00: dev 0a, dec refcount to 0
[   55.493800] pci_bus 0000:00: dev 0a, released physical slot 10
[   55.495103] acpiphp: Slot [9] unregistered
[   55.496121] pci_hotplug: pci_hp_deregister: Removed slot 9 from the list
[   55.497715] acpiphp: release_slot - physical_slot = 9
[   55.498929] pci_bus 0000:00: dev 09, dec refcount to 0
[   55.500206] pci_bus 0000:00: dev 09, released physical slot 9
[   55.501588] acpiphp: Slot [8] unregistered
[   55.502584] pci_hotplug: pci_hp_deregister: Removed slot 8 from the list
[   55.504196] acpiphp: release_slot - physical_slot = 8
[   55.505405] pci_bus 0000:00: dev 08, dec refcount to 0
[   55.506652] pci_bus 0000:00: dev 08, released physical slot 8
[   55.508057] acpiphp: Slot [7] unregistered
[   55.509060] pci_hotplug: pci_hp_deregister: Removed slot 7 from the list
[   55.510639] acpiphp: release_slot - physical_slot = 7
[   55.511838] pci_bus 0000:00: dev 07, dec refcount to 0
[   55.513117] pci_bus 0000:00: dev 07, released physical slot 7
[   55.514496] acpiphp: Slot [6] unregistered
[   55.515486] pci_hotplug: pci_hp_deregister: Removed slot 6 from the list
[   55.517099] acpiphp: release_slot - physical_slot = 6
[   55.518283] pci_bus 0000:00: dev 06, dec refcount to 0
[   55.519504] pci_bus 0000:00: dev 06, released physical slot 6
[   55.520365] acpiphp: Slot [5] unregistered
[   55.522045] pci_hotplug: pci_hp_deregister: Removed slot 5 from the list
[   55.523383] acpiphp: release_slot - physical_slot = 5
[   55.524627] pci_bus 0000:00: dev 05, dec refcount to 0
[   55.525887] pci_bus 0000:00: dev 05, released physical slot 5
[   55.527122] acpiphp: Slot [4] unregistered
[   55.527770] pci_hotplug: pci_hp_deregister: Removed slot 4 from the list
[   55.529417] acpiphp: release_slot - physical_slot = 4
[   55.530620] pci_bus 0000:00: dev 04, dec refcount to 0
[   55.531912] pci_bus 0000:00: dev 04, released physical slot 4
[   55.533325] acpiphp: Slot [3] unregistered
[   55.534327] pci_hotplug: pci_hp_deregister: Removed slot 3 from the list
[   55.535915] acpiphp: release_slot - physical_slot = 3
[   55.537147] pci_bus 0000:00: dev 03, dec refcount to 0
[   55.538388] pci_bus 0000:00: dev 03, released physical slot 3
[   55.539763]   acpi_pci_iommu_remove is called for \_SB_.PCI0 ffff8801964661e0
[   55.541569]   acpi_pci_ioapic_remove is called for \_SB_.PCI0
ffff8801964661e0
[   55.543356] ACPI: Delete PCI Interrupt Routing Table for 0000:00
[   55.544848] pci 0000:00:00.0: freeing pci_dev info
[   55.546002] pci 0000:00:01.0: freeing pci_dev info
[   55.547148] pci 0000:00:01.1: freeing pci_dev info
[   55.548304] pci 0000:00:01.3: freeing pci_dev info
[   55.549346] pci 0000:00:02.0: freeing pci_dev info
[   55.550058] pci 0000:00:03.0: freeing pci_dev info
[   55.550707] pci_bus 0000:00: busn_res: [bus 00-ff] is released
[   55.552535] pci_bus 0000:00: freeing pci_bus info
[   55.553424] pci_host_bridge pci0000:00: freeing pci_host_bridge info
[   55.555303] BUG: unable to handle kernel NULL pointer dereference
at           (null)
[   55.556269] IP: [<ffffffff8153bf9a>] acpi_power_resources_list_free+0x15/0x3f
[   55.556269] PGD 0
[   55.556269] Oops: 0000 [#1] SMP
[   55.556269] Modules linked in:
[   55.556269] CPU 0
[   55.556269] Pid: 1036, comm: kworker/0:1 Not tainted
3.8.0-rc3-yh-00703-gf602aca-dirty #1131 Bochs Bochs
[   55.556269] RIP: 0010:[<ffffffff8153bf9a>]  [<ffffffff8153bf9a>]
acpi_power_resources_list_free+0x15/0x3f
[   55.556269] RSP: 0018:ffff8801962479b8  EFLAGS: 00010292
[   55.556269] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000006
[   55.556269] RDX: 00000000000033a0 RSI: ffff8801960c2e18 RDI: ffff8801965db988
[   55.556269] RBP: ffff8801962479d8 R08: 0000000000000002 R09: 0000000000000000
[   55.556269] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
[   55.556269] R13: ffff8801965db988 R14: ffff8801965db9e0 R15: ffff880196466528
[   55.556269] FS:  0000000000000000(0000) GS:ffff880199200000(0000)
knlGS:0000000000000000
[   55.556269] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   55.556269] CR2: 0000000000000000 CR3: 0000000002c13000 CR4: 00000000000006f0
[   55.556269] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   55.556269] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   55.556269] Process kworker/0:1 (pid: 1036, threadinfo
ffff880196246000, task ffff8801960c2500)
[   55.556269] Stack:
[   55.556269]  0000000000000000 ffff8801965db800 0000000000000000
ffff8801965db9d0
[   55.556269]  ffff880196247a08 ffffffff81536e2f ffffffff81536dff
ffff8801965db9e0
[   55.556269]  ffff8801965db9d0 ffff88019666de00 ffff880196247a38
ffffffff81710385
[   55.556269] Call Trace:
[   55.556269]  [<ffffffff81536e2f>] acpi_device_release+0x30/0x6a
[   55.556269]  [<ffffffff81536dff>] ? acpi_free_ids+0x50/0x50
[   55.556269]  [<ffffffff81710385>] device_release+0xa5/0x110
[   55.556269]  [<ffffffff814bda7f>] kobject_release+0x6f/0x90
[   55.556269]  [<ffffffff814bd93c>] kobject_put+0x4c/0x60
[   55.556269]  [<ffffffff81710087>] put_device+0x17/0x20
[   55.556269]  [<ffffffff8171133e>] device_unregister+0x1e/0x30
[   55.556269]  [<ffffffff815367ed>] acpi_device_unregister+0x162/0x177
[   55.556269]  [<ffffffff8153682d>] acpi_bus_remove+0x2b/0x2f
[   55.556269]  [<ffffffff815601c4>] acpi_ns_walk_namespace+0x114/0x250
[   55.556269]  [<ffffffff81536802>] ? acpi_device_unregister+0x177/0x177
[   55.556269]  [<ffffffff81536802>] ? acpi_device_unregister+0x177/0x177
[   55.556269]  [<ffffffff815607c5>] acpi_walk_namespace+0xee/0x137
[   55.556269]  [<ffffffff81536921>] acpi_bus_trim+0x64/0x7c
[   55.556269]  [<ffffffff815369b2>] acpi_bus_hot_remove_device+0x79/0x16d
[   55.556269]  [<ffffffff81196dc2>] ? kmem_cache_alloc_trace+0x42/0x150
[   55.556269]  [<ffffffff81539c18>] _handle_hotplug_event_root+0x108/0x149
[   55.556269]  [<ffffffff810a8b20>] ? process_one_work+0x270/0x560
[   55.556269]  [<ffffffff810a8b8d>] process_one_work+0x2dd/0x560
[   55.556269]  [<ffffffff810a8b20>] ? process_one_work+0x270/0x560
[   55.556269]  [<ffffffff810a9679>] ? worker_thread+0x59/0x3a0
[   55.556269]  [<ffffffff81539b10>] ? acpi_pci_find_root+0x3f/0x3f
[   55.556269]  [<ffffffff810a989a>] worker_thread+0x27a/0x3a0
[   55.556269]  [<ffffffff810e9f4d>] ? trace_hardirqs_on+0xd/0x10
[   55.556269]  [<ffffffff810a9620>] ? manage_workers+0x280/0x280
[   55.556269]  [<ffffffff810af088>] kthread+0xe8/0xf0
[   55.556269]  [<ffffffff810aefa0>] ? __init_kthread_worker+0x70/0x70
[   55.556269]  [<ffffffff8216d61c>] ret_from_fork+0x7c/0xb0
[   55.556269]  [<ffffffff810aefa0>] ? __init_kthread_worker+0x70/0x70
[   55.556269] Code: fe ff ff 48 8b 1b 4c 39 e3 75 ef 5b 5b 41 5c 44
89 e8 41 5d 5d c3 0f 1f 44 00 00 55 48 89 e5 41 55 49 89 fd 41 54 53
50 48 8b 1f <4c> 8b 23 eb 17 48 89 df e8 c9 34 f9 ff 48 89 df 4c 89 e3
e8 6e


looks like:

acpi_device_release+0x30
0xffffffff81536e2f is in acpi_device_release (drivers/acpi/scan.c:524).
519	static void acpi_free_power_resources_lists(struct acpi_device *device)
520	{
521		int i;
522	
523		acpi_power_resources_list_free(&device->wakeup.resources);
524		if (!device->flags.power_manageable)
525			return;
526	
527		for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) {
528			struct acpi_device_power_state *ps = &device->power.states[i];

wakeup.resources has problem?

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
Rafael Wysocki Jan. 15, 2013, 11:55 p.m. UTC | #5
On Tuesday, January 15, 2013 03:43:17 PM Yinghai Lu wrote:
> On Tue, Jan 15, 2013 at 3:26 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Monday, January 14, 2013 10:55:49 PM Yinghai Lu wrote:
> >> On Sat, Jan 12, 2013 at 3:40 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> >> > On Friday, January 11, 2013 02:40:41 PM Yinghai Lu wrote:
> >> >> Should use acpi_device pointer directly instead of use handle and
> >> >> get the device pointer again later.
> >> >
> >> > Looks good.
> >> >
> >> > I can take this one right now if you want.
> >>
> >> yes, in acpi-scan branch?
> >>
> >> othewise i can not base on pci/next again.
> >
> > OK
> >
> > So I think there will be more patches in acpi-scan you'll need anyway, so
> > I'll put this one on that branch too.
> 
> after updating pci root bus hotplug patches against your linux-next,
> got panic during removal:
> 
> echo "PCI0 3" > /sys/kernel/debug/acpi/sci_notify
> [   55.223155] ACPI: ACPI device name is <PCI0>, event code is <3>
> [   55.226746] ACPI: Notify event is queued
> [   55.228648] _handle_hotplug_event_root: Device eject notify on \_SB_.PCI0
> 10:~ # [   55.340169] ACPI: Device 0000:00:03.0 -x-> \_SB_.PCI0.S03_
> [   55.341040] ACPI: Device 0000:00:02.0 -x-> \_SB_.PCI0.VGA_
> [   55.341711] i2c i2c-0: adapter [SMBus PIIX4 adapter at b100] unregistered
> [   55.342585] i2c-dev: adapter [SMBus PIIX4 adapter at b100] unregistered
> [   55.343522] ACPI: Device 0000:00:01.3 -x-> \_SB_.PCI0.PX13
> [   55.344660] ata1.00: disabled
> [   55.350377] sd 0:0:0:0: [sda] Synchronizing SCSI cache
> [   55.352729] sd 0:0:0:0: [sda]
> [   55.353405] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
> [   55.354010] sd 0:0:0:0: [sda] Stopping disk
> [   55.358144] sd 0:0:0:0: [sda] START_STOP FAILED
> [   55.358660] sd 0:0:0:0: [sda]
> [   55.359026] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
> [   55.361348] ata2.00: disabled
> [   55.371548] ACPI: Device 0000:00:01.0 -x-> \_SB_.PCI0.ISA_
> [   55.372268] ACPI: Device pci0000:00 -x-> \_SB_.PCI0
> [   55.372747]   remove_bridge is called for \_SB_.PCI0 ffff8801964661e0
> [   55.373581] acpiphp: Slot [31] unregistered
> [   55.374110] pci_hotplug: pci_hp_deregister: Removed slot 31 from the list
> [   55.374720] acpiphp: release_slot - physical_slot = 31
> [   55.375195] pci_bus 0000:00: dev 1f, dec refcount to 0
> [   55.375781] pci_bus 0000:00: dev 1f, released physical slot 31
> [   55.376370] acpiphp: Slot [30] unregistered
> [   55.376839] pci_hotplug: pci_hp_deregister: Removed slot 30 from the list
> [   55.377512] acpiphp: release_slot - physical_slot = 30
> [   55.377968] pci_bus 0000:00: dev 1e, dec refcount to 0
> [   55.378432] pci_bus 0000:00: dev 1e, released physical slot 30
> [   55.378976] acpiphp: Slot [29] unregistered
> [   55.379375] pci_hotplug: pci_hp_deregister: Removed slot 29 from the list
> [   55.379977] acpiphp: release_slot - physical_slot = 29
> [   55.380479] pci_bus 0000:00: dev 1d, dec refcount to 0
> [   55.380967] pci_bus 0000:00: dev 1d, released physical slot 29
> [   55.381484] acpiphp: Slot [28] unregistered
> [   55.381860] pci_hotplug: pci_hp_deregister: Removed slot 28 from the list
> [   55.382485] acpiphp: release_slot - physical_slot = 28
> [   55.383067] pci_bus 0000:00: dev 1c, dec refcount to 0
> [   55.384426] pci_bus 0000:00: dev 1c, released physical slot 28
> [   55.385830] acpiphp: Slot [27] unregistered
> [   55.386852] pci_hotplug: pci_hp_deregister: Removed slot 27 from the list
> [   55.388511] acpiphp: release_slot - physical_slot = 27
> [   55.389750] pci_bus 0000:00: dev 1b, dec refcount to 0
> [   55.390994] pci_bus 0000:00: dev 1b, released physical slot 27
> [   55.392418] acpiphp: Slot [26] unregistered
> [   55.393419] pci_hotplug: pci_hp_deregister: Removed slot 26 from the list
> [   55.395034] acpiphp: release_slot - physical_slot = 26
> [   55.396283] pci_bus 0000:00: dev 1a, dec refcount to 0
> [   55.397514] pci_bus 0000:00: dev 1a, released physical slot 26
> [   55.398901] acpiphp: Slot [25] unregistered
> [   55.399927] pci_hotplug: pci_hp_deregister: Removed slot 25 from the list
> [   55.401059] acpiphp: release_slot - physical_slot = 25
> [   55.401761] pci_bus 0000:00: dev 19, dec refcount to 0
> [   55.402715] pci_bus 0000:00: dev 19, released physical slot 25
> [   55.403838] acpiphp: Slot [24] unregistered
> [   55.404892] pci_hotplug: pci_hp_deregister: Removed slot 24 from the list
> [   55.406501] acpiphp: release_slot - physical_slot = 24
> [   55.407720] pci_bus 0000:00: dev 18, dec refcount to 0
> [   55.409001] pci_bus 0000:00: dev 18, released physical slot 24
> [   55.410220] acpiphp: Slot [23] unregistered
> [   55.410951] pci_hotplug: pci_hp_deregister: Removed slot 23 from the list
> [   55.412601] acpiphp: release_slot - physical_slot = 23
> [   55.413840] pci_bus 0000:00: dev 17, dec refcount to 0
> [   55.415092] pci_bus 0000:00: dev 17, released physical slot 23
> [   55.416510] acpiphp: Slot [22] unregistered
> [   55.417529] pci_hotplug: pci_hp_deregister: Removed slot 22 from the list
> [   55.419153] acpiphp: release_slot - physical_slot = 22
> [   55.420415] pci_bus 0000:00: dev 16, dec refcount to 0
> [   55.421665] pci_bus 0000:00: dev 16, released physical slot 22
> [   55.423069] acpiphp: Slot [21] unregistered
> [   55.424110] pci_hotplug: pci_hp_deregister: Removed slot 21 from the list
> [   55.425722] acpiphp: release_slot - physical_slot = 21
> [   55.426952] pci_bus 0000:00: dev 15, dec refcount to 0
> [   55.428209] pci_bus 0000:00: dev 15, released physical slot 21
> [   55.429578] acpiphp: Slot [20] unregistered
> [   55.430219] pci_hotplug: pci_hp_deregister: Removed slot 20 from the list
> [   55.431123] acpiphp: release_slot - physical_slot = 20
> [   55.431796] pci_bus 0000:00: dev 14, dec refcount to 0
> [   55.432986] pci_bus 0000:00: dev 14, released physical slot 20
> [   55.434392] acpiphp: Slot [19] unregistered
> [   55.435411] pci_hotplug: pci_hp_deregister: Removed slot 19 from the list
> [   55.437051] acpiphp: release_slot - physical_slot = 19
> [   55.438309] pci_bus 0000:00: dev 13, dec refcount to 0
> [   55.439556] pci_bus 0000:00: dev 13, released physical slot 19
> [   55.440987] acpiphp: Slot [18] unregistered
> [   55.441993] pci_hotplug: pci_hp_deregister: Removed slot 18 from the list
> [   55.443511] acpiphp: release_slot - physical_slot = 18
> [   55.444269] pci_bus 0000:00: dev 12, dec refcount to 0
> [   55.445522] pci_bus 0000:00: dev 12, released physical slot 18
> [   55.446949] acpiphp: Slot [17] unregistered
> [   55.447961] pci_hotplug: pci_hp_deregister: Removed slot 17 from the list
> [   55.449610] acpiphp: release_slot - physical_slot = 17
> [   55.450839] pci_bus 0000:00: dev 11, dec refcount to 0
> [   55.452097] pci_bus 0000:00: dev 11, released physical slot 17
> [   55.453501] acpiphp: Slot [16] unregistered
> [   55.454509] pci_hotplug: pci_hp_deregister: Removed slot 16 from the list
> [   55.456151] acpiphp: release_slot - physical_slot = 16
> [   55.457370] pci_bus 0000:00: dev 10, dec refcount to 0
> [   55.458601] pci_bus 0000:00: dev 10, released physical slot 16
> [   55.459775] acpiphp: Slot [15] unregistered
> [   55.460444] pci_hotplug: pci_hp_deregister: Removed slot 15 from the list
> [   55.461354] acpiphp: release_slot - physical_slot = 15
> [   55.462059] pci_bus 0000:00: dev 0f, dec refcount to 0
> [   55.462985] pci_bus 0000:00: dev 0f, released physical slot 15
> [   55.464475] acpiphp: Slot [14] unregistered
> [   55.465481] pci_hotplug: pci_hp_deregister: Removed slot 14 from the list
> [   55.467089] acpiphp: release_slot - physical_slot = 14
> [   55.468351] pci_bus 0000:00: dev 0e, dec refcount to 0
> [   55.469597] pci_bus 0000:00: dev 0e, released physical slot 14
> [   55.470994] acpiphp: Slot [13] unregistered
> [   55.472033] pci_hotplug: pci_hp_deregister: Removed slot 13 from the list
> [   55.473650] acpiphp: release_slot - physical_slot = 13
> [   55.474878] pci_bus 0000:00: dev 0d, dec refcount to 0
> [   55.476144] pci_bus 0000:00: dev 0d, released physical slot 13
> [   55.477198] acpiphp: Slot [12] unregistered
> [   55.477926] pci_hotplug: pci_hp_deregister: Removed slot 12 from the list
> [   55.479561] acpiphp: release_slot - physical_slot = 12
> [   55.480816] pci_bus 0000:00: dev 0c, dec refcount to 0
> [   55.482073] pci_bus 0000:00: dev 0c, released physical slot 12
> [   55.483475] acpiphp: Slot [11] unregistered
> [   55.484515] pci_hotplug: pci_hp_deregister: Removed slot 11 from the list
> [   55.486123] acpiphp: release_slot - physical_slot = 11
> [   55.487338] pci_bus 0000:00: dev 0b, dec refcount to 0
> [   55.488597] pci_bus 0000:00: dev 0b, released physical slot 11
> [   55.489670] acpiphp: Slot [10] unregistered
> [   55.490285] pci_hotplug: pci_hp_deregister: Removed slot 10 from the list
> [   55.491700] acpiphp: release_slot - physical_slot = 10
> [   55.492975] pci_bus 0000:00: dev 0a, dec refcount to 0
> [   55.493800] pci_bus 0000:00: dev 0a, released physical slot 10
> [   55.495103] acpiphp: Slot [9] unregistered
> [   55.496121] pci_hotplug: pci_hp_deregister: Removed slot 9 from the list
> [   55.497715] acpiphp: release_slot - physical_slot = 9
> [   55.498929] pci_bus 0000:00: dev 09, dec refcount to 0
> [   55.500206] pci_bus 0000:00: dev 09, released physical slot 9
> [   55.501588] acpiphp: Slot [8] unregistered
> [   55.502584] pci_hotplug: pci_hp_deregister: Removed slot 8 from the list
> [   55.504196] acpiphp: release_slot - physical_slot = 8
> [   55.505405] pci_bus 0000:00: dev 08, dec refcount to 0
> [   55.506652] pci_bus 0000:00: dev 08, released physical slot 8
> [   55.508057] acpiphp: Slot [7] unregistered
> [   55.509060] pci_hotplug: pci_hp_deregister: Removed slot 7 from the list
> [   55.510639] acpiphp: release_slot - physical_slot = 7
> [   55.511838] pci_bus 0000:00: dev 07, dec refcount to 0
> [   55.513117] pci_bus 0000:00: dev 07, released physical slot 7
> [   55.514496] acpiphp: Slot [6] unregistered
> [   55.515486] pci_hotplug: pci_hp_deregister: Removed slot 6 from the list
> [   55.517099] acpiphp: release_slot - physical_slot = 6
> [   55.518283] pci_bus 0000:00: dev 06, dec refcount to 0
> [   55.519504] pci_bus 0000:00: dev 06, released physical slot 6
> [   55.520365] acpiphp: Slot [5] unregistered
> [   55.522045] pci_hotplug: pci_hp_deregister: Removed slot 5 from the list
> [   55.523383] acpiphp: release_slot - physical_slot = 5
> [   55.524627] pci_bus 0000:00: dev 05, dec refcount to 0
> [   55.525887] pci_bus 0000:00: dev 05, released physical slot 5
> [   55.527122] acpiphp: Slot [4] unregistered
> [   55.527770] pci_hotplug: pci_hp_deregister: Removed slot 4 from the list
> [   55.529417] acpiphp: release_slot - physical_slot = 4
> [   55.530620] pci_bus 0000:00: dev 04, dec refcount to 0
> [   55.531912] pci_bus 0000:00: dev 04, released physical slot 4
> [   55.533325] acpiphp: Slot [3] unregistered
> [   55.534327] pci_hotplug: pci_hp_deregister: Removed slot 3 from the list
> [   55.535915] acpiphp: release_slot - physical_slot = 3
> [   55.537147] pci_bus 0000:00: dev 03, dec refcount to 0
> [   55.538388] pci_bus 0000:00: dev 03, released physical slot 3
> [   55.539763]   acpi_pci_iommu_remove is called for \_SB_.PCI0 ffff8801964661e0
> [   55.541569]   acpi_pci_ioapic_remove is called for \_SB_.PCI0
> ffff8801964661e0
> [   55.543356] ACPI: Delete PCI Interrupt Routing Table for 0000:00
> [   55.544848] pci 0000:00:00.0: freeing pci_dev info
> [   55.546002] pci 0000:00:01.0: freeing pci_dev info
> [   55.547148] pci 0000:00:01.1: freeing pci_dev info
> [   55.548304] pci 0000:00:01.3: freeing pci_dev info
> [   55.549346] pci 0000:00:02.0: freeing pci_dev info
> [   55.550058] pci 0000:00:03.0: freeing pci_dev info
> [   55.550707] pci_bus 0000:00: busn_res: [bus 00-ff] is released
> [   55.552535] pci_bus 0000:00: freeing pci_bus info
> [   55.553424] pci_host_bridge pci0000:00: freeing pci_host_bridge info
> [   55.555303] BUG: unable to handle kernel NULL pointer dereference
> at           (null)
> [   55.556269] IP: [<ffffffff8153bf9a>] acpi_power_resources_list_free+0x15/0x3f
> [   55.556269] PGD 0
> [   55.556269] Oops: 0000 [#1] SMP
> [   55.556269] Modules linked in:
> [   55.556269] CPU 0
> [   55.556269] Pid: 1036, comm: kworker/0:1 Not tainted
> 3.8.0-rc3-yh-00703-gf602aca-dirty #1131 Bochs Bochs
> [   55.556269] RIP: 0010:[<ffffffff8153bf9a>]  [<ffffffff8153bf9a>]
> acpi_power_resources_list_free+0x15/0x3f
> [   55.556269] RSP: 0018:ffff8801962479b8  EFLAGS: 00010292
> [   55.556269] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000006
> [   55.556269] RDX: 00000000000033a0 RSI: ffff8801960c2e18 RDI: ffff8801965db988
> [   55.556269] RBP: ffff8801962479d8 R08: 0000000000000002 R09: 0000000000000000
> [   55.556269] R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000
> [   55.556269] R13: ffff8801965db988 R14: ffff8801965db9e0 R15: ffff880196466528
> [   55.556269] FS:  0000000000000000(0000) GS:ffff880199200000(0000)
> knlGS:0000000000000000
> [   55.556269] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [   55.556269] CR2: 0000000000000000 CR3: 0000000002c13000 CR4: 00000000000006f0
> [   55.556269] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   55.556269] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [   55.556269] Process kworker/0:1 (pid: 1036, threadinfo
> ffff880196246000, task ffff8801960c2500)
> [   55.556269] Stack:
> [   55.556269]  0000000000000000 ffff8801965db800 0000000000000000
> ffff8801965db9d0
> [   55.556269]  ffff880196247a08 ffffffff81536e2f ffffffff81536dff
> ffff8801965db9e0
> [   55.556269]  ffff8801965db9d0 ffff88019666de00 ffff880196247a38
> ffffffff81710385
> [   55.556269] Call Trace:
> [   55.556269]  [<ffffffff81536e2f>] acpi_device_release+0x30/0x6a
> [   55.556269]  [<ffffffff81536dff>] ? acpi_free_ids+0x50/0x50
> [   55.556269]  [<ffffffff81710385>] device_release+0xa5/0x110
> [   55.556269]  [<ffffffff814bda7f>] kobject_release+0x6f/0x90
> [   55.556269]  [<ffffffff814bd93c>] kobject_put+0x4c/0x60
> [   55.556269]  [<ffffffff81710087>] put_device+0x17/0x20
> [   55.556269]  [<ffffffff8171133e>] device_unregister+0x1e/0x30
> [   55.556269]  [<ffffffff815367ed>] acpi_device_unregister+0x162/0x177
> [   55.556269]  [<ffffffff8153682d>] acpi_bus_remove+0x2b/0x2f
> [   55.556269]  [<ffffffff815601c4>] acpi_ns_walk_namespace+0x114/0x250
> [   55.556269]  [<ffffffff81536802>] ? acpi_device_unregister+0x177/0x177
> [   55.556269]  [<ffffffff81536802>] ? acpi_device_unregister+0x177/0x177
> [   55.556269]  [<ffffffff815607c5>] acpi_walk_namespace+0xee/0x137
> [   55.556269]  [<ffffffff81536921>] acpi_bus_trim+0x64/0x7c
> [   55.556269]  [<ffffffff815369b2>] acpi_bus_hot_remove_device+0x79/0x16d
> [   55.556269]  [<ffffffff81196dc2>] ? kmem_cache_alloc_trace+0x42/0x150
> [   55.556269]  [<ffffffff81539c18>] _handle_hotplug_event_root+0x108/0x149
> [   55.556269]  [<ffffffff810a8b20>] ? process_one_work+0x270/0x560
> [   55.556269]  [<ffffffff810a8b8d>] process_one_work+0x2dd/0x560
> [   55.556269]  [<ffffffff810a8b20>] ? process_one_work+0x270/0x560
> [   55.556269]  [<ffffffff810a9679>] ? worker_thread+0x59/0x3a0
> [   55.556269]  [<ffffffff81539b10>] ? acpi_pci_find_root+0x3f/0x3f
> [   55.556269]  [<ffffffff810a989a>] worker_thread+0x27a/0x3a0
> [   55.556269]  [<ffffffff810e9f4d>] ? trace_hardirqs_on+0xd/0x10
> [   55.556269]  [<ffffffff810a9620>] ? manage_workers+0x280/0x280
> [   55.556269]  [<ffffffff810af088>] kthread+0xe8/0xf0
> [   55.556269]  [<ffffffff810aefa0>] ? __init_kthread_worker+0x70/0x70
> [   55.556269]  [<ffffffff8216d61c>] ret_from_fork+0x7c/0xb0
> [   55.556269]  [<ffffffff810aefa0>] ? __init_kthread_worker+0x70/0x70
> [   55.556269] Code: fe ff ff 48 8b 1b 4c 39 e3 75 ef 5b 5b 41 5c 44
> 89 e8 41 5d 5d c3 0f 1f 44 00 00 55 48 89 e5 41 55 49 89 fd 41 54 53
> 50 48 8b 1f <4c> 8b 23 eb 17 48 89 df e8 c9 34 f9 ff 48 89 df 4c 89 e3
> e8 6e
> 
> 
> looks like:
> 
> acpi_device_release+0x30
> 0xffffffff81536e2f is in acpi_device_release (drivers/acpi/scan.c:524).
> 519	static void acpi_free_power_resources_lists(struct acpi_device *device)
> 520	{
> 521		int i;
> 522	
> 523		acpi_power_resources_list_free(&device->wakeup.resources);
> 524		if (!device->flags.power_manageable)
> 525			return;
> 526	
> 527		for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) {
> 528			struct acpi_device_power_state *ps = &device->power.states[i];
> 
> wakeup.resources has problem?

Yes, it seems to.

Thanks for the report, looking into it.

Rafael
Rafael Wysocki Jan. 16, 2013, 12:22 a.m. UTC | #6
On Wednesday, January 16, 2013 12:55:20 AM Rafael J. Wysocki wrote:
> On Tuesday, January 15, 2013 03:43:17 PM Yinghai Lu wrote:
> > On Tue, Jan 15, 2013 at 3:26 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > > On Monday, January 14, 2013 10:55:49 PM Yinghai Lu wrote:
[...]
> > 
> > 
> > looks like:
> > 
> > acpi_device_release+0x30
> > 0xffffffff81536e2f is in acpi_device_release (drivers/acpi/scan.c:524).
> > 519	static void acpi_free_power_resources_lists(struct acpi_device *device)
> > 520	{
> > 521		int i;
> > 522	
> > 523		acpi_power_resources_list_free(&device->wakeup.resources);
> > 524		if (!device->flags.power_manageable)
> > 525			return;
> > 526	
> > 527		for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) {
> > 528			struct acpi_device_power_state *ps = &device->power.states[i];
> > 
> > wakeup.resources has problem?
> 
> Yes, it seems to.
> 
> Thanks for the report, looking into it.

Found a bug, fixed it and updated the tree (device->flags.wakeup.valid should
be checked before the acpi_power_resources_list_free(&device->wakeup.resources),
otherwise the list may not be initialized).

Thanks,
Rafael
Yinghai Lu Jan. 16, 2013, 12:36 a.m. UTC | #7
On Tue, Jan 15, 2013 at 4:22 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Wednesday, January 16, 2013 12:55:20 AM Rafael J. Wysocki wrote:
>> On Tuesday, January 15, 2013 03:43:17 PM Yinghai Lu wrote:
>> > On Tue, Jan 15, 2013 at 3:26 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>> > > On Monday, January 14, 2013 10:55:49 PM Yinghai Lu wrote:
> [...]
>> >
>> >
>> > looks like:
>> >
>> > acpi_device_release+0x30
>> > 0xffffffff81536e2f is in acpi_device_release (drivers/acpi/scan.c:524).
>> > 519 static void acpi_free_power_resources_lists(struct acpi_device *device)
>> > 520 {
>> > 521         int i;
>> > 522
>> > 523         acpi_power_resources_list_free(&device->wakeup.resources);
>> > 524         if (!device->flags.power_manageable)
>> > 525                 return;
>> > 526
>> > 527         for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) {
>> > 528                 struct acpi_device_power_state *ps = &device->power.states[i];
>> >
>> > wakeup.resources has problem?
>>
>> Yes, it seems to.
>>
>> Thanks for the report, looking into it.
>
> Found a bug, fixed it and updated the tree (device->flags.wakeup.valid should
> be checked before the acpi_power_resources_list_free(&device->wakeup.resources),
> otherwise the list may not be initialized).
>

still have problems:

[   63.971903] BUG: unable to handle kernel NULL pointer dereference
at 0000000000000010
[   63.972708] IP: [<ffffffff8153bf53>] acpi_power_off_list+0x19/0x53
[   63.972708] PGD 0
[   63.972708] Oops: 0000 [#1] SMP
[   63.972708] Modules linked in:
[   63.972708] CPU 0
[   63.972708] Pid: 4, comm: kworker/0:0 Not tainted
3.8.0-rc3-yh-00703-g5955587-dirty #1132 Bochs Bochs
[   63.972708] RIP: 0010:[<ffffffff8153bf53>]  [<ffffffff8153bf53>]
acpi_power_off_list+0x19/0x53
[   63.972708] RSP: 0018:ffff8801964bba78  EFLAGS: 00010203
[   63.972708] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000001810000e5
[   63.972708] RDX: 00000001810000e6 RSI: 0000000000000004 RDI: ffff8801965de8e0
[   63.972708] RBP: ffff8801964bba98 R08: 0000000000000002 R09: ffff8801993d64b0
[   63.972708] R10: 0000000000000000 R11: 0000000000000001 R12: ffff8801965de8e0
[   63.972708] R13: 0000000000000001 R14: 0000000000000000 R15: ffff880196466528
[   63.972708] FS:  0000000000000000(0000) GS:ffff880199200000(0000)
knlGS:0000000000000000
[   63.972708] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   63.972708] CR2: 0000000000000010 CR3: 000000017f10a000 CR4: 00000000000006f0
[   63.972708] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   63.972708] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   63.972708] Process kworker/0:0 (pid: 4, threadinfo
ffff8801964ba000, task ffff880196580000)
[   63.972708] Stack:
[   63.972708]  ffff8801965de800 0000000000000004 ffff8801965de800
0000000000000001
[   63.972708]  ffff8801964bbab8 ffffffff8153c65e ffff8801965de800
ffff8801965de9d0
[   63.972708]  ffff8801964bbae8 ffffffff815367fa ffff8801964bbb08
0000000000000001
[   63.972708] Call Trace:
[   63.972708]  [<ffffffff8153c65e>] acpi_power_transition+0x6c/0x98
[   63.972708]  [<ffffffff815367fa>] acpi_device_unregister+0x16f/0x177
[   63.972708]  [<ffffffff8153682d>] acpi_bus_remove+0x2b/0x2f
[   63.972708]  [<ffffffff815601cc>] acpi_ns_walk_namespace+0x114/0x250
[   63.972708]  [<ffffffff81536802>] ? acpi_device_unregister+0x177/0x177
[   63.972708]  [<ffffffff81536802>] ? acpi_device_unregister+0x177/0x177
[   63.972708]  [<ffffffff815607cd>] acpi_walk_namespace+0xee/0x137
[   63.972708]  [<ffffffff81536921>] acpi_bus_trim+0x64/0x7c
[   63.972708]  [<ffffffff815369b2>] acpi_bus_hot_remove_device+0x79/0x16d
[   63.972708]  [<ffffffff81196dc2>] ? kmem_cache_alloc_trace+0x42/0x150
[   63.972708]  [<ffffffff81539c20>] _handle_hotplug_event_root+0x108/0x149
[   63.972708]  [<ffffffff810a8b20>] ? process_one_work+0x270/0x560
[   63.972708]  [<ffffffff810a8b8d>] process_one_work+0x2dd/0x560
[   63.972708]  [<ffffffff810a8b20>] ? process_one_work+0x270/0x560
[   63.972708]  [<ffffffff810a9679>] ? worker_thread+0x59/0x3a0
[   63.972708]  [<ffffffff81539b18>] ? acpi_pci_find_root+0x3f/0x3f
[   63.972708]  [<ffffffff810a989a>] worker_thread+0x27a/0x3a0
[   63.972708]  [<ffffffff810e9f4d>] ? trace_hardirqs_on+0xd/0x10
[   63.972708]  [<ffffffff810a9620>] ? manage_workers+0x280/0x280
[   63.972708]  [<ffffffff810af088>] kthread+0xe8/0xf0
[   63.972708]  [<ffffffff810aefa0>] ? __init_kthread_worker+0x70/0x70
[   63.972708]  [<ffffffff8216d61c>] ret_from_fork+0x7c/0xb0
[   63.972708]  [<ffffffff810aefa0>] ? __init_kthread_worker+0x70/0x70
[   63.972708] Code: 08 4c 39 e3 75 ee 41 5a 5b 41 5c 44 89 e8 41 5d
5d c3 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 41 54 49 89 fc 48 8b
5f 08 eb 14 <48> 8b 7b 10 e8 22 fd ff ff 85 c0 41 89 c5 75 17 48 8b 5b
08 4c
--
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 Wysocki Jan. 16, 2013, 2:05 p.m. UTC | #8
On Tuesday, January 15, 2013 04:36:19 PM Yinghai Lu wrote:
> On Tue, Jan 15, 2013 at 4:22 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Wednesday, January 16, 2013 12:55:20 AM Rafael J. Wysocki wrote:
> >> On Tuesday, January 15, 2013 03:43:17 PM Yinghai Lu wrote:
> >> > On Tue, Jan 15, 2013 at 3:26 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> >> > > On Monday, January 14, 2013 10:55:49 PM Yinghai Lu wrote:
> > [...]
> >> >
> >> >
> >> > looks like:
> >> >
> >> > acpi_device_release+0x30
> >> > 0xffffffff81536e2f is in acpi_device_release (drivers/acpi/scan.c:524).
> >> > 519 static void acpi_free_power_resources_lists(struct acpi_device *device)
> >> > 520 {
> >> > 521         int i;
> >> > 522
> >> > 523         acpi_power_resources_list_free(&device->wakeup.resources);
> >> > 524         if (!device->flags.power_manageable)
> >> > 525                 return;
> >> > 526
> >> > 527         for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) {
> >> > 528                 struct acpi_device_power_state *ps = &device->power.states[i];
> >> >
> >> > wakeup.resources has problem?
> >>
> >> Yes, it seems to.
> >>
> >> Thanks for the report, looking into it.
> >
> > Found a bug, fixed it and updated the tree (device->flags.wakeup.valid should
> > be checked before the acpi_power_resources_list_free(&device->wakeup.resources),
> > otherwise the list may not be initialized).
> >
> 
> still have problems:

My bad, sorry about that.

> [   63.971903] BUG: unable to handle kernel NULL pointer dereference
> at 0000000000000010
> [   63.972708] IP: [<ffffffff8153bf53>] acpi_power_off_list+0x19/0x53
> [   63.972708] PGD 0
> [   63.972708] Oops: 0000 [#1] SMP
> [   63.972708] Modules linked in:
> [   63.972708] CPU 0
> [   63.972708] Pid: 4, comm: kworker/0:0 Not tainted
> 3.8.0-rc3-yh-00703-g5955587-dirty #1132 Bochs Bochs
> [   63.972708] RIP: 0010:[<ffffffff8153bf53>]  [<ffffffff8153bf53>]
> acpi_power_off_list+0x19/0x53
> [   63.972708] RSP: 0018:ffff8801964bba78  EFLAGS: 00010203
> [   63.972708] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000001810000e5
> [   63.972708] RDX: 00000001810000e6 RSI: 0000000000000004 RDI: ffff8801965de8e0
> [   63.972708] RBP: ffff8801964bba98 R08: 0000000000000002 R09: ffff8801993d64b0
> [   63.972708] R10: 0000000000000000 R11: 0000000000000001 R12: ffff8801965de8e0
> [   63.972708] R13: 0000000000000001 R14: 0000000000000000 R15: ffff880196466528
> [   63.972708] FS:  0000000000000000(0000) GS:ffff880199200000(0000)
> knlGS:0000000000000000
> [   63.972708] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
> [   63.972708] CR2: 0000000000000010 CR3: 000000017f10a000 CR4: 00000000000006f0
> [   63.972708] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [   63.972708] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
> [   63.972708] Process kworker/0:0 (pid: 4, threadinfo
> ffff8801964ba000, task ffff880196580000)
> [   63.972708] Stack:
> [   63.972708]  ffff8801965de800 0000000000000004 ffff8801965de800
> 0000000000000001
> [   63.972708]  ffff8801964bbab8 ffffffff8153c65e ffff8801965de800
> ffff8801965de9d0
> [   63.972708]  ffff8801964bbae8 ffffffff815367fa ffff8801964bbb08
> 0000000000000001
> [   63.972708] Call Trace:
> [   63.972708]  [<ffffffff8153c65e>] acpi_power_transition+0x6c/0x98
> [   63.972708]  [<ffffffff815367fa>] acpi_device_unregister+0x16f/0x177
> [   63.972708]  [<ffffffff8153682d>] acpi_bus_remove+0x2b/0x2f
> [   63.972708]  [<ffffffff815601cc>] acpi_ns_walk_namespace+0x114/0x250
> [   63.972708]  [<ffffffff81536802>] ? acpi_device_unregister+0x177/0x177
> [   63.972708]  [<ffffffff81536802>] ? acpi_device_unregister+0x177/0x177
> [   63.972708]  [<ffffffff815607cd>] acpi_walk_namespace+0xee/0x137
> [   63.972708]  [<ffffffff81536921>] acpi_bus_trim+0x64/0x7c
> [   63.972708]  [<ffffffff815369b2>] acpi_bus_hot_remove_device+0x79/0x16d
> [   63.972708]  [<ffffffff81196dc2>] ? kmem_cache_alloc_trace+0x42/0x150
> [   63.972708]  [<ffffffff81539c20>] _handle_hotplug_event_root+0x108/0x149
> [   63.972708]  [<ffffffff810a8b20>] ? process_one_work+0x270/0x560
> [   63.972708]  [<ffffffff810a8b8d>] process_one_work+0x2dd/0x560
> [   63.972708]  [<ffffffff810a8b20>] ? process_one_work+0x270/0x560
> [   63.972708]  [<ffffffff810a9679>] ? worker_thread+0x59/0x3a0
> [   63.972708]  [<ffffffff81539b18>] ? acpi_pci_find_root+0x3f/0x3f
> [   63.972708]  [<ffffffff810a989a>] worker_thread+0x27a/0x3a0
> [   63.972708]  [<ffffffff810e9f4d>] ? trace_hardirqs_on+0xd/0x10
> [   63.972708]  [<ffffffff810a9620>] ? manage_workers+0x280/0x280
> [   63.972708]  [<ffffffff810af088>] kthread+0xe8/0xf0
> [   63.972708]  [<ffffffff810aefa0>] ? __init_kthread_worker+0x70/0x70
> [   63.972708]  [<ffffffff8216d61c>] ret_from_fork+0x7c/0xb0
> [   63.972708]  [<ffffffff810aefa0>] ? __init_kthread_worker+0x70/0x70
> [   63.972708] Code: 08 4c 39 e3 75 ee 41 5a 5b 41 5c 44 89 e8 41 5d
> 5d c3 0f 1f 44 00 00 55 48 89 e5 41 55 41 54 53 41 54 49 89 fc 48 8b
> 5f 08 eb 14 <48> 8b 7b 10 e8 22 fd ff ff 85 c0 41 89 c5 75 17 48 8b 5b
> 08 4c

acpi_power_transition() has to check if the device is power-manageable, since
otherwise the power resources lists will not be initialized.  It should be
fixed now.

Thanks,
Rafael
Yinghai Lu Jan. 16, 2013, 7:37 p.m. UTC | #9
On Wed, Jan 16, 2013 at 6:05 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>
> acpi_power_transition() has to check if the device is power-manageable, since
> otherwise the power resources lists will not be initialized.  It should be
> fixed now.

yes, it works now with pm/linux-next.

will resend updated patchset after new acpi-scan get into pci/next.

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
Rafael Wysocki Jan. 16, 2013, 9:48 p.m. UTC | #10
On Wednesday, January 16, 2013 11:37:40 AM Yinghai Lu wrote:
> On Wed, Jan 16, 2013 at 6:05 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> >
> > acpi_power_transition() has to check if the device is power-manageable, since
> > otherwise the power resources lists will not be initialized.  It should be
> > fixed now.
> 
> yes, it works now with pm/linux-next.

Cool, thanks for testing!

> will resend updated patchset after new acpi-scan get into pci/next.

I'll put the new patches into acpi-scan tomorrow.  After that it's up to Bjorn
to decide when to pull them.

Thanks,
Rafael
diff mbox

Patch

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 327ab44..eaddb7a 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -361,7 +361,7 @@  static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
 			break;
 		}
 
-		ej_event->handle = handle;
+		ej_event->device = device;
 		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
 		acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
 					(void *)ej_event);
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 0777663..a24ee43 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -733,7 +733,7 @@  static void acpi_processor_hotplug_notify(acpi_handle handle,
 			break;
 		}
 
-		ej_event->handle = handle;
+		ej_event->device = device;
 		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
 		acpi_os_hotplug_execute(acpi_bus_hot_remove_device,
 					(void *)ej_event);
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 8883539..f4c6305 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -116,20 +116,14 @@  static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);
 void acpi_bus_hot_remove_device(void *context)
 {
 	struct acpi_eject_event *ej_event = (struct acpi_eject_event *) context;
-	struct acpi_device *device;
-	acpi_handle handle = ej_event->handle;
+	struct acpi_device *device = ej_event->device;
+	acpi_handle handle = device->handle;
 	acpi_handle temp;
 	struct acpi_object_list arg_list;
 	union acpi_object arg;
 	acpi_status status = AE_OK;
 	u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
 
-	if (acpi_bus_get_device(handle, &device))
-		goto err_out;
-
-	if (!device)
-		goto err_out;
-
 	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 		"Hot-removing device %s...\n", dev_name(&device->dev)));
 
@@ -215,7 +209,7 @@  acpi_eject_store(struct device *d, struct device_attribute *attr,
 		goto err;
 	}
 
-	ej_event->handle = acpi_device->handle;
+	ej_event->device = acpi_device;
 	if (acpi_device->flags.eject_pending) {
 		/* event originated from ACPI eject notification */
 		ej_event->event = ACPI_NOTIFY_EJECT_REQUEST;
@@ -223,7 +217,7 @@  acpi_eject_store(struct device *d, struct device_attribute *attr,
 	} else {
 		/* event originated from user */
 		ej_event->event = ACPI_OST_EC_OSPM_EJECT;
-		(void) acpi_evaluate_hotplug_ost(ej_event->handle,
+		(void) acpi_evaluate_hotplug_ost(acpi_device->handle,
 			ej_event->event, ACPI_OST_SC_EJECT_IN_PROGRESS, NULL);
 	}
 
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 2246ba9..181ff2d 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -309,7 +309,7 @@  struct acpi_bus_event {
 };
 
 struct acpi_eject_event {
-	acpi_handle	handle;
+	struct acpi_device	*device;
 	u32		event;
 };