How to notify userspace of custom bus master/slave access mode changes ?
Laurent Pinchart
laurentp at cse-semaphore.com
Wed Nov 28 02:51:01 EST 2007
Hi everybody,
I'm a bit unsure about how to notify userspace of changes to access mode to a
custom bus. This is more an architecture issue than an implementation issue.
My system has an ISA-like cold-pluggable extension bus. The bus controller
sits on the CPU board which is plugged along with slave devices into a
passive backplane.
To add CPU redundancy support to the system, I implemented master and slave
modes for the CPU board. The slave monitors the master and can disconnect it
from the bus when a failure is detected.
The bus drivers haven't been developed with hotplug in mind, but I eventually
managed to fix them. The kernel is now able to scan the bus when a CPU board
switches from slave to master mode, adding peripherals as they are detected,
and to remove all peripherals when the CPU board switches from master to
slave.
I now have to notify userspace applications of master <-> slave mode changes.
I thought about using kobject netlink notifications, but the kernel only
generates events for individual peripherals (when they are added or removed).
The bus driver registers a peripheral for the bus controller at boot time. I
thought about registering the peripheral only when the system switches from
slave to master, and deregistering it when it switches back to slave mode,
but that's not very clean as the bus controller is always attached to the
CPU, regardless of its bus access mode. Beside, I need to access the bus
controller to detect master <-> slave transitions, so this would be a bit
hackish.
Is there a kobject netlink event I could use that I haven't thought about ? Am
I missing a pseudo-peripheral in my implementation ? Is there a preferred way
to notify userspace of such events ?
Thanks for any help you can provide (and thanks for having read this mail
throughout :-)).
Best regards,
--
Laurent Pinchart
CSE Semaphore Belgium
Chaussée de Bruxelles, 732A
B-1410 Waterloo
Belgium
T +32 (2) 387 42 59
F +32 (2) 387 42 75
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20071127/c0bc2427/attachment.pgp>
More information about the Linuxppc-dev
mailing list