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 671F0C001DE for ; Mon, 31 Jul 2023 11:44:29 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7968986A1E; Mon, 31 Jul 2023 13:44:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1690803867; bh=iVjcUjOqz6bst1pRcPxWJrMDjkMfQT80FHyCNbqGGWc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uXyXp+tkHYO7mh+BvSpZ6d4ciZgKtX35dXqA9Dj6j0BJQmlB7U/JAH1kPk94Qhcwi ubmMZpkxS2Ej2ArRsStgImlkmB6iOkWROL6Kc4ljOzypHnEBSr2QSIoIQPnd+iWDKH TwNuQa5tSao8MHZTZkkeSFhe8Zy6CvV4af55521HPz55KrIVRXmklQNzvkg2cyR2gK HVIYMFKuooZo3M2BaqNBTG1zwzE6wdWQd2LpBf5kS5Pzel4+8mlCHkiMe8IoR/nt7B UY3oVrYDGomHyxF4cczRt5lrkcEhz00JT81ok6Uu3L0wWw3865cIzAfDJ7AU1/t4At HyGtwPplyWyfg== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 531C9869DE; Mon, 31 Jul 2023 13:44:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1690803866; bh=iVjcUjOqz6bst1pRcPxWJrMDjkMfQT80FHyCNbqGGWc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=oZzVSN1fZFbgzE88ooeVxvchDaHJRgX06MKT4sHZsd4b2D9quz9fA+NpA1uAjJtkQ Nicd6AQ2rZzIJPmIYt+q+QhWw6+pGHx+eUtZ9fRO7EbrLtpyK3zUMwPBPN8LsXUe7Q T4K20K+AagXH6hZjHJiovi555vxMDXPqCh//tSIgk/G+Ga0g4rrpSMtHPnBqM5bUBS edkoOtflbiZERgkgmf3Grt4aZBSn5JRW2Qjn0CQVZoakjJYqBZ8t7ewm7PfSwe1dEY ic9HIQnQJ1VXUBXp80F/Wsiv13dqRw2SXrxNoJG2BNmjjYiKi261598r/xCdoeCgYp 1j2uwHkrgKkzQ== Message-ID: Date: Mon, 31 Jul 2023 13:44:25 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Subject: Re: [PATCH v3 1/4] cmd: bind: Add unbind command with driver filter To: Miquel Raynal Cc: u-boot@lists.denx.de, Kevin Hilman , Lukasz Majewski , Simon Glass References: <20230729145712.213945-1-marex@denx.de> <20230731113159.26e710aa@xps-13> Content-Language: en-US From: Marek Vasut In-Reply-To: <20230731113159.26e710aa@xps-13> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 7/31/23 11:31, Miquel Raynal wrote: > Hi Marek, > > marex@denx.de wrote on Sat, 29 Jul 2023 16:57:09 +0200: > >> Extend the driver core to perform lookup by both OF node and driver >> bound to the node. Use this to look up specific device instances to >> unbind from nodes in the unbind command. One example where this is >> needed is USB peripheral controller, which may have multiple gadget >> drivers bound to it. The unbind command has to select that specific >> gadget driver instance to unbind from the controller, not unbind the >> controller driver itself from the controller. >> >> USB ethernet gadget usage looks as follows with this change. Notice >> the extra 'usb_ether' addition in the 'unbind' command at the end. >> " >> bind /soc/usb-otg@49000000 usb_ether >> setenv ethact usb_ether >> setenv loadaddr 0xc2000000 >> setenv ipaddr 10.0.0.2 >> setenv serverip 10.0.0.1 >> setenv netmask 255.255.255.0 >> tftpboot 0xc2000000 10.0.0.1:test.file >> unbind /soc/usb-otg@49000000 usb_ether >> " >> >> Signed-off-by: Marek Vasut >> --- > > I am no longer getting wrong pointer dereferences, the SPL is working in > recovery mode, TFTP "File not found" errors are no longer a problem and > I did not experience any reset while tftp'ing regular files. > > One last remaining request on my side is the need for using fastboot as > well which does no longer work as-is: > > => fastboot usb 0 > couldn't find an available UDC > g_dnl_register: failed!, error: -19 > exit not allowed from main input shell. > > Can you advise what bind/unbind command would be necessary here? Either 'unbind usb_ether' or run 'dm tree' -> look up the path to usb_ether in the tree (it will be hanging under usb_peripheral or some such), and then use 'unbind '.