From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CF44C678D4 for ; Thu, 2 Mar 2023 18:52:00 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8F93985A1D; Thu, 2 Mar 2023 19:51:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=jannau.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id ECC8385B2A; Thu, 2 Mar 2023 19:51:56 +0100 (CET) Received: from soltyk.jannau.net (soltyk.jannau.net [144.76.91.90]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0DD0785A1D for ; Thu, 2 Mar 2023 19:51:54 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=jannau.net Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=janne@jannau.net Received: by soltyk.jannau.net (Postfix, from userid 1000) id A93E426F841; Thu, 2 Mar 2023 19:51:53 +0100 (CET) Date: Thu, 2 Mar 2023 19:51:53 +0100 From: Janne Grunau To: Marek Vasut Cc: Simon Glass , bluetail , Bin Meng , Mark Kettenis , Tom Rini , u-boot@lists.denx.de Subject: Re: u-boot crashes if mass-storage devices are connected via USB-C Message-ID: <20230302185153.GE24656@jannau.net> References: <322414817369964463b2ffd89ff1989f@posteo.net> <79b7c4da-eae4-2e9c-585e-ae10f5bb0489@denx.de> <20230302091413.GD24656@jannau.net> <1229fb53-96b0-a4bc-f126-6563b4cff24d@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1229fb53-96b0-a4bc-f126-6563b4cff24d@denx.de> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On 2023-03-02 18:33:15 +0100, Marek Vasut wrote: > On 3/2/23 10:14, Janne Grunau wrote: > > On 2023-03-01 23:51:14 +0100, Marek Vasut wrote: > > > On 3/1/23 21:34, Simon Glass wrote: > > > > +Marek Vasut +Bin Meng +Mark Kettenis +Tom Rini > > > > > > > > On Wed, 1 Mar 2023 at 08:12, bluetail wrote: > > > > > > > > > > Essentially, I connect a mass-storage device to the USB-C port of a Mac > > > > > Mini 2020 (M1), and it leads to the issue in the attachment. > > > > > I was able to reproduce it with Icy Box IB-3810 and ICY BOX IB-3805. > > > > > Initially I thought this issue was only for some devices (also attached > > > > > here) https://github.com/AsahiLinux/u-boot/issues/4 but it appears this > > > > > might be a issue that is with many devices. > > > > > > > > > > If you need any more information, please feel free to ask. I am very > > > > > eager to have this issue fixed because it seems to be a very broad issue > > > > > with mass media storage in general. > > > > > uname-r returns 6.1.0-asahi-2-2-edge-ARCH > > > Would it be possible to check whether current u-boot/master works any better > > > > Reproduced with b0eda49bc9b0 ("Merge tag 'u-boot-at91-fixes-2023.04-a' > > of https://source.denx.de/u-boot/custodians/u-boot-at91") and Icy Box > > IB-3804-C31 (same design as IB-3805/IB-3810 but just a single 4 port > > USB3 hub + 4 independent asmedia usb3 to sata converters). > > > > | scanning bus usb@b02280000 for devices... Device NOT ready > > | Request Sense returned 02 3A 00 > > | Device NOT ready > > | Request Sense returned 02 3A 00 > > | Resetting EP 0... > > | WARN halted endpoint, queueing URB anyway. > > | Unexpected XHCI event TRB, skipping... (c9208350 0000010f 13000000 04008401) > > | "Synchronous Abort" handler, esr 0x96000005 > > | elr: 000000000003934c lr : 000000000003934c (reloc) > > | elr: 0000010fcd24034c lr : 0000010fcd24034c > > Could you decode the trace and check where exactly this exception occurred ? > > It should be enough to run "aarch64-...-objdump -lSD u-boot | less" on the > U-Boot which matches the one which generated the trace, and then look up the > lr/elr address in that trace. That should point you to the exact place in > code where the exception occurred . Slightly different binary due to unrelated chnages: | scanning bus usb@702280000 for devices... 1 USB Device(s) found | scanning bus usb@b02280000 for devices... 1 USB Device(s) found | scanning bus usb@f02280000 for devices... 1 USB Device(s) found | scanning bus usb@1302280000 for devices... 2 USB Device(s) found | scanning bus usb@702280000 for devices... 1 USB Device(s) found | scanning bus usb@b02280000 for devices... Resetting EP 0... | WARN halted endpoint, queueing URB anyway. | Unexpected XHCI event TRB, skipping... (c92247b0 0000010f 13000000 02008400) | "Synchronous Abort" handler, esr 0x96000005 | elr: 0000000000039d9c lr : 0000000000039d9c (reloc) | elr: 0000010fcd240d9c lr : 0000010fcd240d9c | x0 : 0000000000000000 x1 : 00000000000003e8 | x2 : 0000000000000040 x3 : 000000000000003f | x4 : 0000010fc9223040 x5 : 0000010fc921ef90 | x6 : 0000000000001800 x7 : 00000000300c0300 | x8 : 0000000000000424 x9 : 0000000000000008 | x10: 00000000ffffffe8 x11: 0000000000000010 | x12: 0000000000010000 x13: 0000000000000001 | x14: 0000010fc91ba320 x15: 0000000000000021 | x16: 0000010fcd23addc x17: 0000000000000040 | x18: 0000010fc91e7d70 x19: 0000010fc9223040 | x20: 0000010fc9234b20 x21: 0000000000000002 | x22: 0000010fc9233790 x23: 0000000000000080 | x24: 0000000000000000 x25: 0000010fc91b9d00 | x26: 0000010fc91b9d00 x27: 0000010fc9233790 | x28: 0000000000000000 x29: 0000010fc91b99b0 | | Code: 97ffff3c 52800401 aa1303e0 97ffffa2 (b9400c00) objdump -lSD u-boot | grep -C 12 ' 39d9c' | Disassembly of section .text_rest: | ... | 39d84: f9400c36 ldr x22, [x1, #24] | /home/janne/src/asahi/u-boot/drivers/usb/host/xhci-ring.c:544 | xhci_queue_command(ctrl, 0, udev->slot_id, ep_index, TRB_STOP_RING); | 39d88: d2800001 mov x1, #0x0 // #0 | 39d8c: 97ffff3c bl 39a7c | /home/janne/src/asahi/u-boot/drivers/usb/host/xhci-ring.c:546 | event = xhci_wait_for_event(ctrl, TRB_TRANSFER); | 39d90: 52800401 mov w1, #0x20 // #32 | 39d94: aa1303e0 mov x0, x19 | 39d98: 97ffffa2 bl 39c20 | /home/janne/src/asahi/u-boot/drivers/usb/host/xhci-ring.c:547 | field = le32_to_cpu(event->trans_event.flags); | 39d9c: b9400c00 ldr w0, [x0, #12] | /home/janne/src/asahi/u-boot/drivers/usb/host/xhci-ring.c:548 | BUG_ON(TRB_TO_SLOT_ID(field) != udev->slot_id); | 39da0: b9494681 ldr w1, [x20, #2372] | 39da4: 6b40603f cmp w1, w0, lsr #24 | 39da8: 54000180 b.eq 39dd8 // b.none | /home/janne/src/asahi/u-boot/drivers/usb/host/xhci-ring.c:548 (discriminator 1) | 39dac: 90000143 adrp x3, 61000 | 39db0: 913d0863 add x3, x3, #0xf42 | 39db4: 52804482 mov w2, #0x224 // #548 | /home/janne/src/asahi/u-boot/drivers/usb/host/xhci-ring.c:549 (discriminator 1) | BUG_ON(TRB_TO_EP_INDEX(field) != ep_index); | 39db8: b0000181 adrp x1, 6a000 not immediately obvious to me what's the problem. x0 looks valid before the ldr. best regards Janne