From patchwork Mon Sep 22 15:48:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 392044 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 977BA140174 for ; Tue, 23 Sep 2014 01:54:35 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D9F83A752F; Mon, 22 Sep 2014 17:54:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id omKbfrOBXUIg; Mon, 22 Sep 2014 17:54:30 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7B7BAA7566; Mon, 22 Sep 2014 17:53:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 38E2CB3797 for ; Mon, 22 Sep 2014 17:53:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qF9DY2HhTuSk for ; Mon, 22 Sep 2014 17:53:24 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ig0-f201.google.com (mail-ig0-f201.google.com [209.85.213.201]) by theia.denx.de (Postfix) with ESMTPS id 86495A7467 for ; Mon, 22 Sep 2014 17:53:13 +0200 (CEST) Received: by mail-ig0-f201.google.com with SMTP id h15so485276igd.0 for ; Mon, 22 Sep 2014 08:53:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3uBFDDmB34RxkGZpR4K7U85L0GqnzKolbBQVfxU5d4I=; b=I4Y4WmPELUbv/117Dui1igKD/m2Rxq1hCibwHuH5oIj8zb7CRgx0SuPQ6jtnOlx2mt Oj+UWrTKNcwWT+zECFUhiuArI15qwA3EHYwJaSHO59GsG7k7uU/xd4BpGB5yv12cjQwz bfIY37fPQdMx7tf41N/bWUhmJXZInX5BVXXzkpBWH5DcjvjZWuGm+qX/YL0aa5iKjIcz k633iw+8qvIApC+lAqVNYKwPQ/k0Q2wV13wZzfuKxId7/D/8suNUkzGbwKjJY0yoqejO rmrCPDUgnL8IAzYj3gpp37OyohHwSWN1VO6Fgc/LcQeN52RHcOLl3rcn5UR4lQrgH4EY fyEw== X-Gm-Message-State: ALoCoQn24jHnCTZY4l7JgkXE6gWOzld6+2mojVoh420LNZvzsTaU5pQVS2iSOfiVNdaSfXReq0Jh X-Received: by 10.182.130.168 with SMTP id of8mr20521414obb.27.1411401192033; Mon, 22 Sep 2014 08:53:12 -0700 (PDT) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id f102si127155yhp.7.2014.09.22.08.53.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Sep 2014 08:53:12 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id 8MmEXIDy.1; Mon, 22 Sep 2014 08:53:11 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 31152220143; Mon, 22 Sep 2014 09:53:11 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 22 Sep 2014 09:48:42 -0600 Message-Id: <1411400934-7754-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1411400934-7754-1-git-send-email-sjg@chromium.org> References: <1411400934-7754-1-git-send-email-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH 02/14] dm: serial: Reset the watchdog while waiting in getc() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- drivers/serial/serial-uclass.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index e93c624..aeaf2d2 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;