All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG - Bananapi USB not working on Mainline
       [not found] <CAOP4N=_Ux0FPSRep7AfBVovd59LeDTbBjH=LBdfWDb6Mc3e=Fg@mail.gmail.com>
@ 2015-12-18 20:22 ` m.silentcreek at gmail.com
  2015-12-19 19:15   ` m.silentcreek at gmail.com
       [not found] ` <ec8d762c-3e2b-4438-a43e-ae2740f8a5f3@googlegroups.com>
  1 sibling, 1 reply; 5+ messages in thread
From: m.silentcreek at gmail.com @ 2015-12-18 20:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi, 

Am Mittwoch, 16. Dezember 2015 02:47:40 UTC+1 schrieb David Tulloh:
> Hi,
> 
> I am working on a SinoVoip Bananapi M1
> 
> With the current mainline  USB does not work. I believe that power to the USB vbus is being disabled during boot.
> 
> Failing build v4.4-rc5
> Working build v4.2.3
> 
> Compiled with
> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig menuconfig zImage dtbs
> 
> The boot log is attached, debug and CONFIG_REGULATOR_DEBUG were enabled.
> The config file is also attached.
> 
> 
> I am happy to do further work on the problem but my unfamiliarity with the kernel means I'm flailing in the dark.
> 
> 
> 
> David

I can confirm there is an issue with USB (not OTG) on the Bananapi in Linux 4.4-rc5. I just compiled and booted a 4.4-rc5 kernel image with a new dtb - or be more precise, I failed to boot it because the kernel couldn't mount the usb drives that I listed in my fstab. The defconfig I used was basically the same that I use for my 4.1.y kernels which is based on sunxi_defconfig but adds a lot more stuff like drivers, netfilter, etc (I merged the changes that happened in sunxi_defconfig between 4.1 and 4.4, though).

I haven't had the time yet to look into it further to bisect the issue. I also haven't tried any other kernel versions between 4.1.15 and 4.4-rc5, so I can't say when the problem slipped in. I just can say that there is an issue on my Lemaker Bananapi. The symptoms are the same as descrived by David. My usb drives don't seem the get power anymore once the kernel boots.

I'll try to find time to look into it in more detail over the weekend and provide configs and logs.

Regards,

Timo

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

* BUG - Bananapi USB not working on Mainline
  2015-12-18 20:22 ` BUG - Bananapi USB not working on Mainline m.silentcreek at gmail.com
