From nobody Fri Nov 12 11:34:38 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 6322E1849AB9 for ; Fri, 12 Nov 2021 11:34:42 +0000 (UTC) (envelope-from freebsd-usb@dino.sk) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4HrGhd4YYpz3rmF for ; Fri, 12 Nov 2021 11:34:41 +0000 (UTC) (envelope-from freebsd-usb@dino.sk) Received: from zeta.dino.sk (fw3.dino.sk [84.245.95.254]) (AUTH: LOGIN milan, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mailhost.netlabit.sk with ESMTPSA; Fri, 12 Nov 2021 12:34:39 +0100 id 00DCA80D.618E514F.00006864 Date: Fri, 12 Nov 2021 12:34:38 +0100 From: Milan Obuch To: freebsd-usb@freebsd.org Subject: Re: USBDMSC emulated device does not work on FreeBSD Message-ID: <20211112123438.6305fc56@zeta.dino.sk> In-Reply-To: <85cdc03e-e8f1-871c-6e1d-66181e45dcb1@selasky.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> X-Mailer: Claws Mail 3.18.0git295 (GTK+ 2.24.33; i386-portbld-freebsd11.4) 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4HrGhd4YYpz3rmF X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-usb@dino.sk designates 84.245.65.72 as permitted sender) smtp.mailfrom=freebsd-usb@dino.sk X-Spamd-Result: default: False [2.62 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dino.sk]; NEURAL_SPAM_MEDIUM(1.00)[0.998]; RCPT_COUNT_ONE(0.00)[1]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_SPAM_LONG(0.92)[0.923]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:5578, ipnet:84.245.64.0/18, country:SK]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N 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