[PATCH v4 0/4] gpio: mpsse: add support for bryx brik

Mary Strodl posted 4 patches 4 months, 1 week ago
There is a newer version of this series
drivers/gpio/gpio-mpsse.c | 229 ++++++++++++++++++++++++++++++++++++--
1 file changed, 217 insertions(+), 12 deletions(-)
[PATCH v4 0/4] gpio: mpsse: add support for bryx brik
Posted by Mary Strodl 4 months, 1 week ago
Hey all,

This series adds support for the Bryx Radio Interface Kit to the gpio-mpsse
driver

Here are some of the major differences compared to the sealevel device this
driver currently supports:
* Uses an FT232HL chip instead of FT2232HL (this is easy, just populates as
  only one interface rather than two)
* There are only two exposed GPIO lines, and each is hardware restricted to
  a particular direction.
* This is an external device, therefore hotpluggable. This caused me to
  discover the race condition in the polling worker teradown, which
  accounts for the bulk of the changes.

The locking changes probably should be backported even though the actual
device isn't hotpluggable. If this isn't the right avenue for introducing
those fixes and it should be sent as a separate patch first, let me know
and it can be structured that way instead.

Other than the locking changes, this series also adds a generic "quirk"
system like I have seen in similar drivers for providing device-specific
line labels and direction restrictions. This should enable easier
integration of new devices in the future.

Lastly, I changed the device label format to expose useful device
information like the device serial number, vid, and pid to userspace. If
there is a better way to get this information (perhaps through udev?), I'm
all ears.

I also noticed a little bug where gpio_mpsse_direction_input wasn't
actually propagating errors, so I have a quick fix for that too.

Changes since v3:
* Refactor supported line quirk logic (1 is supported now)

Changes since v2:
* No more RCU, just use a spinlock to protect the stuff that matters
* Now using _safe variants of list iteration helpers where appropriate
* Use GFP_NOWAIT kmalloc flag
* Move repeated code into new gpio_mpsse_stop_all_except method
* Move little bugfix for direction_input error propagation into its own
  patch

Changes since v1:
* Break out into separate patches
* Fix RCU/concurrency soundness mistakes I noticed (list add/del were not
  protected by a lock, so now there is a separate spin lock, which we can
  use in irq context)
* Use guards for rcu read locks

Let me know what you think!

Mary Strodl (4):
  gpio: mpsse: propagate error from direction_input
  gpio: mpsse: ensure worker is torn down
  gpio: mpsse: add quirk support
  gpio: mpsse: support bryx radio interface kit

 drivers/gpio/gpio-mpsse.c | 229 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 217 insertions(+), 12 deletions(-)

-- 
2.47.0
Re: [PATCH v4 0/4] gpio: mpsse: add support for bryx brik
Posted by Linus Walleij 4 months ago
Hi Mary,

thanks for your patches!

On Fri, Oct 3, 2025 at 9:50 PM Mary Strodl <mstrodl@csh.rit.edu> wrote:

> The locking changes probably should be backported even though the actual
> device isn't hotpluggable. If this isn't the right avenue for introducing
> those fixes and it should be sent as a separate patch first, let me know
> and it can be structured that way instead.

It's fine.

If it doesn't have real-world regressions right now it can just be
applied for next, if it has implications on deployed systems, they
should be tagged for stable@vger.kernel.org.

If you have some idea about that it will help Bartosz to choose
whether this goes into fixes or stable when he applies it.

> Mary Strodl (4):
>   gpio: mpsse: propagate error from direction_input
>   gpio: mpsse: ensure worker is torn down
>   gpio: mpsse: add quirk support
>   gpio: mpsse: support bryx radio interface kit

The series:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Re: [PATCH v4 0/4] gpio: mpsse: add support for bryx brik
Posted by Mary Strodl 4 months ago
On Mon, Oct 06, 2025 at 11:09:02AM +0200, Linus Walleij wrote:
> Hi Mary,
Hey Linus,

> thanks for your patches!
Thank you for looking at them!

> If it doesn't have real-world regressions right now it can just be
> applied for next, if it has implications on deployed systems, they
> should be tagged for stable@vger.kernel.org.
>
> If you have some idea about that it will help Bartosz to choose
> whether this goes into fixes or stable when he applies it.
Mehh, I think since the old device wasn't hotpluggable it's probably fine.

If you have concerns about memory safety or something with the old way,
maybe that's a good reason to do it? That's really the only thing
I can think of though.

> 
> > Mary Strodl (4):
> >   gpio: mpsse: propagate error from direction_input
> >   gpio: mpsse: ensure worker is torn down
> >   gpio: mpsse: add quirk support
> >   gpio: mpsse: support bryx radio interface kit
> 
> The series:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 
> Yours,
> Linus Walleij

Thanks a lot!