Re: twl4030_usb porting advice

2010-12-17 Thread Tomasz Mloduchowski

On 12/17/10 10:11, Felipe Balbi wrote:

Hi,

On Fri, Dec 17, 2010 at 07:23:43AM +, Tomasz Mloduchowski wrote:

I'm quoting a snippet below for commenting.


[ 1.639892] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.646759] ehci_hcd: block sizes: qh 60 qtd 96 itd 160 sitd 96
[ 1.646881] ehci-omap ehci-omap.0: failed to get ehci port1 regulator


This is alarming. Please add this patch to get the error code:

This is also alarming... Let's increase the timeout just for a debugging
purpose:

I've applied both patches. The new kernel log in its entirety resides
here:
http://pastie.org/1384896


Unfortunately seems like pastie.org is down:

503 Service Unavailable
No server is available to handle this request.


And the line of interest is
[ 2.085449] ehci-omap ehci-omap.0: failed to get ehci port1 regulator
-- 0

Unfortunately, I don't understand what an error code of '0' might mean
here, but it surely does something.


That's funny, 0 means success, not sure why that branch is being
called.

I'll wait a bit until pastie is back, but if you could append to your
reply the output of dmesg | grep -i ehci I'd be glad.


I really appreciate your help, this sort of a bug that really stunned me.

I've noticed that the variable storing the error code is set to NULL 
right before printing it out :(, so I corrected this mistake.


[2.065216] ehci-omap ehci-omap.0: failed to get ehci port1 regulator 
-- -19


I also switched to pastebin, with the new, more meaningful dmesg:
http://pastebin.com/86kfLT2G

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


Re: twl4030_usb porting advice

2010-12-17 Thread Felipe Balbi

On Fri, Dec 17, 2010 at 11:14:50AM +, Tomasz Mloduchowski wrote:

I really appreciate your help, this sort of a bug that really stunned me.

I've noticed that the variable storing the error code is set to NULL 
right before printing it out :(, so I corrected this mistake.


[2.065216] ehci-omap ehci-omap.0: failed to get ehci port1 
regulator -- -19


Thanks for that :-)

Error -19 is -ENODEV, so it means there really isn't a regulator.

Maybe you can more debug to ehci_reset() function ?!?


I also switched to pastebin, with the new, more meaningful dmesg:
http://pastebin.com/86kfLT2G


I'll look at it and get back to you. But try to figure out exactly where
ehci decides to bounce the port to companion ohci and start adding
printks or dev_info to that. A good start is ehci_reset(), something
like below might help:

diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 6e25996..7fdaecf 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -330,7 +330,7 @@ dbg_port_buf (char *buf, unsigned len, const char *label, 
int port, u32 status)
 #define dbg_cmd(ehci, label, command) { \
char _buf [80]; \
dbg_command_buf (_buf, sizeof _buf, label, command); \
-   ehci_dbg (ehci, %s\n, _buf); \
+   ehci_info (ehci, %s\n, _buf); \
 }
 
 #define dbg_port(ehci, label, port, status) { \


a lot already.

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


Re: twl4030_usb porting advice

2010-12-16 Thread Felipe Balbi

On Wed, Dec 15, 2010 at 01:09:42PM +, Tomasz Mloduchowski wrote:

On 12/15/10 12:39, Felipe Balbi wrote:

On Wed, Dec 15, 2010 at 12:27:10PM +, Tomasz Mloduchowski wrote:

I would gladly welcome any pointers that could help me solve this
issue.


you're connecting a FS/LS device to EHCI port, that doesn't work. OMAP
can't handle port handoff to companion OHCI controller, then it fails
not being able to enumerate the device. Try remuxing your port to OHCI
controller and disabling EHCI from Kconfig.


