Tegra-otg loop with u-boot

Материал из Toshiba AC100 wiki
Перейти к: навигация, поиск

Bugreport sent to [email protected]

Hello, I have found tegra-otg loop which prevents boot process in kernel L4T-R16-RC3 when using mainline U-BOOT bootloader on Tegra2 harmony based board paz00 (toshiba ac100). Here is ac100 repo https://gitorious.org/~marvin24/ac100/marvin24s-kernel/commits/l4t-r16-r2-ac100 which is based on L4T-R16-RC3.

Kernel output of boot here http://pastebin.com/TH7Pe6Md

loop message is tegra-otg: tegra_otg_irq(280) interrupt val = 0x646 kernel spam it very fast and non stop.

It is possible to bypass this problem if i disable otg in kernel board-paz00 file or if i use below patch, but patch leads to random otg deaths.

diff --git a/drivers/usb/gadget/tegra_udc.c b/drivers/usb/gadget/tegra_udc.c
index c130dae..97d6493 100644
--- a/drivers/usb/gadget/tegra_udc.c
+++ b/drivers/usb/gadget/tegra_udc.c
@@ -2609,7 +2609,7 @@ static int __init tegra_udc_probe(struct platform_device *pdev)
        }
 
        err = request_irq(udc->irq, tegra_udc_irq,
-                               IRQF_SHARED | IRQF_TRIGGER_HIGH,
+                               IRQF_SHARED | IRQF_TRIGGER_RISING,
                                driver_name, udc);
        if (err) {
                ERR("cannot request irq %d err %d\n", udc->irq, err);
diff --git a/drivers/usb/otg/tegra-otg.c b/drivers/usb/otg/tegra-otg.c
index 12c359b..986c1e8 100644
--- a/drivers/usb/otg/tegra-otg.c
+++ b/drivers/usb/otg/tegra-otg.c
@@ -463,7 +463,7 @@ static int tegra_otg_probe(struct platform_device *pdev)
        tegra->irq = res->start;
        err = request_threaded_irq(tegra->irq, tegra_otg_irq,
                                   NULL,
-                                  IRQF_SHARED | IRQF_TRIGGER_HIGH,
+                                  IRQF_SHARED | IRQF_TRIGGER_RISING,
                                   "tegra-otg", tegra);
        if (err) {
                dev_err(&pdev->dev, "Failed to register IRQ\n");


Nvidia answer

Hello Misha,
 
We would like to thank you for pointing out the issue.
 
I would like to inform you that even after our best efforts, 
we have not been able to reproduce the issue locally on Nvidia’s Tegra2 
reference platform (Ventana). We are observing that it is booting 
normally without any crashes.
 
Since we do not have any AC100 units in-house to rule-out hardware specific issues, 
can you please confirm if anybody else is also facing similar issue with any other AC100 boards?
Also, we would like to know if you have used USB-OTG successfully on 
any prior kernels on this specific hardware?
 
Please note that our ability to diagnose the issue is limited as 
we do not have access either to the AC100 boards or its schematics/design.
 
But I would like to provide you with an opinion from one of our engineers 
on the possible cause for the issue:
“Some hang caused by device controller is fixed by changing interrupt 
trigger type from LEVEL (IRQF_TRIGGER_HIGH) to EDGE (IRQF_TRIGGER_RISING) type.  
Reverting the patch should be fine, but this is not a correct fix and hence 
should root cause the original issue. My suspicion based on the observation 
is that the OTG interrupts might not be cleared properly in bootloader. 
You can try by clearing it in otg probe but better one would do it in bootloader. 
If still the issue persists could you post the log with OTG_DEBUG enabled?”
 
Can you please try-out the things suggested here. 
Also, if the issue still persists, please post a log with OTG_DEBUG enabled.
 It’ll be helpful in diagnosing the issue better.
 
We have raised Bug 1299732 (https://nvbugswb.nvidia.com/NVBugs5/swbug.aspx?BugID=1299732&cp=qck) 
for tracking the issue.
 
Thanks and regards,
Naveen Kumar S