From nobody Mon Feb 28 09:54:33 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2B4CA19F55C4; Mon, 28 Feb 2022 09:54:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4K6bMW70WLz4t8l; Mon, 28 Feb 2022 09:54:47 +0000 (UTC) (envelope-from hps@selasky.org) Received: from [10.36.2.165] (unknown [178.17.145.105]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0E78026012D; Mon, 28 Feb 2022 10:54:44 +0100 (CET) Message-ID: <60340b70-69bf-bdb2-728d-c91698f6c587@selasky.org> Date: Mon, 28 Feb 2022 10:54:33 +0100 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: git: 7520b88860d7 - main - usb(4): Automagically apply all quirks for USB mass storage devices. Content-Language: en-US To: Ruslan Bukin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202202240930.21O9UFKS055179@gitrepo.freebsd.org> From: Hans Petter Selasky In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4K6bMW70WLz4t8l X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On 2/28/22 10:19, Ruslan Bukin wrote: > On Sun, Feb 27, 2022 at 09:34:42PM +0100, Hans Petter Selasky wrote: >> On 2/27/22 20:48, Ruslan Bukin wrote: >>> Hi, >>> >>> I've an xhci issue with this change on my ARM Morello Board. >>> I've attached boot log. Can you look? >>> >>> Thanks. >>> >>> Ruslan >> >> Hi, >> >> The "xhci0: Resetting controller" indicates that the XHCI hardware >> halted. If you just need this device working, then just load >> usb_quirk.ko in /boot/loader.conf and add the same quirk there! >> >> man usb_quirk >> >> Maybe you can enable hw.usb.xhci.debug=17 from the loader during boot. >> If there is only one device it shouldn't spam the console too much. >> >> Sorry for the breakage. Seems to be related to xhci.c and probably its >> handling of the unconfigure command. >> > > Here is the output with xhcidebug = 17: > https://people.freebsd.org/~br/usb_issue_debug_17.txt > Can you look? I've unplugged mouse and keyboard, but left USB storage device. > Hi Ruslan, First this happens: > xhci_check_transfer: TD is last > xhci_generic_done: xfer=0xffff00012a7a7180 endpoint=0xffffa00006d55128 transfer done > xhci_generic_done_sub: xfer=0xffff00012a7a7180[0/2] rem=0/8 status=1 > xhci_generic_done_sub: xfer=0xffff00012a7a7180[1/2] rem=0/1 status=1 ^^^ the device returns 1 byte worth of data, and status=1 means success. > xhci_generic_done_sub: xfer=0xffff00012a7a7180[2/2] rem=0/0 status=1 > xhci_device_done: xfer=0xffff00012a7a7180, endpoint=0xffffa00006d55128, error=0 > xhci_interrupt_poll: event[86] = 32 (0x0000000086a77310 0x01000000 0x01018001) ^^^ 0x01 -> XHCI_TRB_ERROR_SUCCESS > xhci_check_transfer: slot=1 epno=1 remainder=0 status=1 This quirk gets set because the byte returned is zero, most likely. > usb_msc_auto_quirk: UQ_MSC_NO_GETMAXLUN set for USB mass storage device SanDisk Extreme (0x0781:0x5580) > xhci_device_generic_open: I suspect a CPU cache sync issue in busdma_dmamap_sync on your platform, as invoked by usb_pc_cpu_xxx(). Maybe you should print all the parameters for the intial usb_pc_cpu_xxx() calls? The LUN byte should be non-zero! Then comes the next problem: > xhci_cmd_set_tr_dequeue_ptr: > xhci_do_command: command[10] = 16 (0x0000000086a84001, 0x00000000, 0x01044000) > xhci_interrupt: real interrupt (status=0x00000008) > xhci_interrupt_poll: event[87] = 33 (0x000000008508ffa0 0x13000000 0x01008401) > xhci_check_command: Received command event > xhci_configure_reset_endpoint: Could not set dequeue ptr for endpoint 4 > xhci_cmd_configure_ep: 0x13 = XHCI_TRB_ERROR_CONTEXT_STATE as found in sys/dev/usb/controller/xhci*.h (Refer to xHCI_Specification_for_USB.pdf for more details) --HPS