Message ID | 20200509203802.821856-2-marek.vasut+renesas@gmail.com |
---|---|
State | Superseded |
Delegated to: | Marek Vasut |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=BztSrg2H; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49KJtl5cSjz9sNH for <incoming@patchwork.ozlabs.org>; Sun, 10 May 2020 06:38:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1B12A80390; Sat, 9 May 2020 22:38:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BztSrg2H"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D39680355; Sat, 9 May 2020 22:38:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CE718801E7 for <u-boot@lists.denx.de>; Sat, 9 May 2020 22:38:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.vasut@gmail.com Received: by mail-wm1-x341.google.com with SMTP id m24so4109299wml.2 for <u-boot@lists.denx.de>; Sat, 09 May 2020 13:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fwxtGDXZQSsH5bagQmLGgbRGaqzBgU45t0/60/vEmE8=; b=BztSrg2HWfVsFZRcvoWGeTkzNEQwAnyw56ewv10Qu3l5gV+MwIHOXdXQCilg4BzUXS mLXBaWc4j5Kg4flxvAslZDRGP/GCdFX6zF9kWXEm3nBncspLVkOwe0Rrg0xGR0pVe4ou 5SGtZ/ccCrJujcu1Ax11GSwLJulQG8OAQcLlR6lLU2T0d1fTbNmjDkP7EojW40HesFty eMO1DVOdBJoy44C9LeGUFLyFDpRgr2QhjB3Mc+Ea1n0I0W0MQeBn56rFLolq/z1uvQio x+aGF/yyxixHKyBoHz1FbdFcnUX5Mj8I1+qEqwJOUl374xBVxbwe5QLX5ErzZDctU5JO x5jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fwxtGDXZQSsH5bagQmLGgbRGaqzBgU45t0/60/vEmE8=; b=OoTMINwRWHxjhFrMoVQu1oMqPeaFY5D0PpS9trEEO3qI0mngVYrqXxaEp4o4nZLQ1d 9Z0E1CFHcPppdUfMNUmJww8uk8BqqxtMDmTFE0yzJ19eHHZWq8vPd1KGdrh082huTMps C8uOnRwEJuwLOvBiyALv6wOOCHwjrbY9+U9mOZybuJnbF1M1j4rSVgpceLGARm8abPBe K58YaBPVyDKr24rlIgZN3iUE3n8qTXOmt0NIItetDy1EOqtJAqqjdE5nJOsTf5HDlMzy yDf8JWIWyvr0Q4y5O+nJvZKhxJKRppFCjfyH4uS2CqO2JAINY4AA5kVD86OVsY0uQLfv bcqQ== X-Gm-Message-State: AGi0PuZa0UhXFMc438WotqsnLnjnWvB5WsyBCdkWanC67Tfo8dyw/sKs GaWxFXda4OVCzAglrZFVkw1fbD// X-Google-Smtp-Source: APiQypKHp9m2edPX+C6pDCX72TQqa4NBaR0mL2p5/6Q7hhskshZzJ7Y6ZIL+5A5L7jahnasc2U3txg== X-Received: by 2002:a1c:98c9:: with SMTP id a192mr1048964wme.48.1589056688223; Sat, 09 May 2020 13:38:08 -0700 (PDT) Received: from desktop.lan (ip-86-49-35-8.net.upcbroadband.cz. [86.49.35.8]) by smtp.gmail.com with ESMTPSA id f8sm9384508wrm.8.2020.05.09.13.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 May 2020 13:38:07 -0700 (PDT) From: Marek Vasut <marek.vasut@gmail.com> X-Google-Original-From: Marek Vasut <marek.vasut+renesas@gmail.com> To: u-boot@lists.denx.de Cc: Marek Vasut <marek.vasut+renesas@gmail.com>, Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Subject: [PATCH 2/5] serial: sh: Improve FIFO empty check on RX Date: Sat, 9 May 2020 22:37:59 +0200 Message-Id: <20200509203802.821856-2-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200509203802.821856-1-marek.vasut+renesas@gmail.com> References: <20200509203802.821856-1-marek.vasut+renesas@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean |
Series |
[1/5] sh: Set gd->malloc_base if MALLOC_F_LEN is set
|
expand
|
diff --git a/drivers/serial/serial_sh.c b/drivers/serial/serial_sh.c index acfcc2954a..0a4dfdc377 100644 --- a/drivers/serial/serial_sh.c +++ b/drivers/serial/serial_sh.c @@ -115,7 +115,10 @@ static int serial_getc_check(struct uart_port *port) handle_error(port); if (sci_in(port, SCLSR) & SCxSR_ORER(port)) handle_error(port); - return status & (SCIF_DR | SCxSR_RDxF(port)); + status &= (SCIF_DR | SCxSR_RDxF(port)); + if (status) + return status; + return scif_rxfill(port); } static int sh_serial_getc_generic(struct uart_port *port)
If the SCIF is receiving data quickly enough, it may happen that the SCxSR_RDxF flag is cleared in sh_serial_getc_generic(), while the FIFO still contains data. If that happens, the serial_getc_check() reports no data in the FIFO as the flag is no longer set. Add one more check, if the SCxSR_RDxF is not set, read out the FIFO level and if there are still characters in the FIFO, permit reading them out. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> --- drivers/serial/serial_sh.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)