Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2541845ybb; Mon, 30 Mar 2020 08:09:35 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsLMz3XJGEHymMvERwaXO317LRIia7oiQDLG25kuTqCps36vAHt73oc2VS5Jc9zEh3g9MIm X-Received: by 2002:aca:4fc7:: with SMTP id d190mr8012648oib.100.1585580974871; Mon, 30 Mar 2020 08:09:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585580974; cv=none; d=google.com; s=arc-20160816; b=jcNuyDkboPB7EDR8YK3VRBAESl3NWVaBrw/fxz2/kl/3HeD4TXgOWLsTQX2JzrtqU8 TTo7IIR0ezHI5af0zd9E9ygb1LccNEg/Y1dyfsEsSx3oLhtneq9hr6mRMaaI32rHVEeR JYnSd7gv4umty58DEo/92Sd+k/JRWMCwgyi3reOCdz69Pi47+iRJScD72iQEvcNxo105 wE8Dr7TT24PGD+ULIjvt6J2gq3zxO2hxcEZUhLd9OVszsUGzIsgTQQ3odT84EBzI9Q7P 8XGiF/skP2UA7pRFreN2ikhZXKbmeCjS4jQzOEM+ABD9+kpHFt0MWEgi9ykfvyGVMJ2W 89/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=s2aJVOegnpgpfiTveFc+aY4DQgb2VoA4ns7xkDdwlwE=; b=dUFMrGv9ISfSFLJwhJHnnNIJYFQ3CPOl/3U4hG3UiK9AtoSWp+9P/GjLB3ITbf3WAk TBE2oSfzLKbraGMW8JXwKIC5gtt4OCufSWK7ssvbxLLPFvvHslnR/B1flYMlQmumw8KJ 5n/P+DCvZ++BUYRpoiSfek+l0GwH4wDQQkQMMfBxHhJWcgQ24GD0TqoGXQnCi5tMUBAN Esjb1YOed/QCUMheCBGZ7tHv1YlGfgdqUeHQpAKaoo93BUN/cL7xnxfJkNQ3/17aEHAv r2KLVHed0cJirQvgnCGIz4BqOUFJc7CnAggJYV6FWqmlqFwRIv80F7+8FtPTtayvVz9b dRfA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si6277391otq.75.2020.03.30.08.09.17; Mon, 30 Mar 2020 08:09:34 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728458AbgC3Owk (ORCPT + 99 others); Mon, 30 Mar 2020 10:52:40 -0400 Received: from mga12.intel.com ([192.55.52.136]:64494 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728091AbgC3Owk (ORCPT ); Mon, 30 Mar 2020 10:52:40 -0400 IronPort-SDR: MIRYyY5gaX862ksA0nrrp5J+dbtAUPZ5FOu0NRb0HzlBhHKMFR4129YBmmSgejwQTN9XlCFq4R JZ3fHnAkgupw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2020 07:52:39 -0700 IronPort-SDR: rfW88gAjoLcRuxEMkeDyZmauk0DBi3xQ4Q1GXDFDjkXTWZvhWkbDmfca24k9dnZz35+i/xkTp/ EroFjNmfikxg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,324,1580803200"; d="scan'208";a="237374537" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga007.jf.intel.com with ESMTP; 30 Mar 2020 07:52:37 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jIvmJ-00EEWj-7l; Mon, 30 Mar 2020 17:52:39 +0300 Date: Mon, 30 Mar 2020 17:52:39 +0300 From: Andy Shevchenko To: Heiko Stuebner Cc: gregkh@linuxfoundation.org, jslaby@suse.com, matwey.kornilov@gmail.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, lukas@wunner.de, christoph.muellner@theobroma-systems.com, giulio.benetti@micronovasrl.com, Heiko Stuebner Subject: Re: [PATCH v2 4/7] serial: 8250: Handle implementations not having TEMT interrupt using em485 Message-ID: <20200330145239.GV1922688@smile.fi.intel.com> References: <20200325231422.1502366-1-heiko@sntech.de> <20200325231422.1502366-5-heiko@sntech.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200325231422.1502366-5-heiko@sntech.de> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2020 at 12:14:19AM +0100, Heiko Stuebner wrote: > From: Giulio Benetti > > Some 8250 ports have a TEMT interrupt but it's not a part of the 8250 > standard, instead only available on some implementations. > > The current em485 implementation does not work on ports without it. > The only chance to make it work is to loop-read on LSR register. > > So add UART_CAP_TEMT to mark 8250 uarts having this interrupt, > update all current em485 users with that capability and make > the stop_tx function loop-read on uarts not having it. > + if (p->capabilities & UART_CAP_TEMT) { > + if ((lsr & BOTH_EMPTY) != BOTH_EMPTY) > + return; > + } else { > + int lsr; > + > + if (readx_poll_timeout(__get_lsr, p, lsr, > + (lsr & BOTH_EMPTY) == BOTH_EMPTY, > + 0, 10000) < 0) ret = readx_poll_timeout(...); if (ret) ... will look better. > + pr_warn("%s: timeout waiting for fifos to empty\n", > + p->port.name); > + } -- With Best Regards, Andy Shevchenko