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]
Message-ID: <20200519090853.GC27787@localhost>
Date:   Tue, 19 May 2020 11:08:53 +0200
From:   Johan Hovold <johan@...nel.org>
To:     Manivannan Sadhasivam <mani@...nel.org>
Cc:     gregkh@...uxfoundation.org, johan@...nel.org,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        patong.mxl@...il.com, Linus Walleij <linus.walleij@...aro.org>,
        linux-gpio@...r.kernel.org
Subject: Re: [PATCH 2/2] usb: serial: xr_serial: Add gpiochip support

On Wed, Apr 29, 2020 at 11:17:27PM +0530, Manivannan Sadhasivam wrote:

> On Wed, Apr 29, 2020 at 01:26:51AM +0530, mani@...nel.org wrote:
> > From: Manivannan Sadhasivam <mani@...nel.org>
> > 
> > Add gpiochip support for Maxlinear/Exar USB to serial converter
> > for controlling the available gpios.
> > 
> > Cc: Linus Walleij <linus.walleij@...aro.org>
> > Cc: linux-gpio@...r.kernel.org
> > Signed-off-by: Manivannan Sadhasivam <mani@...nel.org>

> >  static int xr_port_probe(struct usb_serial_port *port)
> >  {
> >  	struct usb_serial *serial = port->serial;
> > @@ -495,13 +678,14 @@ static int xr_port_probe(struct usb_serial_port *port)
> >  
> >  	usb_set_serial_port_data(port, port_priv);
> >  
> > -	return 0;
> > +	return xr_gpio_init(port);
> 
> Just realised that the gpiochip is registered for 2 interfaces exposed by
> this chip. This is due to the fact that this chip presents CDC-ACM model,
> so there are 2 interfaces (interrupt and bulk IN/OUT).
> 
> We shouldn't need gpiochip for interface 0. So what is the recommended way
> to filter that?

Your driver should only bind to the data interface, but also claim the
control interface (i.e. the reverse of what cdc-acm is doing).

This CDC model doesn't really fit the assumptions of usb-serial core,
but it might be doable. Try returning 1 from the attach callback for the
control interface so that core claims it but doesn't register a tty
device.

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