Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760254AbdCVQHB (ORCPT ); Wed, 22 Mar 2017 12:07:01 -0400 Received: from smtprelay0175.hostedemail.com ([216.40.44.175]:55228 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758975AbdCVQGo (ORCPT ); Wed, 22 Mar 2017 12:06:44 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1183:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1543:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2904:3138:3139:3140:3141:3142:3354:3622:3867:3870:3872:4321:5007:6261:7875:7901:9163:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12555:12740:12760:12895:13439:14181:14659:14721:21080:21433:21451:30029:30054:30056:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: tank97_6ed39a2b4b802 X-Filterd-Recvd-Size: 3958 Date: Wed, 22 Mar 2017 09:05:58 -0700 From: Steven Rostedt To: Lionel Debieve Cc: , , , Subject: Re: [PATCH RT 1/1] remoteproc: Prevent schedule while atomic Message-ID: <20170322090558.72064144@vmware.local.home> In-Reply-To: <1490195923-9560-1-git-send-email-lionel.debieve@st.com> References: <1490195923-9560-1-git-send-email-lionel.debieve@st.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2997 Lines: 88 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 > --- > 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;