linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][ATA] Add ide-disk led-trigger to ATA subsystem
@ 2009-01-10 15:08 Carsten Schlote
  2009-01-14  8:25 ` Andrew Morton
  2009-01-18  8:11 ` Pavel Machek
  0 siblings, 2 replies; 5+ messages in thread
From: Carsten Schlote @ 2009-01-10 15:08 UTC (permalink / raw)
  To: linux-kernel

- 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.

Signed-off-by: Carsten Schlote <c.schlote@konzeptpark.de>
---
 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 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);


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][ATA] Add ide-disk led-trigger to ATA subsystem
  2009-01-10 15:08 [PATCH][ATA] Add ide-disk led-trigger to ATA subsystem Carsten Schlote
@ 2009-01-14  8:25 ` Andrew Morton
  2009-01-18  8:11 ` Pavel Machek
  1 sibling, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2009-01-14  8:25 UTC (permalink / raw)
  To: Carsten Schlote; +Cc: linux-kernel, linux-ide

(cc linux-ide)

On Sat, 10 Jan 2009 16:08:27 +0100 Carsten Schlote <c.schlote@konzeptpark.de> wrote:

> - 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.
> 
> Signed-off-by: Carsten Schlote <c.schlote@konzeptpark.de>
> ---
>  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 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);
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][ATA] Add ide-disk led-trigger to ATA subsystem
  2009-01-10 15:08 [PATCH][ATA] Add ide-disk led-trigger to ATA subsystem Carsten Schlote
  2009-01-14  8:25 ` Andrew Morton
@ 2009-01-18  8:11 ` Pavel Machek
  2009-01-18 15:50   ` Jeff Garzik
  1 sibling, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2009-01-18  8:11 UTC (permalink / raw)
  To: Carsten Schlote; +Cc: linux-kernel

On Sat 2009-01-10 16:08:27, Carsten Schlote wrote:
> - 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.
> 
> Signed-off-by: Carsten Schlote <c.schlote@konzeptpark.de>
> ---
>  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

()s might be nice?

> @@ -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
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][ATA] Add ide-disk led-trigger to ATA subsystem
  2009-01-18  8:11 ` Pavel Machek
@ 2009-01-18 15:50   ` Jeff Garzik
  2009-01-18 18:29     ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2009-01-18 15:50 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Carsten Schlote, linux-kernel

Pavel Machek wrote:
> On Sat 2009-01-10 16:08:27, Carsten Schlote wrote:
>>  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?


One would think you could do this at the block layer...

	Jeff




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][ATA] Add ide-disk led-trigger to ATA subsystem
  2009-01-18 15:50   ` Jeff Garzik
@ 2009-01-18 18:29     ` Alan Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2009-01-18 18:29 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Pavel Machek, Carsten Schlote, linux-kernel

On Sun, 18 Jan 2009 10:50:30 -0500
Jeff Garzik <jeff@garzik.org> wrote:

> Pavel Machek wrote:
> > On Sat 2009-01-10 16:08:27, Carsten Schlote wrote:
> >>  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?
> 
> 
> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-01-18 18:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-10 15:08 [PATCH][ATA] Add ide-disk led-trigger to ATA subsystem Carsten Schlote
2009-01-14  8:25 ` Andrew Morton
2009-01-18  8:11 ` Pavel Machek
2009-01-18 15:50   ` Jeff Garzik
2009-01-18 18:29     ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).