linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Delay recognizing USB-Drive with Kernel 5.9.12
@ 2021-01-15 14:27 thilo
  2021-01-16 19:56 ` Martin Blumenstingl
  2021-01-18 13:37 ` Neil Armstrong
  0 siblings, 2 replies; 3+ messages in thread
From: thilo @ 2021-01-15 14:27 UTC (permalink / raw)
  Cc: linux-amlogic, linux-arm-kernel

Hello!
I am new to linux, please excuse false statements :-)).
I think there is a USB_PWR_EN-problem in the kernel (UAS-driver???)
NO            delay recognizing USB-drive with kernel 4.9.247
 >20 sec    delay recognizing USB-drive with kernel 5.9.12

Installed Armbian on SD on an Odroid n2+.
Wanted to move system to USB-SSD, used nand-sata-install.
After that, didn't boot.
New install on SD.
Realized that most of the time it took >20 sec to recognize USB-SSD.
I felt, failing boot was due to slow USB-drive recognition (system drive
not available at boot).

in kern.log:
... localhost kernel: [   33.760038] USB_PWR_EN: disabling
...
... localhost kernel: [  587.836268] usb 1-1.3: new full-speed USB
device number 6 using xhci-hcd

Did some research, found:
https://forum.armbian.com/topic/13580-odroid-n2-kernel49-no-boot-on-usb-sata-ssd/
with:
'BTW what is USB_PWR_EN, are we looking at something interesting here?'
and a link to:
https://forum.armbian.com/topic/11741-boot-from-ssd-with-n2/page/3/
with:
'None ... delay was necessary when using kernel 4.9.x so ... seems ...
problem with the 5.x kernel series, presumably around the UAS driver ...'

With Armbian-config, changed
Kernel 5.9.12 to 4.9.247 (gladly very easy with that!)
After that recognition of USB-SSD was fast.
Another nand-sata-install.
New boot, worked: root part is on USB-SSD!!!

So: problem with 5.x kernel, see top of mail.

Would be glad to get feedback.

Thilo


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Delay recognizing USB-Drive with Kernel 5.9.12
  2021-01-15 14:27 Delay recognizing USB-Drive with Kernel 5.9.12 thilo
@ 2021-01-16 19:56 ` Martin Blumenstingl
  2021-01-18 13:37 ` Neil Armstrong
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Blumenstingl @ 2021-01-16 19:56 UTC (permalink / raw)
  To: thilo; +Cc: linux-amlogic, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]

Hello Thilo,

On Fri, Jan 15, 2021 at 4:28 PM thilo <thibau@gmx.de> wrote:
>
> Hello!
> I am new to linux, please excuse false statements :-)).
> I think there is a USB_PWR_EN-problem in the kernel (UAS-driver???)
to verify if USB_PWR_EN is really the cause of this problem you can
add the "regulator-always-on" property to
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi (and then
re-build the kernel)
see the attached patch (not tested as I don't have an Odroid-N2 myself)

[...]
> https://forum.armbian.com/topic/11741-boot-from-ssd-with-n2/page/3/
> with:
> 'None ... delay was necessary when using kernel 4.9.x so ... seems ...
> problem with the 5.x kernel series, presumably around the UAS driver ...'
that link mentions:
> Edit /boot/boot.ini and add "usb_storage.quirks=0bc2:3321:" to the linux command line parameters.
this could mean that we're not looking at a problem with the Odroid-N2
but something specific to the USB controller on this Seagate device
involving the people on the Linux USB mailing ist
(linux-usb@vger.kernel.org) is probably a good thing to do

> With Armbian-config, changed
> Kernel 5.9.12 to 4.9.247 (gladly very easy with that!)
> After that recognition of USB-SSD was fast.
The 4.9 kernel is probably using patches (and various hacks) from
Amlogic which may or may not be part of the newer upstream Linux
kernel versions (for example 5.9).
Sometimes differences can be spotted by comparing the "dmesg" (kernel
log) output of both kernels.


Best regards,
Martin

[-- Attachment #2: meson-g12b-odroid-n2-usb-pwr-en-always-on.patch --]
[-- Type: text/x-patch, Size: 524 bytes --]

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
index 39a09661c5f6..160c72cd762f 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
@@ -178,6 +178,7 @@ usb_pwr_en: regulator-usb_pwr_en {
 		/* Connected to the microUSB port power enable */
 		gpio = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
+		regulator-always-on;
 	};
 
 	vddao_1v8: regulator-vddao_1v8 {

[-- Attachment #3: Type: text/plain, Size: 167 bytes --]

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Delay recognizing USB-Drive with Kernel 5.9.12
  2021-01-15 14:27 Delay recognizing USB-Drive with Kernel 5.9.12 thilo
  2021-01-16 19:56 ` Martin Blumenstingl
@ 2021-01-18 13:37 ` Neil Armstrong
  1 sibling, 0 replies; 3+ messages in thread
From: Neil Armstrong @ 2021-01-18 13:37 UTC (permalink / raw)
  To: thilo; +Cc: linux-amlogic, linux-arm-kernel

Hi,

On 15/01/2021 15:27, thilo wrote:
> Hello!
> I am new to linux, please excuse false statements :-)).
> I think there is a USB_PWR_EN-problem in the kernel (UAS-driver???)
> NO            delay recognizing USB-drive with kernel 4.9.247
>>20 sec    delay recognizing USB-drive with kernel 5.9.12
> 
> Installed Armbian on SD on an Odroid n2+.
> Wanted to move system to USB-SSD, used nand-sata-install.
> After that, didn't boot.
> New install on SD.
> Realized that most of the time it took >20 sec to recognize USB-SSD.
> I felt, failing boot was due to slow USB-drive recognition (system drive
> not available at boot).
> 
> in kern.log:
> ... localhost kernel: [   33.760038] USB_PWR_EN: disabling
> ...
> ... localhost kernel: [  587.836268] usb 1-1.3: new full-speed USB
> device number 6 using xhci-hcd
> 
> Did some research, found:
> https://forum.armbian.com/topic/13580-odroid-n2-kernel49-no-boot-on-usb-sata-ssd/
> with:
> 'BTW what is USB_PWR_EN, are we looking at something interesting here?'

USB_PWR_EN is the regulator that powers the micro USB OTG port, when nothing
is connected or a is connected to a PC, power is disabled.
Connecting a device via a microUSB-to-USB-A cable will enable this regulator.

> and a link to:
> https://forum.armbian.com/topic/11741-boot-from-ssd-with-n2/page/3/
> with:
> 'None ... delay was necessary when using kernel 4.9.x so ... seems ...
> problem with the 5.x kernel series, presumably around the UAS driver ...'
> 
> With Armbian-config, changed
> Kernel 5.9.12 to 4.9.247 (gladly very easy with that!)
> After that recognition of USB-SSD was fast.
> Another nand-sata-install.
> New boot, worked: root part is on USB-SSD!!!
> 
> So: problem with 5.x kernel, see top of mail.
> 
> Would be glad to get feedback.

As Martin says, the Amlogic kernel contains a lot a tweaks which are not present
on the mainlinx Linue tree, maybe if you identify what delays this detection we may
find how to reduce such delays on Amlogic SoCs.


Neil

> 
> Thilo
> 
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-18 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 14:27 Delay recognizing USB-Drive with Kernel 5.9.12 thilo
2021-01-16 19:56 ` Martin Blumenstingl
2021-01-18 13:37 ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).