From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24F5FC2D0A8 for ; Mon, 28 Sep 2020 20:13:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C10A205ED for ; Mon, 28 Sep 2020 20:13:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vz5baRe1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="B1pnla2Z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C10A205ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oUPz0ZuEHVwTrhoLy9BSLzyW820WO8sU8pH2qNihtPo=; b=vz5baRe1ihjsKuZ9WkVktn0cX FZY0BuOHkZ6R58JddPBGf/d9Qy1qfh1VrDq5r8K80U8KnT3yK9MaR2YYcQFPsAFMdfthmaCYPAdQs /GX4F9Qlulrx+CgXmCBowyZDosCSVBcaUrRlZtsb3iQEAPcejei0y7awT2ZFRheG92xC4yqdo/i5H 1VWzFul5j9RcxLKq2v2ZPb8iamit/UEy3OlrsZgLpIFhT5EDK+ly9MfDca4pty6c4v2b2akDV1vja 7gGHsD9vUWKotcPQkCVdbsLfKwxeX4rV9vR/0kCHgCN4qb83JxfyXyaq5UXrhybVh83WyRhI3xT+Q vB/K/rwnw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMzUp-0000v2-8L; Mon, 28 Sep 2020 20:11:39 +0000 Received: from mail-ua1-x941.google.com ([2607:f8b0:4864:20::941]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMzUl-0000t4-H0 for linux-arm-kernel@lists.infradead.org; Mon, 28 Sep 2020 20:11:36 +0000 Received: by mail-ua1-x941.google.com with SMTP id z1so2635386uaa.6 for ; Mon, 28 Sep 2020 13:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=egVBIQ7+I6ydt8wO/MFdyJyyx7SFuZumZFU4PdBZEqE=; b=B1pnla2ZGuDFjCK32WQi8nl+dtfGF6esMi6IO6o7iknuB9sazAC/VMVe5dMizVcbwS 5I6dvfiwxkOb28yQ01O6qGMwsWdmlHZ1lyhQOn5vxNJeTURDW6yxITr+G3fq8HY5TH3D E59AAZvIOZPM5Ar8t0imj/PucLlZ6XdvjzJt1hli0wgl1vesb0lileUAZcC54s4/7pVH 97lEnWG6AraElfZMMhdZT5xcmbuwhIwzHeU4dSlZ6EIpVSIPFJDLHrEGWxDgNwzXBlEm DpYfd+4DLWlRyyuuLKDGMnAAH0XEixHTHOWPBOwb/IOOcFD3WKbnGo83VrNyqo6Hk4Sa y+tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=egVBIQ7+I6ydt8wO/MFdyJyyx7SFuZumZFU4PdBZEqE=; b=GSb9sfnlxb1EQVr7gLLFDOcMdFHYhVjDvatc6QRyfI0EnWsDAgaAwO70biG2FLyuJe 9MsBE222S9/vId7HhgBxM9eMonHm/hMMeUzEMr/rgKhgfb5codPzPqzgc9AzL2slqevv kaYfKqIM/AbGK6lopkVU6/5yaDGHNlpFfV63QO2C0OQkHzgYmosomaOc2x7F2stik/05 Nb2vGHano9qj7UtQ79Hl5vGxfMjvboD9PQUoZntx+l1fiQ/TKtjCxcNEYtlkn8ABoR2p DQyWlk9JIIB3cGYEk3y6lXkCnpOLxmPGrC+6P7LjyaT6X9MlwOSlM1TSO/Dceu0QDeMl /7wg== X-Gm-Message-State: AOAM531y562m+OyiQF6xrjkpf6ZHS6NZmXA7lxiF1uphDX7YSeAK4UXp bKIpGyFyUKoR36/E1qENRB2ggG2hQLzrCHI3yoJYBw== X-Google-Smtp-Source: ABdhPJwiA3vRQoLn9pVnXBzneJmi7DWWA/XPq+Ktc/SPS1RiATzILuZwgUAgzKyxrZfiXpqmPwCrSAoU1fQPnceh2z4= X-Received: by 2002:ab0:d93:: with SMTP id i19mr2131336uak.7.1601323893634; Mon, 28 Sep 2020 13:11:33 -0700 (PDT) MIME-Version: 1.0 References: <20200918021455.2067301-1-sashal@kernel.org> <20200918021455.2067301-64-sashal@kernel.org> In-Reply-To: <20200918021455.2067301-64-sashal@kernel.org> From: Naresh Kamboju Date: Tue, 29 Sep 2020 01:41:22 +0530 Message-ID: Subject: Re: [PATCH AUTOSEL 4.9 64/90] serial: uartps: Wait for tx_empty in console setup To: Sasha Levin , Raviteja Narayanam X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200928_161135_848408_15DBDEB5 X-CRM114-Status: GOOD ( 21.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Greg Kroah-Hartman , Shubhrajyoti Datta , open list , linux- stable , lkft-triage@lists.linaro.org, linux-serial@vger.kernel.org, Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, 18 Sep 2020 at 07:55, Sasha Levin wrote: > > From: Raviteja Narayanam > > [ Upstream commit 42e11948ddf68b9f799cad8c0ddeab0a39da33e8 ] > > On some platforms, the log is corrupted while console is being > registered. It is observed that when set_termios is called, there > are still some bytes in the FIFO to be transmitted. > > So, wait for tx_empty inside cdns_uart_console_setup before calling > set_termios. > > Signed-off-by: Raviteja Narayanam > Reviewed-by: Shubhrajyoti Datta > Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.narayanam@xilinx.com > Signed-off-by: Greg Kroah-Hartman > Signed-off-by: Sasha Levin stable rc 4.9 arm64 build broken. drivers/tty/serial/xilinx_uartps.c: In function 'cdns_uart_console_setup': drivers/tty/serial/xilinx_uartps.c:1286:40: error: 'TX_TIMEOUT' undeclared (first use in this function); did you mean 'ETIMEDOUT'? time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); ^~~~~~~~~~ ETIMEDOUT drivers/tty/serial/xilinx_uartps.c:1286:40: note: each undeclared identifier is reported only once for each function it appears in CC drivers/usb/core/port.o scripts/Makefile.build:304: recipe for target 'drivers/tty/serial/xilinx_uartps.o' failed make[5]: *** [drivers/tty/serial/xilinx_uartps.o] Error 1 Reported-by: Naresh Kamboju full test log link, https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-4.9/DISTRO=lkft,MACHINE=hikey,label=docker-lkft/996/consoleText > --- > drivers/tty/serial/xilinx_uartps.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c > index eb61a07fcbbc3..07ea71a611678 100644 > --- a/drivers/tty/serial/xilinx_uartps.c > +++ b/drivers/tty/serial/xilinx_uartps.c > @@ -1268,6 +1268,7 @@ static int cdns_uart_console_setup(struct console *co, char *options) > int bits = 8; > int parity = 'n'; > int flow = 'n'; > + unsigned long time_out; > > if (co->index < 0 || co->index >= CDNS_UART_NR_PORTS) > return -EINVAL; > @@ -1281,6 +1282,13 @@ static int cdns_uart_console_setup(struct console *co, char *options) > if (options) > uart_parse_options(options, &baud, &parity, &bits, &flow); > > + /* Wait for tx_empty before setting up the console */ > + time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); > + > + while (time_before(jiffies, time_out) && > + cdns_uart_tx_empty(port) != TIOCSER_TEMT) > + cpu_relax(); > + > return uart_set_options(port, co, baud, parity, bits, flow); > } > > -- > 2.25.1 > -- Linaro LKFT https://lkft.linaro.org _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel