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 52A80C4332F for ; Thu, 15 Dec 2022 05:59:27 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7FB3785490; Thu, 15 Dec 2022 06:59:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (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=1671083965; bh=t75EXWU95nVXUbMHbRIgNNQFoQ2Ec3ivNS5/gYf3fM8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=hnejFxZP7W//OHgjnfifHyx1Q/ujByZz8pImWDrvuwQDtfVYRHWdJH5J5HRWTFmaP 6mBRqRMi6hMUOgIqcsbj7A1n9ywXZIAPYjmcjmlmx4k9T6NU2k7nWPmg3etI6FN6qB 8bCnygyKfVA7/tp8ytxPlOKCK7y6ZsKWW83CcMRQQL2F8ChULe25K1t35TJHwS7/ig INC3cnQIVfCygmCkfupWlzCnZHbRIc/94IGMjAF6R0JwVKkkPNJBOkocWQG+aKFkj1 CpTXjIkYOleIjU28MNUcKp+2fS/LQEAXAwMxAOHl5Ku1A1NfZE3Xeyrwiw23WPGqGi +N5D5p02Q594Q== 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 EFF7E8544A; Thu, 15 Dec 2022 06:59:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1671083964; bh=t75EXWU95nVXUbMHbRIgNNQFoQ2Ec3ivNS5/gYf3fM8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=C3sZvyuWeVUoYx8xf2GlzK2EbzR8tzY2atXp/3KsuGf/kIeGErPR5zJEszxCJgzYt k+pExHnMa1aoDLZBBxXo/wLmhYNQpPpPozNTuAKMveIyqUicFw0lH5U7Tx1ZZeqg0q XuH8AIq87UnZwtyP118mvi6x54P6byiBUnCxsFCLU3WvPImMHAImVpDz4MLMMvDuKK 7sWOXALGDiMQ3ng/PpTfHJ/nbMznjbtNXSFSvskcGmqJy9jpcMjD3TdQuaxYF89ayZ wsj0y+sAlPUC+zAjjlOPOCXTrV9ZNLHR6HaxV6kBS4BxsXl545ek38+p82oydmXcks wS0dDKIm9fyqw== Message-ID: <93348484-8ea4-24fb-7983-668d898c2c9e@denx.de> Date: Thu, 15 Dec 2022 06:58:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] usb: gadget: ether: split start/stop from init/halt Content-Language: en-US To: Niel Fourie , u-boot@lists.denx.de Cc: Lukasz Majewski , Ramon Fried References: <20221212152945.1870385-1-lusus@denx.de> <20221212152945.1870385-2-lusus@denx.de> <85189f43-e216-0cfd-fec9-a38b0e0bab12@denx.de> From: Marek Vasut In-Reply-To: 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.6 at phobos.denx.de X-Virus-Status: Clean On 12/13/22 12:01, Niel Fourie wrote: > Hi Marek, Hi, > On 12/12/2022 17:46, Marek Vasut wrote: >> On 12/12/22 16:29, Niel Fourie wrote: >>> Split out _usb_eth_start() from _usb_eth_init() and >>> usb_eth_stop() from _usb_eth_halt(). Now _usb_eth_init() only >>> initialises and registers the gadget device, which _usb_eth_halt() >>> reverses, and together are used for probing and removing the >>> device. The _usb_eth_start() and _usb_eth_stop() functions connect >>> and disconnect the gadget as expected by the start()/stop() >>> callbacks. >>> >>> Previously the gadget device was probed on every start() and >>> removed on every stop(), which is inconsistent with other DM_ETH >>> drivers. For non-DM gadget drivers the old behaviour has been >>> retained. >> >> Does this mean the udevice pointer and associated private date are >> retained during the entire operation of the USB gadget , i.e. even >> between stop/start cycles ? > > In the DM_ETH case, yes. The drivers/devices remain registered the whole > time between _usb_eth_init() and _usb_eth_halt(), and the need for > revalidating the private data pointer falls away as was done in my > previous patch. Perfect. > I tested this on imx8mp with the dwc3 gadget driver, and the data > structures, specifically the private data, remained intact from probe() > until remove(). I also tested that probing again after removal works as > expected. Excellent. [...] Should "[PATCH v2] net: eth-uclass: revalidate priv after stop() in eth_halt()" be dropped ? It seems this patch fully replaces it.