Re: [Update][PATCH 2/7] ACPI / scan: Introduce common code forACPI-based device hotplug

From: Toshi Kani
Date: Wed Feb 20 2013 - 20:28:40 EST


On Wed, 2013-02-20 at 23:49 +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
:
> +
> +/**
> + * acpi_bus_hot_remove_device: hot-remove a device and its children
> + * @context: struct acpi_eject_event pointer (freed in this func)
> + *
> + * Hot-remove a device and its children. This function frees up the
> + * memory space passed by arg context, so that the caller may call
> + * this function asynchronously through acpi_os_hotplug_execute().
> + */
> +void acpi_bus_hot_remove_device(void *context)
> +{
> + struct acpi_eject_event *ej_event = context;
> + struct acpi_device *device = ej_event->device;
> + acpi_handle handle = device->handle;
> + u32 ost_code = ACPI_OST_SC_SUCCESS;
> + int error;
> +
> + mutex_lock(&acpi_scan_lock);
> +
> + error = acpi_scan_hot_remove(device);
> + if (error)
> + ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE;
> +
> + acpi_evaluate_hotplug_ost(handle, ej_event->event, ost_code, NULL);

Thanks for the quick update. It fixed the deadlock issue. :-) As it
now completes an eject operation, I found a new issue. When the OS
called _EJ0, it is not supposed to call _OST since FW has already
received the completion status from _EJ0. That is, the OS calls either
_EJ0 (success case) or _OST (failure case) for hot-delete.

-Toshi


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