Re: wrong usage of gpiod stuff and modem status lines in etraxfs-uart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 11, 2015 at 10:23:17AM +0200, Linus Walleij wrote:
> On Wed, Jun 10, 2015 at 8:23 PM, Uwe Kleine-König
> <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
> 
> > Hello,
> >
> > I just noticed that drivers/tty/serial/etraxfs-uart.c (introduced in
> > commit 692132b5b1c5 (serial: driver for ETRAX FS UART) for 4.0-rc1)
> > doesn't use the gpiod stuff correctly and does strange things with the
> > modem status lines. In etraxfs_uart_probe it calls
> >
> >         up->dtr_pin = devm_gpiod_get_optional(&pdev->dev, "dtr");
> >
> > without further checking of the result. The only other usage of the
> > dtr_pin member is:
> >
> >         static unsigned int etraxfs_uart_get_mctrl(struct uart_port *port)
> >         {
> >                 ...
> >                 if (up->dtr_pin && !gpiod_get_raw_value(up->dtr_pin))
> >                         ret |= TIOCM_DTR;
> >                 ...
> >         }
> >
> > and a similar construct in .set_mctrl.
> >
> > There are several problems:
> >
> >  - get_mctrl isn't about DTR;
> >  - the dtr_pin gpiod doesn't have a direction set;
> >  - devm_gpiod_get_optional might return ERR_PTR(-ESOMETHING) and
> >    gpiod_get_raw_value isn't able to handle that; and
> >  - instead of explicitly coding gpio mctrl lines, serial_mctrl_gpio
> >    should be used.
> >
> > The other 3 gpiods requested  have similar problems.

My guess is that this is all theoretical code. CRIS does not have gpiolib
support (yet), and the code is probably a placeholder for the DTR functionality
from the old crappy driver.

> > Who cares for that?

I've poked Niklas, but since he's on vacation now, I'm not sure if
he'll have time to fix this.

I can push a patch that just drops all signal handling (since it's bogus ATM),
or you can ignore the driver as currently implemented.

> I bet sending the remark to the driver writers and random Axis/ETRAX
> people is going to help ;) (see To: line)

:-)

> Yours,
> Linus Walleij

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@xxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux