[PATCH 6/7] omap:mailbox-add notification support for multiple readers

Hari Kanigeri hari.kanigeri at gmail.com
Fri Oct 29 08:05:41 EDT 2010


Omar,

>>
>>  static void omap_mbox_fini(struct omap_mbox *mbox)
>>  {
>> +       if (!--mbox->use_count) {
>> +               tasklet_kill(&mbox->txq->tasklet);
>> +               flush_work(&mbox->rxq->work);
>> +               mbox_queue_free(mbox->txq);
>> +               mbox_queue_free(mbox->rxq);
>> +       }
>> +
>> +       if (likely(mbox->ops->shutdown)) {
>> +               if (!--mbox_configured) {
>> +                       free_irq(mbox->irq, mbox);
>
> Above hunks will create an imbalance of free_irq, as request_irq can be
> called per registered mailbox and free_irq is only done for the last caller
> releasing the mailbox handle.
>
> e.g.: mbox-1, mbox-N will request a shared irq on the same interrupt line,
> but only the last caller of omap_mbox_put will free its irq, leaving the
> other one there.
>
> This can be fixed if the free is moved to be executed within the following
> block:
>
>        if (!--mbox->use_count) {
>                ...
>                free_irq(mbox->irq, mbox);
>        }
>

Good catch. I will make the changes in next revision.

Thank you,
Best regards,
Hari



More information about the linux-arm-kernel mailing list