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 6D717C001DE for ; Fri, 4 Aug 2023 17:23:16 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8312A86949; Fri, 4 Aug 2023 19:23:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="jH4CWQId"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4A6AD8694E; Fri, 4 Aug 2023 19:23:13 +0200 (CEST) Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9A7FA86945 for ; Fri, 4 Aug 2023 19:23:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-5860c7fc2fcso26870197b3.2 for ; Fri, 04 Aug 2023 10:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1691169788; x=1691774588; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=3sPC98usfoEFfCihq1iuPFwBI3QloMe/sXe+oq3uTpo=; b=jH4CWQIdQID2mQD+L4LhJwnE7IHz/IzNtEZ4erJ1rv9dy6JruLXIVmtBPGvbwJOM8N O+FyW0m2J+a7+Rz6Jcd9HJyVhjz6XfgthtPbQvWUlbgG13+zcqCf7DpxBYhDqzrHKDjy 8GapkqekM0BguXSVUysBmM06s6jsIGKr1DXlc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691169788; x=1691774588; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=3sPC98usfoEFfCihq1iuPFwBI3QloMe/sXe+oq3uTpo=; b=Z5Vxkv7mRK5r7O6ufWSebNpWiasZyrzvJRtdSgYCfwCDoI7u6/kKNiDQCO8GOYV+en FqbdRRAbSSPjaK7SrKMYN47bFfuo1H8p5s88nM1liWuoAIqYi0EXzLBfHPWqMeCRfVqu i9IhsqsvXzVjnVLejw/7+xXCbeRvIWhnTqinOigDJC5HZ+7OjirK5je7WPyA8NI5f3Cs 9ODdJUgXqlzncmoqGB4oMGPTxgb0VQ/jg4HNHHJcfN2D8mQ2VLFCKRaeGTUNA7bcP/6t XFP5pyPRnETen8cWJb4RjyZz1TnO7czHka169VUAFffMTMVmoUJ10KAzyBkJHXm353oj e9Yw== X-Gm-Message-State: AOJu0YyyVmdMWzNnLKduiBStpTvmQrYhf5O8fmLy1uIm9R6fP94/TYml i2Q06N0UwdKcqV+TyKVGkqfidA== X-Google-Smtp-Source: AGHT+IF9OqJq2zSzFDs/TT74Jdree+eVcyfasxHtNJfcUMMn+LPtemIojhx8uhx1wi70mfCWsfMvtQ== X-Received: by 2002:a0d:f581:0:b0:583:4f99:73ee with SMTP id e123-20020a0df581000000b005834f9973eemr3435913ywf.22.1691169788327; Fri, 04 Aug 2023 10:23:08 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-c37f-6e0c-fce7-d587.res6.spectrum.com. [2603:6081:7b00:6400:c37f:6e0c:fce7:d587]) by smtp.gmail.com with ESMTPSA id o190-20020a0de5c7000000b005732b228a83sm829392ywe.140.2023.08.04.10.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 10:23:07 -0700 (PDT) Date: Fri, 4 Aug 2023 13:23:05 -0400 From: Tom Rini To: Miquel Raynal Cc: Marek Vasut , u-boot@lists.denx.de, Kevin Hilman , Lukasz Majewski , Simon Glass Subject: Re: [PATCH v4 1/4] cmd: bind: Add unbind command with driver filter Message-ID: <20230804172305.GU3630934@bill-the-cat> References: <20230802124657.31184-1-marex@denx.de> <20230804090028.70aa780d@xps-13> <4833722f-18ab-e885-291a-988115fe39f8@denx.de> <20230804150100.GN3630934@bill-the-cat> <8902cf54-acba-cfb4-571b-09ba807e7a89@denx.de> <20230804171206.07faade4@xps-13> <0eb7f3fe-42da-6252-3b77-50eb3276f2ee@denx.de> <20230804180012.79c4f9ec@xps-13> <20230804163757.GS3630934@bill-the-cat> <20230804190431.6f21efd8@xps-13> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iSRIiSK6rgpVA+94" Content-Disposition: inline In-Reply-To: <20230804190431.6f21efd8@xps-13> X-Clacks-Overhead: GNU Terry Pratchett 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.8 at phobos.denx.de X-Virus-Status: Clean --iSRIiSK6rgpVA+94 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 04, 2023 at 07:04:31PM +0200, Miquel Raynal wrote: > Hi Tom, >=20 > > > > >>>>> Cannot find a device with path /ocp/usb@47400000/usb@47401000= =20 > > > > >>>>> =3D> unbind /ocp/usb@47400000/usb@47401000 > > > > >>>>> =3D> dm tree =20 > > > > >>>>> misc 0 [ + ] ti-musb-wrapper | |-- us= b@47400000 > > > > >>>>> usb 0 [ ] ti-musb-host | | `-= - usb@47401800 =20 > > > > >>>>> =3D> fastboot usb 0 > > > > >>>>> =3D> bind /ocp/usb@47400000/usb@47401000 ti-musb-peripheral > > > > >>>>> =3D> dm tree =20 > > > > >>>>> misc 0 [ + ] ti-musb-wrapper | |-- us= b@47400000 > > > > >>>>> usb 0 [ ] ti-musb-host | | |-= - usb@47401800 > > > > >>>>> usb 0 [ ] ti-musb-peripheral | | `-= - usb@47401000 =20 > > > > >>>>> =3D> fastboot usb 0 =20 > > > > >>>>> musb-hdrc: peripheral reset irq lost! > > > > >>>>> # works! (the irq-related line above as always been there) > > > > >>>>> > > > > >>>>> So now, how do we make this process easy/understandable? = =20 > > > > >>>> > > > > >>>> What would be your proposal ? =20 > > > > >=20 > > > > > At least I would appreciate: > > > > > - to select CMD_BIND "by default" when relevant > > > > > - to make the fastboot error more readable for the regular user = =20 > > > >=20 > > > > Since with this 'unbind ethernet 0' this is orthogonal to this seri= es, send separate patches, thanks. =20 > > >=20 > > > This is not orthogonal, I am sorry. > > >=20 > > > version X: > > > - tftp works "out of the box" > > > - fastboot works "out of the box" > > > version X+1: > > > - tftp works "out of the box" > > > - fastboot returns an obscure error > > >=20 > > > 1/ If we now *need* the bind/unbind commands, the series must take ca= re > > > of it. > > > 2/ Without proper error message you just break fastboot for most > > > regular users (basically everyone but few U-Boot devs). =20 > >=20 > > You're missing the class of users that will be impacted here. In order > > for there to be a change here, you have to already be in the case where > > you have CONFIG_USB_ETHER=3Dy and gadget ethernet device isn't just > > enabled but also initialized by default by calling usb_ether_init(). > > That's a very small list. It's basically am33xx, two mediatek reference > > platforms and xilinx_zynqmp_virt. Given that am33xx defconfigs also > > setup DFU, I'm not really sure just how many people use gadget ethernet. > > The normal flow on modern devices is to be calling bind/unbind here > > already. >=20 > Can we make this behavior explicit to the user? I am sorry, maybe it is > the normal flow for you, but I am a regular U-Boot user and I totally > missed that requirement. >=20 > Typical situation: one needs to use but none is bound > to the UDC (or another is bound), could we make the error messages more > explicit if we decide not to unbind/bind the right one automatically > because it is too "costly"? If you would like to improve this, yes, please do. The uncommon case is where gadget ethernet and fastboot/dfu/etc are also being used one after the other. The typical case is you just fastboot or dfu or whatever, and that command requires you to say what usb controller you're binding to and so works. --=20 Tom --iSRIiSK6rgpVA+94 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmTNM/kACgkQFHw5/5Y0 tyxW4QwAhH57urN44EeGLKukcBYXBsME0bhb+uUOD1ynEL6Yvjk9D2CpjMxx48ml eubnYSWRXdteYZTE4IdXbnMUh+nPAyLH7Ltgmv09cdRS1KWPrRuM4Ugvjt/M9ax1 0Nal4dJgax+AblwoWDOp9jsenPwfcCtW32TO76Da1ewQ6lH7pJ3CjXBEGCaRjTb6 ByUPudERTR0H11f4UqtkTrCwh1EQwyisaUnT/IHlp55MQksDzPxd0Ig6tJCOZA07 bq5E96AS9X7L0AkcYmtHetZpOEd3Vqa6uKAAJ/AC8aTkp6PxlF57mxh/J9DbYA9p iYwb/T449H8DjHInBHzSjuJzWV17iBYmeIM0naoaQR2NuCETo1EN7/dkB7W+VmDe PXl7+XhVFQKEEe0X9Mxr4029oIhxOLjtjUailWtsd+x0xgCAoLVD0QUwKSRZlGGJ rk9TVfWsgFLy7gBZtHKSXrSjaZ7at4DbtITLp0yFwS2s010w8dhydOYi8imN1Tak 4EZyGAoL =VCSR -----END PGP SIGNATURE----- --iSRIiSK6rgpVA+94--