Re: [linux-sunxi] Re: BUG - Bananapi USB not working on Mainline

2015-12-27 Thread Maxime Ripard
Hi,

On Tue, Dec 22, 2015 at 06:42:07AM -0800, m.silentcr...@gmail.com wrote:
> Am Sonntag, 20. Dezember 2015 08:38:52 UTC+1 schrieb David Tulloh:
> > On 20 December 2015 at 08:39,   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 a...@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

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Digital signature


Re: [linux-sunxi] Re: BUG - Bananapi USB not working on Mainline

2015-12-22 Thread m . silentcreek
Hi Hans,
Hi Maxime,

Am Sonntag, 20. Dezember 2015 08:38:52 UTC+1 schrieb David Tulloh:
> On 20 December 2015 at 08:39,   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

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: BUG - Bananapi USB not working on Mainline

2015-12-19 Thread David Tulloh
On 20 December 2015 at 08:39,  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.

I need to check my emails more often, I just spent several hours narrowing
this down but not quite reaching the solution.

Karsten's working config posted earlier defines CONFIG_AXP20X_POWER=m.


David

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: BUG - Bananapi USB not working on Mainline

2015-12-19 Thread m . silentcreek
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

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: BUG - Bananapi USB not working on Mainline

2015-12-19 Thread Hans de Goede
Hi,

On Wednesday, December 16, 2015 at 2:47:40 AM UTC+1, David Tulloh wrote:
>
> 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
>

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 ?

Regards,

Hans

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: BUG - Bananapi USB not working on Mainline

2015-12-19 Thread m . silentcreek
Hi again,

Am Freitag, 18. Dezember 2015 21:22:43 UTC+1 schrieb m.sile...@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

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: BUG - Bananapi USB not working on Mainline

2015-12-18 Thread m . silentcreek
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

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.