From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Chen Subject: Re: usb: chipidea: udc: BUG: sleeping function called from invalid context Date: Thu, 5 Mar 2020 02:12:24 +0000 Message-ID: <20200305021226.GA12837@b29397-desktop> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Language: en-US Content-ID: Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Dmitry Osipenko Cc: "linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" List-Id: linux-tegra@vger.kernel.org On 20-03-04 19:10:08, Dmitry Osipenko wrote: > Hello, >=20 > I was trying out today's linux-next-20200304 and noticed this splat in KM= SG: >=20 > [ 1.161244] BUG: sleeping function called from invalid context at > drivers/base/power/runtime.c:1075 > [ 1.161393] in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: > 37, name: kworker/u8:1 > [ 1.161481] CPU: 1 PID: 37 Comm: kworker/u8:1 Not tainted > 5.6.0-rc4-next-20200304-00181-gbebfd2a5be98 #1588 > [ 1.161616] Hardware name: NVIDIA Tegra SoC (Flattened Device Tree) > [ 1.161769] Workqueue: ci_otg ci_otg_work > [ 1.161882] [] (unwind_backtrace) from [] > (show_stack+0x11/0x14) > [ 1.162035] [] (show_stack) from [] > (dump_stack+0x85/0x94) > [ 1.162132] [] (dump_stack) from [] > (___might_sleep+0xeb/0x118) > [ 1.162281] [] (___might_sleep) from [] > (__pm_runtime_resume+0x75/0x78) > [ 1.162427] [] (__pm_runtime_resume) from [] > (ci_udc_pullup+0x23/0x74) > [ 1.162575] [] (ci_udc_pullup) from [] > (usb_gadget_connect+0x2b/0xcc) > [ 1.162665] [] (usb_gadget_connect) from [] > (ci_hdrc_gadget_connect+0x59/0x104) > [ 1.162807] [] (ci_hdrc_gadget_connect) from [] > (ci_udc_vbus_session+0x43/0x48) > [ 1.162949] [] (ci_udc_vbus_session) from [] > (usb_gadget_vbus_connect+0x17/0x9c) > [ 1.163089] [] (usb_gadget_vbus_connect) from [] > (ci_otg_work+0xbd/0x128) > [ 1.163245] [] (ci_otg_work) from [] > (process_one_work+0x149/0x404) > [ 1.163335] [] (process_one_work) from [] > (worker_thread+0xf7/0x3bc) > [ 1.163479] [] (worker_thread) from [] > (kthread+0xf3/0x118) > [ 1.163621] [] (kthread) from [] > (ret_from_fork+0x11/0x34) >=20 > I haven't tried to figure out what change causes this problem, it didn't > happen using next-20200218. Please take a look, thanks in advance. Dmitry, thanks for reporting. I haven't met that issue, it maybe I enable runtime pm, but you have not? So I don't trigger "dev->power.runtime_status !=3D RPM_ACTIVE" condition below might_sleep_if(!(rpmflags & RPM_ASYNC) && !dev->power.irq_safe && dev->power.runtime_status !=3D RPM_ACTIVE); I send the fix patch, but git send-email seems doesn't add auto cc according to reported-by tag, so you are not at cc list. Would you please have a test? --=20 Thanks, Peter Chen=