Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4133935pxf; Tue, 6 Apr 2021 08:40:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycVhCWM8R0FrVp2l0NakNFtQJkENpKeFJ+eJJYCwA59zoNOsrD5hIhxjt72OCo0yDydfxG X-Received: by 2002:a17:906:2496:: with SMTP id e22mr15887784ejb.29.1617723626303; Tue, 06 Apr 2021 08:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617723626; cv=none; d=google.com; s=arc-20160816; b=gKvnHhkd9HhMBFrBdqyb13+MKiWxm/uHwo48Un4FN9GX6Ji43rlQBoPs+YraQ+/9j7 LDDwelCz3CL/JIlVPdXhBSynS1HmaAyzEE5X5SjCJHpojfI1Jrxdd8RUPFJ3MHesw3tQ x76fe3paRmm7xkG7NYX03VlGs2B2WuZyXBqavhsQKVllD63DwAfSDBThluMf/hZmPfQ5 Z7aWSOnTqTKb/NMTW7L83iP4Hqrb/f6g5MFv/cJT/DI7H30oNtODJ8hy0SLr15+oMkxU muK5hJ4TS+BfGvZiOR+TiprqQb5+iLeEuuDwFXC46PQg793VImhxrLfbJGmaOeN2KokH cLJQ== 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=b0qdSEdX/in6FW8w+Dn0un6vLWLOaxd2zSv7PR70K0E=; b=oUwu1vKOZKC+GL6lx6GKRd8WIJJvAcfIKEK745BOcRV4lGEAygfXo2Se1DJxLnTz8L y2DOBPYmd0jQkVw/2G5EQDEkC7VYV5g+BegQhE60lpXfJ3eiD9ncWNds05oDHXhhcz4o DKNo7BYncP6w6mIuXmnHpNk0rl7tIbn/0ysYiWlAGDGBMakX5qBy7+4oDeW2gKu1byox XurKf1+5lM+AEmQ+IJREERzbaXhBC/VpHqnGb8tcgPFMvT6ptBMT8NlB/OWkzNBGX0kc ZAhk/2wy2/+ke0UdnZI6dWz55s2sOpgfTHSrJuWokY7bSqDC9I4GQi+0hadwppRe3/3D XYHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="dGIH4E+/"; 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 n9si195271edy.611.2021.04.06.08.40.01; Tue, 06 Apr 2021 08:40:26 -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="dGIH4E+/"; 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 S239260AbhDFHNT (ORCPT + 99 others); Tue, 6 Apr 2021 03:13:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:49078 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238014AbhDFHNQ (ORCPT ); Tue, 6 Apr 2021 03:13:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A9C20601FF; Tue, 6 Apr 2021 07:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617693188; bh=+ROOemzsL6HXsZmP2A3hvzMlxx6Hg/qSe+z95RovJrE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dGIH4E+/yxdmOTsrr3g4opHziIW4u1+TkjbuGcE4E+xz7Pmoqa0E9G46vlIAIiY6Y upsWtt12hPD4zpPsXJoJBoCGf9Pra6q0AFXksKI767Fzno5NiebBBL8agKY+SkufQU KgWPDjZpBIcwvEQbUl2xSUdRnprmS5pyAdn+kRuQ= Date: Tue, 6 Apr 2021 09:13:04 +0200 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> <20210305124252.c3ffgca6wjqpkn45@earth.universe> <20210405214446.zhidvtvahcfp4wxa@earth.universe> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210405214446.zhidvtvahcfp4wxa@earth.universe> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 05, 2021 at 11:44:46PM +0200, Sebastian Reichel wrote: > 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 > > > > > > > > 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. > > > > 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: > > > > https://lore.kernel.org/linux-serial/20170629182618.jpahpmuq364ldcv2@pengutronix.de/ > > > > From downstream POV this can be done either by adding a DT property > > to the UART node, or by adding a udev rule. > > > > 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 :( I recommend working with the DT people here, as custom sysfs attributes for things like this that are really just describing the hardware is crazy. thanks, greg k-h