On Wednesday, 23 September 2015, Stephen Warren <swar...@wwwdotorg.org> wrote:
>
> From: Stephen Warren <swar...@nvidia.com>
>
> Tegra's GPIO driver currently enables pins as GPIO as soon as they're
> requested. This is not safe, since the desired direction and output value
> are not yet known. This could cause a glitch on the output pins between
> gpio_request() and gpio_direction_*(), depending on what values happen to
> be in the GPIO controller's in/out and out-value registers vs. the final
> desired configuration.
>
> To solve this, defer enabling pins as GPIOs until some gpio_direction_*()
> is invoked, and the desired configuration is explicitly programmed.
>
> In theory this change could cause regressions, if code exists that claims
> a GPIO, never explicitly sets a direction, and then gets/sets the GPIO
> value based on that assumption. However, I've read through all the Tegra-
> related board files and device drivers that touch GPIOs and I do not see
> such buggy code anywhere.
>
> Signed-off-by: Stephen Warren <swar...@nvidia.com>
> ---
>  drivers/gpio/tegra_gpio.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
>

Reviewed-by: Simon Glass <s...@chromium.org>
>
>
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to