From: Johan Hovold <email@example.com> To: Marc Zyngier <firstname.lastname@example.org> Cc: email@example.com, firstname.lastname@example.org, email@example.com, Linus Walleij <firstname.lastname@example.org>, Bartosz Golaszewski <email@example.com>, Johan Hovold <firstname.lastname@example.org>, Greg Kroah-Hartman <email@example.com>, firstname.lastname@example.org Subject: Re: [PATCH 0/4] USB: ftdio_sio: GPIO validity fixes Date: Mon, 7 Dec 2020 15:01:43 +0100 [thread overview] Message-ID: <X841xwCChUEqi5Ad@localhost> (raw) In-Reply-To: <email@example.com> On Fri, Dec 04, 2020 at 04:47:35PM +0000, Marc Zyngier 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) Consider the alternative, that the gpio offsets (for CBUS0, CBUS1, CBUS2 or CBUS4) varies depending on how the pins have been muxed. Hardly very user friendly. > - it returns an odd error (-ENODEV), instead of the expected -EINVAL > when a line is unavailable, leading to a difficult diagnostic Hmm, maybe. Several gpio driver return -ENODEV when trying to request reserved pins. Even gpiolib returns -ENODEV when a pins is not yet available due to probe deferal. -EBUSY could also be an alternative, but that's used to indicate that a line is already in use as a gpio. > 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. Don't be sad, Marc; write some documentation. ;) Johan
next prev parent reply other threads:[~2020-12-07 14:02 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-04 16:47 Marc Zyngier 2020-12-04 16:47 ` [PATCH 1/4] gpiolib: cdev: Flag invalid GPIOs as used Marc Zyngier 2020-12-07 14:16 ` Johan Hovold 2020-12-07 14:59 ` Marc Zyngier 2020-12-09 9:25 ` Linus Walleij 2020-12-04 16:47 ` [PATCH 2/4] USB: serial: ftdi_sio: Report the valid GPIO lines to gpiolib Marc Zyngier 2020-12-09 9:28 ` Linus Walleij 2020-12-04 16:47 ` [PATCH 3/4] USB: serial: ftdi_sio: Log the CBUS GPIO validity Marc Zyngier 2020-12-07 14:29 ` Johan Hovold 2020-12-07 15:00 ` Marc Zyngier 2020-12-07 15:19 ` Johan Hovold 2020-12-09 9:35 ` Linus Walleij 2020-12-09 17:05 ` Johan Hovold 2020-12-09 17:39 ` Johan Hovold 2020-12-04 16:47 ` [PATCH 4/4] USB: serial: ftdi_sio: Drop GPIO line checking dead code Marc Zyngier 2020-12-07 9:55 ` [PATCH 0/4] USB: ftdio_sio: GPIO validity fixes Andy Shevchenko 2020-12-07 14:01 ` Johan Hovold [this message] 2020-12-07 14:41 ` Marc Zyngier 2020-12-07 15:08 ` Johan Hovold 2020-12-07 15:34 ` Marc Zyngier 2020-12-07 15:49 ` Johan Hovold 2020-12-09 9:20 ` Linus Walleij 2020-12-09 15:42 ` Johan Hovold
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=X841xwCChUEqi5Ad@localhost \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --subject='Re: [PATCH 0/4] USB: ftdio_sio: GPIO validity fixes' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).