@ 2015-12-19 19:15   ` m.silentcreek at gmail.com
  0 siblings, 0 replies; 5+ messages in thread
From: m.silentcreek at gmail.com @ 2015-12-19 19:15 UTC (permalink / raw)
  To: linux-arm-kernel

Hi again,

Am Freitag, 18. Dezember 2015 21:22:43 UTC+1 schrieb m.sile... at gmail.com:
> I can confirm there is an issue with USB (not OTG) on the Bananapi in Linux 4.4-rc5. I just compiled and booted a 4.4-rc5 kernel image with a new dtb - or be more precise, I failed to boot it because the kernel couldn't mount the usb drives that I listed in my fstab. The defconfig I used was basically the same that I use for my 4.1.y kernels which is based on sunxi_defconfig but adds a lot more stuff like drivers, netfilter, etc (I merged the changes that happened in sunxi_defconfig between 4.1 and 4.4, though).
> 
> I haven't had the time yet to look into it further to bisect the issue. I also haven't tried any other kernel versions between 4.1.15 and 4.4-rc5, so I can't say when the problem slipped in. I just can say that there is an issue on my Lemaker Bananapi. The symptoms are the same as descrived by David. My usb drives don't seem the get power anymore once the kernel boots.
> 
> I'll try to find time to look into it in more detail over the weekend and provide configs and logs.
> 

so, I did some more testing. I took a second Lemaker Bananpi with two usb devices attached (a flash drive and a sd card reader) and compiled several kernel images along with their device tree blobs to figure out which version introduced the issue.

I tested linux 4.2, 4.3, 4.4-rc1 and 4.4-rc5. The U-Boot version used was 2015.10. I took the same defconfig for all builds. 

The break seems to have occured between 4.3 and 4.4-rc1, meaning that both 4.2 and 4.3 work fine, but with 4.4-rc1 and 4.4-rc5 the USB devices get turned off during boot.

The defconfig, full configs and the corresponding dmesg output for 4.3 (USB working) and 4.4-rc1 (USB *not* working) can be found here:
http://pastebin.com/HYwCGwcx (config 4.3)
http://pastebin.com/hbW7iLEh (dmesg 4.3)
http://pastebin.com/tKMSXMCW (config 4.4-rc1)
http://pastebin.com/g5NXw42t (dmesg 4.4-rc1)
http://pastebin.com/kW8MjcTq (defconfig, used for all builds)

What caught my eye here are these lines in the 4.4-rc1 dmesg output:
[    0.539619] usb0-vbus: disabling
[    0.539641] usb1-vbus: disabling
[    0.539664] usb2-vbus: disabling

When I submitted the patch to enable the regulators on Bananapi and tested the patch on some linux-next build at that time, I didn't see those in my kernel log. So maybe there was another change leading to that?

As David described as well, the LEDs on my flash drive and my card reader get turned on during the U-Boot phase. When the kernel is loading, they stay on (or keep blinking) with linux 4.3 and earlier. In 4.4-rc1 and later they both turn off, once the kernel is loading. 

Interesting enough, though, the power does not seem to be lost completly. Because if I unplug the card reader once linux 4.4-rc1 has fully booted, and plug it back in, the LED turns on again but the device does not show up in /dev/ and is not mountable. The flash drive stays dark even with this unplugging/plugging cycle.


Regards,

Timo

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

* BUG - Bananapi USB not working on Mainline
       [not found] ` <ec8d762c-3e2b-4438-a43e-ae2740f8a5f3@googlegroups.com>
@ 2015-12-19 21:39   ` m.silentcreek at gmail.com
       [not found]     ` <CAOP4N=98cjUYVAvEngdOXXdXeive7HB_ChC4B+uAASG5tKP1dg@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: m.silentcreek at gmail.com @ 2015-12-19 21:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Am Samstag, 19. Dezember 2015 20:38:08 UTC+1 schrieb Hans de Goede:
> The sunxi usb-phy driver now requires extcon (due to the added otg support), maybe the defconfig is not enabling extcon and thereby you are not getting the sunxi usb-phy driver build, or not build-in at least ?
> 
> Can you edit .config after the make defconfig and see what the value for CONFIG_PHY_SUN4I_USB is ?

I found the solution! The problem is CONFIG_AXP20X_POWER which was introduced in 4.4-rc1 but defaults to no and not set in sunxi_defconfig. Adding CONFIG_AXP20X_POWER=y to sunxi_defconfig solves that and get's my USB devices working again on linux 4.4-rc5. I actually brought that up on IRC once, but at that time nobody seemed to know so I forgot it again.

Anyway, wouldn't it be a better to just have it automatically be selected when e.g. CONFIG_PHY_SUN4I_USB or something else that depends on it is enabled?

Regards,

Timo

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

* [linux-sunxi] Re: BUG - Bananapi USB not working on Mainline
       [not found]     ` <CAOP4N=98cjUYVAvEngdOXXdXeive7HB_ChC4B+uAASG5tKP1dg@mail.gmail.com>
@ 2015-12-22 14:42       ` m.silentcreek at gmail.com
  2015-12-27 21:40         ` Maxime Ripard
  0 siblings, 1 reply; 5+ messages in thread
From: m.silentcreek at gmail.com @ 2015-12-22 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Hans,
Hi Maxime,

Am Sonntag, 20. Dezember 2015 08:38:52 UTC+1 schrieb David Tulloh:
> On 20 December 2015 at 08:39,  <m.sile...@gmail.com> wrote:
> 
> I found the solution! The problem is CONFIG_AXP20X_POWER which was introduced in 4.4-rc1 but defaults to no and not set in sunxi_defconfig. Adding CONFIG_AXP20X_POWER=y to sunxi_defconfig solves that and get's my USB devices working again on linux 4.4-rc5. I actually brought that up on IRC once, but at that time nobody seemed to know so I forgot it again.
> 
> Thanks Timo,
> 
> I can confirm that adding CONFIG_AXP20X_POWER=y to sunxi_defconfig works for me as well.

Is this considered an issue worthwhile to be addressed before the release of 4.4?

The way I see it is that USB support is broken on A10/20 in mainline for anybody who builds on sunxi_defconfig or multi_v7_defconfig at the moment.

I think we should either have CONFIG_PHY_SUN4I_USB select CONFIG_AXP20X_POWER automatically (my preferred solution) or at least add it to sunxi_defconfig and multi_v7_defconfig.

I'd be glad to submit a short patch for it depending on your viewpoint.

Best wishes and happy holidays,

Timo

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

* [linux-sunxi] Re: BUG - Bananapi USB not working on Mainline
  2015-12-22 14:42       ` [linux-sunxi] " m.silentcreek at gmail.com
@ 2015-12-27 21:40         ` Maxime Ripard
  0 siblings, 0 replies; 5+ messages in thread
From: Maxime Ripard @ 2015-12-27 21:40 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Tue, Dec 22, 2015 at 06:42:07AM -0800, m.silentcreek at gmail.com wrote:
> Am Sonntag, 20. Dezember 2015 08:38:52 UTC+1 schrieb David Tulloh:
> > On 20 December 2015 at 08:39,  <m.sile...@gmail.com> wrote:
> > 
> > I found the solution! The problem is CONFIG_AXP20X_POWER which was
> > introduced in 4.4-rc1 but defaults to no and not set in
> > sunxi_defconfig. Adding CONFIG_AXP20X_POWER=y to sunxi_defconfig
> > solves that and get's my USB devices working again on linux
> > 4.4-rc5. I actually brought that up on IRC once, but at that time
> > nobody seemed to know so I forgot it again.
> > 
> > Thanks Timo,
> > 
> > I can confirm that adding CONFIG_AXP20X_POWER=y to sunxi_defconfig
> > works for me as well.
> 
> Is this considered an issue worthwhile to be addressed before the
> release of 4.4?
> 
> The way I see it is that USB support is broken on A10/20 in mainline
> for anybody who builds on sunxi_defconfig or multi_v7_defconfig at
> the moment.

I don't consider it a "release blocker". The defconfig is just what it
says: a default configuration. It's not a one-size-fits-all
configuration.

> I think we should either have CONFIG_PHY_SUN4I_USB select
> CONFIG_AXP20X_POWER automatically (my preferred solution)

It actually depends on the board, so no.

> or at least add it to sunxi_defconfig and multi_v7_defconfig.

Feel free to send a patch for it to arm at kernel.org in addition to the
usual recipients (Chen-Yu, LAKML and myself), and make it clear that
you want them to apply it.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151227/16c6bdc7/attachment.sig>

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

end of thread, other threads:[~2015-12-27 21:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAOP4N=_Ux0FPSRep7AfBVovd59LeDTbBjH=LBdfWDb6Mc3e=Fg@mail.gmail.com>
2015-12-18 20:22 ` BUG - Bananapi USB not working on Mainline m.silentcreek at gmail.com
2015-12-19 19:15   ` m.silentcreek at gmail.com
     [not found] ` <ec8d762c-3e2b-4438-a43e-ae2740f8a5f3@googlegroups.com>
2015-12-19 21:39   ` m.silentcreek at gmail.com
     [not found]     ` <CAOP4N=98cjUYVAvEngdOXXdXeive7HB_ChC4B+uAASG5tKP1dg@mail.gmail.com>
2015-12-22 14:42       ` [linux-sunxi] " m.silentcreek at gmail.com
2015-12-27 21:40         ` Maxime Ripard

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.