Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp922673ybj; Tue, 5 May 2020 09:43:39 -0700 (PDT) X-Google-Smtp-Source: APiQypKINAQL1e2WDIOXNuA3gKkiJSeziR+fUvCQMWyhTEpVGillJJQKzcCGkDyhHd5jhuqsEgb8 X-Received: by 2002:a05:6402:17f1:: with SMTP id t17mr3510910edy.239.1588697019170; Tue, 05 May 2020 09:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588697019; cv=none; d=google.com; s=arc-20160816; b=laIbiMaW/tIFdeaBKmjVnt3RPOOCQiKjTZAZ2wnyn5Ho+hPmX0CGG2rPaSKX94LyJ7 /nepJ3o8sg/8Tcz/i0gTVB16/znHKpchYFv8pKsijubDD1CO2Vq6E3ZdNkBIS4IJFZY4 pj3ooFp5Atq8KA1Zakzg80dpmCWH22ayIGrcA1PXaeO5z4oik2Yab0lnBfx5FJAdAfiu r+rs8JO9zo3gSWYr4geKRzh1Mz9Q054tvqqrqU8G5bWVz6XTQmTZOeYL+Bw6u/WcrYFM +pXLu259XWw8Az4TBnHrVxqPWbgWheFfPhR1Miee9zQ56PWr2dXBnAr+iOPJOuPgDnZp 2EDQ== 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=Tvc8n4TXhaADfvUwpxeZ74bxVz5El9YENFyOmGkT5FY=; b=DAvK1afFelAw3FOyCxE9gHoN/bgoB1qmLHIGNn5hx4LjCoY+h9bf2IBukbYJFxbgBB Njk8Ng8CvHb+tkylsEWUd3eDyRHSIffIBaS7/4PoE/CQBcYGHJB0w22p0VYMiSuoalQR JFC9jBV3+x0NCudNudvSYW0Ib2wti5ZX7cOPY4TjhPkUZUCOdaTFcClHPWei0uYwA0IP qb0pm/I6H3e31DgyWhcxcSc6wTPL6ubnAVkIUEvDxm3US4odDKtm8nTt81Pnsy/aabc0 45ye0SnTxJixM24wjRcmZheFhOW41SnK/K5eBobUa/BwQPEmbMJ4OwdO1+1tRA1IaaI0 4w4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b89si1450988edf.345.2020.05.05.09.43.14; Tue, 05 May 2020 09:43:39 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730085AbgEEQjh (ORCPT + 99 others); Tue, 5 May 2020 12:39:37 -0400 Received: from fieber.vanmierlo.com ([84.243.197.177]:51738 "EHLO kerio9.vanmierlo.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729488AbgEEQjh (ORCPT ); Tue, 5 May 2020 12:39:37 -0400 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.12 patch 1) with ESMTPA; Tue, 5 May 2020 18:38:54 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 05 May 2020 18:38:54 +0200 From: Maarten Brock To: Lukas Wunner Cc: Heiko Stuebner , gregkh@linuxfoundation.org, jslaby@suse.com, andriy.shevchenko@linux.intel.com, matwey.kornilov@gmail.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, christoph.muellner@theobroma-systems.com, giulio.benetti@micronovasrl.com, Heiko Stuebner , linux-serial-owner@vger.kernel.org Subject: Re: [PATCH v2 4/7] serial: 8250: Handle implementations not having TEMT interrupt using em485 In-Reply-To: <20200502134927.6sb7f3na3ff3rpoa@wunner.de> References: <20200325231422.1502366-1-heiko@sntech.de> <20200325231422.1502366-5-heiko@sntech.de> <20200502134927.6sb7f3na3ff3rpoa@wunner.de> Message-ID: <523d8e3fa0215f34532b7990a31b0c17@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-05-02 15:49, Lukas Wunner wrote: > On Thu, Mar 26, 2020 at 12:14:19AM +0100, Heiko Stuebner wrote: >> 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. > > Just to get a better understanding: According to the > Dw_apb_uart_db.pdf > databook I've found, the UART does have a "THR empty" interrupt. So > you > get an interrupt once the Transmit Holding Register (and by consequence > the FIFO) has been drained. Then what do you need a TEMT interrupt > for? > Why is the THR interrupt not sufficient? When the Transmit Holding Register is empty, the Transmitter can still be transmitting. And the Driver Enable must be held active during transmission. I would even say it needs to held active during transmission of the stop bit, but I don't believe there is any uart that has an interrupt flag for that. And since the default state for RS485 is '1' anyway it's not that bad. Maarten