[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcDqHLzaAZ=EOV8EfhOxLvEC4do+UDVmAWD229xmEok+w@mail.gmail.com>
Date: Mon, 7 Dec 2020 11:55:02 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Marc Zyngier <maz@...nel.org>
Cc: USB <linux-usb@...r.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Johan Hovold <johan@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
kernel-team@...roid.com
Subject: Re: [PATCH 0/4] USB: ftdio_sio: GPIO validity fixes
On Fri, Dec 4, 2020 at 6:49 PM Marc Zyngier <maz@...nel.org> wrote:
>
> Having recently tried to use the CBUS GPIOs that come thanks to the
> ftdio_sio driver, it occurred to me that the driver has a couple of
> usability issues:
>
> - it advertises potential GPIOs that are reserved to other uses (LED
> control, or something else)
>
> - it returns an odd error (-ENODEV), instead of the expected -EINVAL
> when a line is unavailable, leading to a difficult diagnostic
>
> We address the issues in a number of ways:
>
> - Stop reporting invalid GPIO lines as valid to userspace. It
> definitely seems odd to do so. Instead, report the line as being
> used, making the userspace interface a bit more consistent.
>
> - Implement the init_valid_mask() callback in the ftdi_sio driver,
> allowing it to report which lines are actually valid.
>
> - As suggested by Linus, give an indication to the user of why some of
> the GPIO lines are unavailable, and point them to a useful tool
> (once per boot). It is a bit sad that there next to no documentation
> on how to use these CBUS pins.
>
> - Drop the error reporting code, which has become useless at this
> point.
>
> Tested with a couple of FTDI devices (FT230X and FT231X) and various
> CBUS configurations.
Series looks pretty good to me, FWIW,
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
> Marc Zyngier (4):
> gpiolib: cdev: Flag invalid GPIOs as used
> USB: serial: ftdi_sio: Report the valid GPIO lines to gpiolib
> USB: serial: ftdi_sio: Log the CBUS GPIO validity
> USB: serial: ftdi_sio: Drop GPIO line checking dead code
>
> drivers/gpio/gpiolib-cdev.c | 1 +
> drivers/usb/serial/ftdi_sio.c | 26 +++++++++++++++++++++++---
> 2 files changed, 24 insertions(+), 3 deletions(-)
>
> --
> 2.28.0
>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists