From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.17 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387307; b=LXL3zY1XBndrh8Sdl+705btTYqRyBU6chLqo6I73/l3ggTMY9dR0UzsWlebtoB8kLRu+ 21/2/vIGnWBN2PkAIXDofQE+IvPOWEElm9axulvb/ALZGU5Zu8nQET5fLtai8wDb8oo46 oc6Fq8fUejwTl3MWAHCvhFzRyvWb8iE3galTdB0zkAodvWvz2mJ7Q8u+jSsHUTTPX5DbX udKJHHe6OmFygCozyB8kzpAkPgox8kIiVALfeh0j1YScoChwTRDKZhMEYBRITl2oXX7UX RpY6IivncZz6nQS+cpTtmeZD/nY7g7suBlIV6YKD3bDsajE95gRVNJzRfv7oBezV/fQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387307; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=74Z74eqp6j+2iyKjAB9e1QjmcGX9q57/2OY9vFrENBg=; b=iRBmkow8Rb6ICxI7ZYtftp4rogKlpoYZqD8sdcdWlX6kTXprzMzXlcDaBKgrgiv5NhJm x8Ym4Q0k6ugSI0AA5t6i/sJpYtvtP0C7ZEgVSmzWsWKEjhq4VPhsD+q5F/S/nPRwC/1M7 C0OhbzyTOQNq7yu0luFyXPyEhKNTaCcaQOP6HesUmU5e+Mk/T/yA9u7CncB3PLMzBVq8T 5YRUBRQ02rZRZnMfjJVuRsJdOMsM/M0d/ZU81hSubXGnnlRmwmOHib0JOfXsL8FmyNfON 8JOo4YAS5ZfmGXPEWOKbLUEyiRCvueob+ZF/WOd4BEKOqf5xc6uyJg8GbbsBv6dKyIw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=c8MBWOg5; arc=none smtp.remote-ip=198.175.65.17 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E329606A330; Fri, 4 Dec 2026 12:28:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 0E329606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=c8MBWOg5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796387307; x=1827923307; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=74Z74eqp6j+2iyKjAB9e1QjmcGX9q57/2OY9vFrENBg=; b=c8MBWOg5bCJgNegrXpaXycWPfstX4iGN/PufL/yBsXgYNhdBdv+Shm5c CD7Hpw99Uun/D53GbdBolPq/XvZR1NsSXBVS5cDj4//txz0YguXfpg8WP G12bD0RnqQ1W49WyrUrPGoR4dP6EK4znx6VC6p2pmVy3Wg72UZ+3QQKZ+ 2l4owPzvJwlU4bRrr/Q7UpKE3Q7u2PlXXRucLpBIpxLLGWl5B6okeJMhB s/weDxYvBUmgMcuGfGJaD4EzmhSLaYcIhNE+kHIYOsbvI5a1teBnHpGox ToLCE3h07ZmCZmcAMU4Fr2VC3q68tk1og9qEMQV5iWA2WcgtfdIe8A/VZ Q==; X-CSE-ConnectionGUID: MTA/Wl6RSzi5xBiaXWiDWQ== X-CSE-MsgGUID: kCPKy3hgTdS8KBofgfQvVQ== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5378530" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5378530" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 04:28:26 -0800 X-CSE-ConnectionGUID: HeMd2r2MRH2B4Cu3Ewbexg== X-CSE-MsgGUID: kUq8sxRcQX2w7+49DcO3eQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="14548200" Received: from alekseim-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.10]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 04:28:25 -0800 Date: Fri, 4 Dec 2026 14:28:22 +0200 From: Andy Shevchenko To: Fuyao Kashizuku Cc: Ilpo =?iso-8859-1?Q?J=E4rvinen?= , linux-serial@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: 8250_dwlib: Restore NOTEMT for em485 Message-ID: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Sat, Nov 21, 2026 at 02:35:15PM +0800, Fuyao Kashizuku wrote: > > A DesignWare UART using software RS485 can transmit one byte and then > leave the next write queued indefinitely. > > dw8250_setup_port() sets UART_CAP_NOTEMT because the UART does not > interrupt when the shift register becomes empty. If neither hardware > nor platform data supplies a component parameter register (CPR) value, > the driver leaves UPF_FIXED_TYPE clear. When autoconfig() identifies > a 16550A, it replaces the capabilities with the type defaults and drops > UART_CAP_NOTEMT. > > If the TX FIFO empties while the shift register is still busy, __stop_tx() > then returns without arming the stop timer or clearing THRI. With no > further interrupt when the last bit leaves the wire, em485 can stay in > transmit mode and a subsequent write can remain queued. > > Restore UART_CAP_NOTEMT in the DW software RS485 configuration callback. > This lets the existing em485 timer finish the transmission and release > RTS after the last character. ... > +static int dw8250_em485_config(struct uart_port *p, struct ktermios *termios, > + struct serial_rs485 *rs485) > +{ > + > + struct uart_8250_port *up = up_to_u8250p(p); > + > + /* > + * Without CPR, 8250 autoconfiguration can overwrite capabilities. > + * Restore NOTEMT before enabling emulation: DW has no TEMT interrupt. Hmm... The end of the phrase raises a Q: Is it true for *all* versions of the DW 8250 IP (there are differences between 4.x and older once which might be related)? > + */ > + up->capabilities |= UART_CAP_NOTEMT; > + > + return serial8250_em485_config(p, termios, rs485); > +} -- With Best Regards, Andy Shevchenko