LED devices

Richard Purdie rpurdie at openedhand.com
Fri Jun 1 09:29:13 PDT 2007


On Fri, 2007-06-01 at 18:12 +0200, Kay Sievers wrote:
> On Fri, 2007-06-01 at 16:56 +0100, Richard Purdie wrote:
> > I've often wished we could do this as it would suit triggers well! The
> > same approach could be used for bio schedulers and other selection type
> > operations. As you say its not really possible though and would be more
> > difficult to use in reality.
> 
> I'm not familiar with the whole infrastructure, so I might be on the
> wrong track. :)
> 
> Wouldn't something like the blockdev holders/ slaves/ subdirs work to
> express such a relationship?
> 
>   $ ls -l /sys/block
>   md0 -> ../devices/virtual/block/md0
>   sda -> ../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda
>   sr0 -> ../devices/pci0000:00/0000:00:1f.1/host4/target4:0:0/4:0:0:0/block/sr0
> 
>   $ ls -l  /sys/block/md0/slaves
>   sda8 -> ../../../../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda8
>   sda9 -> ../../../../../devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda/sda9
> 
>   $ ls -l  /sys/block/sda/sda8/holders
>   md0 -> ../../../../../../../../../../devices/virtual/block/md0
> 
> It shows the relationship in both directions, and is not limited to a
> single relation per device.

Can userspace trigger a change of this relationship though? We need to
be able to change the trigger an LED is using...

At the moment the trigger attribute functions
like /sys/block/*/queue/scheduler:

# cat /sys/block/sda/queue/scheduler 
noop anticipatory deadline [cfq]

# echo "noop" > /sys/block/sda/queue/scheduler 

# cat /sys/block/sda/queue/scheduler 
[noop] anticipatory deadline cfq


Richard






More information about the hal mailing list