Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp82891lqm; Mon, 10 Jun 2024 13:27:17 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXao331BauZ0d9AVx+iFWXqwDP7+UzUPaQmabWiMqJAp2lqIYADcnm9/TwEYLw6fZou6GuOU8Ns2jK2nBQz+EwkoAeDt9oKj2GQS4tOrQ== X-Google-Smtp-Source: AGHT+IFd5Audlvo37OEzrr2tI/AoDhrJktFWrm8HejWlGzojFgf8c6xHj3w5boiivneIZYgNTre4 X-Received: by 2002:a05:6358:60c8:b0:19f:40ab:e82b with SMTP id e5c5f4694b2df-19f40abeb48mr918220255d.10.1718051236938; Mon, 10 Jun 2024 13:27:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718051236; cv=pass; d=google.com; s=arc-20160816; b=uRGaYCce6H98lgahBlcJLIUBBZdaya5nSaWPbk8PFpyK5FDOZ9raly8QTXU5rnEd6N K5hzQq7EnFgra5hewVJMLy4aQ1BKVIh8Temk1vvrEUJfXLPNaAXq+bfkxjEbkYNE6tdO Xgu4NGcBx1oM7i1WmH/ITyht1NZAeNJteZ4bilpNA6rQcOgJ1wMIBWNR7Wq0ssUWVL/x OCbELuP0xKKWBuZZ2zuID7YjtM52QXPT5vnZrFkf9eagqFNNbders7eAtZ1U8l0KyUNz lirPTZwDPXPzNv9AaEdWpXx61DC7v7/Y1aBox+VC0a6MOIkXkLK7GY+fBR17+v0y5JgZ zJxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=6pl8T6m4emk3aMt9ImW1yQY4NMWNiVqYmr9bldDIC9w=; fh=3ThfHLazHtVUKqRRduTcy72Vs9D6CERVDWYG0LcpQz8=; b=BLkXKC2UQvBAqGrgBGZek/iC82FkfJYLPxqyVDNc460kInEVbvB25bmq0I/net/m1f NqUUq7BzzpNKlC8WjU4UQ8zzRNWghkS9bT2qIUY6/gNb5TuGyTQ+Ttz2ddEKfbE2Y5DF UYvlg+9FY7+3lyhFKYDAx+ExJUl6TJAkP9Rb/9gsDxvBklb7POiNnt7P1aMIrkV7ODdH fKTt3NZh7Qq8Dc/iDLzx37UFvKCg/sf/ottveRcTWN6PzgglMdk8k/ypY90PffXkZql1 oHC7eTdF56LgoKpuwtNHZJY6jkpazv2agJ+JeW7oRRN98uqVqeXC8DdWhfFwbrBcG4Cc JuaQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MXcrQilT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208843-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e48d6bae82si5749173a12.193.2024.06.10.13.27.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 13:27:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MXcrQilT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-208843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208843-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0912BB21CCD for ; Mon, 10 Jun 2024 20:16:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3378482D7; Mon, 10 Jun 2024 20:16:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MXcrQilT" Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A2AA3BB30; Mon, 10 Jun 2024 20:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718050601; cv=none; b=kZaScyQuMsd7cHEfc7eMIzIC2BS9GBzwDVyCDXVmUfoDnRt/GkLsS+GhU/0dQaN0VVWiPOQ98j3cgDZFnZr/pe2iTcxf5R4QwNBWBQUq+Fk0cy5fXP+k5hl/WKUrPju0R6gfUKX5GJhHF+oNZQDi3wljTdpRzVg6fPS4Ek49Avk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718050601; c=relaxed/simple; bh=//W7kqXFonvLeGOTPZRMLoM6eBxITBOMJLknJtGDK0w=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=CQsFhtimlbXLbYEsFv0mWIAUr/8fvkFBdrbtyy3zXc6ht5ZbXC2GcK4vt+uY0K8OpwMNQO85joUMTfIn2hpcWjHj4Y0K5IUvl603U/wdTOGys0yOd5R23UN621WMcGfewyQ0Muv9y0BxA/F2hKBx1uhWtBSliFyT0rCYEENWT0I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MXcrQilT; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-57a52dfd081so315263a12.2; Mon, 10 Jun 2024 13:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718050598; x=1718655398; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=6pl8T6m4emk3aMt9ImW1yQY4NMWNiVqYmr9bldDIC9w=; b=MXcrQilThMC3TUQlan3B+hdqGB9H8g46rqMOin49aN/cvSWanvwuTtwjV13ELFo8Ys O5ctzAsuv9tzzYUednMoibWftEN0qMs62J2HriS5Yrlc8QjHLRS10NsSNKf0daizwp0a iNs4zlH6YiTbdWD/xH3LA9x1cY4PakMv3IIwcK6UKCgN0CrMU2/aJMjtRhyjHBDbxue8 aNzV5Nv+vvgUWOPStaa+ldTnbm87nx69JXdaHx+2oT5RGlniroM9aY6+PPiw9OilJU9F opNskyojmcIWn2tfJqpKtUNjjiqOCTTviLtn1OoCXPXRyZbExP+hYUj5PnoVhE3EGVQv Wzug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718050598; x=1718655398; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:from:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6pl8T6m4emk3aMt9ImW1yQY4NMWNiVqYmr9bldDIC9w=; b=aeBi8rducKmJ2MlKb/uMgZwzGWUzvQFrNWhAebkgA8oHMek7HSOwUCbGcyLWJg2PFn wYkj8FFrBlclJsxo0T2uN+vzii6iYW4wpzZ5m9/crMs14PrTTHMoE++c3stgZykDKOyL OL7uh6FYH7d5mWuRVwnMtS+hx+cn74EFCKpW3P+9PMqVAELN2ma/2LT6xBQyWjLoeLrE P8X1cPo9ccY03ANe+nl7fU3qB3OARV0bb6NhHqYsm01HJrrI5ix6mWO4Y97WdnU0VQL8 5CQ0itkjMVo2DVpD5vZuXxtjlqsr2LgZOcSYnNJPsyxD7K9XP6kuEOLxdABMbH9Dbu8G hzuw== X-Forwarded-Encrypted: i=1; AJvYcCWxLuWsW/imoUpe/4MtVM0+0oOxJD6VptrOTkJZ8AngKTtzOM26MzonrMJ/v/EeA0Qy3xSUVTQ4WG4RbH3VnRSxdI68Izxpj7MksYBMThNd1dDNuUwrZJxfy1ITot4uQeyAurimxVybzzvwgw== X-Gm-Message-State: AOJu0YzPkKBr5CZNud7HaXw9ASDFuDblzMlQWac69u7vLctpoKoSSGXz aWdSv8kBOaRoPdAVaDPR31VDpPtQNjU0Wh5FAjp7cnXOOeHKSF7U X-Received: by 2002:a17:906:1503:b0:a6f:118c:2622 with SMTP id a640c23a62f3a-a6f118c26aamr371908066b.63.1718050597938; Mon, 10 Jun 2024 13:16:37 -0700 (PDT) Received: from ?IPV6:2a02:a466:68ed:1:2173:d612:de41:2058? ([2a02:a466:68ed:1:2173:d612:de41:2058]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f1b7f5b12sm217710466b.196.2024.06.10.13.16.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jun 2024 13:16:37 -0700 (PDT) Message-ID: <364fbb96-006f-4582-a0f8-a0f9edd50f6f@gmail.com> Date: Mon, 10 Jun 2024 22:16:28 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/15] tty: serial: switch from circ_buf to kfifo From: Ferry Toth To: Jiri Slaby , neil.armstrong@linaro.org, gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Al Cooper , Alexander Shiyan , Alexandre Belloni , Alexandre Torgue , Alim Akhtar , Andrew Morton , "Aneesh Kumar K.V" , AngeloGioacchino Del Regno , Baolin Wang , Baruch Siach , Bjorn Andersson , Claudiu Beznea , "David S. Miller" , Fabio Estevam , Hammer Hsieh , =?UTF-8?Q?Christian_K=C3=B6nig?= , Christophe Leroy , Chunyan Zhang , Jerome Brunet , Jonathan Hunter , Kevin Hilman , Konrad Dybcio , Krzysztof Kozlowski , Kumaravel Thiagarajan , Laxman Dewangan , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, "Maciej W. Rozycki" , Manivannan Sadhasivam , Martin Blumenstingl , Matthias Brugger , Maxime Coquelin , Michael Ellerman , Michal Simek , "Naveen N. Rao" , Nicolas Ferre , Nicholas Piggin , Orson Zhai , =?UTF-8?Q?Pali_Roh=C3=A1r?= , Patrice Chotard , Peter Korsgaard , Richard Genoud , Russell King , Sascha Hauer , Shawn Guo , Stefani Seibold , Sumit Semwal , Taichi Sugaya , Takao Orito , Tharun Kumar P , Thierry Reding , Timur Tabi , Vineet Gupta , Marek Szyprowski References: <20240405060826.2521-1-jirislaby@kernel.org> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Op 07-06-2024 om 22:32 schreef Ferry Toth: > Hi, > > Op 22-04-2024 om 07:51 schreef Jiri Slaby: >> Hi, >> >> On 19. 04. 24, 17:12, Neil Armstrong wrote: >>> On 05/04/2024 08:08, Jiri Slaby (SUSE) wrote: >>>> This series switches tty serial layer to use kfifo instead of circ_buf. >>>> >>>> The reasoning can be found in the switching patch in this series: >>>> """ >>>> Switch from struct circ_buf to proper kfifo. kfifo provides much better >>>> API, esp. when wrap-around of the buffer needs to be taken into >>>> account. >>>> Look at pl011_dma_tx_refill() or cpm_uart_tx_pump() changes for >>>> example. >>>> >>>> Kfifo API can also fill in scatter-gather DMA structures, so it easier >>>> for that use case too. Look at lpuart_dma_tx() for example. Note that >>>> not all drivers can be converted to that (like atmel_serial), they >>>> handle DMA specially. >>>> >>>> Note that usb-serial uses kfifo for TX for ages. >>>> """ >> ... >>> This patchset has at least broken all Amlogic and Qualcomm boards so >>> far, only part of them were fixed in next- >> >> So are there still not fixed problems yet? >> >>> but this serie has been merged in v1 >> >> Ugh, are you saying that v1 patches are not worth taking? That doesn't >> fit with my experience. >> >>> with no serious testing >> >> Sadly, everyone had a chance to test the series: >> >> https://lore.kernel.org/all/20240319095315.27624-1-jirislaby@kernel.org/ >> for more than two weeks before I sent this version for inclusion. And >> then it took another 5 days till this series appeared in -next. But >> noone with this HW apparently cared enough back then. I'd wish they >> (you) didn't. Maybe next time, people will listen more carefully: >> === >> This is Request for Testing as I cannot test all the changes >> (obviously). So please test your HW's serial properly. >> === >> >>> and should've been dropped immediately when the first regressions >>> were reported. >> >> Provided the RFT was mostly ignored (anyone who tested that here, or I >> only wasted my time?), how exactly would dropping help me finding >> potential issues in the series? In the end, noone is running -next in >> production, so glitches are sort of expected, right? And I believe I >> smashed them quickly enough (despite I was sidetracked to handle the >> n_gsm issue). But I might be wrong, as usual. > > I arrived at this party a bit late, sorry about that. No good excuses. > >> So no, dropping is not helping moving forward, actions taken by e.g. >> Marek Szyprowski do, IMNSHO. > > Good news is I tested on Merrifield (Intel Edison) which is slow > (500MHz) and has a HSU that can transmit up to 3.5Mb/s. It really > normally needs DMA and just a single interrupt at the end of transmit > and receive for which I my own patches locally. The bounce buffer I was > using on transmit broke due to this patch, so I dropped that. Still, > with the extra interrupts caused by the circ buffer wrapping around it > seems to work well. Too late to add my Tested-by. > > One question though: in 8250_dma.c serial8250_tx_dma() you mention "/* > kfifo can do more than one sg, we don't (quite yet) */". > > I see the opportunity to use 2 sg entries to get all the data out in one > dma transfer, but there doesn't seem to be much documentation or > examples on how to do that. It seems just increasing nents to 2 would do > the trick? Nevertheless I got this to work. Very nice. Thanks for this series. I am seeing only 2 interrupts (x2 as each interrupt happens twice), one for dma complete. The 2nd, not sure but likely, uart tx done. In any case the whole buffer is transferred without interchar gaps. > So, what was the reason to "don't (quite yet)"? Before considering to send out a patch for this, are there any caveats that I'm overlooking? >> thanks, >