Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3776119pxt; Tue, 10 Aug 2021 11:04:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjlo2ViVKoFskdCLlL3asxTc/TtZcXWJ5jnroUuNBvUFnCAg6Al9C5wvEQVff13Ey5di0o X-Received: by 2002:a17:906:19cc:: with SMTP id h12mr28101086ejd.386.1628618641422; Tue, 10 Aug 2021 11:04:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628618641; cv=none; d=google.com; s=arc-20160816; b=WchC+HzmzZCdBUO2uW4QQfSMCoe/EbaEABQnbEEi/ukhOZJ6IkaqI+Lp30j9BVC6Db 7P6EpCV9rmyU91nXfC2mUE7Dq+8bd4ij1vIpbsLoKRdEDZRLZ8iaNxhlPTnvEfIGiA+7 z7iSlLSzTB1JMI85lgoe9QEQYnX0H/ChFZ4l5OJKWJgDpPT7UthPc5Rv2bs5i70VilIZ w3m87fDJBisnMbOkyWTAh8Y1VJZeyI7/Qy8R47UGfRhWQk+GZbeF1jnhh9/C8c6icjDm 0yt2911VVmvPHYeyMZ20NN8vY8OW4OQIVrVqQw6SYtuWjkWEWPopQ7QQOEKXsy2WhmV+ PCzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Q15TthDotK+nKcko+akGkd0SE0ixAgP8VmXJvcsrSeY=; b=vEj9wWJeBV35mYe5O2klhuet3iRykVyVC250KdKaVkdCCP+oNQbwVEgKGz5xlUHfSP rp09isMcoZWwLpyqSxlrU5GLSs/kZgtj01zNqgUJtYBv0TY4G+dLmZiPmASj2aXI//yq uWs4+tUqEtNEC5O1kVPInIgPuzAWsqn8+0g79hgIihtyBu3akF+IeyxL/8//wYH4gU6G kFOB9z9KM0wZAM2wtj809uukHZ7Xp/4yOVejVKwy7/U8yXhsGusl8Qe6EVTRnGnTbKzr BPE5kqRIErRcUEiipkR+u5eGwRzbTfn5fSeWv9YKJXBFohOuD8cYQ9jaq0GgbZaDVBaO 26bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VHvcsE9r; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v2si22944969edc.86.2021.08.10.11.03.36; Tue, 10 Aug 2021 11:04:01 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VHvcsE9r; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238123AbhHJR7T (ORCPT + 99 others); Tue, 10 Aug 2021 13:59:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:52288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237737AbhHJRyy (ORCPT ); Tue, 10 Aug 2021 13:54:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 52DBE6108C; Tue, 10 Aug 2021 17:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617473; bh=l8tU+aNvmiH3O6wifGTHLkYIXutAko7PDTr3+NYhIzc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VHvcsE9rWTKFvW68eZ16EBIWZL+KhxU6kUZt6gDnLraShG9ndyX8M1Gbq8uI5JTKZ OMAC3Ggr+bDpLTh8zaqdDqw1SBHUQ1Q0XAgrNXi4IzxC1NC7PJMsRUuHQN8k9LADM0 x8cICHEUyHA92ajPKDUt6IjNfrpAVorTwWxDi/Zc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Willy Tarreau , Johan Hovold Subject: [PATCH 5.13 075/175] USB: serial: ch341: fix character loss at high transfer rates Date: Tue, 10 Aug 2021 19:29:43 +0200 Message-Id: <20210810173003.403776370@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810173000.928681411@linuxfoundation.org> References: <20210810173000.928681411@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Willy Tarreau commit 3c18e9baee0ef97510dcda78c82285f52626764b upstream. The chip supports high transfer rates, but with the small default buffers (64 bytes read), some entire blocks are regularly lost. This typically happens at 1.5 Mbps (which is the default speed on Rockchip devices) when used as a console to access U-Boot where the output of the "help" command misses many lines and where "printenv" mangles the environment. The FTDI driver doesn't suffer at all from this. One difference is that it uses 512 bytes rx buffers and 256 bytes tx buffers. Adopting these values completely resolved the issue, even the output of "dmesg" is reliable. I preferred to leave the Tx value unchanged as it is not involved in this issue, while a change could increase the risk of triggering the same issue with other devices having too small buffers. I verified that it backports well (and works) at least to 5.4. It's of low importance enough to be dropped where it doesn't trivially apply anymore. Cc: stable@vger.kernel.org Signed-off-by: Willy Tarreau Link: https://lore.kernel.org/r/20210724152739.18726-1-w@1wt.eu Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ch341.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c @@ -851,6 +851,7 @@ static struct usb_serial_driver ch341_de .owner = THIS_MODULE, .name = "ch341-uart", }, + .bulk_in_size = 512, .id_table = id_table, .num_ports = 1, .open = ch341_open,