Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp259663rdb; Thu, 1 Feb 2024 07:49:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IFQujVJ4jJmDwBHoZ8kJcA4JBxom/RPd4tuIkZoskmMkw5MqFBuQfLrTsOBccg+FjA0OGwR X-Received: by 2002:a17:906:1396:b0:a34:9d98:ac1f with SMTP id f22-20020a170906139600b00a349d98ac1fmr5335200ejc.24.1706802576461; Thu, 01 Feb 2024 07:49:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706802576; cv=pass; d=google.com; s=arc-20160816; b=cnviIaYmUGoUkZplhHhNeKhZdkDWaOrBlIPyX8hxmvDsUfaIwj2M5QmSWxzq/4t4qy Pl45Rnw3S0NSPs6U7AIw+IpCczJBy0Fbnsz4VAFzXImo3hGDvysacsO6nXUjjb1cVIZg CJsd97MuaR49BJmAS8paQ2uoW1BDZngCTBKdVXVMoVeIcdS5OgjR1lFBuGvUNnCdLp0I AUq9PmGtGF3RngUrErMp009dUQdki1kTOsXPeMFXOsvqHrvZL+scVmgfgVD9R/tsHD8E ST776YnuVLXVkk6ak6cpqbXWnrWSCskOYbqpuMnwpKGzX/FgIpk1liFlJKSX56vckLMC b92Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=SH1nmP8MQBJdqYjWZuEUz2VSp4EhHpkxSTitA2ghz6A=; fh=S93qUVV5Hhem30OSXaJc3397pddJK5uxDGVxzEKYZ+E=; b=oNcnQ9miLLV72t27kc500niHBKekIO+gw2jKQ4a9JyKWmqC1sk5RPqJfwPaUoFrtRf miPynIGXN4jKx+++cohdegLGxLYJxWISW8q/Aid/OHdTrXMg+Fo8KGHImO1VPGctUAFh nCt6iwyTswq+jfUsqeoGkdX5noFC5Z2G52WesWLQ/fUyzlGEfQ5Hiho18/kThA7Sfl3p /TSN+LKlZzx52A60GnQjdbkWmg7YSXcE11ut+fq9PecgHltrVc63MmQib0FzefF8lq2A f69zrR8tYbkK63ZxRZOwj0nrk07pSX8CnZc/r0Z6/QsMWEIRYWVGGoovQXbuVyB45ZGC x80A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=flaZPBOZ; arc=pass (i=1 spf=pass spfdomain=protonmail.com dkim=pass dkdomain=protonmail.com dmarc=pass fromdomain=protonmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48438-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48438-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com X-Forwarded-Encrypted: i=1; AJvYcCXQHNXU2KGJFQjXyjJvWDNoyoBtO6eBtqMgz+C7e1Jum7wJGjoF+bgWAXAsr49NbWXRF74Vv8ciWtTGBVl7agNVVqHxcCjPa6JSjJ8Lng== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p8-20020a1709061b4800b00a36718a452esi1724483ejg.784.2024.02.01.07.49.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 07:49:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48438-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=flaZPBOZ; arc=pass (i=1 spf=pass spfdomain=protonmail.com dkim=pass dkdomain=protonmail.com dmarc=pass fromdomain=protonmail.com); spf=pass (google.com: domain of linux-kernel+bounces-48438-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48438-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3ACD41F24FFD for ; Thu, 1 Feb 2024 15:49:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3AB1626A6; Thu, 1 Feb 2024 15:49:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="flaZPBOZ" Received: from mail-4316.protonmail.ch (mail-4316.protonmail.ch [185.70.43.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C1E45F49A for ; Thu, 1 Feb 2024 15:49:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706802569; cv=none; b=uEW/f3ZUXANDe9uxTzfzm9WQ04XveCVftGKXP3J+dDqZvnVhC3o3OfYAoZZoljsNBT4x/X3xLKE0fqPovAH1I006sDli3VENesM2r9mP8yn1Huc/jY3Cp2EBedH0J578yXSIrIbnA1J3X+Lf8vngCZItngwSalMxOAEWhmp+Ayw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706802569; c=relaxed/simple; bh=NPk98WBulq+hq2fUD9jM8B+ymuNCFgSHiTHFoEGJk1w=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WxuXHLRNwdGT/SycPME/lWdsPrYuZRzjdLT/7CvBO1PDNVuEW3a72+q6i2+syrQNmYoRBYBhHLacFzY38bkUeCAlMsuJD2/vrHAvumapGj0wvH6Gikm5qlbteIh10u8/EtzvcWd4r36qgDcw4uNSyoeWrYZ7MS7IPCxQnn1WCTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=flaZPBOZ; arc=none smtp.client-ip=185.70.43.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1706802565; x=1707061765; bh=SH1nmP8MQBJdqYjWZuEUz2VSp4EhHpkxSTitA2ghz6A=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=flaZPBOZyM4p+5g78AAXY83pP3qjb0y+9v53CXSOOXcZzJwHPJGVxH5VY0qIUaysS ahG35yqmcT6a7ylUxeWw1LevGvH+lLzsDvInF2JFGuGq3hoLq633Wj8rCkSTHw4K+e HKkzf1rY5m6xasNBu3jo8hGVT2YmbrRZrkWGxvRj2xMbo+Iir4Qy8iIiDFPPFfcLbo zInsnHxILzNxjUnubpSIjzflKGd8aQAq6LPDB26/5eB7QBLntTAOv9vbRfAtNUS91q 8YcqdtgqT8iENKzdg4/nVsUrbz9kmgY45H3vr06ff3RwmBzzL3O0R6X8RE7qVJ5XYM Rte/3AF5FXihQ== Date: Thu, 01 Feb 2024 15:49:06 +0000 To: "Jiri Slaby (SUSE)" From: Emil Kronborg Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] serial: mxs-auart: fix tx Message-ID: In-Reply-To: <20240201105557.28043-2-jirislaby@kernel.org> References: <20240201105557.28043-1-jirislaby@kernel.org> <20240201105557.28043-2-jirislaby@kernel.org> Feedback-ID: 20949900:user:proton Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Thu, Feb 01, 2024 at 11:55 +0100, Jiri Slaby (SUSE) wrote: > Emil reports: > After updating Linux on an i.MX28 board, serial communication over > AUART broke. When I TX from the board and measure on the TX pin, it > seems like the HW fifo is not emptied before the transmission is > stopped. >=20 > MXS performs weird things with stop_tx(). The driver makes it > conditional on uart_tx_stopped(). >=20 > So the driver needs special handling. Pass the brand new UART_TX_NOSTOP > to uart_port_tx_flags() and handle the stop on its own. >=20 > Signed-off-by: Jiri Slaby (SUSE) > Reported-by: Emil Kronborg > Fixes: 2d141e683e9a ("tty: serial: use uart_port_tx() helper") > Closes: https://lore.kernel.org/all/miwgbnvy3hjpnricubg76ytpn7xoceehwahup= y25bubbduu23s@om2lptpa26xw/ > --- > drivers/tty/serial/mxs-auart.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auar= t.c > index 3ec725555bcc..4749331fe618 100644 > --- a/drivers/tty/serial/mxs-auart.c > +++ b/drivers/tty/serial/mxs-auart.c > @@ -605,13 +605,16 @@ static void mxs_auart_tx_chars(struct mxs_auart_por= t *s) > =09=09return; > =09} >=20 > -=09pending =3D uart_port_tx(&s->port, ch, > +=09pending =3D uart_port_tx_flags(&s->port, ch, UART_TX_NOSTOP, > =09=09!(mxs_read(s, REG_STAT) & AUART_STAT_TXFF), > =09=09mxs_write(ch, s, REG_DATA)); > =09if (pending) > =09=09mxs_set(AUART_INTR_TXIEN, s, REG_INTR); > =09else > =09=09mxs_clr(AUART_INTR_TXIEN, s, REG_INTR); > + > +=09if (uart_tx_stopped(&s->port)) > + mxs_auart_stop_tx(&s->port); > } >=20 > static void mxs_auart_rx_char(struct mxs_auart_port *s) > -- > 2.43.0 >=20 Tested on i.MX28. Tested-by: Emil Kronborg --=20 Emil Kronborg