From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754787AbcLYVUm (ORCPT ); Sun, 25 Dec 2016 16:20:42 -0500 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:33580 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752237AbcLYVUh (ORCPT ); Sun, 25 Dec 2016 16:20:37 -0500 Date: Sun, 25 Dec 2016 22:20:35 +0100 From: Pavel Machek To: Sascha Hauer Cc: linux-serial@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de Subject: Re: [PATCH 1/4] serial: core: Add LED trigger support Message-ID: <20161225212034.GC26891@amd> References: <20161123100106.15969-1-s.hauer@pengutronix.de> <20161123100106.15969-2-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lMM8JwqTlfDpEaS6" Content-Disposition: inline In-Reply-To: <20161123100106.15969-2-s.hauer@pengutronix.de> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --lMM8JwqTlfDpEaS6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > As the serial core layer does not know when the hardware actually sends > or receives characters, this needs help from the UART drivers. The > LED triggers are registered in uart_add_led_triggers() called from > the UART drivers which want to support LED triggers. All the driver > has to do then is to call uart_led_trigger_[tx|rx] to indicate > activity. >=20 > Signed-off-by: Sascha Hauer > --- > drivers/tty/serial/serial_core.c | 73 ++++++++++++++++++++++++++++++++++= ++++++ > include/linux/serial_core.h | 10 ++++++ > 2 files changed, 83 insertions(+) >=20 > + if (!IS_ENABLED(CONFIG_LEDS_TRIGGERS)) > + return 0; > + > + uport->led_trigger_tx_name =3D kasprintf(GFP_KERNEL, "%s%d-tx", > + drv->dev_name, uport->line); > + uport->led_trigger_rx_name =3D kasprintf(GFP_KERNEL, "%s%d-rx", > + drv->dev_name, uport->line); Is it neccessary to have separate triggers for rx and tx? Won't most common application be "light a led for rx _or_ tx", which is something this can not do? If I have system with 200 serials, this creates 400 triggers, each trigger name will be about 10 characters AFAICT... and we'll overflow some buffer when doing "cat triggers", no? Would it be enough to have 3 triggers? (Any activity, any rx, any tx)? Thanks, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --lMM8JwqTlfDpEaS6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlhgOCIACgkQMOfwapXb+vJbMQCginbIjK2OxemgW1ZOlCYq5jHD 6RMAoLKNHP6HFHWUJ40k3KaHl4yeip3i =ICme -----END PGP SIGNATURE----- --lMM8JwqTlfDpEaS6--