From nobody Fri Nov 12 12:49:24 2021 X-Original-To: freebsd-usb@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 8FF5F185901B for ; Fri, 12 Nov 2021 12:49:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 4HrJLv37jbz4lbF for ; Fri, 12 Nov 2021 12:49:27 +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 4000C260483; Fri, 12 Nov 2021 13:49:26 +0100 (CET) Message-ID: Date: Fri, 12 Nov 2021 13:49:24 +0100 List-Id: FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-usb List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: USBDMSC emulated device does not work on FreeBSD Content-Language: en-US To: Milan Obuch , freebsd-usb@freebsd.org References: <20211112095915.226af6be@zeta.dino.sk> <6a6850f5-8233-aae7-8e65-42594402fcb5@selasky.org> <20211112120714.73f195a9@zeta.dino.sk> <972a650d-d490-1965-13a4-2fb984531f1d@selasky.org> <20211112121806.2db2a908@zeta.dino.sk> <85cdc03e-e8f1-871c-6e1d-66181e45dcb1@selasky.org> <20211112123438.6305fc56@zeta.dino.sk> From: Hans Petter Selasky In-Reply-To: <20211112123438.6305fc56@zeta.dino.sk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HrJLv37jbz4lbF 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 11/12/21 12:34, Milan Obuch wrote: > On Fri, 12 Nov 2021 12:20:45 +0100 > Hans Petter Selasky wrote: > >> On 11/12/21 12:18, Milan Obuch wrote: >>> On Fri, 12 Nov 2021 12:11:38 +0100 >>> Hans Petter Selasky wrote: >>> >>>> Hi, >>>> >>>>> kernel: ugen1.3: at usbus1 >>>>> >>>>> line in console (and later in dmesg). Relevant line in output of >>>>> 'usbconfig show_ifdrv' command is >>>>> >>>>> ugen1.3: at usbus1, >>>>> cfg=255 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA) >>>> >>>> cfg=255 means something very low level USB failed. It was not able >>>> to set the configuration number. >>>> >>>> Try: >>>> >>>> usbconfig -d ugen1.3 set_config 0 >>>> >>>> --HPS >>>> >>> >>> I tried, basically no change (no output on console, no change in >>> output of 'usbconfig show_ifdrv' command). >>> >>> Also, I tried 'usbconfig -d ugen1.3 dump_all_desc' just out of >>> curiosity, output is >>> >>> ugen1.3: at usbus1, cfg=255 >>> md=HOST spd=HIGH (480Mbps) pwr=ON (100mA) >>> >>> bLength = 0x0012 >>> bDescriptorType = 0x0001 >>> bcdUSB = 0x0200 >>> bDeviceClass = 0x0000 >>> bDeviceSubClass = 0x0000 >>> bDeviceProtocol = 0x0000 >>> bMaxPacketSize0 = 0x0008 >>> idVendor = 0x1514 >>> idProduct = 0x0001 >>> bcdDevice = 0x3000 >>> iManufacturer = 0x0001 >>> iProduct = 0x0002 >>> iSerialNumber = 0x0003 >>> bNumConfigurations = 0x0001 >>> >> >> Hi, >> >> I suspect the USB implementation in this device is buggy and not >> fully spec. compliant. >> >> You may try to set the UQ_NO_STRINGS quirk on this device and re-plug: >> >> usbconfig -d ugen1.3 add_quirk UQ_NO_STRINGS >> >> Then physically re-plug the device. >> >> --HPS >> > > I agree this device has buggy USB implementation - there is > > __assert_func(): services/mmc/mmc_api.c:214: HSS_MMC_ReadBlock() Assertion failed: ((size_t)srcOffset & (HSS_MMC_SECTOR_SIZE-1)) == 0u > > soon after 'usbdmsc' command execution (when connected to FreeBSD box). > That could explain it does not work :) > > Trying the command you wrote I get just > > Adding quirk 'UQ_NO_STRINGS' failed, continuing. > > I tested this on both 11.4 and 12.2 boxes. So I think something FreeBSD > did in early stage after discovering new device on USB bus disturbs > this device's USB stack badly and somehow it crashes (I need reset in > order to continue working with it). > > Regards, > Milan > There is also "usbdump -i usbus1 -f 3 -s 65536 -vvv" which may point at the exact command which is failing. -_HPS