[PATCH 1/3] mailbox: add support for APM X-Gene platform mailbox driver

Jassi Brar jaswinder.singh at linaro.org
Tue Apr 21 17:13:15 PDT 2015


On 22 April 2015 at 06:14, Feng Kan <fkan at apm.com> wrote:
> On Tue, Apr 21, 2015 at 12:42 AM, Jassi Brar <jassisinghbrar at gmail.com> wrote:
>>
>>> +/* Configuration and Status Registers */
>>> +struct slimpro_mbox_reg {
>>> +       u32 in;
>>> +       u32 din0;
>>> +       u32 din1;
>>> +       u32 rsvd1;
>>> +       u32 out;
>>> +       u32 dout0;
>>> +       u32 dout1;
>>> +       u32 rsvd2;
>>> +       u32 status;
>>> +       u32 statusmask;
>>> +};
>>> +
>> Why not the normal way of defining offset macros, like most drivers do?
> I personally don't prefer one way over another, let me know if you want me
> to change to use defines.
>
Yes please.

>>
>>> +               mbox_chan_received_data(mb_chan->chan, mb_chan->rx_msg);
>>> +       }
>>> +
>>> +       return IRQ_HANDLED;
>>> +}
>>> +
>>> +static int slimpro_mbox_send_data(struct mbox_chan *chan, void *msg)
>>> +{
>>> +       struct slimpro_mbox_chan *mb_chan = to_slimpro_mbox_chan(chan);
>>> +
>>> +       mb_chan_send_msg(mb_chan, msg);
>>> +       return 0;
>>> +}
>>> +
>>> +static int slimpro_mbox_startup(struct mbox_chan *chan)
>>> +{
>>> +       struct slimpro_mbox_chan *mb_chan = to_slimpro_mbox_chan(chan);
>>> +       int rc;
>>> +
>>> +       rc = devm_request_irq(mb_chan->dev, mb_chan->irq, slimpro_mbox_irq, 0,
>>> +                             MBOX_CON_NAME, mb_chan);
>>>
>> You may want to use IRQF_SHARED flag here and make slimpro_mbox_irq()
>> aware of that -- some platforms tie together irq lines of all
>> instances of a resource, like dma, mbox, so they may share the same
>> irq line.
> this is an internal dedicated irq line.
>
Yes on this platform/soc it is. But some future platform that uses the
same mbox controller might choose to tie all irqs together at the cost
of slightly increased latency. However I am OK if you are. So as you
wish for now.



More information about the linux-arm-kernel mailing list