Add ide-disk led-trigger to ATA subsystem
PATCH 1/1 Add ide-disk led-trigger to ATA subsystem
- Adds a call to ide-disk LED trigger to libata-sff.c
- Changed Kconfig to allow for ide-disk LED trigger when ATA drivers are enabled.
Open Issue:
- There might be more suitable place to call the trigger function. Only devices using libata-sff.c trigger LEDs right now.
--- drivers/ata/libata-sff.c | 3 +++ drivers/leds/Kconfig | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
Index: .kernel/drivers/leds/Kconfig
===================================================================
--- .kernel.orig/drivers/leds/Kconfig 2009-01-07 22:13:40.000000000
+0100
+++ .kernel/drivers/leds/Kconfig 2009-01-07 22:14:46.000000000 +0100
@@ -185,7 +185,7 @@
config LEDS_TRIGGER_IDE_DISK
bool "LED IDE Disk Trigger"
- depends on LEDS_TRIGGERS && BLK_DEV_IDEDISK
+ depends on LEDS_TRIGGERS && BLK_DEV_IDEDISK || ATA
help
This allows LEDs to be controlled by IDE disk activity. If unsure, say Y.
Index: .kernel/drivers/ata/libata-sff.c
===================================================================
--- .kernel.orig/drivers/ata/libata-sff.c 2009-01-07 22:14:09.000000000
+0100
+++ .kernel/drivers/ata/libata-sff.c 2009-01-07 22:14:46.000000000 +0100
@@ -36,6 +36,7 @@
#include <linux/pci.h>
#include <linux/libata.h>
#include <linux/highmem.h>
+#include <linux/leds.h>
#include "libata.h"
@@ -647,6 +648,8 @@
*/
void ata_sff_exec_command(struct ata_port *ap, const structata_taskfile *tf)
{
+ ledtrig_ide_activity();
+
DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
iowrite8(tf->command, ap->ioaddr.command_addr);
(cc linux-ide)
Quoted 52 lines · On Sat, 10 Jan 2009 16:08:27 +0100 Carsten Schlote <[email protected]>…
- Adds a call to ide-disk LED trigger to
libata-sff.c
- ChangedKconfigto allow for ide-disk LED trigger when ATA drivers are enabled.Open Issue:
- There might be more suitable place to call the trigger function. Only devices usinglibata-sff.ctrigger LEDs right now.Signed-off-by Carsten Schlote <[email protected]>--- drivers/ata/libata-sff.c | 3 +++ drivers/leds/Kconfig | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)Index: .kernel/drivers/leds/Kconfig
===================================================================
--- .kernel.orig/drivers/leds/Kconfig 2009-01-07 22:13:40.000000000
+0100
+++ .kernel/drivers/leds/Kconfig 2009-01-07 22:14:46.000000000 +0100(quoted diff) +1
-1@@ -185,7 +185,7 @@ config LEDS_TRIGGER_IDE_DISK bool "LED IDE Disk Trigger" - depends on LEDS_TRIGGERS && BLK_DEV_IDEDISK + depends on LEDS_TRIGGERS && BLK_DEV_IDEDISK || ATA help This allows LEDs to be controlled by IDE disk activity. If unsure, say Y.Index:
.kernel/drivers/ata/libata-sff.c
===================================================================
---.kernel.orig/drivers/ata/libata-sff.c2009-01-07 22:14:09.000000000
+0100
+++.kernel/drivers/ata/libata-sff.c2009-01-07 22:14:46.000000000 +0100(quoted diff) +3
-0@@ -36,6 +36,7 @@ #include <linux/pci.h> #include <linux/libata.h> #include <linux/highmem.h> +#include <linux/leds.h> #include "libata.h"@@ -647,6 +648,8 @@ */ void ata_sff_exec_command(struct ata_port *ap, const struct ata_taskfile *tf) { + ledtrig_ide_activity(); + DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
iowrite8(tf->command, ap->ioaddr.command_addr);
Quoted 20 lines · Carsten Schlote
- Adds a call to ide-disk LED trigger to
libata-sff.c
- ChangedKconfigto allow for ide-disk LED trigger when ATA drivers are enabled.Open Issue:
- There might be more suitable place to call the trigger function. Only devices usinglibata-sff.ctrigger LEDs right now.Signed-off-by Carsten Schlote <[email protected]>--- drivers/ata/libata-sff.c | 3 +++ drivers/leds/Kconfig | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)Index: .kernel/drivers/leds/Kconfig
===================================================================
--- .kernel.orig/drivers/leds/Kconfig 2009-01-07 22:13:40.000000000
+0100
+++ .kernel/drivers/leds/Kconfig 2009-01-07 22:14:46.000000000 +0100
Review line 188
Quoted 5 lines
(quoted diff) +1
-1@@ -185,7 +185,7 @@ config LEDS_TRIGGER_IDE_DISK bool "LED IDE Disk Trigger" - depends on LEDS_TRIGGERS && BLK_DEV_IDEDISK + depends on LEDS_TRIGGERS && BLK_DEV_IDEDISK || ATA
()s might be nice?
Quoted 11 lines
(quoted diff) +2
-0@@ -647,6 +648,8 @@ */ void ata_sff_exec_command(struct ata_port *ap, const struct ata_taskfile *tf) { + ledtrig_ide_activity(); + DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
iowrite8(tf->command, ap->ioaddr.command_addr);
Is there a more generic place so that we won't have to modify all the libata drivers?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 8 lines · Pavel Machek
Quoted 7 lines · Carsten Schlote
void ata_sff_exec_command(struct
ata_port*ap, const structata_taskfile*tf)
{(quoted diff) +2
-0+ ledtrig_ide_activity(); + DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
Quoted 5 lines
Quoted 2 lines
iowrite8(tf->command, ap->ioaddr.command_addr);Is there a more generic place so that we won't have to modify all the libata drivers?
One would think you could do this at the block layer...
Jeff
Quoted 9 lines · On Sun, 18 Jan 2009 10:50:30 -0500 Jeff Garzik <[email protected]> wrote:
Quoted 8 lines · Pavel Machek
Quoted 7 lines · Carsten Schlote
void ata_sff_exec_command(struct
ata_port*ap, const structata_taskfile*tf)
{(quoted diff) +2
-0+ ledtrig_ide_activity(); + DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command);
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
iowrite8(tf->command, ap->ioaddr.command_addr);Is there a more generic place so that we won't have to modify all the libata drivers?
One would think you could do this at the block layer...
ata_sff_exec_command is also on a timing critical path so the wrong place to be touching other stuff. It's mid command issue.