It actually is a HS device (it's a 4-port hub) - when booting the
vendor supplied kernel (based off 2.6.32, i.e. pre -IR redesign), the
device identifies as follows:

Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

with the following boot messages:

usb 1-2: new high speed USB device using ehci-omap and address 2
usb 1-2: New USB device found, idVendor=05e3, idProduct=0608
usb 1-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-2: Product: USB2.0 Hub
hub 1-2:1.0: USB hub found
hub 1-2:1.0: 4 ports detected


I've pasted the boot log for my kernel:
http://pastie.org/1379102

And the boot log for the original kernel:
http://pastie.org/1379100


It could be a bug on the reset sequence on ehci-omap.c, do you have
anything connected to any of the hub ports ?

Please enable CONFIG_USB_DEBUG on your kernel config and grab a bit more
information.

Also, boot the machine without the device attached and after booting
run:

# dmesg -c

then attach the device, then grab the output of dmesg.



I don't have the ability to disconnect the hub - it's integrated on 
the board :(


I see.

I've also made a mistake describing the pastebins - the working, PSP 
kernel boot log is here:

http://pastie.org/1379102

while the non-working git kernel messages are here (with CONFIG_USB_DEBUG):
http://pastie.org/1379100


I'm quoting a snippet below for commenting.


[1.639892] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[1.646759] ehci_hcd: block sizes: qh 60 qtd 96 itd 160 sitd 96
[1.646881] ehci-omap ehci-omap.0: failed to get ehci port1 regulator


This is alarming. Please add this patch to get the error code:

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 116ae28..5da3fa3 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -682,7 +682,8 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
if (IS_ERR(omap-regulator[i])) {
omap-regulator[i] = NULL;
dev_dbg(pdev-dev,
-   failed to get ehci port%d regulator\n, i);
+   failed to get ehci port%d regulator -- %d\n, i,
+   PTR_ERR(omap-regulator[i]));
} else {
regulator_enable(omap-regulator[i]);
}


[1.646911] ehci-omap ehci-omap.0: starting TI EHCI USB Controller
[1.647064] ehci-omap ehci-omap.0: OMAP UHH_REVISION 0x10
[1.647094] ehci-omap ehci-omap.0: TLL RESET DONE
[1.647094] ehci-omap ehci-omap.0: OMAP3 ES version  ES2.1
[1.647125] ehci-omap ehci-omap.0: UHH setup done, uhh_hostconfig=21c
[2.649841] ehci-omap ehci-omap.0: phy reset operation timed out


This is also alarming... Let's increase the timeout just for a debugging
purpose:

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 116ae28..fa8bff0 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -239,7 +239,7 @@ static void omap_usb_utmi_init(struct ehci_hcd_omap *omap, 
u8 tll_channel_mask)
 
 static void omap_ehci_soft_phy_reset(struct ehci_hcd_omap *omap, u8 port)

 {
-   unsigned long timeout = jiffies + msecs_to_jiffies(1000);
+   unsigned long timeout = jiffies + msecs_to_jiffies(1);
unsigned reg = 0;
 
reg = ULPI_FUNC_CTRL_RESET


beware, this might slow your boot time quite a lot :-p

The rest is just continuing the enumeration and there's not much
interesting there besides the unable to enumerate message, which could
be caused by the two problems above.

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


Re: twl4030_usb porting advice

2010-12-16 Thread Tomasz Mloduchowski

On 12/16/10 09:09, Felipe Balbi wrote:

On Wed, Dec 15, 2010 at 01:09:42PM +, Tomasz Mloduchowski wrote:

On 12/15/10 12:39, Felipe Balbi wrote:

On Wed, Dec 15, 2010 at 12:27:10PM +, Tomasz Mloduchowski wrote:

I would gladly welcome any pointers that could help me solve this
issue.


you're connecting a FS/LS device to EHCI port, that doesn't work. OMAP
can't handle port handoff to companion OHCI controller, then it fails
not being able to enumerate the device. Try remuxing your port to OHCI
controller and disabling EHCI from Kconfig.


It actually is a HS device (it's a 4-port hub) - when booting the
vendor supplied kernel (based off 2.6.32, i.e. pre -IR redesign), the
device identifies as follows:

I've also made a mistake describing the pastebins - the working, PSP
kernel boot log is here:
http://pastie.org/1379102

while the non-working git kernel messages are here (with
CONFIG_USB_DEBUG):
http://pastie.org/1379100


I'm quoting a snippet below for commenting.


[ 1.639892] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.646759] ehci_hcd: block sizes: qh 60 qtd 96 itd 160 sitd 96
[ 1.646881] ehci-omap ehci-omap.0: failed to get ehci port1 regulator


This is alarming. Please add this patch to get the error code:



This is also alarming... Let's increase the timeout just for a debugging
purpose:

I've applied both patches. The new kernel log in its entirety resides here:
http://pastie.org/1384896

And the line of interest is
[2.085449] ehci-omap ehci-omap.0: failed to get ehci port1 regulator 
-- 0


Unfortunately, I don't understand what an error code of '0' might mean 
here, but it surely does something.


Cheers,
Tomasz

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


Re: twl4030_usb porting advice

2010-12-15 Thread Felipe Balbi

On Wed, Dec 15, 2010 at 11:55:24AM +, Tomasz Mloduchowski wrote:

Hi!

I'm trying to port the support patches for an OMAP3530 based 
development kit by Technexion.
Technexion provides patches for PSP kernel trees, I need to use a 
kernel with modern IR stack, so I'm developing against 
linux-omap-2.6.git



I'm mostly done with the initial port, however, I'm stuck with the 
following issue:


[2.991973] ehci-omap ehci-omap.0: port 2 full speed -- companion
[2.992034] ehci-omap ehci-omap.0: GetStatus port:2 status 003801 0 
ACK POWER OWNER sig=j CONNECT

[2.992095] hub 1-0:1.0: port 2 not reset yet, waiting 50ms
[3.055511] asoc: twl4030-hifi - omap-mcbsp-dai.1 mapping ok
[3.061920] ehci-omap ehci-omap.0: GetStatus port:2 status 003002 0 
ACK POWER OWNER sig=se0 CSC

[3.061981] hub 1-0:1.0: unable to enumerate USB device on port 2
[3.068389] hub 1-0:1.0: state 7 ports 3 chg  evt 0004


I would gladly welcome any pointers that could help me solve this issue.


you're connecting a FS/LS device to EHCI port, that doesn't work. OMAP
can't handle port handoff to companion OHCI controller, then it fails
not being able to enumerate the device. Try remuxing your port to OHCI
controller and disabling EHCI from Kconfig.

You should be using ohci-omap3.c driver.

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


Re: twl4030_usb porting advice

2010-12-15 Thread Tomasz Mloduchowski

I would gladly welcome any pointers that could help me solve this issue.


you're connecting a FS/LS device to EHCI port, that doesn't work. OMAP
can't handle port handoff to companion OHCI controller, then it fails
not being able to enumerate the device. Try remuxing your port to OHCI
controller and disabling EHCI from Kconfig.


It actually is a HS device (it's a 4-port hub) - when booting the vendor 
supplied kernel (based off 2.6.32, i.e. pre -IR redesign), the device 
identifies as follows:


Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

with the following boot messages:

usb 1-2: new high speed USB device using ehci-omap and address 2
usb 1-2: New USB device found, idVendor=05e3, idProduct=0608
usb 1-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-2: Product: USB2.0 Hub
hub 1-2:1.0: USB hub found
hub 1-2:1.0: 4 ports detected


I've pasted the boot log for my kernel:
http://pastie.org/1379102

And the boot log for the original kernel:
http://pastie.org/1379100

Cheers,
Tomasz


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


Re: twl4030_usb porting advice

2010-12-15 Thread Felipe Balbi

On Wed, Dec 15, 2010 at 12:27:10PM +, Tomasz Mloduchowski wrote:

I would gladly welcome any pointers that could help me solve this issue.


you're connecting a FS/LS device to EHCI port, that doesn't work. OMAP
can't handle port handoff to companion OHCI controller, then it fails
not being able to enumerate the device. Try remuxing your port to OHCI
controller and disabling EHCI from Kconfig.


It actually is a HS device (it's a 4-port hub) - when booting the 
vendor supplied kernel (based off 2.6.32, i.e. pre -IR redesign), the 
device identifies as follows:


Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

with the following boot messages:

usb 1-2: new high speed USB device using ehci-omap and address 2
usb 1-2: New USB device found, idVendor=05e3, idProduct=0608
usb 1-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-2: Product: USB2.0 Hub
hub 1-2:1.0: USB hub found
hub 1-2:1.0: 4 ports detected


I've pasted the boot log for my kernel:
http://pastie.org/1379102

And the boot log for the original kernel:
http://pastie.org/1379100


It could be a bug on the reset sequence on ehci-omap.c, do you have
anything connected to any of the hub ports ?

Please enable CONFIG_USB_DEBUG on your kernel config and grab a bit more
information.

Also, boot the machine without the device attached and after booting
run:

# dmesg -c

then attach the device, then grab the output of dmesg.

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


Re: twl4030_usb porting advice

2010-12-15 Thread Tomasz Mloduchowski

On 12/15/10 12:39, Felipe Balbi wrote:

On Wed, Dec 15, 2010 at 12:27:10PM +, Tomasz Mloduchowski wrote:

I would gladly welcome any pointers that could help me solve this
issue.


you're connecting a FS/LS device to EHCI port, that doesn't work. OMAP
can't handle port handoff to companion OHCI controller, then it fails
not being able to enumerate the device. Try remuxing your port to OHCI
controller and disabling EHCI from Kconfig.


It actually is a HS device (it's a 4-port hub) - when booting the
vendor supplied kernel (based off 2.6.32, i.e. pre -IR redesign), the
device identifies as follows:

Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

with the following boot messages:

usb 1-2: new high speed USB device using ehci-omap and address 2
usb 1-2: New USB device found, idVendor=05e3, idProduct=0608
usb 1-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 1-2: Product: USB2.0 Hub
hub 1-2:1.0: USB hub found
hub 1-2:1.0: 4 ports detected


I've pasted the boot log for my kernel:
http://pastie.org/1379102

And the boot log for the original kernel:
http://pastie.org/1379100


It could be a bug on the reset sequence on ehci-omap.c, do you have
anything connected to any of the hub ports ?

Please enable CONFIG_USB_DEBUG on your kernel config and grab a bit more
information.

Also, boot the machine without the device attached and after booting
run:

# dmesg -c

then attach the device, then grab the output of dmesg.



I don't have the ability to disconnect the hub - it's integrated on the 
board :(


I've also made a mistake describing the pastebins - the working, PSP 
kernel boot log is here:

http://pastie.org/1379102

while the non-working git kernel messages are here (with CONFIG_USB_DEBUG):
http://pastie.org/1379100

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