Skip to contentSkip to conversation

libata: ahci enclosure save new led state

PATCH Applied David Milburn 2 participants 2 messages Mar 20, 2009 – Mar 25, 2009 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libata: ahci enclosure save new led state

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
---
 drivers/ata/ahci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/ata/ahci.c +1 -1
index 66e012c..288f12f 100644
@@ -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
Applied
#1 lore raw
Quoted 9 lines · David Milburn

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.

Quoted 8 lines
# echo 0 > /sys/class/scsi_host/host1/em_message
# cat /sys/class/scsi_host/host1/em_message
1
---
 drivers/ata/ahci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

applied