From d49d9d8659c0a832ffec472b63e91f9908a5961c Mon Sep 17 00:00:00 2001 From: Toshi Kani Date: Wed, 13 Mar 2013 19:29:26 +0000 Subject: [PATCH] --- yaml --- r: 367551 b: refs/heads/master c: 882fd12e641b612bcf31620f9b1b7bb03f8e9ab5 h: refs/heads/master i: 367549: 9450afb9c47fa86dd275ad3f0f9f2d963181481a 367547: 252a25bf36a47d8d8dad16da5526650cfbd7f8ea 367543: 448211008c372f5a816736b7ad316ac9f082d094 367535: 808c71a3a1a61c3891f1349ae9ef0c30f27bdf74 367519: 09e87167d3521c22878b98e645ebf0b6156308a8 367487: 9186cc366b038bebb4c1507284f5356067ffb44c v: v3 --- [refs] | 2 +- trunk/drivers/acpi/scan.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 30434fa5c99a..c9d8ec1ba502 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ea6a4581ce11bd1a5dca421c01b11d1ff2867c2f +refs/heads/master: 882fd12e641b612bcf31620f9b1b7bb03f8e9ab5 diff --git a/trunk/drivers/acpi/scan.c b/trunk/drivers/acpi/scan.c index dfdbcfdd9def..8cacc16af6e7 100644 --- a/trunk/drivers/acpi/scan.c +++ b/trunk/drivers/acpi/scan.c @@ -127,6 +127,7 @@ static int acpi_scan_hot_remove(struct acpi_device *device) struct acpi_object_list arg_list; union acpi_object arg; acpi_status status; + unsigned long long sta; /* If there is no handle, the device node has been unregistered. */ if (!handle) { @@ -164,10 +165,25 @@ static int acpi_scan_hot_remove(struct acpi_device *device) if (status == AE_NOT_FOUND) { return -ENODEV; } else { - acpi_handle_warn(handle, "Eject failed\n"); + acpi_handle_warn(handle, "Eject failed (0x%x)\n", + status); return -EIO; } } + + /* + * Verify if eject was indeed successful. If not, log an error + * message. No need to call _OST since _EJ0 call was made OK. + */ + status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); + if (ACPI_FAILURE(status)) { + acpi_handle_warn(handle, + "Status check after eject failed (0x%x)\n", status); + } else if (sta & ACPI_STA_DEVICE_ENABLED) { + acpi_handle_warn(handle, + "Eject incomplete - status 0x%llx\n", sta); + } + return 0; }