Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3285205pxk; Mon, 28 Sep 2020 13:13:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnNPGOSjjUasg4H14Tn639ZHauQRkpso4lcADX1rqEqC6TwdAZ88Azo20ojdyetla5KAVK X-Received: by 2002:a17:906:e216:: with SMTP id gf22mr494537ejb.2.1601324000343; Mon, 28 Sep 2020 13:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601324000; cv=none; d=google.com; s=arc-20160816; b=hkb2EtRqjLpqVsI57meDAZAsZK4GfFz3jOub5StZZV3xxtwi79eWb/LBuoLeMZx+hS eqouwicLjb4PGtzLNFrHZaaSq9WftvwQ9yvfk+MuhAZ6Bn23H+9GHdgNl2W0950M03Zs EDivWe67fIJTW3cLJZShfLpAPSnBgoEioP8HyAaOyvqCLmg91XNAHPv6Bz5PRBOyLR9j cY+5ICT1Jh4Dxn5crPVHbsa1mSmSOhKemYFHgwnzB/pQl7fu+RvVLuf7is61YzjO2a1N +XSpNlD/MTLjOhEjSNe/sZ3SXEEgXCcMX92IK5/g3il46wDgApv9n/QL0HJe5wGcHblO jLDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=egVBIQ7+I6ydt8wO/MFdyJyyx7SFuZumZFU4PdBZEqE=; b=Pua2o9sOlLL8gqIblUnWHObPd2cgcIQ+WOGw/ZpVoUDb6vakkgMwFWXYuEv/KBzweh gyFSrCrSr37CS32b/58XAq8rlyEZ8ybSLC3mpNY4ykxFfL3x0bMwwwRRlKdCMDoNnKaQ iig/yAETNOBueOvXuFNcjYNH0jKl6YtzVgqBYutuXNRhuYhkOt5XALaLySFwGMFDWWHu mq9Vg49Gl+6Yogxv+lGDfQDSpZOh49F6MNEl+99Z5FGM2ZHEuHAjelACSy7pV+OVySFB bG8Dpzm0kvjCt2HM8Rbilb4YB70ItvfN+7eChfESdv9BVcvup/ec/9KjybIUJEuFt3J6 W9ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B1pnla2Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si1293245ejw.227.2020.09.28.13.12.58; Mon, 28 Sep 2020 13:13:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B1pnla2Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbgI1ULf (ORCPT + 99 others); Mon, 28 Sep 2020 16:11:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbgI1ULf (ORCPT ); Mon, 28 Sep 2020 16:11:35 -0400 Received: from mail-ua1-x944.google.com (mail-ua1-x944.google.com [IPv6:2607:f8b0:4864:20::944]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88E9BC0613CE for ; Mon, 28 Sep 2020 13:11:34 -0700 (PDT) Received: by mail-ua1-x944.google.com with SMTP id n26so2633718uao.8 for ; Mon, 28 Sep 2020 13:11:34 -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=LVZPLbn1+MsDBOtUa4/W4UdjzpYNCr/oGxjiLEyIcth4SbG0njrzDr9LiftTF6074N 1WMvUQ0xJvnDwmDwN+cwjueZnlYLMu6xVJz1vimIY7fXNCtBAo1zTTzjw2zBWOHmpoto l5lRvTQp3Lo8/p//5YPsJGOu/Z1c9AOBmsoI7RP4m55UFeKZuQjRzoHnjCfw6kG4GG4k K2JUGJ/+6/r/w2OKE1QFsAiYTyQA//QvbsCYjOkXd3zYJAiodki5YvNKYYHw8gWMgJ0Z AEoyXYa8C4ozgTyg2aE5eegKMbg3XIFSQNJ1Z9JTsOVCpsi6dNDYCn71QgvxZjHBLj5K s8GQ== X-Gm-Message-State: AOAM532O5zwdLlRQflvV2iYFaTos0ZLerG/XRCRNl8vTG/XPE/CqzHKV rDYXmH40utyz999hNxlZwd2eiYBzWihHirv0vQSzBw== 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 Cc: open list , linux- stable , Shubhrajyoti Datta , Greg Kroah-Hartman , linux-serial@vger.kernel.org, Linux ARM , lkft-triage@lists.linaro.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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