[libata] ahci: correct enclosure LED state save
authorDavid Milburn <dmilburn@redhat.com>
Fri, 20 Mar 2009 19:14:23 +0000 (14:14 -0500)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 25 Mar 2009 02:42:49 +0000 (22:42 -0400)
ahci_transmit_led_message saves off the led_state
with a value that includes the port number OR'd
in, this incorrect value maybe reported back
in ahci_led_store.

For instance, if you turn off all the leds for
port 1 and cat the value back it will report 1
instead of 0.

# echo 0 > /sys/class/scsi_host/host1/em_message
# cat /sys/class/scsi_host/host1/em_message
1

Signed-off-by: David Milburn <dmilburn@redhat.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/ahci.c

index ec2922ad2dc03dfd878a9022b316d174021a61c5..788bba2b1e1798fc8b60336f701e06348c0396c8 100644 (file)
@@ -1348,7 +1348,7 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state,
        writel(message[1], mmio + hpriv->em_loc+4);
 
        /* save off new led state for port/slot */
-       emp->led_state = message[1];
+       emp->led_state = state;
 
        /*
         * tell hardware to transmit the message