Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp765237ybl; Fri, 13 Dec 2019 04:20:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzN6x1AFw5e+RPekIzuIx1YWbOy7iso0qpSctIUtfnQ3u26x0cXRbqeOmqVshLQlzdFUOQF X-Received: by 2002:a9d:bcb:: with SMTP id 69mr14608605oth.290.1576239615754; Fri, 13 Dec 2019 04:20:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576239615; cv=none; d=google.com; s=arc-20160816; b=y05w+qfOv6pBzVwVX5asktKuMUwk3ESSA959EEE8+YwtbJcdRYB8d6vDAtR+rxNvGf klov4dKa1HlQ1rJH+zUPtzyaAc539FeM7Qxxf2w4SDUg/LoCCmp0XPaBf+c7hQ4VNHnV Sciz5ioIFcK9F7ULkAjWF2CqJbS5mq3bWJXHHoAwbSuOMOf1HmwXt+ixN/VANfCG9jg8 w720UevH/ZRSVSFG+5Rjbazch9+knVCeElYTEIBCL6Nhz8nGHMrjvNCUAbAu+pCTwgUM hBUWgjmLMJJbzRQPIrCWMuaISVwbFG6RX0dwvy8crD58Jh3tR7rdhXTM/Cfj74dfc2Lr m7Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:autocrypt :from:references:cc:to:subject; bh=L3zlWBl8Sd2jqYbYIm0wjIEsWBw/r2QE814SC4zgXHs=; b=vcELLJDw8Zy1AWxYhUEVel+uriPbBGmWkfG0rKTIOp07t3PLbTyPNvyg7u1bi/1djA xTJPvHEyk2YnNm+4higqv3qHBFjFq17GOvJv95eheu6HD6L58q1KZ+/9/7ibPW57/B2A zmOPbBIULY0AqRmkX4KWxCBv6VMgLczLcD+WUgYhSTdz25DwgJ0r/rFwR1LBDXxzj/fE PkrRt+3WrZOF6QM5tYG8xIgikwx2YnFJfIIYvKfMJSqhW706/6MwLm5PRPw2oxlsGH1A +2oZ0ULfeSZqjzNwP3+DE6WbGOvhpwNqOUfDmb0qK2qwjGV8Y3l2T4C82gUL/P6aHwUE Jp5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7si4933214oih.237.2019.12.13.04.20.03; Fri, 13 Dec 2019 04:20:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726903AbfLMMTV (ORCPT + 99 others); Fri, 13 Dec 2019 07:19:21 -0500 Received: from comms.puri.sm ([159.203.221.185]:39646 "EHLO comms.puri.sm" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfLMMTV (ORCPT ); Fri, 13 Dec 2019 07:19:21 -0500 Received: from localhost (localhost [127.0.0.1]) by comms.puri.sm (Postfix) with ESMTP id 2DD12DFFA3; Fri, 13 Dec 2019 04:19:19 -0800 (PST) Received: from comms.puri.sm ([127.0.0.1]) by localhost (comms.puri.sm [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nOpD2ZPraf31; Fri, 13 Dec 2019 04:19:18 -0800 (PST) Subject: Re: suspend problem with dwc3 gadget / g_multi when usb disconnected To: Felipe Balbi , linux-usb@vger.kernel.org, gregkh@linuxfoundation.org Cc: kernel@puri.sm, linux-kernel@vger.kernel.org, p.zabel@pengutronix.de References: <38edc05e-680b-d881-49fc-e8230a93b2c8@puri.sm> <87blsgl88s.fsf@gmail.com> <87fthpwwdk.fsf@kernel.org> From: Martin Kepplinger Autocrypt: addr=martin.kepplinger@puri.sm; keydata= mQINBFULfZABEADRxJqDOYAHfrp1w8Egcv88qoru37k1x0Ugy8S6qYtKLAAt7boZW+q5gPv3 Sj2KjfkWA7gotXpASN21OIfE/puKGwhDLAySY1DGNMQ0gIVakUO0ji5GJPjeB9JlmN5hbA87 Si9k3yKQQfv7Cf9Lr1iZaV4A4yjLP/JQMImaCVdC5KyqJ98Luwci1GbsLIGX3EEjfg1+MceO dnJTKZpBAKd1J7S2Ib3dRwvALdiD7zqMGqkw5xrtwasatS7pc6o/BFgA9GxbeIzKmvW/hc3Q amS/sB12BojyzdUJ3TnIoAqvwKTGcv5VYo2Z+3FV+/MJVXPo8cj2vmfxQx1WG4n6X0pK4X8A BkCKw2N/evMZblNqAzzGVtoJvqQYkzQ20Fm+d3wFl6lS1db4MB+kU13G8kEIE22Q3i6kx4NA N49FLlPeDabGfJUyDaZp5pmKdcd7/FIGH/HjShjx7g+LKSwWNMkDygr4WARAP4h8zYDZuNqe ofPvMLqJxHeexBPIGF/+OwMyTvM7otP5ODuFmq6OqjNPf1irJmkiFv3yEa+Ip0vZzwl4XvrZ U0IKjSy2rbRLg22NsJT0XVZJbutIXYSvIHGqSxzzfiOOLnRjR++fbeEoVlRJ4NZHDKCh3pJv LNd+j03jXr4Rm058YLgO7164yr7FhMZniBJw6z648rk8/8gGPQARAQABtC1NYXJ0aW4gS2Vw cGxpbmdlciA8bWFydGluLmtlcHBsaW5nZXJAcHVyaS5zbT6JAk4EEwEIADgWIQTyCCuID55C OTRobj9QA5jfWrOH0wUCXPSlkwIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRBQA5jf WrOH06/FEACC/GTz88DOdWR5JgghjtOhaW+EfpFMquJaZwhsaVips7ttkTKbf95rzunhkf2e 8YSalWfmyDzZlf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6fae-d7bd-8d2b3e0626e9@puri.sm> Date: Fri, 13 Dec 2019 13:19:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: <87fthpwwdk.fsf@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12.12.19 13:39, Felipe Balbi wrote: > > Hi, > > Martin Kepplinger writes: >> [ 64.405226] Modules linked in: rfkill st_magn_spi st_sensors_spi >> mousedev qmi_wwan caam_jr caamhash_desc caamalg_desc cdc_wdm option >> usbnet usb_wwan mii usbserial st_magn_i2c st_magn st_sensors_i2c >> st_sensors industrialio_triggered_buffer goodix kfifo_buf tcpci tcpm >> roles imx2_wdt watchdog aes_ce_blk crypto_simd typec bq25890_charger >> caam imx_sdma virt_dma error crct10dif_ce ghash_ce sha2_ce sha1_ce >> gpio_vibra usb_f_acm u_serial usb_f_rndis g_multi usb_f_mass_storage >> u_ether libcomposite ip_tables x_tables ipv6 nf_defrag_ipv6 >> xhci_plat_hcd xhci_hcd usbcore dwc3 snvs_pwrkey ulpi udc_core >> phy_fsl_imx8mq_usb usb_common >> [ 64.462126] CPU: 3 PID: 884 Comm: ip Not tainted >> 5.5.0-rc1-next-20191212-librem5-00019-g4fb81fdd9c7d #1 >> [ 64.471909] Hardware name: Purism Librem 5 devkit (DT) >> [ 64.477264] pstate: 60000085 (nZCv daIf -PAN -UAO) >> [ 64.482268] pc : dwc3_stop_active_transfer.constprop.38+0xe8/0x100 [dwc3] >> [ 64.489351] lr : dwc3_stop_active_transfer.constprop.38+0x64/0x100 [dwc3] >> [ 64.496421] sp : ffff00009f213240 >> [ 64.499874] x29: ffff00009f213240 x28: 0000000000000000 >> [ 64.505410] x27: ffff00009f2137b0 x26: ffff0000a4e0cc10 >> [ 64.510946] x25: 0000000000000001 x24: ffff0000a324518c >> [ 64.516482] x23: ffff0000a3245193 x22: ffff0000a41f0080 >> [ 64.522018] x21: 0000000000000000 x20: ffff0000a4176600 >> [ 64.527553] x19: ffff800010ee87c8 x18: 0000000000000000 >> [ 64.533089] x17: 0000000000000000 x16: 0000000000000000 >> [ 64.538625] x15: 0000000000000000 x14: 0000000000000000 >> [ 64.544160] x13: ffff0000a4176868 x12: ffff0000a4176868 >> [ 64.549696] x11: ffffffffffff3f08 x10: 0000000000000008 >> [ 64.555232] x9 : ffffffffffff3f04 x8 : 0000000000000811 >> [ 64.560767] x7 : ffffffffffff3f00 x6 : ffffffffffff3f0c >> [ 64.566303] x5 : 0000000000000000 x4 : ffff80001007483c >> [ 64.571839] x3 : 0000000000000808 x2 : ffff00009f21327c >> [ 64.577375] x1 : 0000000000000040 x0 : 00000000ffffff92 >> [ 64.582911] Call trace: >> [ 64.585474] dwc3_stop_active_transfer.constprop.38+0xe8/0x100 [dwc3] >> [ 64.592194] __dwc3_gadget_ep_disable+0x34/0x380 [dwc3] >> [ 64.597649] dwc3_gadget_ep_disable+0x44/0xf8 [dwc3] >> [ 64.602841] usb_ep_disable+0x34/0x100 [udc_core] >> [ 64.607749] eth_stop+0xb4/0x130 [u_ether] >> [ 64.612026] __dev_close_many+0xb4/0x138 >> [ 64.616116] __dev_change_flags+0xb8/0x1d0 >> [ 64.620385] dev_change_flags+0x28/0x68 >> [ 64.624384] do_setlink+0x30c/0xc90 >> [ 64.628021] __rtnl_newlink+0x3f8/0x788 >> [ 64.632018] rtnl_newlink+0x54/0x80 >> [ 64.635654] rtnetlink_rcv_msg+0x128/0x370 >> [ 64.639926] netlink_rcv_skb+0x60/0x120 >> [ 64.643924] rtnetlink_rcv+0x1c/0x28 >> [ 64.647650] netlink_unicast+0x1b8/0x278 >> [ 64.651739] netlink_sendmsg+0x1ac/0x3b0 >> [ 64.655829] ____sys_sendmsg+0x250/0x298 >> [ 64.659918] ___sys_sendmsg+0x88/0xc8 >> [ 64.663735] __sys_sendmsg+0x70/0xc0 >> [ 64.667463] __arm64_sys_sendmsg+0x28/0x30 >> [ 64.671736] el0_svc_common.constprop.3+0x98/0x170 >> [ 64.676729] el0_svc_handler+0x20/0x28 >> [ 64.680638] el0_sync_handler+0x134/0x1a0 >> [ 64.684817] el0_sync+0x140/0x180 >> [ 64.688271] ---[ end trace 4f6aa846a9c6f20c ]--- >> >> ... again. at every shutdown or rmmod. >> >> I hope that this might be already helpful. > > I need to see the trace events for this failure case too. You could add > ftrace_dump_on_oops to your cmdline and change the WARN_ONCE() to a > BUG_ON() or something. > doing that and having "ftrace=function ftrace_dump_on_oops" dumps way too much to handle and somehow my board resets while printing... I found I can avoid the above error during shutdown though by keeping a few regulators enabled for now. I'm not entirely sure if that's a dwc3 problem now, so let's leave the above for now. Back to my first issue: disconnected USB and suspend: I disable all gadget configs now. "echo mem > /sys/power/state" still only hangs the system - again: all that's in the logs is: [ 97.405251] PM: suspend entry (deep) and on the console then: [ 118.608738] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: [ 118.615093] rcu: 1-...0: (0 ticks this GP) idle=e86/1/0x4000000000000000 softirq=16109/16109 fqs=2626 [ 181.628739] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: [ 181.635088] rcu: 1-...0: (0 ticks this GP) idle=e86/1/0x4000000000000000 softirq=16109/16109 fqs=10503 [ 244.648738] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks: [ 244.655087] rcu: 1-...0: (0 ticks this GP) idle=e86/1/0x4000000000000000 softirq=16109/16109 fqs=17402 ... not sure how to further debug that.