Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3765157pxt; Tue, 10 Aug 2021 10:47:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/WkCRW3RFzyqD+nsM370INREe6HQeozLXjhrmWgukRvQCqvst6XRelBNISzBQPnu+/mXg X-Received: by 2002:a92:6a03:: with SMTP id f3mr451297ilc.43.1628617663900; Tue, 10 Aug 2021 10:47:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628617663; cv=none; d=google.com; s=arc-20160816; b=g/kxyu7TLyTDgSK8bXvEpBjLji4TF9Snx1CIe+joruC2fKVIVxmpjMy2q77xf3kR7e PKKn0oEtkl5um76a+pSOq0Z9sMy1iEnXeeci6SOrZd/R1gK15aU0SC1i3u8CTyu6OXjC piY+k0LXzRLVD4ndAmpbRfVAE6k4pcx4AsK2tSMteomJ5kdBjjnBYpQ5nk4zgBDxGN+s DHBYYTplm0bRBjiSqCHsJN0pmGIr8jNL5QeLCSG6KY4bsY+I/kEDTB2itmWyBZCUuFGJ 5tkFCWMVb5tRyU9vWxZ9RJqDYSePHlC3w2eM3ewSx/rYmE1XNGpwxyyG5a0vD+yBdHpW uDlQ== 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=n8eS4t8oj7stM67Epjxz1qydx04wrX/S04l9iMckQGg=; b=BZjhqKLXmblgICxwAoFh2zHGSJq3MRoKLu7qUuoap+7GVJ9r8P2K4W4FSeLAxrYMvr kE2LfTgGzMNBfgdc8uPcYdfuw4wZkQUf0r/hG4kfSbeNx1T+aSLn98wU4ln1bp9wkMIS JXQrGFfQza7cYd22sZNE37Z5y8TBpKPhU2TKQrj693AkoL+ZAV/ohV0Ym3IbwX2uSd1B pwj+3kSQXD1lKsQIcyvy2UrcpXZG++S0Ptv7tABxGvtKmvLjsFa564sY0p9IWk/PYQvL FEpw5W+eaxvR7fmKb8/pbAtYVB7r9igG7XBlnX8qWu3Unm2hlI5rSLMYwKNIAfBuwPke 0o4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NwXlCBkC; 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 f10si26672695ila.58.2021.08.10.10.47.32; Tue, 10 Aug 2021 10:47:43 -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=NwXlCBkC; 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 S234655AbhHJRqC (ORCPT + 99 others); Tue, 10 Aug 2021 13:46:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:34382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234223AbhHJRmJ (ORCPT ); Tue, 10 Aug 2021 13:42:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 50D92603E7; Tue, 10 Aug 2021 17:38:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628617121; bh=WQnjjGyEF9yLD7dMbwJsQUl7lQBzi6bSOE3gvj+9dI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NwXlCBkCrAzgvE4FuWnaWfcFe98fNOXz9/zYPJf1Eek/Q6hbC7WCwBd6T2ur9fogx kw5PDtqSmsxaT7iF6C/TnbvIwKLI+T0/1xnFMG3itlpEQeYcP+MpdVRxH+5uAYvdVT yL2au1PAQlk2zqm+jjqXl+ymwEwdXyj8KsZjX7II= 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.10 054/135] USB: serial: ch341: fix character loss at high transfer rates Date: Tue, 10 Aug 2021 19:29:48 +0200 Message-Id: <20210810172957.529461544@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810172955.660225700@linuxfoundation.org> References: <20210810172955.660225700@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 @@ -853,6 +853,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,