lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 08 May 2024 10:48:23 +0200
From: Christoph Fritz <christoph.fritz@...dev.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jiri Slaby <jirislaby@...nel.org>, Oliver Hartkopp
 <socketcan@...tkopp.net>,  Marc Kleine-Budde <mkl@...gutronix.de>, Vincent
 Mailhol <mailhol.vincent@...adoo.fr>, "David S . Miller"
 <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
 <kuba@...nel.org>,  Paolo Abeni <pabeni@...hat.com>, Rob Herring
 <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,  Conor Dooley
 <conor+dt@...nel.org>, Jiri Kosina <jikos@...nel.org>, Benjamin Tissoires
 <bentiss@...nel.org>,  Sebastian Reichel <sre@...nel.org>, Linus Walleij
 <linus.walleij@...aro.org>, Andreas Lauser
 <andreas.lauser@...cedes-benz.com>, Jonathan Corbet <corbet@....net>, Pavel
 Pisa <pisa@....felk.cvut.cz>, linux-can@...r.kernel.org,
 netdev@...r.kernel.org,  devicetree@...r.kernel.org,
 linux-input@...r.kernel.org,  linux-serial@...r.kernel.org
Subject: Re: [PATCH v3 03/11] tty: serdev: Add flag buffer aware
 receive_buf_fp()

On Sat, 2024-05-04 at 18:00 +0200, Greg Kroah-Hartman wrote:
> On Thu, May 02, 2024 at 08:27:56PM +0200, Christoph Fritz wrote:
> > This patch introduces an additional receive buffer callback variation
> > besides the already existing receive_buf(). This new callback function
> > also passes the flag buffer (TTY_NORMAL, TTY_BREAK, and friends).
> > 
> > If defined, this function gets prioritized and called instead of the
> > standard receive_buf().
> > 
> > An alternative approach could have been to enhance the receive_buf()
> > function and update all drivers that use it.
> 
> Please, let's do that instead of adding random letters at the end of a
> function pointer :)

:) sure

> 
> > Signed-off-by: Christoph Fritz <christoph.fritz@...dev.de>
> > ---
> >  drivers/tty/serdev/serdev-ttyport.c |  2 +-
> >  include/linux/serdev.h              | 17 ++++++++++++++---
> >  2 files changed, 15 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> > index 3d7ae7fa50186..bb47691afdb21 100644
> > --- a/drivers/tty/serdev/serdev-ttyport.c
> > +++ b/drivers/tty/serdev/serdev-ttyport.c
> > @@ -32,7 +32,7 @@ static size_t ttyport_receive_buf(struct tty_port *port, const u8 *cp,
> >  	if (!test_bit(SERPORT_ACTIVE, &serport->flags))
> >  		return 0;
> >  
> > -	ret = serdev_controller_receive_buf(ctrl, cp, count);
> > +	ret = serdev_controller_receive_buf(ctrl, cp, fp, count);
> >  
> >  	dev_WARN_ONCE(&ctrl->dev, ret > count,
> >  				"receive_buf returns %zu (count = %zu)\n",
> > diff --git a/include/linux/serdev.h b/include/linux/serdev.h
> > index ff78efc1f60df..c6ef5a8988e07 100644
> > --- a/include/linux/serdev.h
> > +++ b/include/linux/serdev.h
> > @@ -23,11 +23,17 @@ struct serdev_device;
> >   * struct serdev_device_ops - Callback operations for a serdev device
> >   * @receive_buf:	Function called with data received from device;
> >   *			returns number of bytes accepted; may sleep.
> > + * @receive_buf_fp:	Function called with data and flag buffer received
> > + *			from device; If defined, this function gets called
> > + *			instead of @receive_buf;
> > + *			returns number of bytes accepted; may sleep.
> 
> I don't remember waht "fp" means here, and you don't document it, so
> let's just have one recieve_buf() callback please.

OK, that is a great opportunity for me to use Coccinelle. In the
upcoming revision v4 I'll add the "flag buffer pointer" treewide, then
named "flags".

thanks
  -- Christoph

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