ACPI: Properly clear flags on false-positives and send uevent on sudden unplug - Kernel

This is a discussion on ACPI: Properly clear flags on false-positives and send uevent on sudden unplug - Kernel ; Some devices emit a ACPI_NOTIFY_DEVICE_CHECK while physically unplugging even if the software undock has already been done and dock_present() check fails. However, the internal flags need to be cleared (complete_undock()). Also, even notify userspace if the dock station suddently went ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: ACPI: Properly clear flags on false-positives and send uevent on sudden unplug

  1. ACPI: Properly clear flags on false-positives and send uevent on sudden unplug

    Some devices emit a ACPI_NOTIFY_DEVICE_CHECK while physically unplugging
    even if the software undock has already been done and dock_present() check
    fails. However, the internal flags need to be cleared (complete_undock()).

    Also, even notify userspace if the dock station suddently went away
    without proper software undocking.

    Signed-off-by: Holger Macht
    ---

    diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c
    index bb7c51f..7d2edf1 100644
    --- a/drivers/acpi/dock.c
    +++ b/drivers/acpi/dock.c
    @@ -563,9 +563,6 @@ EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device);
    */
    static int handle_eject_request(struct dock_station *ds, u32 event)
    {
    - if (!dock_present(ds))
    - return -ENODEV;
    -
    if (dock_in_progress(ds))
    return -EBUSY;

    @@ -573,8 +570,16 @@ static int handle_eject_request(struct dock_station *ds, u32 event)
    * here we need to generate the undock
    * event prior to actually doing the undock
    * so that the device struct still exists.
    + * Also, even send the dock event if the
    + * device is not present anymore
    */
    dock_event(ds, event, UNDOCK_EVENT);
    +
    + if (!dock_present(ds)) {
    + complete_undock(ds);
    + return -ENODEV;
    + }
    +
    hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
    undock(ds);
    eject_dock(ds);
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: ACPI: Properly clear flags on false-positives and send uevent on sudden unplug

    Holger Macht wrote:
    > Some devices


    What devices are that?

    -Andi
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: ACPI: Properly clear flags on false-positives and send uevent on sudden unplug

    On Mon 11. Aug - 13:28:13, Andi Kleen wrote:
    > Holger Macht wrote:
    >> Some devices

    >
    > What devices are that?


    The one I did the testing with was an Acer TravelMate 3000.

    Regards,
    Holger
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread