public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: stable@vger.kernel.org, kernel@pengutronix.de,
	Linus Walleij <linus.walleij@linaro.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: Re: please backport 833eacc7b5913da9896bacd30db7d490aa777868 to stable
Date: Tue, 6 Nov 2018 14:06:17 -0500	[thread overview]
Message-ID: <20181106190617.GG151445@sasha-vm> (raw)
In-Reply-To: <20181105104956.fwly3zflzg6wtoqy@pengutronix.de>

On Mon, Nov 05, 2018 at 11:49:56AM +0100, Uwe Kleine-K�nig wrote:
>Hello,
>
>on an mxs machine running a v4.9-rt kernel I saw the following
>backtrace:
>
>[   25.309794] BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:987
>[   25.309810] in_atomic(): 1, irqs_disabled(): 128, pid: 221, name: mrp62439d
>[   25.309834] CPU: 0 PID: 221 Comm: mrp62439d Not tainted 4.9.109-20180709-1-rt76-00043-g80a57dee2c6b-dirty #43
>[   25.309840] Hardware name: Freescale MXS (Device Tree)
>[   25.309913] [<c000fad8>] (unwind_backtrace) from [<c000df34>] (show_stack+0x18/0x1c)
>[   25.309957] [<c000df34>] (show_stack) from [<c0042924>] (___might_sleep+0xf8/0x164)
>[   25.309996] [<c0042924>] (___might_sleep) from [<c04ec920>] (rt_spin_lock+0x20/0x6c)
>[   25.310039] [<c04ec920>] (rt_spin_lock) from [<c02e5a20>] (gpio_to_desc+0x1c/0xbc)
>[   25.310076] [<c02e5a20>] (gpio_to_desc) from [<c02ec358>] (mxs_gpio_set_irq_type+0x114/0x194)
>[   25.310107] [<c02ec358>] (mxs_gpio_set_irq_type) from [<c00558d8>] (__irq_set_trigger+0x64/0x158)
>[   25.310132] [<c00558d8>] (__irq_set_trigger) from [<c0055f74>] (__setup_irq+0x5a8/0x694)
>[   25.310156] [<c0055f74>] (__setup_irq) from [<c0056408>] (request_threaded_irq+0xe4/0x18c)
>[   25.310187] [<c0056408>] (request_threaded_irq) from [<c02e8650>] (gpio_ioctl+0x304/0x680)
>[   25.310217] [<c02e8650>] (gpio_ioctl) from [<c01476a4>] (do_vfs_ioctl+0x98/0x970)
>[   25.310241] [<c01476a4>] (do_vfs_ioctl) from [<c0147fb8>] (SyS_ioctl+0x3c/0x64)
>[   25.310264] [<c0147fb8>] (SyS_ioctl) from [<c000a4d8>] (__sys_trace_return+0x0/0x10)
>
>The problem is that __irq_set_trigger is called in atomic context (even on rt)
>and mxs_gpio_set_irq_type calls gpio_get_value which takes the
>(sleeping on rt) gpio_lock.
>
>I didn't test 833eacc7b5913da9896bacd30db7d490aa777868 yet (I used
>
>	val = readl(port->base + PINCTRL_DIN(port)) & pin_mask;
>
>instead) but this commit should have the same effect.
>
>Can you please backport this? (There are maybe some more similar
>problems that were introduced in v4.5-rc1 / 0f4630f3720e7e, I didn't
>check these though.)

Queued for 4.9-4.19. Thank you.

--
Thanks,
Sasha

      reply	other threads:[~2018-11-07  4:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05 10:49 please backport 833eacc7b5913da9896bacd30db7d490aa777868 to stable Uwe Kleine-König
2018-11-06 19:06 ` Sasha Levin [this message]

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=20181106190617.GG151445@sasha-vm \
    --to=sashal@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=stable@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.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