Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1643686

[4.12 REGRESSION] pinctrl: rockchip: sleeping function called from atomic context

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Brian Norris <briannorris@chromium.org>
Newsgroups linux.kernel
Subject [4.12 REGRESSION] pinctrl: rockchip: sleeping function called from atomic context
Date Thu, 18 May 2017 01:00:02 +0200
Message-ID <tIg5c-OG-9@gated-at.bofh.it> (permalink)
X-Original-To Heiko Stuebner <heiko@sntech.de>, Linus Walleij <linus.walleij@linaro.org>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=fzPksiPJ4XNfMNo+lkt49srNg73glggUDhajzD7KPWI=; b=BbT7FTOvZr0HoGNdTQ3mMfJLfK2Pm1Mh0kP7eBbWkeqxAfbGaiu6ll2FnsCEw233wg vnflkpJZiTWCvWRTKnj0SHVaLl5hPZtNTic1wQz3giCBqCRzvKTuPbYoKD49HYCjARDA 8sBajWSp44DhRq/d9WnnhRQ7XLwvvEjBHxKyI=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=fzPksiPJ4XNfMNo+lkt49srNg73glggUDhajzD7KPWI=; b=VujilUUQCevMkNS4BoOiOHsDfcf6nJcIs4BlsySAL7v6pzOPih6tmCJXUkX8XlNmbL s7GSt6ABF8oz/WkLfHtgDQ5lx/9mV7e3S1qazBiqiD5PJ6xw9nutczsuONvLKsmzq1nU eyCcxEFqRuLxsIAHKiiuPBauHq85Gz/behxvz2CBagMqZl8zzTe9VjzoF4BDSVJuQhav 5Cyw5lmQ4Jd2gR+8hpSHIPxeLw6Bw7BBJiENb+NWx8timKaa1JakGDhyjCUD0zrxzqyz e6qmVyb498dmtmmd71Jn+tZE6gsOxi/Ak/Ied9Tst53AtZteM+Svh/4kSlMlpZVENwSz MIAw==
X-Gm-Message-State AODbwcBd0CaBdkBJ8ZIJrv70ij4VDU/ICevurt3gZzCBKmVpmoxeYs1Z EufqCd7MEjGHf1W4
X-Received by 10.107.131.97 with SMTP id f94mr1412223iod.40.1495061798564; Wed, 17 May 2017 15:56:38 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 37
Organization linux.* mail to news gateway
X-Original-Cc linux-rockchip@lists.infradead.org, Julia Cartwright <julia@ni.com>, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, John Keeping <john@metanate.com>, linux-pm@vger.kernel.org
X-Original-Date Wed, 17 May 2017 15:56:35 -0700
X-Original-Message-ID <20170517225634.GA11404@google.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1643686

Show key headers only | View raw


Hi,

Looks like we've added a mutex in the ->bus_lock() callback for
Rockchip's pinctrl irqchip, which triggers a CONFIG_DEBUG_ATOMIC_SLEEP
warning when entering system suspend:

[  151.406483] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:238
[  151.420321] in_atomic(): 0, irqs_disabled(): 0, pid: 2447, name: cat
[  151.427457] CPU: 2 PID: 2447 Comm: cat Tainted: G        W     4.12.0-rc1+
[  151.435922] Hardware name: Google Kevin (DT)
[  151.440687] Call trace:
[  151.443440] [<ffffff900808b2fc>] dump_backtrace+0x0/0x2b8
[  151.449485] [<ffffff900808b5d4>] show_stack+0x20/0x28
[  151.455137] [<ffffff900848f738>] dump_stack+0xa4/0xcc
[  151.460797] [<ffffff90080e3118>] ___might_sleep+0x16c/0x188
[  151.467036] [<ffffff90080e31f4>] __might_sleep+0xc0/0xd4
[  151.472979] [<ffffff9008a70ca0>] mutex_lock+0x2c/0x68
[  151.478637] [<ffffff90084e806c>] rockchip_irq_bus_lock+0x48/0x54
[  151.485364] [<ffffff900811e3ac>] __irq_get_desc_lock+0x9c/0xc8
[  151.491895] [<ffffff900811fa3c>] irq_set_irq_wake+0x44/0x178
[  151.498235] [<ffffff900860d190>] dev_pm_arm_wake_irq+0x78/0x84
[  151.504769] [<ffffff90086137bc>] device_wakeup_arm_wake_irqs+0x48/0x70
[  151.512077] [<ffffff90086109c8>] dpm_suspend_noirq+0x180/0x51c
[  151.518608] [<ffffff90081171a4>] suspend_devices_and_enter+0x1dc/0xde4
[  151.525914] [<ffffff90081187a4>] pm_suspend+0x9f8/0xa38
[...]

The warning goes away if I revert commit 88bb94216f59 ("pinctrl:
rockchip: avoid hardirq-unsafe functions in irq_chip").

The thing is, the documentation (and apparent design) suggest that
calling sleeping functions from ->irq_bus_lock() is perfectly valid. I'm
not 100% following the ___might_sleep() logic, but is this complaining
because of the RCU read locking in device_wakeup_arm_wake_irqs()? I have
CONFIG_PREEMPT_RCU and CONFIG_PREEMPT enabled, FWIW.

Brian

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[4.12 REGRESSION] pinctrl: rockchip: sleeping function called from  atomic context Brian Norris <briannorris@chromium.org> - 2017-05-18 01:00 +0200

csiph-web