Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1958518pxb; Fri, 5 Mar 2021 04:07:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwpNqnGNK+wyOScPoZ8L9a+t2fKu5Ko8PMc4dCNmYHG000dxO3ZK253A2brvjutd3OSKGKO X-Received: by 2002:aa7:c95a:: with SMTP id h26mr8829856edt.166.1614946074505; Fri, 05 Mar 2021 04:07:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614946074; cv=none; d=google.com; s=arc-20160816; b=NwBPVav8LO+fEyMD8goiDVCuZgy0zN8bdVCWvBEQLRp3Wr+FXO8Flk12KYmY5Rnj2o ZIVq/6VGb64xmXQmQ7jmQpeLESz6kqZ0bPG/hn5NAtdkmp1bzDIUAt2fniSRUR8ME5yg YLOqhMpzqMgxhQVALw7EOqM3SESeD+ZR+E53YAzmClDG3aozbfRXeEu/uiVnoYiyjrcM Z5QDI/doqvRB+prcTY/m4A+RX1zzHUrbFP8r3a278OtANCHYHAzQdWLMqlnSZt1mZuoa rIQMJ3TsDdt8vdxv+f/8T8u3+8hZKgLdanHqrEc8bfTJo3ghQO11Q65BfPq3FdDtbewh 2Bmg== 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:dkim-signature; bh=smCckzfP8dg55QToYaTJ/n6sw6ACZBtdKXOXsxn+5a0=; b=nzt18ygARfCYGqJN1nZjvkcosIhV9jw0zzyAPWytC1lv2ZDLiRhQxieK+jmFDfqYjo PQaPA96+xSwa0cmqM7Xx94zeCLH/UQuF8l2Qje/BZ9M9gcH394hzxUNHviTMPgqgLbYq 3FCOaodiaWBNSI50jCcAZtt4TJmi64vwLdJqDB7mABSTUZRiBFr8xtdQyBW/yTdPcX0K Rdb9xjbr0FsMSoKI3/BCnfL+khROUy4Xj3lHNiswG7dE86Gr+zBLehebd5ShPD0jpzpm gG+p6RDquyDIlG9tdEDTRUcrA8v1IPpTIQpJKp2JsGdu2sZ70le4hFUWHt2H0mknTJ0q Q8UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=perRWwrn; 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 e6si1409226edv.518.2021.03.05.04.07.26; Fri, 05 Mar 2021 04:07:54 -0800 (PST) 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=perRWwrn; 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 S229682AbhCEMGR (ORCPT + 99 others); Fri, 5 Mar 2021 07:06:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:54820 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbhCEMGQ (ORCPT ); Fri, 5 Mar 2021 07:06:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 05F9564E60; Fri, 5 Mar 2021 12:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614945975; bh=seIgEFW9DLtQzQlaeFxbhm+QRr5e0pQ/jgFuY8NjaGI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=perRWwrnJeslMC1hKprDhNXjUI7bveE5t87LFC3/uVP4/0R1nBqJivBtjShEhub1e DtkoeyhmamPYWa2lGkzVn1WLBVe+RHIWNuLFhi7quOGr8AAITTBfsM4CKWiYic0jd6 8Ew7aWuj6leNJP78kmnyRSmezX4xJjtpC1Qjbmss= Date: Fri, 5 Mar 2021 13:06:12 +0100 From: Greg Kroah-Hartman To: Sebastian Reichel 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: References: <20210305115058.92284-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210305115058.92284-1-sebastian.reichel@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 05, 2021 at 12:50:58PM +0100, Sebastian Reichel wrote: > From: Fabien Lahoudere > > 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: > > /sys/class/tty/ttymxc*/dma_buffer_size > /sys/class/tty/ttymxc*/dma_buffer_count Ick no. Custom sysfs attributes for things like serial ports are crazy. > This is mainly needed for GEHC CS ONE (arch/arm/boot/dts/imx53-ppd.dts), > which has multiple microcontrollers connected via UART controlling. One > of the UARTs is connected to an on-board microcontroller at 19200 baud, > 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 = 53.333ms, which is way too long (note: Worst > Case would be remote processor sending data with short pauses <= 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 cannot > be used as new default. 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 :( Please never force a user to choose stuff like this, they never will know what to do. thanks, greg k-h