Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5449871imu; Wed, 19 Dec 2018 11:21:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/W7HJpgV/mXMHL0F5S5DJM1xmgOScjbJPxRarzRNBKYLRpi9j2vTzT0pRx21UBbTRwY+5X/ X-Received: by 2002:a63:ce08:: with SMTP id y8mr20247911pgf.388.1545247288213; Wed, 19 Dec 2018 11:21:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545247288; cv=none; d=google.com; s=arc-20160816; b=VSy7Y7cwzO6uQD4NRzoYrofjdGOUsFpEg0eMVs6xxZOmXZgoTfaakn31A4RZwqdZna 3LgFzVCx6eyY8QN4T9NPMoqgpf28ETySlWunqN1wo72z9dx0ioXftSEZ7D/uSSY/r8tz h4bXRpg3VXe4kZlaKQYm5Qt4CIf1jE0hUlgRbYthFlZnf1QMgeJVxUTsWHyzPOVbJ4ED oyIiGLfS8MhTDXZ2LE9eHLln80sg8qQxn0S2tp1JboriJvBpB8EiOiYVubJaHf8ogoCg wQBeY5AdfKlmRvghgyE67PcjHPo48ClLlufv5HH4wRw49tnmmSYe1SyuwieFh2oPIn8u Sx8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vh8T2inOJ25IQEKjOC6j5qkkV3kczuPBsJF+LxTgu5g=; b=OR4mI3nEcbASo6uFz1kL1bfIhaW3n4+HVI5//abiqztOlThwqcjbDcKlfbzlaBQD0E dPJTlObyr6tO5HUBdemnmP2BlvBxv93eGLZ04sT8thlmaF1QOwy+cANCHtIuaikH5b6k lXWaal8xCMhSKLHAk+hlENkzNNSJycZZmw1oXoQpqrIVgyw0tWBSLBa/2WJSLkOeFlcs PmUFE27OC7On8LfviCUYrl/JpRI6eh0KUjnYamAAwPrLZ/2yk2N/p7bYif0NWQGFuq1b wE7Y5ZrZIO++HH4XCfOTV833RH1ZFvFV06YA6Um6TT6NseYP1j3DdQeI2f8ZcZyPbv+9 udgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DQighkSM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z22si16521520plo.202.2018.12.19.11.21.12; Wed, 19 Dec 2018 11:21:28 -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; dkim=pass header.i=@chromium.org header.s=google header.b=DQighkSM; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730257AbeLSTEd (ORCPT + 99 others); Wed, 19 Dec 2018 14:04:33 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36223 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729678AbeLSTE2 (ORCPT ); Wed, 19 Dec 2018 14:04:28 -0500 Received: by mail-pl1-f193.google.com with SMTP id g9so9869657plo.3 for ; Wed, 19 Dec 2018 11:04:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=vh8T2inOJ25IQEKjOC6j5qkkV3kczuPBsJF+LxTgu5g=; b=DQighkSMTv7fp7wr3qvQwNKiCdAZVqzEjuaQ8xQqJrGbdymlDrAZk4YTZ+P95oCZQD UK8U267JsC5P/ktvJeroDZ9YJHx+DN8vCPgaEZ2PvkT4oks56ml/iVTantvGrxlgE0oo jQrHdhlmn9OSeXGBP50L1xqrlMixElCtXoLNQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vh8T2inOJ25IQEKjOC6j5qkkV3kczuPBsJF+LxTgu5g=; b=HGlUZ6Fl/19mrc6fuWZS9vInUO7pmSBr2MSPkXXSz4kN7ZivK0GnLKcVB+FakRpoos 4gfgmDUj/vLnmpFlRipmP4VsOa+oRhF2NptcH+/FbwdzP08v809yhYmeDjpKg4J4SUHt /y5HcQDhsqpzzgcoYOM3YM4gJvm750+vNxnR5tWrw0xVQJdI01WUtr/UKL61uQDsqi54 Qe7/9FBKW0sdp1kqo9FkVNiGz6mzeNYC5FuhHGP7+xawXLZmbmahBefPUA7sMtRWmpxW EvOwc0VjroxFvmgVSbqeBPOlBWMly6LCxugKaBqP//6jivoA8adqnZTSabczMOmG4ftV 4KeA== X-Gm-Message-State: AA+aEWYNsF1LZXXV5dzC/dVQghWTRfq88jJf0jMhOoozzeNjUHMITsPa A5xfh2xGh89evz1coYeUy2YfSmmcYCc= X-Received: by 2002:a17:902:8c98:: with SMTP id t24mr21365375plo.130.1545246267108; Wed, 19 Dec 2018 11:04:27 -0800 (PST) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id l3sm32197657pga.92.2018.12.19.11.04.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Dec 2018 11:04:26 -0800 (PST) Date: Wed, 19 Dec 2018 11:04:25 -0800 From: Matthias Kaehlcke To: Evan Green Cc: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, msavaliy@codeaurora.org, ryandcase@chromium.org, Doug Anderson Subject: Re: [PATCH] tty: serial: qcom_geni_serial: Fix wrap around of TX buffer Message-ID: <20181219190425.GC109358@google.com> References: <20181219181747.118278-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 19, 2018 at 10:49:26AM -0800, Evan Green wrote: > On Wed, Dec 19, 2018 at 10:17 AM Matthias Kaehlcke wrote: > > > > Before commit a1fee899e5bed ("tty: serial: qcom_geni_serial: Fix > > softlock") the size of TX transfers was limited to the TX FIFO size, > > and wrap arounds of the UART circular buffer were split into two > > transfers. With the commit wrap around are allowed within a transfer. > > The TX FIFO of the geni serial port uses a word size of 4 bytes. In > > case of a circular buffer wrap within a transfer the driver currently > > may write an incomplete word to the FIFO, with some bytes containing > > data from the circular buffer and others being zero. Since the > > transfer isn't completed yet the zero bytes are sent as if they were > > actual data. > > > > Handle wrap arounds of the TX buffer properly and ensure that words > > written to the TX FIFO always contain valid data (unless the transfer > > is completed). > > > > Fixes: a1fee899e5bed ("tty: serial: qcom_geni_serial: Fix softlock") > > Signed-off-by: Matthias Kaehlcke > > Oh nice, so this did end up being your problem with corrupt > characters? Yes > Strange though, I still would have expected this bug to > result in inserted serial characters, rather than edited ones. You are right here, initially I interpreted that some bytes changed, but actually we observed inserted bytes, and later missing ones at the end of the transfer. > Either way, this looks good to me. > > Reviewed-by: Evan Green Thanks!