Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-18 Thread Michael Niewöhner
Hi,
On Mon, 2016-10-17 at 15:21 +0530, Vivek Gautam wrote:
> 
> On 10/17/2016 01:38 PM, Felipe Balbi wrote:
> > Hi,
> > 
> > Michael Niewöhner  writes:
> > > Hi Felipe,
> > > On Fri, 2016-10-07 at 22:26 +0200, Michael Niewöhner wrote:
> > > > Hi Felipe,
> > > > 
> > > > On Fr, 2016-10-07 at 10:42 +0300, Felipe Balbi wrote:
> > > > > Hi,
> > > > > 
> > > > > Michael Niewöhner  writes:
> > > > > > > The clocks are same across working/non-working.
> > > > > > > Is it possible to bisect the commit that's causing hang for 4.8x ?
> > > > > > 
> > > > > > [c499ff71ff2a281366c6ec7a904c547d806cbcd1] usb: dwc3: core: 
> > > > > > re-factor init and exit paths
> > > > > > This patch causes both the hang on reboot and the lsusb hang.
> > > > > 
> > > > > How to reproduce? Why don't we see this on x86 and TI boards? I'm
> > > > > guessing this is failed bisection, as I can't see anything in that
> > > > > commit that would cause reboot hang. Also, that code path is *NOT*
> > > > > executed when you run lsusb.
> > > > > 
> > > > 
> > > > I've tested this procedure multiple times to be sure:
> > > > 
> > > > - checkout c499ff71, compile, boot the odroid
> > > > - run lsusb -v => lsusb hangs, can't terminate with ctrl-c
> > > > - hard reset, after boot run poweroff or reboot => board does not 
> > > > completely power off / reboot (see log below)
> > > > - revert c499ff71, mrproper, compile, boot the odroid
> > > > - run lsusb -v => shows full output, not hanging
> > > > - run reboot or poweroff => board powers off / reboots just fine
> > > > 
> > > > 
> > > > dmesg poweroff not working:
> > > > ...
> > > > [  120.733519] systemd-journald[144]: systemd-journald stopped as pid 
> > > > 144
> > > > [  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining 
> > > > processes...
> > > > [  120.769212] systemd-shutdown[1]: Unmounting file systems.
> > > > [  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug.
> > > > [  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue.
> > > > [  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
> > > > [  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
> > > > [  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
> > > > [  121.101014] systemd-shutdown[1]: All filesystems unmounted.
> > > > [  121.106523] systemd-shutdown[1]: Deactivating swaps.
> > > > [  121.111585] systemd-shutdown[1]: All swaps deactivated.
> > > > [  121.116661] systemd-shutdown[1]: Detaching loop devices.
> > > > [  121.126395] systemd-shutdown[1]: All loop devices detached.
> > > > [  121.130525] systemd-shutdown[1]: Detaching DM devices.
> > > > [  121.135824] systemd-shutdown[1]: All DM devices detached.
> > > > [  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown 
> > > > succeeded.
> > > > [  121.171739] systemd-shutdown[1]: Powering off.
> > > > 
> > > > => at this point removing the sd card would show a message
> > > > "removed mmc0" (not sure what the real message was...) so the board is 
> > > > not completely off.
> > > > 
> > > > 
> > > > dmesg poweroff working:
> > > > ...
> > > > [  120.733519] systemd-journald[144]: systemd-journald stopped as pid 
> > > > 144
> > > > [  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining 
> > > > processes...
> > > > [  120.769212] systemd-shutdown[1]: Unmounting file systems.
> > > > [  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug.
> > > > [  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue.
> > > > [  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
> > > > [  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
> > > > [  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
> > > > [  121.101014] systemd-shutdown[1]: All filesystems unmounted.
> > > > [  121.106523] systemd-shutdown[1]: Deactivating swaps.
> > > > [  121.111585] systemd-shutdown[1]: All swaps deactivated.
> > > > [  121.116661] systemd-shutdown[1]: Detaching loop devices.
> > > > [  121.126395] systemd-shutdown[1]: All loop devices detached.
> > > > [  121.130525] systemd-shutdown[1]: Detaching DM devices.
> > > > [  121.135824] systemd-shutdown[1]: All DM devices detached.
> > > > [  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown 
> > > > succeeded.
> > > > [  121.171739] systemd-shutdown[1]: Powering off.
> > > > [  121.182331] rebo�
> > > > 
> > > > 
> > > > 
> > > > Best regards
> > > > Michael Niewöhner
> > > 
> > > I did some more tests with next-20161016. Reverting / commenting out
> > > one part of your patch "solves" the lsusb hang, the reboot problem
> > > and also the "debounce failed" message. [1]
> > > Another "solution" is to call phy_power_off before phy_power_on. [2]
> > > 
> > > Disclaimer: I have no idea what I was doing ;-) These were just some
> > > simple trial-and-error attempts that maybe help to find the real
> > > cause of the problems.
> > > 
> > > [1]
> > > diff --git a/drivers/usb/dwc3/core.c 

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-17 Thread Vivek Gautam



On 10/17/2016 01:38 PM, Felipe Balbi wrote:

Hi,

Michael Niewöhner  writes:

Hi Felipe,
On Fri, 2016-10-07 at 22:26 +0200, Michael Niewöhner wrote:

Hi Felipe,

On Fr, 2016-10-07 at 10:42 +0300, Felipe Balbi wrote:

Hi,

Michael Niewöhner  writes:

The clocks are same across working/non-working.
Is it possible to bisect the commit that's causing hang for 4.8x ?


[c499ff71ff2a281366c6ec7a904c547d806cbcd1] usb: dwc3: core: re-factor init and 
exit paths
This patch causes both the hang on reboot and the lsusb hang.

How to reproduce? Why don't we see this on x86 and TI boards? I'm
guessing this is failed bisection, as I can't see anything in that
commit that would cause reboot hang. Also, that code path is *NOT*
executed when you run lsusb.


I've tested this procedure multiple times to be sure:

- checkout c499ff71, compile, boot the odroid
- run lsusb -v => lsusb hangs, can't terminate with ctrl-c
- hard reset, after boot run poweroff or reboot => board does not completely 
power off / reboot (see log below)
- revert c499ff71, mrproper, compile, boot the odroid
- run lsusb -v => shows full output, not hanging
- run reboot or poweroff => board powers off / reboots just fine


dmesg poweroff not working:
...
[  120.733519] systemd-journald[144]: systemd-journald stopped as pid 144
[  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[  120.769212] systemd-shutdown[1]: Unmounting file systems.
[  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug.
[  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue.
[  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.101014] systemd-shutdown[1]: All filesystems unmounted.
[  121.106523] systemd-shutdown[1]: Deactivating swaps.
[  121.111585] systemd-shutdown[1]: All swaps deactivated.
[  121.116661] systemd-shutdown[1]: Detaching loop devices.
[  121.126395] systemd-shutdown[1]: All loop devices detached.
[  121.130525] systemd-shutdown[1]: Detaching DM devices.
[  121.135824] systemd-shutdown[1]: All DM devices detached.
[  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown succeeded.
[  121.171739] systemd-shutdown[1]: Powering off.

=> at this point removing the sd card would show a message
"removed mmc0" (not sure what the real message was...) so the board is not 
completely off.


dmesg poweroff working:
...
[  120.733519] systemd-journald[144]: systemd-journald stopped as pid 144
[  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[  120.769212] systemd-shutdown[1]: Unmounting file systems.
[  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug.
[  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue.
[  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.101014] systemd-shutdown[1]: All filesystems unmounted.
[  121.106523] systemd-shutdown[1]: Deactivating swaps.
[  121.111585] systemd-shutdown[1]: All swaps deactivated.
[  121.116661] systemd-shutdown[1]: Detaching loop devices.
[  121.126395] systemd-shutdown[1]: All loop devices detached.
[  121.130525] systemd-shutdown[1]: Detaching DM devices.
[  121.135824] systemd-shutdown[1]: All DM devices detached.
[  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown succeeded.
[  121.171739] systemd-shutdown[1]: Powering off.
[  121.182331] rebo�



Best regards
Michael Niewöhner


I did some more tests with next-20161016. Reverting / commenting out
one part of your patch "solves" the lsusb hang, the reboot problem
and also the "debounce failed" message. [1]
Another "solution" is to call phy_power_off before phy_power_on. [2]

Disclaimer: I have no idea what I was doing ;-) These were just some
simple trial-and-error attempts that maybe help to find the real
cause of the problems.

[1]
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 7287a76..5ef589d 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -724,6 +724,7 @@ static int dwc3_core_init(struct dwc3 *dwc)
/* Adjust Frame Length */
dwc3_frame_length_adjustment(dwc);
  
+/*

usb_phy_set_suspend(dwc->usb2_phy, 0);
usb_phy_set_suspend(dwc->usb3_phy, 0);
ret = phy_power_on(dwc->usb2_generic_phy);
@@ -733,6 +734,7 @@ static int dwc3_core_init(struct dwc3 *dwc)
ret = phy_power_on(dwc->usb3_generic_phy);
if (ret < 0)
goto err3;
+*/
  
  	ret = dwc3_event_buffers_setup(dwc);

if (ret) {

[2]
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 7287a76..f6c8e13 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -726,6 +726,8 @@ static int dwc3_core_init(struct dwc3 *dwc)
  
 

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-17 Thread Felipe Balbi

Hi,

Michael Niewöhner  writes:
> Hi Felipe,
> On Fri, 2016-10-07 at 22:26 +0200, Michael Niewöhner wrote:
>> Hi Felipe,
>> 
>> On Fr, 2016-10-07 at 10:42 +0300, Felipe Balbi wrote:
>> > Hi,
>> > 
>> > Michael Niewöhner  writes:
>> > > 
>> > > > 
>> > > > The clocks are same across working/non-working.
>> > > > Is it possible to bisect the commit that's causing hang for 4.8x ?
>> > > 
>> > > 
>> > > [c499ff71ff2a281366c6ec7a904c547d806cbcd1] usb: dwc3: core: re-factor 
>> > > init and exit paths
>> > > This patch causes both the hang on reboot and the lsusb hang.
>> > 
>> > How to reproduce? Why don't we see this on x86 and TI boards? I'm
>> > guessing this is failed bisection, as I can't see anything in that
>> > commit that would cause reboot hang. Also, that code path is *NOT*
>> > executed when you run lsusb.
>> > 
>> 
>> I've tested this procedure multiple times to be sure:
>> 
>> - checkout c499ff71, compile, boot the odroid
>> - run lsusb -v => lsusb hangs, can't terminate with ctrl-c
>> - hard reset, after boot run poweroff or reboot => board does not completely 
>> power off / reboot (see log below)
>> - revert c499ff71, mrproper, compile, boot the odroid
>> - run lsusb -v => shows full output, not hanging
>> - run reboot or poweroff => board powers off / reboots just fine
>> 
>> 
>> dmesg poweroff not working:
>> ...
>> [  120.733519] systemd-journald[144]: systemd-journald stopped as pid 144
>>    
>> [  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining 
>> processes...   
>> [  120.769212] systemd-shutdown[1]: Unmounting file systems. 
>>    
>> [  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug.
>>    
>> [  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue.  
>>    
>> [  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null) 
>>    
>> [  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null) 
>>    
>> [  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null) 
>>    
>> [  121.101014] systemd-shutdown[1]: All filesystems unmounted.   
>>    
>> [  121.106523] systemd-shutdown[1]: Deactivating swaps.  
>>    
>> [  121.111585] systemd-shutdown[1]: All swaps deactivated.   
>>    
>> [  121.116661] systemd-shutdown[1]: Detaching loop devices.  
>>    
>> [  121.126395] systemd-shutdown[1]: All loop devices detached.   
>>    
>> [  121.130525] systemd-shutdown[1]: Detaching DM devices.
>>    
>> [  121.135824] systemd-shutdown[1]: All DM devices detached. 
>>    
>> [  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown succeeded.  
>>    
>> [  121.171739] systemd-shutdown[1]: Powering off.
>> 
>> => at this point removing the sd card would show a message 
>> "removed mmc0" (not sure what the real message was...) so the board is not 
>> completely off.
>> 
>> 
>> dmesg poweroff working:
>> ...
>> [  120.733519] systemd-journald[144]: systemd-journald stopped as pid 144
>>    
>> [  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining 
>> processes...   
>> [  120.769212] systemd-shutdown[1]: Unmounting file systems. 
>>    
>> [  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug.
>>    
>> [  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue.  
>>    
>> [  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null) 
>>    
>> [  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null) 
>>    
>> [  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null) 
>>    
>> [  121.101014] systemd-shutdown[1]: All filesystems unmounted.   
>>    
>> [  121.106523] systemd-shutdown[1]: Deactivating swaps.  
>>    
>> [  121.111585] systemd-shutdown[1]: All swaps deactivated.   
>>    
>> [  121.116661] systemd-shutdown[1]: Detaching loop devices.  
>>    
>> [  121.126395] systemd-shutdown[1]: All loop devices detached.   
>>    
>> [  121.130525] systemd-shutdown[1]: Detaching DM devices.
>>    
>> [  121.135824] systemd-shutdown[1]: All DM devices detached. 
>>    
>> [  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown succeeded.  
>>    
>> [  121.171739] systemd-shutdown[1]: Powering off.
>> [  121.182331] rebo�
>> 
>> 
>> 
>> Best regards
>> Michael Niewöhner
>
>
> I did some more tests with next-20161016. Reverting / commenting out
> one part of your patch "solves" the lsusb hang, the reboot problem
> and also the "debounce failed" message. [1]
> Another "solution" is to call phy_power_off before phy_power_on. [2]
>
> Disclaimer: I have no idea what I was doing ;-) These were just some
> simple trial-and-error attempts that maybe help to find the real
> 

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-16 Thread Michael Niewöhner
Hi Felipe,
On Fri, 2016-10-07 at 22:26 +0200, Michael Niewöhner wrote:
> Hi Felipe,
> 
> On Fr, 2016-10-07 at 10:42 +0300, Felipe Balbi wrote:
> > Hi,
> > 
> > Michael Niewöhner  writes:
> > > 
> > > > 
> > > > The clocks are same across working/non-working.
> > > > Is it possible to bisect the commit that's causing hang for 4.8x ?
> > > 
> > > 
> > > [c499ff71ff2a281366c6ec7a904c547d806cbcd1] usb: dwc3: core: re-factor 
> > > init and exit paths
> > > This patch causes both the hang on reboot and the lsusb hang.
> > 
> > How to reproduce? Why don't we see this on x86 and TI boards? I'm
> > guessing this is failed bisection, as I can't see anything in that
> > commit that would cause reboot hang. Also, that code path is *NOT*
> > executed when you run lsusb.
> > 
> 
> I've tested this procedure multiple times to be sure:
> 
> - checkout c499ff71, compile, boot the odroid
> - run lsusb -v => lsusb hangs, can't terminate with ctrl-c
> - hard reset, after boot run poweroff or reboot => board does not completely 
> power off / reboot (see log below)
> - revert c499ff71, mrproper, compile, boot the odroid
> - run lsusb -v => shows full output, not hanging
> - run reboot or poweroff => board powers off / reboots just fine
> 
> 
> dmesg poweroff not working:
> ...
> [  120.733519] systemd-journald[144]: systemd-journald stopped as pid 144 
>   
> [  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining processes... 
>   
> [  120.769212] systemd-shutdown[1]: Unmounting file systems.  
>   
> [  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug. 
>   
> [  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue.   
>   
> [  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)  
>   
> [  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)  
>   
> [  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)  
>   
> [  121.101014] systemd-shutdown[1]: All filesystems unmounted.
>   
> [  121.106523] systemd-shutdown[1]: Deactivating swaps.   
>   
> [  121.111585] systemd-shutdown[1]: All swaps deactivated.
>   
> [  121.116661] systemd-shutdown[1]: Detaching loop devices.   
>   
> [  121.126395] systemd-shutdown[1]: All loop devices detached.
>   
> [  121.130525] systemd-shutdown[1]: Detaching DM devices. 
>   
> [  121.135824] systemd-shutdown[1]: All DM devices detached.  
>   
> [  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown succeeded.   
>   
> [  121.171739] systemd-shutdown[1]: Powering off.
> 
> => at this point removing the sd card would show a message 
> "removed mmc0" (not sure what the real message was...) so the board is not 
> completely off.
> 
> 
> dmesg poweroff working:
> ...
> [  120.733519] systemd-journald[144]: systemd-journald stopped as pid 144 
>   
> [  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining processes... 
>   
> [  120.769212] systemd-shutdown[1]: Unmounting file systems.  
>   
> [  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug. 
>   
> [  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue.   
>   
> [  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)  
>   
> [  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)  
>   
> [  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)  
>   
> [  121.101014] systemd-shutdown[1]: All filesystems unmounted.
>   
> [  121.106523] systemd-shutdown[1]: Deactivating swaps.   
>   
> [  121.111585] systemd-shutdown[1]: All swaps deactivated.
>   
> [  121.116661] systemd-shutdown[1]: Detaching loop devices.   
>   
> [  121.126395] systemd-shutdown[1]: All loop devices detached.
>   
> [  121.130525] systemd-shutdown[1]: Detaching DM devices. 
>   
> [  121.135824] systemd-shutdown[1]: All DM devices detached.  
>   
> [  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown succeeded.   
>   
> [  121.171739] systemd-shutdown[1]: Powering off.
> [  121.182331] rebo�
> 
> 
> 
> Best regards
> Michael Niewöhner


I did some more tests with next-20161016. Reverting / commenting out
one part of your patch "solves" the lsusb hang, the reboot problem
and also the "debounce failed" message. [1]
Another "solution" is to call phy_power_off before phy_power_on. [2]

Disclaimer: I have no idea what I was doing ;-) These were just some
simple trial-and-error attempts that maybe help to find the real
cause of the problems.

[1]
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 7287a76..5ef589d 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -724,6 

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-07 Thread Michael Niewöhner
Hi Felipe,

On Fr, 2016-10-07 at 10:42 +0300, Felipe Balbi wrote:
> Hi,
> 
> Michael Niewöhner  writes:
> > 
> > > 
> > > The clocks are same across working/non-working.
> > > Is it possible to bisect the commit that's causing hang for 4.8x ?
> > 
> > 
> > [c499ff71ff2a281366c6ec7a904c547d806cbcd1] usb: dwc3: core: re-factor init 
> > and exit paths
> > This patch causes both the hang on reboot and the lsusb hang.
> 
> How to reproduce? Why don't we see this on x86 and TI boards? I'm
> guessing this is failed bisection, as I can't see anything in that
> commit that would cause reboot hang. Also, that code path is *NOT*
> executed when you run lsusb.
> 

I've tested this procedure multiple times to be sure:

- checkout c499ff71, compile, boot the odroid
- run lsusb -v => lsusb hangs, can't terminate with ctrl-c
- hard reset, after boot run poweroff or reboot => board does not completely 
power off / reboot (see log below)
- revert c499ff71, mrproper, compile, boot the odroid
- run lsusb -v => shows full output, not hanging
- run reboot or poweroff => board powers off / reboots just fine


dmesg poweroff not working:
...
[  120.733519] systemd-journald[144]: systemd-journald stopped as pid 144   
[  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining processes...   
[  120.769212] systemd-shutdown[1]: Unmounting file systems.
[  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug.   
[  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue. 
[  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.101014] systemd-shutdown[1]: All filesystems unmounted.  
[  121.106523] systemd-shutdown[1]: Deactivating swaps. 
[  121.111585] systemd-shutdown[1]: All swaps deactivated.  
[  121.116661] systemd-shutdown[1]: Detaching loop devices. 
[  121.126395] systemd-shutdown[1]: All loop devices detached.  
[  121.130525] systemd-shutdown[1]: Detaching DM devices.   
[  121.135824] systemd-shutdown[1]: All DM devices detached.
[  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown succeeded. 
[  121.171739] systemd-shutdown[1]: Powering off.

=> at this point removing the sd card would show a message 
"removed mmc0" (not sure what the real message was...) so the board is not 
completely off.


dmesg poweroff working:
...
[  120.733519] systemd-journald[144]: systemd-journald stopped as pid 144   
[  120.742663] systemd-shutdown[1]: Sending SIGKILL to remaining processes...   
[  120.769212] systemd-shutdown[1]: Unmounting file systems.
[  120.773713] systemd-shutdown[1]: Unmounting /sys/kernel/debug.   
[  120.827211] systemd-shutdown[1]: Unmounting /dev/mqueue. 
[  121.081672] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.091687] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.095608] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null)
[  121.101014] systemd-shutdown[1]: All filesystems unmounted.  
[  121.106523] systemd-shutdown[1]: Deactivating swaps. 
[  121.111585] systemd-shutdown[1]: All swaps deactivated.  
[  121.116661] systemd-shutdown[1]: Detaching loop devices. 
[  121.126395] systemd-shutdown[1]: All loop devices detached.  
[  121.130525] systemd-shutdown[1]: Detaching DM devices.   
[  121.135824] systemd-shutdown[1]: All DM devices detached.
[  121.166327] systemd-shutdown[1]: /lib/systemd/system-shutdown succeeded. 
[  121.171739] systemd-shutdown[1]: Powering off.
[  121.182331] rebo�



Best regards
Michael

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-07 Thread Felipe Balbi

Hi,

Michael Niewöhner  writes:
>> The clocks are same across working/non-working.
>> Is it possible to bisect the commit that's causing hang for 4.8x ?
>
>
> [c499ff71ff2a281366c6ec7a904c547d806cbcd1] usb: dwc3: core: re-factor init 
> and exit paths
> This patch causes both the hang on reboot and the lsusb hang.

How to reproduce? Why don't we see this on x86 and TI boards? I'm
guessing this is failed bisection, as I can't see anything in that
commit that would cause reboot hang. Also, that code path is *NOT*
executed when you run lsusb.

-- 
balbi


signature.asc
Description: PGP signature


Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-06 Thread Michael Niewöhner
Hi Vivek,
On Di, 2016-10-04 at 17:32 +0530, Vivek Gautam wrote:
> Hi Michael,
> 
> 
> On Tue, Oct 4, 2016 at 4:28 PM, Michael Niewöhner  
> wrote:
> 
> > 
> > > 
> > > > 
> > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > [1.] One line summary of the problem:
> > > > > > > DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422
> > > > > > > 
> > > > > > > [2.] Full description of the problem/report:
> > > > > > > No usb 3.0 devices are being detected when attached while USB 2.0
> > > > > > > devices work on the same port.
> > > > > > > USB 3.0 works after applying patches [9.1] and [9.2], but seems
> > > > > > > to be
> > > > > > > buggy. The usb hub is redetected every time an usb device is
> > > > > > > attached.
> 
> [snip]
> 
> > 
> > > 
> > > > 
> > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > > 
> > > > > > > > [9.] Other notes, patches, fixes, workarounds:
> > > > > > > > [9.1] https://lkml.org/lkml/2014/4/28/234
> > > > > > > > [9.2] https://lkml.org/lkml/2015/2/2/259
> > > 
> > > These patches are required to get USB super-speed working on 
> > > Exynos5420/5800.
> > > But they did not make to upstream. There was resistance on adding new
> > > phy_calibrate()
> > > callback.
> > > 
> > > Without these patches the Exynos5420/5800 will enumerate all
> > > super-speed capable devices
> > > as high-speed devices.
> > > Last time we checked with exynos542x smdk boards and peach-* boards,
> > > we could get the
> > > Super - speed devices working. I have not tested odroid anytime so
> > > don't have much idea about the
> > > its intricacies.
> > > I guess Anand was able to use these patches to get his kernel working in 
> > > past.
> > 
> > 
> > The patches don't work anymore with 4.8-rc* / 4.8. They worked - but very
> > unstable - with 4.7.
> > 
> > One more problem appeared since one of the 4.8-RCs: reboot hangs when the 
> > dwc3
> > module is loaded. If I unload it before reboot / shutdown everything is 
> > fine.
> > 
> > 
> > > 
> > > 
> > > When you have a downstream on-board usb hub, ideally it should be able
> > > to detect the devices
> > > and not reset everytime you connect a new device (like you mentioned 
> > > earlier).
> > > There can be two possible reasons why the hub keeps getting reset ever
> > > after applying the above
> > > mentioned patches:
> > > 1) the clock rates are not proper.
> > > 2) the regulator load setting is not enough to drive the hub.
> > > 
> > > Anand, can you please point Michael to an older kernel with which you
> > > could test usb on odroid successfully ?
> > > You can compare the clocks with an older version and see if there'a
> > > any difference.
> > > 
> > > Any possibility of any other framework (such as, bus-freq) trimming
> > > down the clock - rates ?
> > 
> > 
> > 
> > # v4.7.5
> > 
> > 
> > $ cat /sys/kernel/debug/clk/clk_summary | grep usb
> >  sclk_usbh20_scan_clk 00   48000
> >   0
> >  sclk_usbh20  0048000
> > 000  0
> > mout_usbd300  112400
> >   0
> >    dout_usbd300   002400
> >   0
> >   sclk_usbd300
> >  002400  0
> >    dout_usbphy300 112400
> >   0
> >   sclk_usbphy300  4424000
> > 000  0
> > mout_usbd301  112400
> >   0
> >    dout_usbd301   002400
> >   0
> >   sclk_usbd301
> >  002400  0
> >    dout_usbphy301 112400
> >   0
> >   sclk_usbphy301  3324000
> > 000  0
> >  usbd301   11   1
> >  usbd300   11   1
> > 
> > usbh20   33   1  0
> 
> > 
> > 
> > 
> > # v4.8.0
> > 
> > 
> > $ cat /sys/kernel/debug/clk/clk_summary | grep usb
> >  sclk_usbh20_scan_clk 00   48000
> >   0
> >  sclk_usbh20  004800
> > 0
> > mout_usbd300  112400
> >   0
> >    dout_usbd300   002400
> >   0
> >   sclk_usbd300
> > 002400  0
> >    dout_usbphy300 112400
> >   0
> >   sclk_usbphy300  442400
> > 0
> > 

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-05 Thread Anand Moon
Hi Vivek,

On 5 October 2016 at 10:15, Vivek Gautam  wrote:
> Hi Anand,
>
>
> On Tue, Oct 4, 2016 at 8:39 PM, Anand Moon  wrote:
>> Hi Vivek,
>>
>
> [snip]
>
>>
>> What I feel is that their need to be some reset of usb phy so that
>> device are assigned to respective bus ports.
>
> The phy resets are what we do in the phy-exynos5-usbdrd driver. In
> addition to what we
> have currently in this phy driver, we just need the phy calibration
> patch [1] for phy configurations.
>
> [1] https://lkml.org/lkml/2015/2/2/259

Yes I am only using the above patch.
If you dont mind please resend this patch again.

>
>> odroid@odroid:~$ lsusb -t
>> /:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
>> /:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
>> |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=r8152, 480M
>
> This shows the ethernet device gets detected on the high-speed port of one
> of the controller.
> The lsusb output for kernel v4.7.x posted by Michael show that the
> ethernet device got detected on super-speed port of the controller.
> So, there seems to be a difference between the two.
> Or, is this how it is behaving ?

With other patches it miss behaves and the ethernet land onto another bus
port
.


> Is this lsusb output on 4.8 kernel with the patch [1] ?

Yes correct.

>
>> /:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
>> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
>> |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 
>> 5000M
>> |__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 
>> 5000M
>> /:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
>> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
>> /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
>> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=exynos-ehci/3p, 480M
>> |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M
>>
>>
>> Bus 06.Port should register the Realtek Ethernet r8153 device.
>> But I am not able to trace out how it's should happen.
>
> If i understand, below is how the configuration looks like on the board?
>
> +---+
> +-->|   |
> |   |   Bus 6   |---+
> +---+   |(super-speed)  |   |
> |   |   +---+   |
> |Controller |   | > Ethernet device
> |2  |   |
> |   |   +---+   |
> +---+   |   |   |
> |   |   Bus 5   |---+
> +-->|   (high-speed)|
> +---+
>
>
> +---+
> +-->|   |
> |   |   Bus 4   |---+
> +---+   |(super-speed)  |   |
> |   |   +---+   |
> |Controller |   | > (On board
> hub ?? _OR_ external hub with downstream devices) ???
> |1  |   |
> |   |   +---+   |
> +---+   |   |   |
> |   |   Bus 3   |---+
> +-->|   (high-speed)|
> +---+
>
[snip]

Yes this is correct mapping of usb ports and ethernet on the board.

Below is the schematic of the board.

http://dn.odroid.com/5422/ODROID-XU4/Schematics/XU4_MAIN_REV0.1_20151202.pdf

I have couple of questions so if you can help me out.

1 > Their is no vbus pin connector to the usb ports ?

2 > I have also tried to configure usbdrd_dwc3_0/1 nodes with no luck
snps,usb3_lpm_capable;
snps,dis_u3_susphy_quirk;
snps,dis_u2_susphy_quirk;

3 > do you feel their could be way to reset the USB PHY (ethenet)
   either though the DTS using gpio and pincrt

4 > how should be the port mapping done to the usb hub.
  Odroid XU4 has 2 usb 3.0 and 1 ehci port.
  Odroid XU3 has 1 usb 3.0 and 1 usb 3.0 otg port and 4 ehci
port


I would like to know how to debug low level debug of USB connection.
so that we could solve the issue.

Thanks for you help in looking to this, please guide me.
Attach is the logs of lsusb -v and console output.

-Best Regards
Anand Moon
odroid@odroid:~$ lsusb -v

Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Couldn't open device, some information will be missing
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   3.00
  bDeviceClass9 Hub
  bDeviceSubClass 0 Unused
  bDeviceProtocol 3
  bMaxPacketSize0 9
  idVendor  

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-04 Thread Vivek Gautam
Hi Anand,


On Tue, Oct 4, 2016 at 8:39 PM, Anand Moon  wrote:
> Hi Vivek,
>

[snip]

>
> What I feel is that their need to be some reset of usb phy so that
> device are assigned to respective bus ports.

The phy resets are what we do in the phy-exynos5-usbdrd driver. In
addition to what we
have currently in this phy driver, we just need the phy calibration
patch [1] for phy configurations.

[1] https://lkml.org/lkml/2015/2/2/259

> odroid@odroid:~$ lsusb -t
> /:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> /:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=r8152, 480M

This shows the ethernet device gets detected on the high-speed port of one
of the controller.
The lsusb output for kernel v4.7.x posted by Michael show that the
ethernet device got detected on super-speed port of the controller.
So, there seems to be a difference between the two.
Or, is this how it is behaving ?

Is this lsusb output on 4.8 kernel with the patch [1] ?

> /:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
> |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
> |__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
> /:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
> /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=exynos-ehci/3p, 480M
> |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M
>
>
> Bus 06.Port should register the Realtek Ethernet r8153 device.
> But I am not able to trace out how it's should happen.

If i understand, below is how the configuration looks like on the board?

+---+
+-->|   |
|   |   Bus 6   |---+
+---+   |(super-speed)  |   |
|   |   +---+   |
|Controller |   | > Ethernet device
|2  |   |
|   |   +---+   |
+---+   |   |   |
|   |   Bus 5   |---+
+-->|   (high-speed)|
+---+


+---+
+-->|   |
|   |   Bus 4   |---+
+---+   |(super-speed)  |   |
|   |   +---+   |
|Controller |   | > (On board
hub ?? _OR_ external hub with downstream devices) ???
|1  |   |
|   |   +---+   |
+---+   |   |   |
|   |   Bus 3   |---+
+-->|   (high-speed)|
+---+


Thanks
Vivek


--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-04 Thread Anand Moon
Hi Vivek,

On 4 October 2016 at 17:32, Vivek Gautam  wrote:
> Hi Michael,
>
>
> On Tue, Oct 4, 2016 at 4:28 PM, Michael Niewöhner  
> wrote:
>
>> > > > > > [1.] One line summary of the problem:
>> > > > > > DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422
>> > > > > >
>> > > > > > [2.] Full description of the problem/report:
>> > > > > > No usb 3.0 devices are being detected when attached while USB 2.0
>> > > > > > devices work on the same port.
>> > > > > > USB 3.0 works after applying patches [9.1] and [9.2], but seems
>> > > > > > to be
>> > > > > > buggy. The usb hub is redetected every time an usb device is
>> > > > > > attached.
>
> [snip]
>
>>> > > > > > [9.] Other notes, patches, fixes, workarounds:
>>> > > > > > [9.1] https://lkml.org/lkml/2014/4/28/234
>>> > > > > > [9.2] https://lkml.org/lkml/2015/2/2/259
>>>
>>> These patches are required to get USB super-speed working on 
>>> Exynos5420/5800.
>>> But they did not make to upstream. There was resistance on adding new
>>> phy_calibrate()
>>> callback.
>>>
>>> Without these patches the Exynos5420/5800 will enumerate all
>>> super-speed capable devices
>>> as high-speed devices.
>>> Last time we checked with exynos542x smdk boards and peach-* boards,
>>> we could get the
>>> Super - speed devices working. I have not tested odroid anytime so
>>> don't have much idea about the
>>> its intricacies.
>>> I guess Anand was able to use these patches to get his kernel working in 
>>> past.
>>
>>
>> The patches don't work anymore with 4.8-rc* / 4.8. They worked - but very
>> unstable - with 4.7.
>>
>> One more problem appeared since one of the 4.8-RCs: reboot hangs when the 
>> dwc3
>> module is loaded. If I unload it before reboot / shutdown everything is fine.
>>
>>
>>>
>>> When you have a downstream on-board usb hub, ideally it should be able
>>> to detect the devices
>>> and not reset everytime you connect a new device (like you mentioned 
>>> earlier).
>>> There can be two possible reasons why the hub keeps getting reset ever
>>> after applying the above
>>> mentioned patches:
>>> 1) the clock rates are not proper.
>>> 2) the regulator load setting is not enough to drive the hub.
>>>
>>> Anand, can you please point Michael to an older kernel with which you
>>> could test usb on odroid successfully ?
>>> You can compare the clocks with an older version and see if there'a
>>> any difference.
>>>
>>> Any possibility of any other framework (such as, bus-freq) trimming
>>> down the clock - rates ?
>>
>>
>> 
>> # v4.7.5
>> 
>>
>> $ cat /sys/kernel/debug/clk/clk_summary | grep usb
>>  sclk_usbh20_scan_clk 00   48000 
>>  0
>>  sclk_usbh20  0048000
>> 000  0
>> mout_usbd300  112400 
>>  0
>>dout_usbd300   002400 
>>  0
>>   sclk_usbd300
>>  002400  0
>>dout_usbphy300 112400 
>>  0
>>   sclk_usbphy300  4424000
>> 000  0
>> mout_usbd301  112400 
>>  0
>>dout_usbd301   002400 
>>  0
>>   sclk_usbd301
>>  002400  0
>>dout_usbphy301 112400 
>>  0
>>   sclk_usbphy301  3324000
>> 000  0
>>  usbd301   11   1
>>  usbd300   11   1
>>
>> usbh20   33   1  0
>
>>
>> 
>> # v4.8.0
>> 
>>
>> $ cat /sys/kernel/debug/clk/clk_summary | grep usb
>>  sclk_usbh20_scan_clk 00   48000 
>>  0
>>  sclk_usbh20  004800
>> 0
>> mout_usbd300  112400 
>>  0
>>dout_usbd300   002400 
>>  0
>>   sclk_usbd300
>> 002400  0
>>dout_usbphy300 112400 
>>  0
>>   sclk_usbphy300  442400
>> 0
>> mout_usbd301  112400 
>>  0
>>dout_usbd301   002400 
>>  0
>>   sclk_usbd301
>> 002400  0
>>dout_usbphy301 11   

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-04 Thread Vivek Gautam
Hi Michael,


On Tue, Oct 4, 2016 at 4:28 PM, Michael Niewöhner  wrote:

> > > > > > [1.] One line summary of the problem:
> > > > > > DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422
> > > > > >
> > > > > > [2.] Full description of the problem/report:
> > > > > > No usb 3.0 devices are being detected when attached while USB 2.0
> > > > > > devices work on the same port.
> > > > > > USB 3.0 works after applying patches [9.1] and [9.2], but seems
> > > > > > to be
> > > > > > buggy. The usb hub is redetected every time an usb device is
> > > > > > attached.

[snip]

>> > > > > > [9.] Other notes, patches, fixes, workarounds:
>> > > > > > [9.1] https://lkml.org/lkml/2014/4/28/234
>> > > > > > [9.2] https://lkml.org/lkml/2015/2/2/259
>>
>> These patches are required to get USB super-speed working on Exynos5420/5800.
>> But they did not make to upstream. There was resistance on adding new
>> phy_calibrate()
>> callback.
>>
>> Without these patches the Exynos5420/5800 will enumerate all
>> super-speed capable devices
>> as high-speed devices.
>> Last time we checked with exynos542x smdk boards and peach-* boards,
>> we could get the
>> Super - speed devices working. I have not tested odroid anytime so
>> don't have much idea about the
>> its intricacies.
>> I guess Anand was able to use these patches to get his kernel working in 
>> past.
>
>
> The patches don't work anymore with 4.8-rc* / 4.8. They worked - but very
> unstable - with 4.7.
>
> One more problem appeared since one of the 4.8-RCs: reboot hangs when the dwc3
> module is loaded. If I unload it before reboot / shutdown everything is fine.
>
>
>>
>> When you have a downstream on-board usb hub, ideally it should be able
>> to detect the devices
>> and not reset everytime you connect a new device (like you mentioned 
>> earlier).
>> There can be two possible reasons why the hub keeps getting reset ever
>> after applying the above
>> mentioned patches:
>> 1) the clock rates are not proper.
>> 2) the regulator load setting is not enough to drive the hub.
>>
>> Anand, can you please point Michael to an older kernel with which you
>> could test usb on odroid successfully ?
>> You can compare the clocks with an older version and see if there'a
>> any difference.
>>
>> Any possibility of any other framework (such as, bus-freq) trimming
>> down the clock - rates ?
>
>
> 
> # v4.7.5
> 
>
> $ cat /sys/kernel/debug/clk/clk_summary | grep usb
>  sclk_usbh20_scan_clk 00   48000  > 0
>  sclk_usbh20  0048000
> 000  0
> mout_usbd300  112400  > 0
>dout_usbd300   002400  > 0
>   sclk_usbd300
>  002400  0
>dout_usbphy300 112400  > 0
>   sclk_usbphy300  4424000
> 000  0
> mout_usbd301  112400  > 0
>dout_usbd301   002400  > 0
>   sclk_usbd301
>  002400  0
>dout_usbphy301 112400  > 0
>   sclk_usbphy301  3324000
> 000  0
>  usbd301   11   1
>  usbd300   11   1
>
> usbh20   33   1  0

>
> 
> # v4.8.0
> 
>
> $ cat /sys/kernel/debug/clk/clk_summary | grep usb
>  sclk_usbh20_scan_clk 00   48000  > 0
>  sclk_usbh20  004800
> 0
> mout_usbd300  112400  > 0
>dout_usbd300   002400  > 0
>   sclk_usbd300
> 002400  0
>dout_usbphy300 112400  > 0
>   sclk_usbphy300  442400
> 0
> mout_usbd301  112400  > 0
>dout_usbd301   002400  > 0
>   sclk_usbd301
> 002400  0
>dout_usbphy301 112400  > 0
>   sclk_usbphy301  332400
> 0
>  usbd301   11   1

This clock should have been 200MHz.

>  

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-04 Thread Vivek Gautam
Hi Michael,


On Tue, Aug 30, 2016 at 10:32 AM, Anand Moon  wrote:
> Hi All
>
> Adding Vivek Gautam.

Sorry for missing out this conversation. I am no longer part of Samsung.

>
> On 29 August 2016 at 16:35, Michael Niewöhner  wrote:
>> Hi Mathias,
>> On Mo, 2016-08-29 at 13:59 +0300, Mathias Nyman wrote:
>>> On 29.08.2016 10:28, Felipe Balbi wrote:
>>> >
>>> >
>>> > Hi,
>>> >
>>> > Michael Niewöhner  writes:
>>> > >
>>> > > [1.] One line summary of the problem:
>>> > > DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422
>>> > >
>>> > > [2.] Full description of the problem/report:
>>> > > No usb 3.0 devices are being detected when attached while USB 2.0
>>> > > devices work on the same port.
>>> > > USB 3.0 works after applying patches [9.1] and [9.2], but seems
>>> > > to be
>>> > > buggy. The usb hub is redetected every time an usb device is
>>> > > attached.

[snip]

>>> >
>>> > >
>>> > > [9.] Other notes, patches, fixes, workarounds:
>>> > > [9.1] https://lkml.org/lkml/2014/4/28/234
>>> > > [9.2] https://lkml.org/lkml/2015/2/2/259

These patches are required to get USB super-speed working on Exynos5420/5800.
But they did not make to upstream. There was resistance on adding new
phy_calibrate()
callback.

Without these patches the Exynos5420/5800 will enumerate all
super-speed capable devices
as high-speed devices.
Last time we checked with exynos542x smdk boards and peach-* boards,
we could get the
Super - speed devices working. I have not tested odroid anytime so
don't have much idea about the
its intricacies.
I guess Anand was able to use these patches to get his kernel working in past.

When you have a downstream on-board usb hub, ideally it should be able
to detect the devices
and not reset everytime you connect a new device (like you mentioned earlier).
There can be two possible reasons why the hub keeps getting reset ever
after applying the above
mentioned patches:
1) the clock rates are not proper.
2) the regulator load setting is not enough to drive the hub.

Anand, can you please point Michael to an older kernel with which you
could test usb on odroid successfully ?
You can compare the clocks with an older version and see if there'a
any difference.

Any possibility of any other framework (such as, bus-freq) trimming
down the clock - rates ?


[snip]

>
> There are two dwc3 ports in the SoC : one for Gbit Ethernet another
> one for on-board GL3521 USB 3.0 hub controller.
>
> 3.10.x kernel
> odroid@odroid:~$ lsusb -t
> /:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
> /:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> /:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
> /:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
> /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=s5p-ehci/3p, 480M
>
> 4.x kernel
> odroid@odroid:~$ lsusb -t
> /:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> /:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=r8152, 480M
> /:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
> |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
> |__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
> /:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
> /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=exynos-ehci/3p, 480M

[snip]

Michael, please paste the output of lsusb -t and/or lsusb -v as well.


Best regards
Vivek

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-10-03 Thread Michael Niewöhner
Hi,

On Di, 2016-09-20 at 23:12 +0200, Michael Niewöhner wrote:
> 
> 
> Hi guys,
> > 
> > 
> > > 
> > > 
> > > Hi All
> > >  
> > > Adding Vivek Gautam.
> > >  
> > > On 29 August 2016 at 16:35, Michael Niewöhner
> > 
> > > 
> > > 
> > > wrote:
> > > > 
> > > > 
> > > > > 
> > > > > 
> > > > >  
> > > > > Hi Mathias,
> > > > > On Mo, 2016-08-29 at 13:59 +0300, Mathias Nyman wrote:
> > > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >  
> > > > > > > On 29.08.2016 10:28, Felipe Balbi wrote:
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > Hi,
> > > > > > > > >  
> > > > > > > > > Michael Niewöhner  writes:
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > [1.] One line summary of the problem:
> > > > > > > > > > > DWC3 USB 3.0 not working on Odroid-XU4 with
> > > > > > Exynos 5422
> > > > > > > 
> > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > >  
> > > > > > > > > > > [2.] Full description of the problem/report:
> > > > > > > > > > > No usb 3.0 devices are being detected when
> > > > > > attached while USB
> > > > > > > 
> > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 2.0
> > > > > > > > > > > devices work on the same port.
> > > > > > > > > > > USB 3.0 works after applying patches [9.1] and
> > > > > > [9.2], but
> > > > > > > 
> > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > seems
> > > > > > > > > > > to be
> > > > > > > > > > > buggy. The usb hub is redetected every time an
> > > > > > usb device is
> > > > > > > 
> > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > attached.
> > > > > > > > >  
> > > > > > > > > dwc3 is host, which means it's actually XHCI :-)
> > > > > > > > >  
> > > > > > > > > Adding Mathias
> > > > > > > > >  
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > dmesg:
> > > > > > > > > > > [  192.287080] usb 3-1.2: USB disconnect, device
> > > > > > number 7
> > > > > > > 
> > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > [  210.370699] hub 3-1:1.0: hub_ext_port_status
> > > > > > failed (err =
> > > > > > > 
> > > > > > > 
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > -71)
> > > > > > >  
> > > > > > > Looks like the hub GetPortStatus request fails with
> > > > protocol
> > > > > 
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > error.
> > > > > > >  
> > > > > > > Reading xhci root hub port status is mostly just register
> > > > reads
> > > > > 
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > and
> > > > > > > writes. It
> > > > > > > shouldn't include any actual transfers that could return
> > > > -EPROTO
> > > > > 
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > >  
> > > > > > > So this is not the root hub? but a external or integrated
> > > > on your
> > > > > 
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > board, right?
> > > > > > >  
> > > > > > > The protocol error -71 is returned at transfer errors or
> > > > if
> > > > > 
> > > > > 
> > > > > > 
> > > > > > 
> > > > > > > 
> > > > > > > 
> > > > > > > device
> > > > > > > stalled.
> > > > > > >  
> > > > > > > Adding more xhci debugging options could show something:
> > > > > > > echo -n 'module xhci_hcd =p' >
> > > > > > > /sys/kernel/debug/dynamic_debug/control
> > > > > > >  
> > > > > > > > 
> > > > > > > > 
> > > > > > > > > 
> > > > > > > > > 
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > > 
> > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > > 
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > [9.] Other notes, patches, fixes, workarounds:
> > > > > > > > > > > [9.1] https://lkml.org/lkml/2014/4/28/234
> > > > > > > > > > > [9.2] https://lkml.org/lkml/2015/2/2/259
> > > > > > >  
> > > > > > > The additional patches 

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-09-20 Thread Michael Niewöhner
Hi guys,
On Di, 2016-08-30 at 10:32 +0530, Anand Moon wrote:
> Hi All
> 
> Adding Vivek Gautam.
> 
> On 29 August 2016 at 16:35, Michael Niewöhner 
> wrote:
> > 
> > Hi Mathias,
> > On Mo, 2016-08-29 at 13:59 +0300, Mathias Nyman wrote:
> > > 
> > > On 29.08.2016 10:28, Felipe Balbi wrote:
> > > > 
> > > > 
> > > > 
> > > > Hi,
> > > > 
> > > > Michael Niewöhner  writes:
> > > > > 
> > > > > 
> > > > > [1.] One line summary of the problem:
> > > > > DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422
> > > > > 
> > > > > [2.] Full description of the problem/report:
> > > > > No usb 3.0 devices are being detected when attached while USB
> > > > > 2.0
> > > > > devices work on the same port.
> > > > > USB 3.0 works after applying patches [9.1] and [9.2], but
> > > > > seems
> > > > > to be
> > > > > buggy. The usb hub is redetected every time an usb device is
> > > > > attached.
> > > > 
> > > > dwc3 is host, which means it's actually XHCI :-)
> > > > 
> > > > Adding Mathias
> > > > 
> > > > > 
> > > > > 
> > > > > dmesg:
> > > > > [  192.287080] usb 3-1.2: USB disconnect, device number 7
> > > > > [  210.370699] hub 3-1:1.0: hub_ext_port_status failed (err =
> > > > > -71)
> > > 
> > > Looks like the hub GetPortStatus request fails with protocol
> > > error.
> > > 
> > > Reading xhci root hub port status is mostly just register reads
> > > and
> > > writes. It
> > > shouldn't include any actual transfers that could return -EPROTO
> > > 
> > > So this is not the root hub? but a external or integrated on your
> > > board, right?
> > > 
> > > The protocol error -71 is returned at transfer errors or if
> > > device
> > > stalled.
> > > 
> > > Adding more xhci debugging options could show something:
> > > echo -n 'module xhci_hcd =p' >
> > > /sys/kernel/debug/dynamic_debug/control
> > > 
> > > > 
> > > > 
> > > > > 
> > > > > 
> > > > > [9.] Other notes, patches, fixes, workarounds:
> > > > > [9.1] https://lkml.org/lkml/2014/4/28/234
> > > > > [9.2] https://lkml.org/lkml/2015/2/2/259
> > > 
> > > The additional patches that makes things somehow work involve
> > > tuning
> > > the PHY,
> > > this is an area I'm not familiar with
> > > 
> > > -Mathias
> > > 
> > 
> > 
> > I'm sorry, I should have said that this is the dmesg output with
> > the
> > patches applied. Without them there is no output at all when I
> > attach
> > an usb 3.0 device.
> > 
> > Michael
> 
> There are two dwc3 ports in the SoC : one for Gbit Ethernet another
> one for on-board GL3521 USB 3.0 hub controller.
> 
> 3.10.x kernel
> odroid@odroid:~$ lsusb -t
> /:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class,
> Driver=r8152, 5000M
> /:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> /:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
> /:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
> /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=s5p-ehci/3p, 480M
> 
> 4.x kernel
> odroid@odroid:~$ lsusb -t
> /:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> /:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class,
> Driver=r8152, 480M
> /:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
> |__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-
> storage, 5000M
> |__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=usb-
> storage, 5000M
> /:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
> /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=exynos-ehci/3p, 480M
> 
> I fell that Ethernet driver r8152 is not getting registered to
> xhci-hcd to bus port 06
> which lead to other ports to miss configure, some time the Ethernet
> port get register to bus port 04
> 
> Their is also a possibility that all the port are not getting proper
> power from the S2MPS11 PMIC
> and possible some reset of the phy is needed to reconfigure the
> exynos
> USB HSIC controller.
> 
> Best Regards
> -Anand Moon
> --
> To unsubscribe from this list: send the line "unsubscribe linux-
> samsung-soc" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Today I've tested v4.8-rc7 (without the patches above). The USB 3.0
ports have stopped working completely for me. Neither USB 2.0 nor USB
3.0 are being detected. The Ethernet port does not work, too. The USB-
2.0-only Port works.

There also a new problem: my XU4 does not 

Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-08-29 Thread Anand Moon
Hi All

Adding Vivek Gautam.

On 29 August 2016 at 16:35, Michael Niewöhner  wrote:
> Hi Mathias,
> On Mo, 2016-08-29 at 13:59 +0300, Mathias Nyman wrote:
>> On 29.08.2016 10:28, Felipe Balbi wrote:
>> >
>> >
>> > Hi,
>> >
>> > Michael Niewöhner  writes:
>> > >
>> > > [1.] One line summary of the problem:
>> > > DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422
>> > >
>> > > [2.] Full description of the problem/report:
>> > > No usb 3.0 devices are being detected when attached while USB 2.0
>> > > devices work on the same port.
>> > > USB 3.0 works after applying patches [9.1] and [9.2], but seems
>> > > to be
>> > > buggy. The usb hub is redetected every time an usb device is
>> > > attached.
>> >
>> > dwc3 is host, which means it's actually XHCI :-)
>> >
>> > Adding Mathias
>> >
>> > >
>> > > dmesg:
>> > > [  192.287080] usb 3-1.2: USB disconnect, device number 7
>> > > [  210.370699] hub 3-1:1.0: hub_ext_port_status failed (err =
>> > > -71)
>>
>> Looks like the hub GetPortStatus request fails with protocol error.
>>
>> Reading xhci root hub port status is mostly just register reads and
>> writes. It
>> shouldn't include any actual transfers that could return -EPROTO
>>
>> So this is not the root hub? but a external or integrated on your
>> board, right?
>>
>> The protocol error -71 is returned at transfer errors or if device
>> stalled.
>>
>> Adding more xhci debugging options could show something:
>> echo -n 'module xhci_hcd =p' >
>> /sys/kernel/debug/dynamic_debug/control
>>
>> >
>> > >
>> > > [9.] Other notes, patches, fixes, workarounds:
>> > > [9.1] https://lkml.org/lkml/2014/4/28/234
>> > > [9.2] https://lkml.org/lkml/2015/2/2/259
>>
>> The additional patches that makes things somehow work involve tuning
>> the PHY,
>> this is an area I'm not familiar with
>>
>> -Mathias
>>
>
>
> I'm sorry, I should have said that this is the dmesg output with the
> patches applied. Without them there is no output at all when I attach
> an usb 3.0 device.
>
> Michael

There are two dwc3 ports in the SoC : one for Gbit Ethernet another
one for on-board GL3521 USB 3.0 hub controller.

3.10.x kernel
odroid@odroid:~$ lsusb -t
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=s5p-ehci/3p, 480M

4.x kernel
odroid@odroid:~$ lsusb -t
/:  Bus 06.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=r8152, 480M
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 5000M
|__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
|__ Port 2: Dev 4, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=exynos-ehci/3p, 480M

I fell that Ethernet driver r8152 is not getting registered to
xhci-hcd to bus port 06
which lead to other ports to miss configure, some time the Ethernet
port get register to bus port 04

Their is also a possibility that all the port are not getting proper
power from the S2MPS11 PMIC
and possible some reset of the phy is needed to reconfigure the exynos
USB HSIC controller.

Best Regards
-Anand Moon
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-08-29 Thread Michael Niewöhner
Hi Mathias,
On Mo, 2016-08-29 at 13:59 +0300, Mathias Nyman wrote:
> On 29.08.2016 10:28, Felipe Balbi wrote:
> > 
> > 
> > Hi,
> > 
> > Michael Niewöhner  writes:
> > > 
> > > [1.] One line summary of the problem:
> > > DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422
> > > 
> > > [2.] Full description of the problem/report:
> > > No usb 3.0 devices are being detected when attached while USB 2.0
> > > devices work on the same port.
> > > USB 3.0 works after applying patches [9.1] and [9.2], but seems
> > > to be
> > > buggy. The usb hub is redetected every time an usb device is
> > > attached.
> > 
> > dwc3 is host, which means it's actually XHCI :-)
> > 
> > Adding Mathias
> > 
> > > 
> > > dmesg:
> > > [  192.287080] usb 3-1.2: USB disconnect, device number 7
> > > [  210.370699] hub 3-1:1.0: hub_ext_port_status failed (err =
> > > -71)
> 
> Looks like the hub GetPortStatus request fails with protocol error.
> 
> Reading xhci root hub port status is mostly just register reads and
> writes. It
> shouldn't include any actual transfers that could return -EPROTO
> 
> So this is not the root hub? but a external or integrated on your
> board, right?
> 
> The protocol error -71 is returned at transfer errors or if device
> stalled.
> 
> Adding more xhci debugging options could show something:
> echo -n 'module xhci_hcd =p' >
> /sys/kernel/debug/dynamic_debug/control
> 
> > 
> > > 
> > > [9.] Other notes, patches, fixes, workarounds:
> > > [9.1] https://lkml.org/lkml/2014/4/28/234
> > > [9.2] https://lkml.org/lkml/2015/2/2/259
> 
> The additional patches that makes things somehow work involve tuning
> the PHY,
> this is an area I'm not familiar with
> 
> -Mathias
> 


I'm sorry, I should have said that this is the dmesg output with the
patches applied. Without them there is no output at all when I attach
an usb 3.0 device.

Michael

signature.asc
Description: This is a digitally signed message part


Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-08-29 Thread Mathias Nyman

On 29.08.2016 10:28, Felipe Balbi wrote:


Hi,

Michael Niewöhner  writes:

[1.] One line summary of the problem:
DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

[2.] Full description of the problem/report:
No usb 3.0 devices are being detected when attached while USB 2.0
devices work on the same port.
USB 3.0 works after applying patches [9.1] and [9.2], but seems to be
buggy. The usb hub is redetected every time an usb device is attached.


dwc3 is host, which means it's actually XHCI :-)

Adding Mathias


dmesg:
[  192.287080] usb 3-1.2: USB disconnect, device number 7
[  210.370699] hub 3-1:1.0: hub_ext_port_status failed (err = -71)


Looks like the hub GetPortStatus request fails with protocol error.

Reading xhci root hub port status is mostly just register reads and writes. It
shouldn't include any actual transfers that could return -EPROTO

So this is not the root hub? but a external or integrated on your board, right?

The protocol error -71 is returned at transfer errors or if device stalled.

Adding more xhci debugging options could show something:
echo -n 'module xhci_hcd =p' > /sys/kernel/debug/dynamic_debug/control


[9.] Other notes, patches, fixes, workarounds:
[9.1] https://lkml.org/lkml/2014/4/28/234
[9.2] https://lkml.org/lkml/2015/2/2/259


The additional patches that makes things somehow work involve tuning the PHY,
this is an area I'm not familiar with

-Mathias

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-08-29 Thread Felipe Balbi

Hi,

Michael Niewöhner  writes:
> [1.] One line summary of the problem:
> DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422
>
> [2.] Full description of the problem/report:
> No usb 3.0 devices are being detected when attached while USB 2.0
> devices work on the same port.
> USB 3.0 works after applying patches [9.1] and [9.2], but seems to be
> buggy. The usb hub is redetected every time an usb device is attached.

dwc3 is host, which means it's actually XHCI :-)

Adding Mathias

> dmesg:
> [  192.287080] usb 3-1.2: USB disconnect, device number 7
> [  210.370699] hub 3-1:1.0: hub_ext_port_status failed (err = -71)
> [  210.375159] usb 3-1-port2: connect-debounce failed
> [  210.380126] usb 3-1: USB disconnect, device number 5
> [  210.488917] usb 4-1: USB disconnect, device number 3
> [  210.708861] usb 3-1: new high-speed USB device number 9 using xhci-hcd
> [  210.851308] usb 3-1: New USB device found, idVendor=05e3, idProduct=0610
> [  210.856530] usb 3-1: New USB device strings: Mfr=1, Product=2, 
> SerialNumber=0
> [  210.863696] usb 3-1: Product: USB2.0 Hub
> [  210.867721] usb 3-1: Manufacturer: GenesysLogic
> [  210.877800] hub 3-1:1.0: USB hub found
> [  210.880600] hub 3-1:1.0: 2 ports detected
> [  210.913438] [drm:hdmi_probe] *ERROR* Failed to get ddc i2c adapter by node
> [  211.468970] usb 3-1.2: new high-speed USB device number 10 using xhci-hcd
> [  211.579279] usb 3-1.2: New USB device found, idVendor=0951, idProduct=1666
> [  211.584667] usb 3-1.2: New USB device strings: Mfr=1, Product=2, 
> SerialNumber=3
> [  211.592002] usb 3-1.2: Product: DataTraveler 3.0
> [  211.596720] usb 3-1.2: Manufacturer: Kingston
> [  211.601075] usb 3-1.2: SerialNumber: 00190F0C0295BE711962B008
> [  211.607557] usb-storage 3-1.2:1.0: USB Mass Storage device detected
> [  211.613640] scsi host0: usb-storage 3-1.2:1.0
> [  211.620179] [drm:hdmi_probe] *ERROR* Failed to get ddc i2c adapter by node
> [  212.677008] scsi 0:0:0:0: Direct-Access Kingston DataTraveler 3.0 PMAP 
> PQ: 0 ANSI: 6
> [  212.685208] sd 0:0:0:0: Attached scsi generic sg0 type 0
> [  212.687323] [drm:hdmi_probe] *ERROR* Failed to get ddc i2c adapter by node
> [  214.209074] usb 4-1: new SuperSpeed USB device number 4 using xhci-hcd
> [  214.231660] usb 4-1: New USB device found, idVendor=05e3, idProduct=0616
> [  214.236882] usb 4-1: New USB device strings: Mfr=1, Product=2, 
> SerialNumber=0
> [  214.244057] usb 4-1: Product: USB3.0 Hub
> [  214.248060] usb 4-1: Manufacturer: GenesysLogic
> [  214.254181] hub 4-1:1.0: USB hub found
> [  214.256754] hub 4-1:1.0: 2 ports detected
> [  214.264279] [drm:hdmi_probe] *ERROR* Failed to get ddc i2c adapter by node
> [  214.634773] sd 0:0:0:0: [sda] 61457664 512-byte logical blocks: (31.5 
> GB/29.3 GiB)
> [  214.641164] sd 0:0:0:0: [sda] Write Protect is off
> [  214.645631] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
> [  214.645900] sd 0:0:0:0: [sda] No Caching mode page found
> [  214.650978] sd 0:0:0:0: [sda] Assuming drive cache: write through [  
> 214.682552]  sda: sda1
> [  214.685165] sd 0:0:0:0: [sda] Attached SCSI removable disk
> [  234.526936] usb 3-1.2: USB disconnect, device number 10
>
> [3.] Keywords (i.e., modules, networking, kernel):
> usb 3.0, dwc3, exynos, odroid
>  
> [4.] Kernel information
> 4.6.x, 4.7.x
>
> [4.1.] Kernel version (from /proc/version):
> Linux version 4.7.2+ (c0d3@z3r0) (gcc version 5.3.1 20160113 (Linaro
> GCC 5.3-2016.02) ) #1 SMP Sun Aug 28 18:52:25 CEST 2016
>
> [4.2.] Kernel .config file:
> #cat .config | grep -E "(USB|DWC|DRD).*=(m|y)"
> CONFIG_CAN_EMS_USB=m
> CONFIG_CAN_ESD_USB2=m
> CONFIG_CAN_GS_USB=m
> CONFIG_CAN_KVASER_USB=m
> CONFIG_CAN_PEAK_USB=m
> CONFIG_CAN_8DEV_USB=m
> CONFIG_BT_HCIBTUSB=m
> CONFIG_BT_HCIBTUSB_BCM=y
> CONFIG_BT_HCIBTUSB_RTL=y
> CONFIG_USB_NET_DRIVERS=y
> CONFIG_USB_CATC=m
> CONFIG_USB_KAWETH=m
> CONFIG_USB_PEGASUS=m
> CONFIG_USB_RTL8150=m
> CONFIG_USB_RTL8152=m
> CONFIG_USB_USBNET=m
> CONFIG_USB_NET_AX8817X=m
> CONFIG_USB_NET_AX88179_178A=m
> CONFIG_USB_NET_CDCETHER=m
> CONFIG_USB_NET_CDC_EEM=m
> CONFIG_USB_NET_CDC_NCM=m
> CONFIG_USB_NET_HUAWEI_CDC_NCM=m
> CONFIG_USB_NET_CDC_MBIM=m
> CONFIG_USB_NET_DM9601=m
> CONFIG_USB_NET_SR9700=m
> CONFIG_USB_NET_SR9800=m
> CONFIG_USB_NET_SMSC75XX=m
> CONFIG_USB_NET_SMSC95XX=m
> CONFIG_USB_NET_GL620A=m
> CONFIG_USB_NET_NET1080=m
> CONFIG_USB_NET_PLUSB=m
> CONFIG_USB_NET_MCS7830=m
> CONFIG_USB_NET_RNDIS_HOST=m
> CONFIG_USB_NET_CDC_SUBSET_ENABLE=m
> CONFIG_USB_NET_CDC_SUBSET=m
> CONFIG_USB_ALI_M5632=y
> CONFIG_USB_AN2720=y
> CONFIG_USB_BELKIN=y
> CONFIG_USB_ARMLINUX=y
> CONFIG_USB_EPSON2888=y
> CONFIG_USB_KC2190=y
> CONFIG_USB_NET_ZAURUS=m
> CONFIG_USB_NET_CX82310_ETH=m
> CONFIG_USB_NET_KALMIA=m
> CONFIG_USB_NET_QMI_WWAN=m
> CONFIG_USB_HSO=m
> CONFIG_USB_NET_INT51X1=m
> CONFIG_USB_CDC_PHONET=m
> CONFIG_USB_IPHETH=m
> CONFIG_USB_SIERRA_NET=m
> CONFIG_USB_VL600=m
> CONFIG_ATH6KL_USB=m
> CONFIG_AT76C50X_USB=m
> CONFIG_BRCMFMAC_USB=y
> CONFIG_P54_USB=m
> 

PROBLEM: DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

2016-08-28 Thread Michael Niewöhner

[1.] One line summary of the problem:
DWC3 USB 3.0 not working on Odroid-XU4 with Exynos 5422

[2.] Full description of the problem/report:
No usb 3.0 devices are being detected when attached while USB 2.0
devices work on the same port.
USB 3.0 works after applying patches [9.1] and [9.2], but seems to be
buggy. The usb hub is redetected every time an usb device is attached.

dmesg:
[  192.287080] usb 3-1.2: USB disconnect, device number 7
[  210.370699] hub 3-1:1.0: hub_ext_port_status failed (err = -71)
[  210.375159] usb 3-1-port2: connect-debounce failed
[  210.380126] usb 3-1: USB disconnect, device number 5
[  210.488917] usb 4-1: USB disconnect, device number 3
[  210.708861] usb 3-1: new high-speed USB device number 9 using xhci-
hcd
[  210.851308] usb 3-1: New USB device found, idVendor=05e3,
idProduct=0610
[  210.856530] usb 3-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[  210.863696] usb 3-1: Product: USB2.0 Hub
[  210.867721] usb 3-1: Manufacturer: GenesysLogic
[  210.877800] hub 3-1:1.0: USB hub found
[  210.880600] hub 3-1:1.0: 2 ports detected
[  210.913438] [drm:hdmi_probe] *ERROR* Failed to get ddc i2c adapter
by node
[  211.468970] usb 3-1.2: new high-speed USB device number 10 using
xhci-hcd
[  211.579279] usb 3-1.2: New USB device found, idVendor=0951,
idProduct=1666
[  211.584667] usb 3-1.2: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[  211.592002] usb 3-1.2: Product: DataTraveler 3.0
[  211.596720] usb 3-1.2: Manufacturer: Kingston
[  211.601075] usb 3-1.2: SerialNumber: 00190F0C0295BE711962B008
[  211.607557] usb-storage 3-1.2:1.0: USB Mass Storage device detected
[  211.613640] scsi host0: usb-storage 3-1.2:1.0
[  211.620179] [drm:hdmi_probe] *ERROR* Failed to get ddc i2c adapter
by node
[  212.677008] scsi 0:0:0:0: Direct-Access Kingston DataTraveler
3.0 PMAP PQ: 0 ANSI: 6
[  212.685208] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  212.687323] [drm:hdmi_probe] *ERROR* Failed to get ddc i2c adapter
by node
[  214.209074] usb 4-1: new SuperSpeed USB device number 4 using xhci-
hcd
[  214.231660] usb 4-1: New USB device found, idVendor=05e3,
idProduct=0616
[  214.236882] usb 4-1: New USB device strings: Mfr=1, Product=2,
SerialNumber=0
[  214.244057] usb 4-1: Product: USB3.0 Hub
[  214.248060] usb 4-1: Manufacturer: GenesysLogic
[  214.254181] hub 4-1:1.0: USB hub found
[  214.256754] hub 4-1:1.0: 2 ports detected
[  214.264279] [drm:hdmi_probe] *ERROR* Failed to get ddc i2c adapter
by node
[  214.634773] sd 0:0:0:0: [sda] 61457664 512-byte logical blocks:
(31.5 GB/29.3 GiB)
[  214.641164] sd 0:0:0:0: [sda] Write Protect is off
[  214.645631] sd 0:0:0:0: [sda] Mode Sense: 23 00 00 00
[  214.645900] sd 0:0:0:0: [sda] No Caching mode page found
[  214.650978] sd 0:0:0:0: [sda] Assuming drive cache: write through
[  214.682552]  sda: sda1
[  214.685165] sd 0:0:0:0: [sda] Attached SCSI removable disk
[  234.526936] usb 3-1.2: USB disconnect, device number 10

[3.] Keywords (i.e., modules, networking, kernel):
usb 3.0, dwc3, exynos, odroid
 
[4.] Kernel information
4.6.x, 4.7.x

[4.1.] Kernel version (from /proc/version):
Linux version 4.7.2+ (c0d3@z3r0) (gcc version 5.3.1 20160113 (Linaro
GCC 5.3-2016.02) ) #1 SMP Sun Aug 28 18:52:25 CEST 2016

[4.2.] Kernel .config file:
#cat .config | grep -E "(USB|DWC|DRD).*=(m|y)"
CONFIG_CAN_EMS_USB=m
CONFIG_CAN_ESD_USB2=m
CONFIG_CAN_GS_USB=m
CONFIG_CAN_KVASER_USB=m
CONFIG_CAN_PEAK_USB=m
CONFIG_CAN_8DEV_USB=m
CONFIG_BT_HCIBTUSB=m
CONFIG_BT_HCIBTUSB_BCM=y
CONFIG_BT_HCIBTUSB_RTL=y
CONFIG_USB_NET_DRIVERS=y
CONFIG_USB_CATC=m
CONFIG_USB_KAWETH=m
CONFIG_USB_PEGASUS=m
CONFIG_USB_RTL8150=m
CONFIG_USB_RTL8152=m
CONFIG_USB_USBNET=m
CONFIG_USB_NET_AX8817X=m
CONFIG_USB_NET_AX88179_178A=m
CONFIG_USB_NET_CDCETHER=m
CONFIG_USB_NET_CDC_EEM=m
CONFIG_USB_NET_CDC_NCM=m
CONFIG_USB_NET_HUAWEI_CDC_NCM=m
CONFIG_USB_NET_CDC_MBIM=m
CONFIG_USB_NET_DM9601=m
CONFIG_USB_NET_SR9700=m
CONFIG_USB_NET_SR9800=m
CONFIG_USB_NET_SMSC75XX=m
CONFIG_USB_NET_SMSC95XX=m
CONFIG_USB_NET_GL620A=m
CONFIG_USB_NET_NET1080=m
CONFIG_USB_NET_PLUSB=m
CONFIG_USB_NET_MCS7830=m
CONFIG_USB_NET_RNDIS_HOST=m
CONFIG_USB_NET_CDC_SUBSET_ENABLE=m
CONFIG_USB_NET_CDC_SUBSET=m
CONFIG_USB_ALI_M5632=y
CONFIG_USB_AN2720=y
CONFIG_USB_BELKIN=y
CONFIG_USB_ARMLINUX=y
CONFIG_USB_EPSON2888=y
CONFIG_USB_KC2190=y
CONFIG_USB_NET_ZAURUS=m
CONFIG_USB_NET_CX82310_ETH=m
CONFIG_USB_NET_KALMIA=m
CONFIG_USB_NET_QMI_WWAN=m
CONFIG_USB_HSO=m
CONFIG_USB_NET_INT51X1=m
CONFIG_USB_CDC_PHONET=m
CONFIG_USB_IPHETH=m
CONFIG_USB_SIERRA_NET=m
CONFIG_USB_VL600=m
CONFIG_ATH6KL_USB=m
CONFIG_AT76C50X_USB=m
CONFIG_BRCMFMAC_USB=y
CONFIG_P54_USB=m
CONFIG_LIBERTAS_USB=m
CONFIG_LIBERTAS_THINFIRM_USB=m
CONFIG_RT2500USB=m
CONFIG_RT73USB=m
CONFIG_RT2800USB=m
CONFIG_RT2800USB_RT33XX=y
CONFIG_RT2800USB_RT35XX=y
CONFIG_RT2800USB_RT3573=y
CONFIG_RT2800USB_RT53XX=y
CONFIG_RT2800USB_RT55XX=y
CONFIG_RT2X00_LIB_USB=m
CONFIG_RTLWIFI_USB=m
CONFIG_RSI_USB=m
CONFIG_USB_NET_RNDIS_WLAN=m
CONFIG_WIMAX_I2400M_USB=m