summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Milburn <dmilburn@redhat.com>2008-10-16 09:26:19 -0500
committerJeff Garzik <jgarzik@redhat.com>2008-10-28 00:36:10 -0400
commiteb40963c835c69681af516388a2a92b57e2f0fe7 (patch)
tree06cf541df117f772d48d2e8ebe00bc6e561f008c /drivers
parente7c0d217cdaa837d30bc265eddac4d176969fd68 (diff)
downloadop-kernel-dev-eb40963c835c69681af516388a2a92b57e2f0fe7.zip
op-kernel-dev-eb40963c835c69681af516388a2a92b57e2f0fe7.tar.gz
libata: ahci enclosure management led sync
Synchronize ahci_sw_activity and ahci_sw_activity_blink with ata_port lock. Signed-off-by: David Milburn <dmilburn@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/ahci.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 289719b..3c71d31 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1223,6 +1223,7 @@ static void ahci_sw_activity_blink(unsigned long arg)
struct ahci_em_priv *emp = &pp->em_priv[link->pmp];
unsigned long led_message = emp->led_state;
u32 activity_led_state;
+ unsigned long flags;
led_message &= 0xffff0000;
led_message |= ap->port_no | (link->pmp << 8);
@@ -1231,6 +1232,7 @@ static void ahci_sw_activity_blink(unsigned long arg)
* toggle state of LED and reset timer. If not,
* turn LED to desired idle state.
*/
+ spin_lock_irqsave(ap->lock, flags);
if (emp->saved_activity != emp->activity) {
emp->saved_activity = emp->activity;
/* get the current LED state */
@@ -1253,6 +1255,7 @@ static void ahci_sw_activity_blink(unsigned long arg)
if (emp->blink_policy == BLINK_OFF)
led_message |= (1 << 16);
}
+ spin_unlock_irqrestore(ap->lock, flags);
ahci_transmit_led_message(ap, led_message, 4);
}
OpenPOWER on IntegriCloud