From: Lionel Debieve <lionel.debieve@st.com>
To: <linux-rt-users@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <bigeasy@linutronix.de>, <tglx@linutronix.de>,
<rostedt@goodmis.org>, Lionel Debieve <lionel.debieve@st.com>
Subject: [PATCH RT 1/1] remoteproc: Prevent schedule while atomic
Date: Wed, 22 Mar 2017 16:18:43 +0100 [thread overview]
Message-ID: <1490195923-9560-1-git-send-email-lionel.debieve@st.com> (raw)
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:
[<c01790fc>] __handle_domain_irq+0x4c/0xec
CPU: 0 PID: 307 Comm: pulseaudio
Hardware name: STi SoC with Flattened Device Tree
[<c011046c>] (unwind_backtrace)
[<c010c7f4>] (show_stack)
[<c03d1578>] (dump_stack)
[<c014e440>] (___might_sleep)
[<c08e7f24>] (rt_spin_lock)
[<c069bb04>] (sti_mbox_disable_channel)
[<c069befc>] (sti_mbox_irq_handler)
[<c0179900>] (__handle_irq_event_percpu)
[<c01799dc>] (handle_irq_event_percpu)
[<c0179a78>] (handle_irq_event)
[<c017d1c8>] (handle_fasteoi_irq)
[<c0178c08>] (generic_handle_irq)
[<c017912c>] (__handle_domain_irq)
[<c0101488>] (gic_handle_irq)
Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
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;
--
2.7.4
next reply other threads:[~2017-03-22 15:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 15:18 Lionel Debieve [this message]
2017-03-22 16:05 ` Steven Rostedt
2017-03-22 17:15 ` Lionel DEBIEVE
2017-03-29 16:06 ` Sebastian Andrzej Siewior
2017-03-30 7:54 ` Lee Jones
2017-04-04 8:33 ` Lionel DEBIEVE
2017-03-22 17:37 ` Julia Cartwright
2017-03-22 18:01 ` Steven Rostedt
2017-03-22 18:30 ` Grygorii Strashko
2017-03-22 18:47 ` Julia Cartwright
2017-03-23 8:28 ` Lionel DEBIEVE
2017-03-23 10:26 ` Lee Jones
2017-03-23 20:51 ` Julia Cartwright
2017-03-28 9:31 ` Lee Jones
2017-03-24 8:38 ` Thomas Gleixner
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=1490195923-9560-1-git-send-email-lionel.debieve@st.com \
--to=lionel.debieve@st.com \
--cc=bigeasy@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®