From mboxrd@z Thu Jan 1 00:00:00 1970 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 E8606C433EF for ; Mon, 22 Nov 2021 11:54:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 26EC782058; Mon, 22 Nov 2021 12:54:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="U13ZPSYX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 816F0815A8; Mon, 22 Nov 2021 12:54:19 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D96DD82058 for ; Mon, 22 Nov 2021 12:54:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: by mail.kernel.org (Postfix) with ESMTPSA id 1B3F860F6B; Mon, 22 Nov 2021 11:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637582054; bh=Dt3wcgt3hJIo0APqP03WLpyJHVpvs5u1e74Y00lKu+o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U13ZPSYXrcRgQ+Y6WDfbcxICOCoe3XOc9LJV6DFdgCjUq9882pP3UaQDNmz553cbH 2Tqb+ruXgDofj5IcjsQiwxpMCW/OO7p63v9yT16oTgh/McQkfLQQKXjGtgwFBBA9s4 VMnFXHLMx7Pqf0wzhdArLQwpq8OTdVNaw8/6DP/cLt7jWkZ/QNfEGL+Zmujl6LR7N+ FpOcs1P6s5eRV9Z9DAPLpPKF/YulB9TZMW+3oqm/Tp8v5O2bddHqby6vKFgy8EiDrE CqFqnvVoT/fBMmpxUE4JVA/ruFWqK38A62Xr7CSgkPmIZKboPAU8asR1kPWo0U828Q PGmqTGpkqPs5g== Received: by pali.im (Postfix) id A2A23A87; Mon, 22 Nov 2021 12:54:11 +0100 (CET) Date: Mon, 22 Nov 2021 12:54:11 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Loic Poulain Cc: marex@denx.de, u-boot@lists.denx.de, lukma@denx.de Subject: Re: [PATCH 3/3] cmd: add acmconsole command Message-ID: <20211122115411.clyrucvmq7rc4acz@pali> References: <1629371586-9349-1-git-send-email-loic.poulain@linaro.org> <1629371586-9349-3-git-send-email-loic.poulain@linaro.org> <20210927200410.yermgu4vwtkb2zzw@pali> <20211116193614.axibh6qvl46viepx@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.37 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.2 at phobos.denx.de X-Virus-Status: Clean On Monday 22 November 2021 11:33:15 Loic Poulain wrote: > Hi Pali, > > On Tue, 16 Nov 2021 at 20:36, Pali Rohár wrote: > > > > Hello! > > > > On Tuesday 16 November 2021 20:05:07 Loic Poulain wrote: > > > Hi Pali, > > > > > > Sorry for the late reply, > > > > > > On Mon, 27 Sept 2021 at 22:04, Pali Rohár wrote: > > > > > > > > On Thursday 19 August 2021 13:13:06 Loic Poulain wrote: > > > > > This command allows to start CDC ACM function and redirect console > > > > > (stdin, stdout, stderr) to USB (acmconsole start). The console can > > > > > then be accessed through the USB host for debugging purpose. The > > > > > host can stop the session (acmconsole stop) to revert back console > > > > > to serial and unregister CDC ACM USB function. > > > > > > > > Hello! > > > > > > > > Could you rather implement this CDC ACM gadget in a way that calling > > > > 'setenv stdout cdc_acm' (or 'setenv stdout usbtty') would do this > > > > console redirect? Like it is supported for current usbtty or vga output > > > > code. > > > > > > > > Then this acmconsole command would not be needed at all. > > > > > > Yes, that would be good, but AFAIR I restricted this cdc_acm usage to > > > this command because we can't have fine grained control like e.g. > > > using cdc_acm as stdout only, when used, it should necessarily be > > > STDIN (at least). The reason is because of the single-tasking nature > > > of u-boot, and the fact that we need to poll the USB controller for > > > events via the 'usb_gadget_handle_interrupts()' function. > > > > There was already discussion that custom commands for activating drivers > > are against driver model design. See: > > https://lore.kernel.org/u-boot/20211026151742.42b0fcfa@thinkpad/ > > > > So I think that there should not be any driver specific command which > > just activates device (in this case console). > > That's a bit different here since it's not a standard > device/peripheral driver but a USB function, which is something the > 'user' can decide to enable or not, all the other USB functions have > dedicated commands AFAIK. It's not clear otherwise at which place we > should register the acm_console? should it be unconditionally > registered at init? I really do not know. But for me it could make sense that activation happens when calling standard "setenv std* cdc_acm" commands...