aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2008-07-11 09:42:03 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-11 09:42:03 -0400
commit3c1e3896344063273715b332b1c0534deb9b286c (patch)
treefbc97263f4c9c87288baaf65825fcddead14f617 /drivers
parentedb804713ffb660ddad5dda5fb8f2addea7ad8c6 (diff)
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 <rui.zhang@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/libata-acpi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index abea74b42a2..9330b7922f6 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,
197 /* This device does not support hotplug */ 197 /* This device does not support hotplug */
198 return; 198 return;
199 199
200 if (event == ACPI_NOTIFY_BUS_CHECK ||
201 event == ACPI_NOTIFY_DEVICE_CHECK)
202 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
203
200 spin_lock_irqsave(ap->lock, flags); 204 spin_lock_irqsave(ap->lock, flags);
201 205
202 switch (event) { 206 switch (event) {
@@ -204,7 +208,6 @@ static void ata_acpi_handle_hotplug(struct ata_port *ap, struct ata_device *dev,
204 case ACPI_NOTIFY_DEVICE_CHECK: 208 case ACPI_NOTIFY_DEVICE_CHECK:
205 ata_ehi_push_desc(ehi, "ACPI event"); 209 ata_ehi_push_desc(ehi, "ACPI event");
206 210
207 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta);
208 if (ACPI_FAILURE(status)) { 211 if (ACPI_FAILURE(status)) {
209 ata_port_printk(ap, KERN_ERR, 212 ata_port_printk(ap, KERN_ERR,
210 "acpi: failed to determine bay status (0x%x)\n", 213 "acpi: failed to determine bay status (0x%x)\n",