Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp475541lqp; Wed, 12 Jun 2024 07:17:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5s6PpMRStbd7pw0497aiXP0DLSBNsgVA+mtxmM62eoxVhFBAxYSbWc4mfEQ6jy3iM6mZ5CA5nYNIBaAoKU9chtvY1cvsw5BKrE1HmqA== X-Google-Smtp-Source: AGHT+IGWFQMdBSK35bhXP+xjQGJeHY5Qn3QQCdZkjwk9Oke6cnSSP4ErlHCh9exw9zHIBBrC4BC5 X-Received: by 2002:a17:90a:67c7:b0:2ac:5d2d:12ac with SMTP id 98e67ed59e1d1-2c4a7606ec7mr2309269a91.5.1718201839280; Wed, 12 Jun 2024 07:17:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718201839; cv=pass; d=google.com; s=arc-20160816; b=RPVsPviaSS+0QZ9q8UVMbO9EI4j/HsthVNM9DrUzwCp77r6UsST9mSuA9WrTu6I5x3 Il9enS3dnfWUhSNEkyStezs7/g0QTd8lLmXAJACj5dQlMp24wmY0gjs1u7Le+uS0dYh5 puKDuKAWqElLUbH9XNScSDJB7AqIlhxTpEoPt1OY2Tcj2W3PNt6uCN1BOU+3n/5CekzE 4t7fAJZh49CHK9B1bESPaayrMCdQ1/ZYOmeW5fKrwXC91Qh5+0IkkQ3tpOgBCos1heBT EmRBUaoETBq70ZS2K3oJDv/ltyVnVqJLpgZd3QPURADgpKJRP4mn0VIRAvtP2z/uq9Zn fPIg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:date:from :dkim-signature; bh=euuemkxynpnO/rlQLVQ2DFTv/li79wNarmZobhV1CYM=; fh=qA/7Ba9qOCHobrGg6rzRrOd+4fXmLCh02gn5PR4c0As=; b=gj1uQ181St0eUTtCrtZHT6oP8MVRQ7v7V7l41cMXTASkgqBPILgOT0TZKKlfCQz4yu xMXzvhDZE/cTXgYPbhppjSMzw6fgmDj/GBVB/vvRTpA0EcjO24fyygdP+e5DUCKJ5CUd +8JY2D++sLIerKVsnjn0VFWqlnjp+YCJIfxl+kZuAq6BA36y408z/KjHXckzmCsnkiRU 6Vkk2xvsvPi3oIJNfEvm1Hpp4TGuqNNExfkfvdpV6QFhA6q/p7Eu4CCmt2nIhyqqjPpf a5YjlO8wOA0IJPLNj/04rP4KauJu6yh7csdiklcZkFVoCevBG9WA9B6CVpKwOD1XJps+ awWw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NWcJpCx2; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-211542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4a75f3beasi1633263a91.59.2024.06.12.07.17.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 07:17:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NWcJpCx2; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-211542-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211542-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 B2829B212B6 for ; Wed, 12 Jun 2024 13:15:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6EA317B42A; Wed, 12 Jun 2024 13:14:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NWcJpCx2" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01DF4178CE2; Wed, 12 Jun 2024 13:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718198097; cv=none; b=HaavO4F2DdoEkNu3B5D4qQ2FimCTMx9+ACHqLsxqHWJ6TUteq+ZZX3qrpVyKhcCOMxSckKEpVAw2A1OqSP/EaPXOJeUxokqEtPpHEDoabQB+oU1wleTa+Ibqqa5wtfnUwsd8pbpDxrCHXWSw/59kYJRvzqVO9o40Wk9vyxjspq4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718198097; c=relaxed/simple; bh=NjR9EmT2USXh4mzPSyqvcRcDLdrJnfGaf9Bxzh5GMm8=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=ma/WOxIfMKhwYsvoQNq30yinOvxZhl4Mq5AH+rkCX/ywvzj3lTSdHR+gt+bUyd3cHhrxiIr6fdoau4DfLMVkhEZqhli+/4sStmLHe1EE3ZEb5Y3yXYgWkSA2W/qQC5oGiDSqaNYfOxMvUBxlGnpva1J89aUDeSeSDFiT5UtXEjU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NWcJpCx2; arc=none smtp.client-ip=192.198.163.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718198096; x=1749734096; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=NjR9EmT2USXh4mzPSyqvcRcDLdrJnfGaf9Bxzh5GMm8=; b=NWcJpCx20V4swG705ViPMktXjyJkhwNkgisQbZMPxU895k1cavm1ONRf /fH5C3NVpa5oVgMFHFc9rowQcUpbQa+aQs2naxytbD8OJRxD42yo+G1ZH UIN8oeQKepmJ7hxieuOUdDSFWnwWYXceu4ccxYCvlA29xAA0J+hUPtkbZ ExOe4N93F1QZxO/V0geZVWb5catqKLf6kTUg6P8lclndmUt1jWwST4UvP 0/oeXtlA+mbBouNnn7PC3loz4OEhgHbfXDby6/hOuW8DcKF/qAZQnNgla F9iNIxzUb6YQ5uL62MeYuOs5hTQjWFNTLrmsvriGRtCLOIAq91zcezTmB Q==; X-CSE-ConnectionGUID: mlou6Ze8QCOxsBMuvoPOpg== X-CSE-MsgGUID: TXQYRVnsSwC/UE0gmI1KxQ== X-IronPort-AV: E=McAfee;i="6700,10204,11101"; a="14833613" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="14833613" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa111.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 06:13:59 -0700 X-CSE-ConnectionGUID: s17X2DmVRiyWyalMUlsVIw== X-CSE-MsgGUID: Z9GqfwPoRs2NdGc50Rzebw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="70990266" Received: from unknown (HELO localhost) ([10.245.247.204]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 06:13:41 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Wed, 12 Jun 2024 16:13:38 +0300 (EEST) To: Ferry Toth cc: Jiri Slaby , neil.armstrong@linaro.org, Greg Kroah-Hartman , linux-serial , LKML , 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 , =?ISO-8859-15?Q?Christian_K=F6nig?= , 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 , =?ISO-8859-15?Q?Pali_Roh=E1r?= , 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 Subject: Re: [PATCH 00/15] tty: serial: switch from circ_buf to kfifo In-Reply-To: <364fbb96-006f-4582-a0f8-a0f9edd50f6f@gmail.com> Message-ID: References: <20240405060826.2521-1-jirislaby@kernel.org> <364fbb96-006f-4582-a0f8-a0f9edd50f6f@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Mon, 10 Jun 2024, Ferry Toth wrote: > Op 07-06-2024 om 22:32 schreef Ferry Toth: > > Op 22-04-2024 om 07:51 schreef Jiri Slaby: > > > 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. > > > > > """ > > > 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? Not exactly related to that quoted comment, but you should Cc the person who added RNZ1 DMA a year or two back (in 8250_dw.c) because it required writing Tx length into some custom register. I don't know the meaning of that HW specific register so it would be good to get confirmation the HW is okay if it gets more than 1 sg entry (at worst, a HW-specific limit on nents might need to be imposed). -- i.