On Mon, Feb 10, 2014 at 08:09:34PM +0100, Josh Cartwright wrote: > On Mon, Feb 10, 2014 at 11:52:05AM -0600, Rob Herring wrote: > > On Mon, Feb 10, 2014 at 8:11 AM, Arnd Bergmann <arnd@xxxxxxxx> wrote: > > > On Friday 07 February 2014 16:50:14 Courtney Cavin wrote: > [..] > > >> +int mbox_channel_notify(struct mbox_channel *chan, > > >> + const void *data, unsigned int len) > > >> +{ > > >> + return atomic_notifier_call_chain(&chan->notifier, len, (void *)data); > > >> +} > > >> +EXPORT_SYMBOL(mbox_channel_notify); > > > > > > What is the reason to use a notifier chain here? Isn't a simple > > > callback function pointer enough? I would expect that each mailbox > > > can have exactly one consumer, not multiple ones. > > > > It probably can be a callback, but there can be multiple consumers. It > > was only a notifier on the pl320 as there was no framework at the time > > and to avoid creating custom interfaces between drivers. On highbank > > for example, we can asynchronously receive the events for temperature > > change, power off, and reset. So either there needs to be an event > > demux somewhere or callbacks have to return whether they handled an > > event or not. > > I'm not familiar with highbank IPC, but with these requirements should > the mailbox core even bother with asynchronous notifier chain? It > sounds like a better fit might be for the mailbox core to implement a > proper adapter-specific irqdomain and used a chained irq handler to > demux (or have consumers request with IRQF_SHARED in the shared case). Although modeling this using irqdomains makes sense for the notification bit, and would probably suit most adapters, there's the issue of data being passed around which doesn't quite fit. "Ok, I have mail... where is it?" Did you have something in mind for that? Frankly, I don't see the notifier chain as being extraneous or over-complicated here core-wise or implementation-wise, and unless I understand Rob incorrectly, should suit the existing use-cases. Am I missing something? -Courtney -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html