From: Zhang Rui Date: Fri, 11 Jul 2008 13:42:03 +0000 (-0400) Subject: libata-acpi: don't call sleeping function from invalid context X-Git-Tag: MMI-PSA29.97-13-9~33723^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3c1e3896344063273715b332b1c0534deb9b286c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git libata-acpi: don't call sleeping function from invalid context The problem is introduced by commit 664d080c41463570b95717b5ad86e79dc1be0877. acpi_evaluate_integer is a sleeping function, and it should not be called with spin_lock_irqsave. https://bugzilla.redhat.com/show_bug.cgi?id=451399 Signed-off-by: Zhang Rui Signed-off-by: Jeff Garzik --- diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c index abea74b42a20..9330b7922f62 100644 --- a/drivers/ata/libata-acpi.c +++ b/drivers/ata/libata-acpi.c @@ -197,6 +197,10 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev, /* This device does not support hotplug */ return; + if (event == ACPI_NOTIFY_BUS_CHECK || + event == ACPI_NOTIFY_DEVICE_CHECK) + status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); + spin_lock_irqsave(ap->lock, flags); switch (event) { @@ -204,7 +208,6 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev, case ACPI_NOTIFY_DEVICE_CHECK: ata_ehi_push_desc(ehi, "ACPI event"); - status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); if (ACPI_FAILURE(status)) { ata_port_printk(ap, KERN_ERR, "acpi: failed to determine bay status (0x%x)\n",