From: Suman Anna <s-anna@ti.com>
To: Russ Dill <russ.dill@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>,
Ohad Ben-Cohen <ohad@wizery.com>,
Omar Ramirez Luna <omar.ramirez@copitl.com>,
Jassi Brar <jaswinder.singh@linaro.org>,
Loic Pallardy <loic.pallardy@st.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Fernando Guzman Lugo <lugo.fernando@gmail.com>
Subject: Re: [PATCH 3/7] omap: mailbox: call request_irq after mbox queues are allocated
Date: Mon, 10 Jun 2013 14:14:55 -0500 [thread overview]
Message-ID: <51B625AF.3040801@ti.com> (raw)
In-Reply-To: <CA+Bv8XYWswZOy91pQgrT_YgXXavwZbHgB=H7_mTkYFRf0kdcbg@mail.gmail.com>
Russ,
On 06/08/2013 01:53 PM, Russ Dill wrote:
> On Fri, Jun 7, 2013 at 6:57 PM, Suman Anna <s-anna@ti.com> wrote:
>> The OMAP mailbox startup code is enabling the interrupt even before
>> any of the associated mailbox queues are allocated. Any pending
>> received mailbox message could cause a kernel panic as soon as
>> the interrupt is enabled due to the dereferencing of non-existing
>> mailbox queues within the ISR.
>>
>> Signed-off-by: Fernando Guzman Lugo <lugo.fernando@gmail.com>
>> Signed-off-by: Suman Anna <s-anna@ti.com>
>> ---
>> arch/arm/plat-omap/mailbox.c | 18 +++++++++---------
>> 1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
>> index 5fb4027..e1bd333 100644
>> --- a/arch/arm/plat-omap/mailbox.c
>> +++ b/arch/arm/plat-omap/mailbox.c
>> @@ -261,13 +261,6 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
>> }
>>
>> if (!mbox->use_count++) {
>> - ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
>> - mbox->name, mbox);
>> - if (unlikely(ret)) {
>> - pr_err("failed to register mailbox interrupt:%d\n",
>> - ret);
>> - goto fail_request_irq;
>> - }
>> mq = mbox_queue_alloc(mbox, NULL, mbox_tx_tasklet);
>> if (!mq) {
>> ret = -ENOMEM;
>> @@ -282,17 +275,24 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
>> }
>> mbox->rxq = mq;
>> mq->mbox = mbox;
>> + ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
>> + mbox->name, mbox);
>> + if (unlikely(ret)) {
>> + pr_err("failed to register mailbox interrupt:%d\n",
>> + ret);
>> + goto fail_request_irq;
>> + }
>>
>> omap_mbox_enable_irq(mbox, IRQ_RX);
>
> I can't help but to notice the IRQ unmasking function here. Is there a
> reason it isn't working?
This patch was based on an internal patch needed before the equivalent
of 1d8a0e9 "ARM: OMAP: enable mailbox irq per instance" is merged. I
will revise the patch description - this is more of a minor cleanup now
rather than a fix, would have been a fix without the above patch. Thanks
for pointing it out.
regards
Suman
WARNING: multiple messages have this Message-ID (diff)
From: s-anna@ti.com (Suman Anna)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/7] omap: mailbox: call request_irq after mbox queues are allocated
Date: Mon, 10 Jun 2013 14:14:55 -0500 [thread overview]
Message-ID: <51B625AF.3040801@ti.com> (raw)
In-Reply-To: <CA+Bv8XYWswZOy91pQgrT_YgXXavwZbHgB=H7_mTkYFRf0kdcbg@mail.gmail.com>
Russ,
On 06/08/2013 01:53 PM, Russ Dill wrote:
> On Fri, Jun 7, 2013 at 6:57 PM, Suman Anna <s-anna@ti.com> wrote:
>> The OMAP mailbox startup code is enabling the interrupt even before
>> any of the associated mailbox queues are allocated. Any pending
>> received mailbox message could cause a kernel panic as soon as
>> the interrupt is enabled due to the dereferencing of non-existing
>> mailbox queues within the ISR.
>>
>> Signed-off-by: Fernando Guzman Lugo <lugo.fernando@gmail.com>
>> Signed-off-by: Suman Anna <s-anna@ti.com>
>> ---
>> arch/arm/plat-omap/mailbox.c | 18 +++++++++---------
>> 1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
>> index 5fb4027..e1bd333 100644
>> --- a/arch/arm/plat-omap/mailbox.c
>> +++ b/arch/arm/plat-omap/mailbox.c
>> @@ -261,13 +261,6 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
>> }
>>
>> if (!mbox->use_count++) {
>> - ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
>> - mbox->name, mbox);
>> - if (unlikely(ret)) {
>> - pr_err("failed to register mailbox interrupt:%d\n",
>> - ret);
>> - goto fail_request_irq;
>> - }
>> mq = mbox_queue_alloc(mbox, NULL, mbox_tx_tasklet);
>> if (!mq) {
>> ret = -ENOMEM;
>> @@ -282,17 +275,24 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
>> }
>> mbox->rxq = mq;
>> mq->mbox = mbox;
>> + ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
>> + mbox->name, mbox);
>> + if (unlikely(ret)) {
>> + pr_err("failed to register mailbox interrupt:%d\n",
>> + ret);
>> + goto fail_request_irq;
>> + }
>>
>> omap_mbox_enable_irq(mbox, IRQ_RX);
>
> I can't help but to notice the IRQ unmasking function here. Is there a
> reason it isn't working?
This patch was based on an internal patch needed before the equivalent
of 1d8a0e9 "ARM: OMAP: enable mailbox irq per instance" is merged. I
will revise the patch description - this is more of a minor cleanup now
rather than a fix, would have been a fix without the above patch. Thanks
for pointing it out.
regards
Suman
next prev parent reply other threads:[~2013-06-10 19:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-08 1:57 [PATCH 3/7] omap: mailbox: call request_irq after mbox queues are allocated Suman Anna
2013-06-08 1:57 ` Suman Anna
2013-06-08 18:53 ` Russ Dill
2013-06-08 18:53 ` Russ Dill
2013-06-10 19:14 ` Suman Anna [this message]
2013-06-10 19:14 ` Suman Anna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51B625AF.3040801@ti.com \
--to=s-anna@ti.com \
--cc=jaswinder.singh@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=loic.pallardy@st.com \
--cc=lugo.fernando@gmail.com \
--cc=ohad@wizery.com \
--cc=omar.ramirez@copitl.com \
--cc=russ.dill@gmail.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.