Skip to content

Commit

Permalink
libata-acpi: don't call sleeping function from invalid context
Browse files Browse the repository at this point in the history
The problem is introduced by commit
664d080.

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>
  • Loading branch information
Zhang Rui authored and Jeff Garzik committed Jul 11, 2008
1 parent edb8047 commit 3c1e389
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/ata/libata-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,17 @@ 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) {
case ACPI_NOTIFY_BUS_CHECK:
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",
Expand Down

0 comments on commit 3c1e389

Please sign in to comment.