]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
exynos: usb: Fix data abort on boards w/o vbus-gpio node in the DT
authorandrey.konovalov@linaro.org <andrey.konovalov@linaro.org>
Tue, 22 Apr 2014 17:23:49 +0000 (21:23 +0400)
committerMarek Vasut <marex@denx.de>
Wed, 30 Apr 2014 08:30:57 +0000 (10:30 +0200)
Commit 4a271cb1b4ff doesn't take into account that fdtdec_setup_gpio()
returns success when the gpio passed to it is FDT_GPIO_NONE (no
gpio node found in the fdtdec_decode_gpio() call). This results in
calling gpio_direction_output() on invalid gpio. For this reason
executing "usb start" command on Arndale causes data abort in the
ehci-exynos driver.

Add the fdt_gpio_isvalid() check to fix that problem.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Marek Vasut <marex@denx.de>
drivers/usb/host/ehci-exynos.c
drivers/usb/host/xhci-exynos5.c

index 9356878eb2e452ce05ea756b098ea02cf569ff96..edd91a84a7e78ec97f37a5a27e82826a06eadb2c 100644 (file)
@@ -197,7 +197,8 @@ int ehci_hcd_init(int index, enum usb_init_type init,
 
 #ifdef CONFIG_OF_CONTROL
        /* setup the Vbus gpio here */
-       if (!fdtdec_setup_gpio(&ctx->vbus_gpio))
+       if (fdt_gpio_isvalid(&ctx->vbus_gpio) &&
+           !fdtdec_setup_gpio(&ctx->vbus_gpio))
                gpio_direction_output(ctx->vbus_gpio.gpio, 1);
 #endif
 
index 1146d101de40901d5789c342c3716a2f2a1b7aaf..b4946a3f1cf5900614e7238f8033979876eac942 100644 (file)
@@ -298,7 +298,8 @@ int xhci_hcd_init(int index, struct xhci_hccr **hccr, struct xhci_hcor **hcor)
 
 #ifdef CONFIG_OF_CONTROL
        /* setup the Vbus gpio here */
-       if (!fdtdec_setup_gpio(&ctx->vbus_gpio))
+       if (fdt_gpio_isvalid(&ctx->vbus_gpio) &&
+           !fdtdec_setup_gpio(&ctx->vbus_gpio))
                gpio_direction_output(ctx->vbus_gpio.gpio, 1);
 #endif