From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753291AbaCSFUY (ORCPT ); Wed, 19 Mar 2014 01:20:24 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:40548 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751387AbaCSFUX (ORCPT ); Wed, 19 Mar 2014 01:20:23 -0400 MIME-Version: 1.0 In-Reply-To: References: <1395168169-28978-1-git-send-email-jaswinder.singh@linaro.org> <1395168335-29119-1-git-send-email-jaswinder.singh@linaro.org> Date: Wed, 19 Mar 2014 10:50:22 +0530 Message-ID: Subject: Re: [PATCHv4 2/5] mailbox: Introduce framework for mailbox From: Jassi Brar To: Girish KS Cc: Jassi Brar , Linux Kernel Mailing List , Greg Kroah-Hartman , "Anna, Suman" , Tony Lindgren , "Omar Ramirez Luna (omar.ramirez@copitl.com)" , Loic Pallardy , LeyFoon Tan , Craig McGeachie , Courtney Cavin , "Rafael J. Wysocki" , Rob Herring , Arnd Bergmann , Josh Cartwright , Linus Walleij , Kumar Gala , "ks.giri@samsung.com" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19 March 2014 09:30, Girish KS wrote: > On Wed, Mar 19, 2014 at 12:15 AM, Jassi Brar 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