All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Dragan Simic <dsimic@manjaro.org>
Cc: u-boot@lists.denx.de, Dang Huynh <danct12@riseup.net>,
	Piotr Zalewski <pZ010001011111@proton.me>
Subject: Re: [PATCH] usb: Make what it takes for "usbkbd" to work in "stdin" clear
Date: Mon, 27 Jan 2025 23:23:09 +0100	[thread overview]
Message-ID: <5f794a65-eab4-4dde-9b44-eec6c97ff335@denx.de> (raw)
In-Reply-To: <6e2b3f3cdfbed67122725d22055d8877@manjaro.org>

On 1/27/25 11:20 PM, Dragan Simic wrote:
> Hello Marek,
> 
> On 2025-01-27 22:55, Marek Vasut wrote:
>> On 1/19/25 7:50 PM, Dragan Simic wrote:
>>> Selecting the CONFIG_SYS_CONSOLE_ENV_OVERWRITE option actually 
>>> prevents the
>>> CONFIG_USB_KEYBOARD option from working as expected, i.e. USB 
>>> keyboards end
>>> up not working as console inputs when "usbkbd" is properly specified 
>>> as part
>>> of the value of the "stdin" environment variable.  Describe this 
>>> clearly in
>>> the two relevant Kconfig files, to prevent any possible confusion.
>>>
>>> In more detail, the console_init_r() function ends up overwriting the 
>>> "stdin"
>>> environment variable so it contains only the devices available at 
>>> that point
>>> (which doesn't include "usbkbd"), while the "usb start" operation is 
>>> performed
>>> much later, at which point the probe_usb_keyboard() function cannot 
>>> assign any
>>> discovered USB keyboards to the console because "usbkbd" is no longer 
>>> present
>>> in the "stdin" environment variable.
>>
>> Wouldn't it be better to patch console_init_r() , check if "stdin"
>> variable contains 'usbkbd' and if so, start USB and register the
>> keyboard as stdin device at this point ? This is called after
>> relocation, so starting USB should be OK to do here. The behavior
>> should then be less confusing to users too.
> 
> Please correct me if I'm wrong, but isn't "usb start" deliberately
> left to be executed as desired by the supported boards, or as part
> of distroboot, i.e. in include/config_distro_bootcmd.h?

It is, but if the user needs USB keyboard as input device, shouldn't we 
probe for that (which yes, will make the start up slower) ?

  reply	other threads:[~2025-01-27 22:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-19 18:50 [PATCH] usb: Make what it takes for "usbkbd" to work in "stdin" clear Dragan Simic
2025-01-27 21:55 ` Marek Vasut
2025-01-27 22:20   ` Dragan Simic
2025-01-27 22:23     ` Marek Vasut [this message]
2025-01-27 22:42       ` Dragan Simic
2025-01-27 23:03         ` Marek Vasut
2025-01-27 23:22           ` Dragan Simic
2025-01-28  1:47             ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5f794a65-eab4-4dde-9b44-eec6c97ff335@denx.de \
    --to=marex@denx.de \
    --cc=danct12@riseup.net \
    --cc=dsimic@manjaro.org \
    --cc=pZ010001011111@proton.me \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.