Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759236AbdCVRP5 convert rfc822-to-8bit (ORCPT ); Wed, 22 Mar 2017 13:15:57 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:35795 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964973AbdCVRPk (ORCPT ); Wed, 22 Mar 2017 13:15:40 -0400 From: Lionel DEBIEVE To: Steven Rostedt CC: "linux-rt-users@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bigeasy@linutronix.de" , "tglx@linutronix.de" Subject: Re: [PATCH RT 1/1] remoteproc: Prevent schedule while atomic Thread-Topic: [PATCH RT 1/1] remoteproc: Prevent schedule while atomic Thread-Index: AQHSoy/lexYOehVkTUOOchoJTo+ipw== Date: Wed, 22 Mar 2017 17:15:25 +0000 Message-ID: <025b6099-1a26-cdb5-6ddb-fbf36cbad5d9@st.com> References: <1490195923-9560-1-git-send-email-lionel.debieve@st.com> <20170322090558.72064144@vmware.local.home> In-Reply-To: <20170322090558.72064144@vmware.local.home> Accept-Language: fr-FR, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.47] Content-Type: text/plain; charset="Windows-1252" Content-ID: <75B89288FDC5114C975E2D608030A05E@st.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-22_15:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3201 Lines: 94 On 03/22/2017 05:05 PM, Steven Rostedt wrote: > On Wed, 22 Mar 2017 16:18:43 +0100 > Lionel Debieve wrote: > >> Use raw_spin_lock in enable/disable channel as it comes from >> interrupt context. >> >> BUG: sleeping function called from invalid context at >> kernel/locking/rtmutex.c:995 >> in_atomic(): 1, irqs_disabled(): 128, pid: 307, name: pulseaudio >> Preemption disabled at: >> [] __handle_domain_irq+0x4c/0xec >> CPU: 0 PID: 307 Comm: pulseaudio >> Hardware name: STi SoC with Flattened Device Tree >> [] (unwind_backtrace) >> [] (show_stack) >> [] (dump_stack) >> [] (___might_sleep) >> [] (rt_spin_lock) >> [] (sti_mbox_disable_channel) >> [] (sti_mbox_irq_handler) >> [] (__handle_irq_event_percpu) >> [] (handle_irq_event_percpu) >> [] (handle_irq_event) >> [] (handle_fasteoi_irq) >> [] (generic_handle_irq) >> [] (__handle_domain_irq) >> [] (gic_handle_irq) >> >> Signed-off-by: Lionel Debieve > Looks fine to me. Should this go to mainline? > > Acked-by: Steven Rostedt (VMware) > > -- Steve Will look deeper if it can be. Lionel > >> --- >> drivers/mailbox/mailbox-sti.c | 12 ++++++------ >> 1 file changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/mailbox/mailbox-sti.c >> b/drivers/mailbox/mailbox-sti.c index 41bcd33..f9674ca 100644 >> --- a/drivers/mailbox/mailbox-sti.c >> +++ b/drivers/mailbox/mailbox-sti.c >> @@ -60,7 +60,7 @@ struct sti_mbox_device { >> void __iomem *base; >> const char *name; >> u32 enabled[STI_MBOX_INST_MAX]; >> - spinlock_t lock; >> + raw_spinlock_t lock; >> }; >> >> /** >> @@ -129,10 +129,10 @@ static void sti_mbox_enable_channel(struct >> mbox_chan *chan) unsigned long flags; >> void __iomem *base = MBOX_BASE(mdev, instance); >> >> - spin_lock_irqsave(&mdev->lock, flags); >> + raw_spin_lock_irqsave(&mdev->lock, flags); >> mdev->enabled[instance] |= BIT(channel); >> writel_relaxed(BIT(channel), base + STI_ENA_SET_OFFSET); >> - spin_unlock_irqrestore(&mdev->lock, flags); >> + raw_spin_unlock_irqrestore(&mdev->lock, flags); >> } >> >> static void sti_mbox_disable_channel(struct mbox_chan *chan) >> @@ -144,10 +144,10 @@ static void sti_mbox_disable_channel(struct >> mbox_chan *chan) unsigned long flags; >> void __iomem *base = MBOX_BASE(mdev, instance); >> >> - spin_lock_irqsave(&mdev->lock, flags); >> + raw_spin_lock_irqsave(&mdev->lock, flags); >> mdev->enabled[instance] &= ~BIT(channel); >> writel_relaxed(BIT(channel), base + STI_ENA_CLR_OFFSET); >> - spin_unlock_irqrestore(&mdev->lock, flags); >> + raw_spin_unlock_irqrestore(&mdev->lock, flags); >> } >> >> static void sti_mbox_clear_irq(struct mbox_chan *chan) >> @@ -450,7 +450,7 @@ static int sti_mbox_probe(struct platform_device >> *pdev) mdev->dev = &pdev->dev; >> mdev->mbox = mbox; >> >> - spin_lock_init(&mdev->lock); >> + raw_spin_lock_init(&mdev->lock); >> >> /* STi Mailbox does not have a Tx-Done or Tx-Ready IRQ */ >> mbox->txdone_irq = false; >