diff mbox

[0/30] ACPI / hotplug / PCI: Major rework + Thunderbolt workarounds

Message ID 3215120.cRBBS5jciE@vostro.rjw.lan
State Not Applicable
Headers show

Commit Message

Rafael J. Wysocki July 23, 2013, 9:39 p.m. UTC
On Monday, July 22, 2013 11:49:45 PM Yinghai Lu wrote:
> On Wed, Jul 17, 2013 at 4:05 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > Hi All,
> >
> > Now the series has been rebased on top of current linux-pm.git/linux-next
> > and tested on two systems with Thunderbolt.  Some changes have been made too. ->
> >
> > On Friday, July 12, 2013 01:34:20 AM Rafael J. Wysocki wrote:
> >> Hi,
> >>
> >> I've made some progress with my ACPIPHP rework since I posted the series last
> >> time and here goes an update.
> >>
> >> First off, the previous series was somewhat racy, which should be fixed now.
> >> Apart from this there's quite some new material on top of the patches I posted
> >> last time (or rather on top of their new versions) and I integrated the
> >> Thunderbolt series from Mika with that.  As a result,
> >>
> >> https://patchwork.kernel.org/patch/2817341/
> >>
> >> is required to be applied.
> >>
> >> Still untested, still based on 3.10 with ACPI+PM 3.11 material merged on top,
> >> but this time I don't have any plans to add more patches to the series for the
> >> time being.  Also 3.11-rc1 should be out in a couple of days, so I'll be able
> >> to integrate this work with the previous cleanups series from Gerry and myself
> >> on top of it.
> >>
> >> I did my best not to change too much at a time and some steps add stuff that
> >> is removed by the subsequent ones, so hopefully it is bisectable.
> >>
> >> If anyone finds something questionable or outright bogus in these patches,
> >> please let me know before it's too late. ;-)
> >>
> >> [ 1/30] Make bus registration and unregistration symmetric.  [Resend]
> >> [ 2/30] Consolidate acpiphp_enumerate_slots().  [Resend]
> >> [ 3/30] Fix error code path in register_slot().  [Resend]
> >> [ 4/30] Introduce hotplug context objects for ACPI device objects corresponding
> >>         to PCI hotplug devices.  [Update]
> >> [ 5/30] Unified notify handler for hotplug events.  [Update]
> >> [ 6/30] Drop acpiphp_handle_to_bridge() and use context objects instead of it.  [Update]
> >> [ 7/30] Pass entire hotplug context objects (instead of their fields
> >>         individually) to event handling work functions.  [Update]
> >> [ 8/30] Merge hotplug event handling functions.  [Update]
> >> [ 9/30] Drop func field from struct acpiphp_bridge.
> >> [10/30] Refactor slot allocation code in register_slot().
> >> [11/30] Make acpiphp_enumerate_slots() to register all devices on the given bus
> >>         and install the notification handler for all of them.
> >> [12/30] Drop sun field from struct acpiphp_slot.
> >> [13/30] Use common slot count variable in register_slot().
> >
> > -> The one above has been dropped, because it might cause regressions to appear
> > on some systems, but that's not a big deal.
> >
> > The numbering of the patches below has changed as a result, so the next one is
> > [13/30] now and so on.
> >
> >> [14/30] Drop flags field from struct acpiphp_bridge.
> >> [15/30] Embed function structure into struct acpiphp_context.
> >> [16/30] Drop handle field from struct acpiphp_func.
> >> [17/30] Drop handle field from struct acpiphp_bridge.
> >> [18/30] Store parent bridge pointer in function objects and bus pointer in slot
> >>         objects.
> >> [19/30] Rework ACPI namespace scanning and trimming routines.
> >> [20/30] Drop redundant checks from check_hotplug_bridge().
> >> [21/30] Consolidate slot disabling and ejecting
> >> [22/30] Do not queue up event handling work items for non-hotplug events.
> >> [23/30] Do not execute _PS0 and _PS3 directly.
> >
> > This one was fixed after Mika had reported a problem with it.
> >
> >> [24/30] Do not check SLOT_ENABLED in enable_device().  [Thunderbolt series]
> >> [25/30] Allow slots without new devices to be rescanned.  [Thunderbolt series]
> >> [26/30] Check for new devices on enabled slots.  [Thunderbolt series, TBD]
> >
> > This one was reworked to use acpi_bus_trim() on ACPI device objects
> > corresponding to PCI devices being removed (it also uses _STA to check the
> > status of those devices if available).
> >
> >> [27/30] Get rid of unused constands in acpiphp.h.  [Thunderbolt series]
> >> [28/30] Sanitize acpiphp_get_(latch)|(adapter)_status().  [Thunderbolt series]
> >> [29/30] Redefine enable_device() and disable_device() (rename and change to void).
> >> [30/30] Clean up the usage of bridge_mutex.
> >
> > The one above is [29/30] now and we have added one more patch:
> >
> > [30/30] Drop check_sub_bridges() which isn't necessary any more.
> >
> > The updated patches follow.
> >
> > If you don't hate this stuff, I'll put it into linux-next over the weekend for
> > further testing.
> 
> pm/linux-next with those patches breaks acpi root bus hotplug.
> it is kvm guest:
> 
> 10:~ # echo "PCI0 3" > /sys/kernel/debug/acpi/sci_notify
> [   92.549508] ACPI: ACPI device name is <PCI0>, event code is <3>
> [   92.552433] ACPI: Notify event is queued
> 10:~ # [   92.554279] ACPI: \_SB_.PCI0: Device eject notify on
> _handle_hotplug_event_root
> [   92.677696] ACPI: Device 0000:00:03.0 -x-> \_SB_.PCI0.S03_
> [   92.679229] ACPI: Device 0000:00:02.0 -x-> \_SB_.PCI0.VGA_
> [   92.680684] ACPI: Device 0000:00:01.3 -x-> \_SB_.PCI0.PX13
> [   92.682235] ata1.00: disabled
> [   92.689000] sd 0:0:0:0: [sda] Synchronizing SCSI cache
> [   92.690399] sd 0:0:0:0: [sda]
> [   92.691133] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
> [   92.693151] sd 0:0:0:0: [sda] Stopping disk
> [   92.694682] sd 0:0:0:0: [sda] START_STOP FAILED
> [   92.696749] sd 0:0:0:0: [sda]
> [   92.698157] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
> [   92.702852] ata2.00: disabled
> [   92.711550] ACPI: Device 0000:00:01.0 -x-> \_SB_.PCI0.ISA_
> [   92.713208] ACPI: Device pci0000:00 -x-> \_SB_.PCI0
> [   92.713226]   acpi_pci_iommu_remove is called for \_SB_.PCI0 ffff88007ab3f1e0
> [   92.713274]   acpi_pci_ioapic_remove is called for \_SB_.PCI0
> ffff88007ab3f1e0
> [   92.713345] pci 0000:00:00.0: freeing pci_dev info
> [   92.713363] pci 0000:00:01.0: freeing pci_dev info
> [   92.713366] pci 0000:00:01.1: freeing pci_dev info
> [   92.713376] pci 0000:00:01.3: freeing pci_dev info
> [   92.713380] pci 0000:00:02.0: freeing pci_dev info
> [   92.713384] pci 0000:00:03.0: freeing pci_dev info
> [   92.713396] pci_bus 0000:00: busn_res: [bus 00-ff] is released
> [   92.713441] BUG: unable to handle kernel NULL pointer dereference
> at           (null)
> [   92.713446] IP: [<ffffffff81557910>]
> acpiphp_unregister_hotplug_slot+0x20/0x60

