Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5449415imu; Wed, 19 Dec 2018 11:20:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/UiY2r3ZemXHZpvSk3BainvhvW9ACtunw+TjzBz30fYZuZfHUysXHp4qmQjISvPFwBMbbSd X-Received: by 2002:a63:8c2:: with SMTP id 185mr20888700pgi.26.1545247255769; Wed, 19 Dec 2018 11:20:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545247255; cv=none; d=google.com; s=arc-20160816; b=QVI1OSN1MpoKjTnxU0Dirg+tj88AaYQMU518EW4vkpY279rCZIJtmUNq3Nj60TI0pI kng3wXxdAjp7G5gTYc4Me3gO6L3uwxK8EYeP/U+a+pPmXmNuhqYfa0UO9XeKDsTC9/T6 tEgukzYzU7poCHkhgIIwWjfSkQ63no1+fnLwqzOTxas2utZ4OjpOTbzB24V9FrVnDdaV 8w58FS/O75BfDzpULGGKMxFobD7yo4YLOOaksi91K3tlqyvNh/xdS1PRyaZFUKhg0cqM PTsev2fz0TAR2jbQ68b7BPL/9m+l50W6l1Jg4CGpEV9Pl8f6VRHiOYXomf6rtzsOL7N+ 40SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=PO0k9/o7FTI1jmrZxBjOjNf74wJ/GL8BCXp4XKglEmI=; b=k6/MnDaNN4sXRUifOhBjzrRT0boG8H0+7sVw67ZtEAjZ0OIdFv2fhqGo9Og0bqfkVx /adrmyxaqY5HD4jFoFefZKdLIfWKxvJZoKqGYyZfQgGJiwNwMidmGDpO1Pbj+SDVpdyT 3+lUtROMFmux0LXbqqJVkR8HFELFvlooNqneVktPJ1yRo1ob3F8hDGwfwJh5PG5z3lhg c5ubjfcTPqR6AgkfSMCCDtfoGc3JnGUtQaBjQvXAm/fu+/K2uShJc9bZF0/xsC4ffL/F BNYZanNcFprOoQVhWQhHOMauTD+w5GBZZovJm5Qk9P3tHfMx06OxUhqVUlj8bfgCCtpB A4Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iQVmLVfe; 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 37si16749296pgw.590.2018.12.19.11.20.40; Wed, 19 Dec 2018 11:20:55 -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=iQVmLVfe; 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 S1730030AbeLSSuH (ORCPT + 99 others); Wed, 19 Dec 2018 13:50:07 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:40066 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729478AbeLSSuH (ORCPT ); Wed, 19 Dec 2018 13:50:07 -0500 Received: by mail-lf1-f65.google.com with SMTP id v5so15842846lfe.7 for ; Wed, 19 Dec 2018 10:50:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PO0k9/o7FTI1jmrZxBjOjNf74wJ/GL8BCXp4XKglEmI=; b=iQVmLVfePQuBwksRtmeoKDlom41PV7298F02ulRzbo0gry7p9hGyVy/sy67yu5mNFM f+VUWogabWm2Up1+oC9aVduDK4g9c5+yluSQ4H5NFaEhKPES5ByPKdjmngWmOo77Fqdi I3BbczXpU7mrqD4x92RGu9CMx3PxRvhKGQYcs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PO0k9/o7FTI1jmrZxBjOjNf74wJ/GL8BCXp4XKglEmI=; b=lYj4QEPU8qvZyzXoPm/Bcg5n16zQQpvp2FvSplFp/M0AqN9gT6vtk5+BcQZtriUiGS iwvAJx9X14LlIcj3XwdGEWZFJdrsmkBDw1m19oraYFoxj4miXjsj6N7mmmhSu7vKxftM iu30w/U7gM57fBOwml/d/efRFCvJA+Tlq6afTOyqTj5+KmRUTL4iVUfpzEF84TJVsRy5 ftS9gAwnLIZdsMOTY0Ks9blyetLe3148cvBjOJS4Z0Cic9XVXnIsNM4H6icL4Moy/2Xr GeLkmhhXtvStynql6F4HUOgA7bvGpxQqOjNpXoK0e69KiUSQzS2luI/yhZHtXBwiAMNY 1A/Q== X-Gm-Message-State: AA+aEWahV6oVwlXFQyQyk3fpBPJtpbdmOn6PnsIZC4/g90iujaBAr4pA rtwCMsnWV6iRm29+9Vy7KyTnC6/YIG8= X-Received: by 2002:ac2:50c4:: with SMTP id h4mr11597859lfm.81.1545245404728; Wed, 19 Dec 2018 10:50:04 -0800 (PST) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com. [209.85.208.174]) by smtp.gmail.com with ESMTPSA id a62sm3978968lfa.37.2018.12.19.10.50.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 10:50:04 -0800 (PST) Received: by mail-lj1-f174.google.com with SMTP id v1-v6so18358497ljd.0 for ; Wed, 19 Dec 2018 10:50:04 -0800 (PST) X-Received: by 2002:a2e:45d:: with SMTP id 90-v6mr13628864lje.110.1545245402786; Wed, 19 Dec 2018 10:50:02 -0800 (PST) MIME-Version: 1.0 References: <20181219181747.118278-1-mka@chromium.org> In-Reply-To: <20181219181747.118278-1-mka@chromium.org> From: Evan Green Date: Wed, 19 Dec 2018 10:49:26 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] tty: serial: qcom_geni_serial: Fix wrap around of TX buffer To: mka@chromium.org 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 Content-Type: text/plain; charset="UTF-8" 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: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? Strange though, I still would have expected this bug to result in inserted serial characters, rather than edited ones. Either way, this looks good to me. Reviewed-by: Evan Green