From: Simon Glass Date: Thu, 23 Oct 2014 03:37:02 +0000 (-0600) Subject: dm: serial: Reset the watchdog while waiting in getc() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=c487fd476c8779dbd6ee1427489f1312b34bfc5e;p=u-boot.git dm: serial: Reset the watchdog while waiting in getc() We have moved the busy-wait loop out of drivers and into the uclass. This means that we must reset the watchdog when busy-waiting. Note: some drivers may still have a busy-wait even with driver model, as a transition mechanism. Driver model will tolerate this, and is can be cleaned up when all users of the driver use driver model. An example is ns16550. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 1a75950d19..1983a3d55b 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -11,9 +11,12 @@ #include #include #include +#include #include #include +#include + DECLARE_GLOBAL_DATA_PTR; /* The currently-selected console serial device */ @@ -119,6 +122,8 @@ static int serial_getc_dev(struct udevice *dev) do { err = ops->getc(dev); + if (err == -EAGAIN) + WATCHDOG_RESET(); } while (err == -EAGAIN); return err >= 0 ? err : 0;