Ugh, stupid bug, sorry about it.  We try to unregister something that may have
not been registered.

Can you please check if the appended patch helps (on top of
linux-pm.git/linux-next)?

Rafael


---
 drivers/pci/hotplug/acpiphp_glue.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


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

Comments

Yinghai Lu July 24, 2013, 2:20 a.m. UTC | #1
On Tue, Jul 23, 2013 at 2:39 PM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
>
> Ugh, stupid bug, sorry about it.  We try to unregister something that may have
> not been registered.
>
> Can you please check if the appended patch helps (on top of
> linux-pm.git/linux-next)?
>
> Rafael
>
>
> ---
>  drivers/pci/hotplug/acpiphp_glue.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c
> ===================================================================
> --- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c
> +++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c
> @@ -340,6 +340,7 @@ static acpi_status register_slot(acpi_ha
>
>                 retval = acpiphp_register_hotplug_slot(slot, sun);
>                 if (retval) {
> +                       slot->slot = NULL;
>                         bridge->nr_slots--;
>                         if (retval == -EBUSY)
>                                 warn("Slot %llu already registered by another "
> @@ -429,7 +430,8 @@ static void cleanup_bridge(struct acpiph
>                                         err("failed to remove notify handler\n");
>                         }
>                 }
> -               acpiphp_unregister_hotplug_slot(slot);
> +               if (slot->slot)
> +                       acpiphp_unregister_hotplug_slot(slot);
>         }
>
>         mutex_lock(&bridge_mutex);
>

yes, that fixes the problem. Thanks

10:~ # echo "PCI0 3" > /sys/kernel/debug/acpi/sci_notify
[  102.231645] ACPI: ACPI device name is <PCI0>, event code is <3>
[  102.233189] ACPI: Notify event is queued
[  102.234326] ACPI: \_SB_.PCI0: Device eject notify on
_handle_hotplug_event_root
10:~ # [  102.357749] ACPI: Device 0000:00:03.0 -x-> \_SB_.PCI0.S03_
[  102.359902] ACPI: Device 0000:00:02.0 -x-> \_SB_.PCI0.VGA_
[  102.362188] ACPI: Device 0000:00:01.3 -x-> \_SB_.PCI0.PX13
[  102.364752] ata1.00: disabled
[  102.372154] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[  102.374523] sd 0:0:0:0: [sda]
[  102.375759] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[  102.378173] sd 0:0:0:0: [sda] Stopping disk
[  102.380248] sd 0:0:0:0: [sda] START_STOP FAILED
[  102.381983] sd 0:0:0:0: [sda]
[  102.383167] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
[  102.387588] ata2.00: disabled
[  102.395254] ACPI: Device 0000:00:01.0 -x-> \_SB_.PCI0.ISA_
[  102.396943] ACPI: Device pci0000:00 -x-> \_SB_.PCI0
[  102.398162]   acpi_pci_iommu_remove is called for \_SB_.PCI0 ffff88007ab3f1e0
[  102.400253]   acpi_pci_ioapic_remove is called for \_SB_.PCI0
ffff88007ab3f1e0
[  102.402176] pci 0000:00:00.0: freeing pci_dev info
[  102.404247] pci 0000:00:01.0: freeing pci_dev info
[  102.406611] pci 0000:00:01.1: freeing pci_dev info
[  102.408401] pci 0000:00:01.3: freeing pci_dev info
[  102.410276] pci 0000:00:02.0: freeing pci_dev info
[  102.411378] pci 0000:00:03.0: freeing pci_dev info
[  102.412485] pci_bus 0000:00: busn_res: [bus 00-ff] is released
[  102.413945] acpiphp: Slot [3] unregistered
[  102.415189] pci_hotplug: pci_hp_deregister: Removed slot 3 from the list
[  102.418224] acpiphp: release_slot - physical_slot = 3
[  102.420439] pci_bus 0000:00: dev 03, dec refcount to 1
[  102.422689] acpiphp: Slot [4] unregistered
[  102.424592] pci_hotplug: pci_hp_deregister: Removed slot 4 from the list
[  102.427484] acpiphp: release_slot - physical_slot = 4
[  102.429679] pci_bus 0000:00: dev 04, dec refcount to 1
[  102.431492] acpiphp: Slot [5] unregistered
[  102.433169] pci_hotplug: pci_hp_deregister: Removed slot 5 from the list
[  102.435486] acpiphp: release_slot - physical_slot = 5
[  102.436963] pci_bus 0000:00: dev 05, dec refcount to 1
[  102.438140] acpiphp: Slot [6] unregistered
[  102.439116] pci_hotplug: pci_hp_deregister: Removed slot 6 from the list
[  102.440922] acpiphp: release_slot - physical_slot = 6
[  102.442079] pci_bus 0000:00: dev 06, dec refcount to 1
[  102.443280] acpiphp: Slot [7] unregistered
[  102.444286] pci_hotplug: pci_hp_deregister: Removed slot 7 from the list
[  102.445840] acpiphp: release_slot - physical_slot = 7
[  102.447024] pci_bus 0000:00: dev 07, dec refcount to 1
[  102.448272] acpiphp: Slot [8] unregistered
[  102.449236] pci_hotplug: pci_hp_deregister: Removed slot 8 from the list
[  102.450770] acpiphp: release_slot - physical_slot = 8
[  102.451632] pci_bus 0000:00: dev 08, dec refcount to 1
[  102.452870] acpiphp: Slot [9] unregistered
[  102.453848] pci_hotplug: pci_hp_deregister: Removed slot 9 from the list
[  102.455400] acpiphp: release_slot - physical_slot = 9
[  102.456594] pci_bus 0000:00: dev 09, dec refcount to 1
[  102.457557] acpiphp: Slot [10] unregistered
[  102.458542] pci_hotplug: pci_hp_deregister: Removed slot 10 from the list
[  102.460124] acpiphp: release_slot - physical_slot = 10
[  102.461295] pci_bus 0000:00: dev 0a, dec refcount to 1
[  102.462482] acpiphp: Slot [11] unregistered
[  102.463464] pci_hotplug: pci_hp_deregister: Removed slot 11 from the list
[  102.465046] acpiphp: release_slot - physical_slot = 11
[  102.467024] pci_bus 0000:00: dev 0b, dec refcount to 1
[  102.468199] acpiphp: Slot [12] unregistered
[  102.469210] pci_hotplug: pci_hp_deregister: Removed slot 12 from the list
[  102.470798] acpiphp: release_slot - physical_slot = 12
[  102.471992] pci_bus 0000:00: dev 0c, dec refcount to 1
[  102.473239] acpiphp: Slot [13] unregistered
[  102.473959] pci_hotplug: pci_hp_deregister: Removed slot 13 from the list
[  102.475545] acpiphp: release_slot - physical_slot = 13
[  102.476516] pci_bus 0000:00: dev 0d, dec refcount to 1
[  102.477740] acpiphp: Slot [14] unregistered
[  102.478733] pci_hotplug: pci_hp_deregister: Removed slot 14 from the list
[  102.480319] acpiphp: release_slot - physical_slot = 14
[  102.481296] pci_bus 0000:00: dev 0e, dec refcount to 1
[  102.481947] acpiphp: Slot [15] unregistered
[  102.482888] pci_hotplug: pci_hp_deregister: Removed slot 15 from the list
[  102.484555] acpiphp: release_slot - physical_slot = 15
[  102.485806] pci_bus 0000:00: dev 0f, dec refcount to 1
[  102.486808] acpiphp: Slot [16] unregistered
[  102.487652] pci_hotplug: pci_hp_deregister: Removed slot 16 from the list
[  102.488986] acpiphp: release_slot - physical_slot = 16
[  102.489996] pci_bus 0000:00: dev 10, dec refcount to 1
[  102.491100] acpiphp: Slot [17] unregistered
[  102.492054] pci_hotplug: pci_hp_deregister: Removed slot 17 from the list
[  102.493572] acpiphp: release_slot - physical_slot = 17
[  102.494444] pci_bus 0000:00: dev 11, dec refcount to 1
[  102.495266] acpiphp: Slot [18] unregistered
[  102.495966] pci_hotplug: pci_hp_deregister: Removed slot 18 from the list
[  102.497083] acpiphp: release_slot - physical_slot = 18
[  102.497921] pci_bus 0000:00: dev 12, dec refcount to 1
[  102.498770] acpiphp: Slot [19] unregistered
[  102.499474] pci_hotplug: pci_hp_deregister: Removed slot 19 from the list
[  102.500764] acpiphp: release_slot - physical_slot = 19
[  102.501873] pci_bus 0000:00: dev 13, dec refcount to 1
[  102.502966] acpiphp: Slot [20] unregistered
[  102.503824] pci_hotplug: pci_hp_deregister: Removed slot 20 from the list
[  102.504770] acpiphp: release_slot - physical_slot = 20
[  102.505608] pci_bus 0000:00: dev 14, dec refcount to 1
[  102.506456] acpiphp: Slot [21] unregistered
[  102.507146] pci_hotplug: pci_hp_deregister: Removed slot 21 from the list
[  102.508269] acpiphp: release_slot - physical_slot = 21
[  102.508981] pci_bus 0000:00: dev 15, dec refcount to 1
[  102.509815] acpiphp: Slot [22] unregistered
[  102.510668] pci_hotplug: pci_hp_deregister: Removed slot 22 from the list
[  102.511955] acpiphp: release_slot - physical_slot = 22
[  102.512980] pci_bus 0000:00: dev 16, dec refcount to 1
[  102.514040] acpiphp: Slot [23] unregistered
[  102.514621] pci_hotplug: pci_hp_deregister: Removed slot 23 from the list
[  102.515446] acpiphp: release_slot - physical_slot = 23
[  102.516101] pci_bus 0000:00: dev 17, dec refcount to 1
[  102.516752] acpiphp: Slot [24] unregistered
[  102.517370] pci_hotplug: pci_hp_deregister: Removed slot 24 from the list
[  102.518210] acpiphp: release_slot - physical_slot = 24
[  102.518841] pci_bus 0000:00: dev 18, dec refcount to 1
[  102.519500] acpiphp: Slot [25] unregistered
[  102.520146] pci_hotplug: pci_hp_deregister: Removed slot 25 from the list
[  102.520995] acpiphp: release_slot - physical_slot = 25
[  102.522445] pci_bus 0000:00: dev 19, dec refcount to 1
[  102.523463] acpiphp: Slot [26] unregistered
[  102.524335] pci_hotplug: pci_hp_deregister: Removed slot 26 from the list
[  102.525597] acpiphp: release_slot - physical_slot = 26
[  102.526599] pci_bus 0000:00: dev 1a, dec refcount to 1
[  102.527636] acpiphp: Slot [27] unregistered
[  102.528483] pci_hotplug: pci_hp_deregister: Removed slot 27 from the list
[  102.529812] acpiphp: release_slot - physical_slot = 27
[  102.530872] pci_bus 0000:00: dev 1b, dec refcount to 1
[  102.531988] acpiphp: Slot [28] unregistered
[  102.532775] pci_hotplug: pci_hp_deregister: Removed slot 28 from the list
[  102.534200] acpiphp: release_slot - physical_slot = 28
[  102.535038] pci_bus 0000:00: dev 1c, dec refcount to 1
[  102.535727] acpiphp: Slot [29] unregistered
[  102.536328] pci_hotplug: pci_hp_deregister: Removed slot 29 from the list
[  102.537213] acpiphp: release_slot - physical_slot = 29
[  102.537886] pci_bus 0000:00: dev 1d, dec refcount to 1
[  102.539560] acpiphp: Slot [30] unregistered
[  102.541427] pci_hotplug: pci_hp_deregister: Removed slot 30 from the list
[  102.544245] acpiphp: release_slot - physical_slot = 30
[  102.545431] pci_bus 0000:00: dev 1e, dec refcount to 1
[  102.546647] acpiphp: Slot [31] unregistered
[  102.547643] pci_hotplug: pci_hp_deregister: Removed slot 31 from the list
[  102.549290] acpiphp: release_slot - physical_slot = 31
[  102.550510] pci_bus 0000:00: dev 1f, dec refcount to 1
[  102.551810] pci_bus 0000:00: dev 1f, dec refcount to 0
[  102.552861] pci_bus 0000:00: dev 1f, released physical slot 31
[  102.554226] pci_bus 0000:00: dev 1e, dec refcount to 0
[  102.555448] pci_bus 0000:00: dev 1e, released physical slot 30
[  102.556836] pci_bus 0000:00: dev 1d, dec refcount to 0
[  102.558061] pci_bus 0000:00: dev 1d, released physical slot 29
[  102.559420] pci_bus 0000:00: dev 1c, dec refcount to 0
[  102.560662] pci_bus 0000:00: dev 1c, released physical slot 28
[  102.562016] pci_bus 0000:00: dev 1b, dec refcount to 0
[  102.563218] pci_bus 0000:00: dev 1b, released physical slot 27
[  102.564556] pci_bus 0000:00: dev 1a, dec refcount to 0
[  102.565767] pci_bus 0000:00: dev 1a, released physical slot 26
[  102.567132] pci_bus 0000:00: dev 19, dec refcount to 0
[  102.568366] pci_bus 0000:00: dev 19, released physical slot 25
[  102.569631] pci_bus 0000:00: dev 18, dec refcount to 0
[  102.570826] pci_bus 0000:00: dev 18, released physical slot 24
[  102.572194] pci_bus 0000:00: dev 17, dec refcount to 0
[  102.573407] pci_bus 0000:00: dev 17, released physical slot 23
[  102.574741] pci_bus 0000:00: dev 16, dec refcount to 0
[  102.575960] pci_bus 0000:00: dev 16, released physical slot 22
[  102.577334] pci_bus 0000:00: dev 15, dec refcount to 0
[  102.578548] pci_bus 0000:00: dev 15, released physical slot 21
[  102.579894] pci_bus 0000:00: dev 14, dec refcount to 0
[  102.581141] pci_bus 0000:00: dev 14, released physical slot 20
[  102.582506] pci_bus 0000:00: dev 13, dec refcount to 0
[  102.583722] pci_bus 0000:00: dev 13, released physical slot 19
[  102.585111] pci_bus 0000:00: dev 12, dec refcount to 0
[  102.586328] pci_bus 0000:00: dev 12, released physical slot 18
[  102.587688] pci_bus 0000:00: dev 11, dec refcount to 0
[  102.588915] pci_bus 0000:00: dev 11, released physical slot 17
[  102.590281] pci_bus 0000:00: dev 10, dec refcount to 0
[  102.591485] pci_bus 0000:00: dev 10, released physical slot 16
[  102.592854] pci_bus 0000:00: dev 0f, dec refcount to 0
[  102.594066] pci_bus 0000:00: dev 0f, released physical slot 15
[  102.595417] pci_bus 0000:00: dev 0e, dec refcount to 0
[  102.596635] pci_bus 0000:00: dev 0e, released physical slot 14
[  102.598010] pci_bus 0000:00: dev 0d, dec refcount to 0
[  102.599210] pci_bus 0000:00: dev 0d, released physical slot 13
[  102.600595] pci_bus 0000:00: dev 0c, dec refcount to 0
[  102.601794] pci_bus 0000:00: dev 0c, released physical slot 12
[  102.603143] pci_bus 0000:00: dev 0b, dec refcount to 0
[  102.604362] pci_bus 0000:00: dev 0b, released physical slot 11
[  102.605700] pci_bus 0000:00: dev 0a, dec refcount to 0
[  102.606904] pci_bus 0000:00: dev 0a, released physical slot 10
[  102.608313] pci_bus 0000:00: dev 09, dec refcount to 0
[  102.609539] pci_bus 0000:00: dev 09, released physical slot 9
[  102.610879] pci_bus 0000:00: dev 08, dec refcount to 0
[  102.612117] pci_bus 0000:00: dev 08, released physical slot 8
[  102.613452] pci_bus 0000:00: dev 07, dec refcount to 0
[  102.614664] pci_bus 0000:00: dev 07, released physical slot 7
[  102.615992] pci_bus 0000:00: dev 06, dec refcount to 0
[  102.617221] pci_bus 0000:00: dev 06, released physical slot 6
[  102.618554] pci_bus 0000:00: dev 05, dec refcount to 0
[  102.619758] pci_bus 0000:00: dev 05, released physical slot 5
[  102.621116] pci_bus 0000:00: dev 04, dec refcount to 0
[  102.622320] pci_bus 0000:00: dev 04, released physical slot 4
[  102.623656] pci_bus 0000:00: dev 03, dec refcount to 0
[  102.624887] pci_bus 0000:00: dev 03, released physical slot 3
[  102.626239] pci_bus 0000:00: dev 02, dec refcount to 0
[  102.627445] pci_bus 0000:00: dev 02, released physical slot 2
[  102.628805] pci_bus 0000:00: dev 01, dec refcount to 0
[  102.629589] pci_bus 0000:00: dev 01, released physical slot 1
[  102.630631] pci_bus 0000:00: freeing pci_bus info
[  102.631369] pci_host_bridge pci0000:00: freeing pci_host_bridge info
[  102.633091] ACPI: Device does not support D3cold
[  102.633915] ACPI: Device does not support D3cold
[  102.635221] ACPI: Device does not support D3cold
[  102.636103] ACPI: Device does not support D3cold
[  102.636902] ACPI: Device does not support D3cold
[  102.637685] ACPI: Device does not support D3cold
[  102.638467] ACPI: Device does not support D3cold
[  102.639631] ACPI: Device does not support D3cold
[  102.640472] ACPI: Device does not support D3cold
[  102.641310] ACPI: Device does not support D3cold
[  102.642105] ACPI: Device does not support D3cold
[  102.642928] ACPI: Device does not support D3cold
[  102.643725] ACPI: Device does not support D3cold
[  102.644544] ACPI: Device does not support D3cold
[  102.645344] ACPI: Device does not support D3cold
[  102.646126] ACPI: Device does not support D3cold
[  102.646902] ACPI: Device does not support D3cold
[  102.647677] ACPI: Device does not support D3cold
[  102.648485] ACPI: Device does not support D3cold
[  102.649269] ACPI: Device does not support D3cold
[  102.650065] ACPI: Device does not support D3cold
[  102.650822] ACPI: Device does not support D3cold
[  102.652483] ACPI: Device does not support D3cold
[  102.654157] ACPI: Device does not support D3cold
[  102.655803] ACPI: Device does not support D3cold
[  102.657419] ACPI: Device does not support D3cold
[  102.658528] ACPI: Device does not support D3cold
[  102.659255] ACPI: Device does not support D3cold
[  102.659973] ACPI: Device does not support D3cold
[  102.661807] ACPI: Device does not support D3cold
[  102.661925] ACPI: Device does not support D3cold
[  102.662047] ACPI: Device does not support D3cold
[  102.662148] ACPI: Device does not support D3cold
[  102.662258] ACPI: Device does not support D3cold
[  102.662374] ACPI: Device does not support D3cold
[  102.662486] ACPI: Device does not support D3cold
[  102.662597] ACPI: Device does not support D3cold
[  102.662711] ACPI: Device does not support D3cold
[  102.662814] ACPI: Device does not support D3cold
[  102.662918] ACPI: Device does not support D3cold
[  102.663019] ACPI: Device does not support D3cold
[  102.663039] ACPI: \_SB_.PCI0: No _EJ0 support for device
--
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
diff mbox

Patch

Index: linux-pm/drivers/pci/hotplug/acpiphp_glue.c
===================================================================
--- linux-pm.orig/drivers/pci/hotplug/acpiphp_glue.c
+++ linux-pm/drivers/pci/hotplug/acpiphp_glue.c
@@ -340,6 +340,7 @@  static acpi_status register_slot(acpi_ha
 
 		retval = acpiphp_register_hotplug_slot(slot, sun);
 		if (retval) {
+			slot->slot = NULL;
 			bridge->nr_slots--;
 			if (retval == -EBUSY)
 				warn("Slot %llu already registered by another "
@@ -429,7 +430,8 @@  static void cleanup_bridge(struct acpiph
 					err("failed to remove notify handler\n");
 			}
 		}
-		acpiphp_unregister_hotplug_slot(slot);
+		if (slot->slot)
+			acpiphp_unregister_hotplug_slot(slot);
 	}
 
 	mutex_lock(&bridge_mutex);