Re: [PATCHv4 2/5] mailbox: Introduce framework for mailbox

From: Jassi Brar
Date: Wed Mar 19 2014 - 01:20:32 EST


On 19 March 2014 09:30, Girish KS <girishks2000@xxxxxxxxx> wrote:
> On Wed, Mar 19, 2014 at 12:15 AM, Jassi Brar <jassisinghbrar@xxxxxxxxx> wrote:

>> +int mbox_send_message(struct mbox_chan *chan, void *mssg)
>> +{
>> + int t;
>> +
>> + if (!chan || !chan->cl)
>> + return -EINVAL;
>> +
>> + t = _add_to_rbuf(chan, mssg);
>> + if (t < 0) {
>> + pr_err("Try increasing MBOX_TX_QUEUE_LEN\n");
>> + return t;
>> + }
>> +
>> + _msg_submit(chan);
>> +
>> + if (chan->txdone_method == TXDONE_BY_POLL)
>> + poll_txdone((unsigned long)chan->con);
>
> I came across a panic in the complete function. When i traced bact the
> call sequence it was
> When a client sets chan->cl->tx_block = true, and polling is enabled
> for controller.
> 1.Client sends the message with mbox_send_message. This function as
> seen above will call __msg_submit (this calls the controller specific
> send function).
> 2. Since the tx method is polling the above condition is satisfied and
> calls the poll_txdone function.
> 3. In this poll function, the tx_tick function is invoked.
> 4. In this tick function since the client has enabled the tx_block it
> calls the notify function complete(&chan->tx_complete);
> 5. Here there is a panic. because the complete is called before
> initialization. init_completion needs to be called but not called.
>
Are you sure you have applied the patch "[PATCHv4 4/5] mailbox: Fix TX
completion init" ?

Thanks
Jassi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/