Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3899049pxf; Tue, 6 Apr 2021 03:09:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj829s5GDm4Whv9JiEWTS2zsZW+Jw81pUPw6mo141gEtGgKJtv8mG8sU3beqD0z2TJwl53 X-Received: by 2002:a17:906:704a:: with SMTP id r10mr33307933ejj.312.1617703739931; Tue, 06 Apr 2021 03:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617703739; cv=none; d=google.com; s=arc-20160816; b=bVO5+0BXJOD5AwA+q9ynA2UpWPOrQZEny2NE6+UrgBdkFdXXmPXJLZ67TwbKZ/ELm/ M11gX+4S/vG4aweSZEzSxkRqnlmBVtWjtvbZU4AtuUx0iC6kX/bouQEGS7Edo1u5LIXH hE8UJto+HTYeSXgsykpJPQ8e4uxfkf9IHyuAzfEv2D/gaThHoAKITJJtViOaOfIneOPk 8RukwrwqGSCn5G08XdeegjvQjCd7R3T97Iy//uZQdaeQ81mtcriS6j6dV/HjN+G5sTYl 09K0gT7/wgPJUV+tvyRoS454ELWHlkw2BYS05rGd1X0VwroXj0nipavJGB1T4t+9o6fO QtbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=1X9Gg8e+5vjS3qZ1rFZBmVHAz09SrcG9Rpu0qJhy3yw=; b=0KaPEJ5TaBM2/qWMSy4EfG2iT4JXdW0QfNN99kaIpDrNpgbhrnDfU7rouqYg88ZlHO xb/skSxZHT9IwtWsAH+9Vn+el5kjG8GRkt1ioM5SXittYsgY+B7mvQFtcTx3R5G9lOyI +f7rXS74a+BB9FYzwBn41rtzuDpBL+g9qPsFwWMJO64WcqBkPv0EWWBY5wg+SPPnIyFn mdqaBZVmikgaYd7jynTeLhlp3IgBS+O608iX7YPvm2sN6qBlrYLWvAkNDqYyML1I7ghz 45wWGxDyJZWKl/qCtMWHjeBuifEPeWNxvsyD+2P5JmKTFjKIzl12ynWXXkcBPl+vbyWT zxIQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o6si12085458edi.480.2021.04.06.03.08.36; Tue, 06 Apr 2021 03:08:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241346AbhDEVo6 (ORCPT + 99 others); Mon, 5 Apr 2021 17:44:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241285AbhDEVo4 (ORCPT ); Mon, 5 Apr 2021 17:44:56 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8EA1C061756; Mon, 5 Apr 2021 14:44:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 5DB6B1F4469E Received: by earth.universe (Postfix, from userid 1000) id 7CEDA3C0C96; Mon, 5 Apr 2021 23:44:46 +0200 (CEST) Date: Mon, 5 Apr 2021 23:44:46 +0200 From: Sebastian Reichel To: Greg Kroah-Hartman Cc: Jiri Slaby , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Ian Ray , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCHv4] serial: imx: Add DMA buffer configuration via sysfs Message-ID: <20210405214446.zhidvtvahcfp4wxa@earth.universe> References: <20210305115058.92284-1-sebastian.reichel@collabora.com> <20210305124252.c3ffgca6wjqpkn45@earth.universe> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="jyl37mmk7opoozsa" Content-Disposition: inline In-Reply-To: <20210305124252.c3ffgca6wjqpkn45@earth.universe> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --jyl37mmk7opoozsa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Mar 05, 2021 at 01:42:52PM +0100, Sebastian Reichel wrote: > On Fri, Mar 05, 2021 at 01:06:12PM +0100, Greg Kroah-Hartman wrote: > > On Fri, Mar 05, 2021 at 12:50:58PM +0100, Sebastian Reichel wrote: > > > From: Fabien Lahoudere > > >=20 > > > In order to optimize serial communication (performance/throughput VS > > > latency), we may need to tweak DMA period number and size. This adds > > > sysfs attributes to configure those values before initialising DMA. > > > The defaults will stay the same as before (16 buffers with a size of > > > 1024 bytes). Afterwards the values can be read/write with the > > > following sysfs files: > > >=20 > > > /sys/class/tty/ttymxc*/dma_buffer_size > > > /sys/class/tty/ttymxc*/dma_buffer_count > >=20 > > Ick no. Custom sysfs attributes for things like serial ports are crazy. > >=20 > > > This is mainly needed for GEHC CS ONE (arch/arm/boot/dts/imx53-ppd.dt= s), > > > which has multiple microcontrollers connected via UART controlling. O= ne > > > of the UARTs is connected to an on-board microcontroller at 19200 bau= d, > > > which constantly pushes critical data (so aging character detect > > > interrupt will never trigger). This data must be processed at 50-200 = Hz, > > > so UART should return data in less than 5-20ms. With 1024 byte DMA > > > buffer (and a constant data stream) the read operation instead needs > > > 1024 byte / 19200 baud =3D 53.333ms, which is way too long (note: Wor= st > > > Case would be remote processor sending data with short pauses <=3D 7 > > > characters, which would further increase this number). The current > > > downstream kernel instead configures 24 bytes resulting in 1.25ms, > > > but that is obviously not sensible for normal UART use cases and cann= ot > > > be used as new default. > >=20 > > Why can't this be a device tree attribute? Why does this have to be a > > sysfs thing that no one will know how to tune and set over time. This > > hardware should not force a user to manually tune it to get it to work > > properly, this isn't the 1990's anymore :( > >=20 > > Please never force a user to choose stuff like this, they never will > > know what to do. >=20 > This used to be a DT attribute in PATCHv1. It has been moved over to > sysfs since PATCHv2, since it does not describe the hardware, but > configuration. Unfortunately lore.kernel.org does not have the full > thread, but this is the discussion: >=20 > https://lore.kernel.org/linux-serial/20170629182618.jpahpmuq364ldcv2@peng= utronix.de/ >=20 > From downstream POV this can be done either by adding a DT property > to the UART node, or by adding a udev rule. >=20 > From my POV there is not a huge difference. In both cases we will > be bound by an ABI afterwards, in both cases people will usually > stick to the default value and in both cases people that do deviate > from the default probably ran into problems and started to look > for a solution. ping? It's not very nice to get a rejected in cycles :( -- Sebastian --jyl37mmk7opoozsa Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmBrhMgACgkQ2O7X88g7 +pqyWhAAqargM2/F1Rs/EcL2QbtjVCapugkkOIjeMaC2QKgTPfrPYkmVUrfeHNbS HhLKLND5sZnmEfsgu3/y1acGUR0QDbn9HbiI0VrSr1YfLK7us9D7DxeorlW1QLfV 6ZfI1m/xDVdF8Rj216hSb3uawdcUvfbF5jGlXeMN24ZqKPd1wT5paM+sHp6UJO/7 eLfTnD5VdNQT7u/tRFNv3G4SawrEWut0LtFOdP8RXF/kDc+cGSuGRNLojoIeCm8B X1oKBNPergkXnr5A56bqB6suHrwVOT1BEOstKMZ5VpF1gJDKODu4X5XRMAFNotsV 9WVYDInY3LfVekEtQzQMI/4sCAP48TW5mtoyPJjBgFZRmQAQyviWZZ437EeasFSh WVtisky1Ure4r0Qes7OdvlITrxh/3TzqiOvqN0gjKjVhwzU5XHGIU1BZ0tfvYvP2 6Z8uVk0sy4JrsB2Gaf5ka2OBB18bzBNNZ0/fPVGlfqinG/Uk8r7U1IwQE6jfj8X7 BL6qXTxB//oWKE5YaeGsQW9Xn7PN3riAZgqV3+NKBoxLPB5rvXuLRY0lNotH6vyY uWsJm+AD2LwFhuRbfoUUGsnA9fQQy2/NPMubJvvK6LaTPPxShdtSHn6fx4od+pux gn44W2kG1AzJC0pRCIr4I5UjtqXCWW81W8Wji3AUUJ16GJveUeU= =pCYr -----END PGP SIGNATURE----- --jyl37mmk7opoozsa--