From: Laurent Pinchart <laurentp@cse-semaphore.com>
To: linuxppc-dev@ozlabs.org
Subject: How to notify userspace of custom bus master/slave access mode changes ?
Date: Tue, 27 Nov 2007 16:51:01 +0100 [thread overview]
Message-ID: <200711271651.07191.laurentp@cse-semaphore.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2043 bytes --]
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
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
reply other threads:[~2007-11-27 15:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200711271651.07191.laurentp@cse-semaphore.com \
--to=laurentp@cse-semaphore.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).