Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1676784ybl; Sat, 1 Feb 2020 04:00:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwKWdyuOh3Krlwzv/7uZg7NiFEBrYEDfurfeBJPvT2sfmmjfl0Oj6GyNsW6Xj/VwUMlk7lB X-Received: by 2002:a05:6808:45:: with SMTP id v5mr8875392oic.90.1580558446328; Sat, 01 Feb 2020 04:00:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580558446; cv=none; d=google.com; s=arc-20160816; b=ISOYs6h/1MdyHICrjTuSSPHeFm+oIfg6GrDsyXDUeo/wsGR/vMK3I5Amxb+Lh34e1O HxSkQixDcrUzJiBqnVyuR9e9ISkDmwgWcaKG015vnM2GpqJZA6V06CUDuafrCgszHOsR b70bNCLKpraoe/POtdi1NIVasZJVMff813R2GajGeCCsUwwcoUZVFNofKefADpwVJ40d zSo2fzU4HG5xpoFUlsIvY+v3S6KIkNtruhq1uoo25Wku5ArB/yeooXWVvUgOiijTG9ni o70nIUIP2XQ5KF3LUWREUA+4bfD2yzhnW0cqjdkml3VagPfzT4Q5XSI4/ajyec/jSkr/ dXJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version; bh=fsZxOKlIxPurWjmmFdcyZwxMfK1uml/IKaHcq1tTDvE=; b=XkHa3WltgqXH+suano2r/1cdQulinuZrBqA8GFCCx5FWue298cD1xuImrDAYKl9WIQ YS2aEHI9XnCJYSdUvtEugKrjTyvENXVk/DXd5RNizEc9bBHtQ0N4CSzUOo7G4rZJ2ur3 KB9wWX1j97GeMXT0PMFgLqi0ZsENu9rhtmcEiyYKf6ixZ9pWFslKoV9e/2W6Nze8KXW7 yF3yCstisT27bTf2INgr4G4LvLj19YrpJbKqRSVrEQFEBvuRiWGo+mUAS22GqgUi/wVg wMeZHl0oij/7coDeBsVphPy8lkQYyDItyAWS4D28ssFy3LZ2lhqoLmiiKIGDCgk3So1I kWNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5si6204191otq.238.2020.02.01.04.00.34; Sat, 01 Feb 2020 04:00:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726518AbgBAL7o (ORCPT + 99 others); Sat, 1 Feb 2020 06:59:44 -0500 Received: from fieber.vanmierlo.com ([84.243.197.177]:41332 "EHLO kerio9.vanmierlo.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726297AbgBAL7o (ORCPT ); Sat, 1 Feb 2020 06:59:44 -0500 X-Greylist: delayed 1805 seconds by postgrey-1.27 at vger.kernel.org; Sat, 01 Feb 2020 06:59:43 EST X-Footer: dmFubWllcmxvLmNvbQ== Received: from roundcube.vanmierlo.com ([192.168.37.37]) (authenticated user m.brock@vanmierlo.com) by kerio9.vanmierlo.com (Kerio Connect 9.2.11 beta 1) with ESMTPA; Sat, 1 Feb 2020 12:29:15 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 01 Feb 2020 12:29:15 +0100 From: Maarten Brock To: Shubhrajyoti Datta Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jslaby@suse.com, michal.simek@xilinx.com, linux-kernel@vger.kernel.org, Raviteja Narayanam , linux-serial-owner@vger.kernel.org Subject: Re: [PATCH v3] serial: uartps: Add TACTIVE bit in cdns_uart_tx_empty function In-Reply-To: <1580468685-11373-1-git-send-email-shubhrajyoti.datta@xilinx.com> References: <1580468685-11373-1-git-send-email-shubhrajyoti.datta@xilinx.com> Message-ID: <44b8cf91d3d2f20a81e0215b1b2fc7a8@vanmierlo.com> X-Sender: m.brock@vanmierlo.com User-Agent: Roundcube Webmail/1.3.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-31 12:04, Shubhrajyoti Datta wrote: > drivers/tty/serial/xilinx_uartps.c | 22 +++++----------------- > 1 file changed, 5 insertions(+), 17 deletions(-) > > diff --git a/drivers/tty/serial/xilinx_uartps.c > b/drivers/tty/serial/xilinx_uartps.c > index ed2f325..ebd0a74 100644 > --- a/drivers/tty/serial/xilinx_uartps.c > +++ b/drivers/tty/serial/xilinx_uartps.c > @@ -656,8 +655,9 @@ static unsigned int cdns_uart_tx_empty(struct > uart_port *port) > { > unsigned int status; > > - status = readl(port->membase + CDNS_UART_SR) & > - CDNS_UART_SR_TXEMPTY; > + status = ((readl(port->membase + CDNS_UART_SR) & > + (CDNS_UART_SR_TXEMPTY | > + CDNS_UART_SR_TACTIVE)) == CDNS_UART_SR_TXEMPTY); > return status ? TIOCSER_TEMT : 0; > } These lines look pretty incomprehensible. How about rewriting it like this? status = readl(port->membase + CDNS_UART_SR) & (CDNS_UART_SR_TXEMPTY | CDNS_UART_SR_TACTIVE); return (status == CDNS_UART_SR_TXEMPTY) ? TIOCSER_TEMT : 0; Maarten