lkml.org 
[lkml]   [2014]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC 1/6] mailbox: add core framework
From
On Mon, Feb 10, 2014 at 8:11 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Friday 07 February 2014 16:50:14 Courtney Cavin wrote:
>> The mailbox drivers are fragmented, and some implement their own core.
>> Unify the drivers and implement common functionality in a framework.
>>
>> Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>

[snip]

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

Rob


\
 
 \ /
  Last update: 2014-02-10 19:41    [W:0.075 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site