mbox series

[v4,0/7] Implement get_multiple for ACCES and PC/104 drivers

Message ID cover.1521723192.git.vilhelm.gray@gmail.com
Headers show
Series Implement get_multiple for ACCES and PC/104 drivers | expand

Message

William Breathitt Gray March 22, 2018, 12:59 p.m. UTC
Changes in v4:
  - Remove STX104 patch as it has been picked up through the IIO tree
  - Utilize GENMASK for 104-IDIO-16 patch to avoid long literal bitmasks
  - Fix off-by-one errors for port_mask initializations
  - Add end comma to ports arrays initializations for consistency

This patchset implements get_multiple callbacks for the PC104 GPIO
drivers as well as the PCI-IDIO-16 and PCIe-IDIO-24 GPIO drivers. These
devices all acquire the multiple input lines with a single read, so
utilizing the get_multiple callback can provide improvement for those
users who regularly access multiple input lines.

While developing this patchset I noticed many of these devices make use
of Intel 8255 compatible interfaces for their I/O. I may write a generic
8255 GPIO driver in the future to reduce some of the redundant code I
see pop among the drivers for these devices.

William Breathitt Gray (7):
  gpio: 104-idio-16: Implement get_multiple callback
  gpio: pci-idio-16: Implement get_multiple callback
  gpio: pcie-idio-24: Implement get_multiple/set_multiple callbacks
  gpio: 104-dio-48e: Implement get_multiple callback
  gpio: 104-idi-48: Implement get_multiple callback
  gpio: gpio-mm: Implement get_multiple callback
  gpio: ws16c48: Implement get_multiple callback

 drivers/gpio/gpio-104-dio-48e.c  |  47 ++++++++++++++++
 drivers/gpio/gpio-104-idi-48.c   |  47 ++++++++++++++++
 drivers/gpio/gpio-104-idio-16.c  |  15 +++++
 drivers/gpio/gpio-gpio-mm.c      |  47 ++++++++++++++++
 drivers/gpio/gpio-pci-idio-16.c  |  50 +++++++++++++++++
 drivers/gpio/gpio-pcie-idio-24.c | 117 +++++++++++++++++++++++++++++++++++++++
 drivers/gpio/gpio-ws16c48.c      |  47 ++++++++++++++++
 7 files changed, 370 insertions(+)

Comments

Linus Walleij March 26, 2018, 8:31 a.m. UTC | #1
On Thu, Mar 22, 2018 at 1:59 PM, William Breathitt Gray
<vilhelm.gray@gmail.com> wrote:

> Changes in v4:

I applied the v4 patch set so we get some rotation in linux-next before
the merge window.

If reviewers still find smallish issues they can certainly be fixed in follow-up
patches.

> This patchset implements get_multiple callbacks for the PC104 GPIO
> drivers as well as the PCI-IDIO-16 and PCIe-IDIO-24 GPIO drivers. These
> devices all acquire the multiple input lines with a single read, so
> utilizing the get_multiple callback can provide improvement for those
> users who regularly access multiple input lines.

Did you use the userspace chardev for some interesting experiments
with your set-ups?

I tend to think of your applications as pretty interesting for industry
peers, and a good proof-of-concept for the userspace API.

> While developing this patchset I noticed many of these devices make use
> of Intel 8255 compatible interfaces for their I/O. I may write a generic
> 8255 GPIO driver in the future to reduce some of the redundant code I
> see pop among the drivers for these devices.

Oh!
This guy?
https://en.wikipedia.org/wiki/Intel_8255

Yeah that makes all kind of sense. We are living with the legacy
of the first PCs every day when it comes own to EISA & friends...

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
William Breathitt Gray March 26, 2018, 1:27 p.m. UTC | #2
On Mon, Mar 26, 2018 at 10:31:41AM +0200, Linus Walleij wrote:
>On Thu, Mar 22, 2018 at 1:59 PM, William Breathitt Gray
><vilhelm.gray@gmail.com> wrote:
>
>> Changes in v4:
>
>I applied the v4 patch set so we get some rotation in linux-next before
>the merge window.
>
>If reviewers still find smallish issues they can certainly be fixed in follow-up
>patches.
>
>> This patchset implements get_multiple callbacks for the PC104 GPIO
>> drivers as well as the PCI-IDIO-16 and PCIe-IDIO-24 GPIO drivers. These
>> devices all acquire the multiple input lines with a single read, so
>> utilizing the get_multiple callback can provide improvement for those
>> users who regularly access multiple input lines.
>
>Did you use the userspace chardev for some interesting experiments
>with your set-ups?
>
>I tend to think of your applications as pretty interesting for industry
>peers, and a good proof-of-concept for the userspace API.

I use these PC104 drivers in several semi-realtime critical
applications, so latency has always been a big concern for me. The
switch from sysfs file I/O to chardev ioctl had a great improvement in
the reduction of latency, which I was very happy to utilize.

Since the next big point of latency in my systems have been port I/O,
taking advantage of the get_multiple/set_multiple functionality is my
next goal in optimization. I have a new system coming out soon that uses
the 104-IDI-48 for input -- it'll be interesting to see the performance
improvements of acquiring the entire input port at a time, rather than
every GPIO line individually.

>
>> While developing this patchset I noticed many of these devices make use
>> of Intel 8255 compatible interfaces for their I/O. I may write a generic
>> 8255 GPIO driver in the future to reduce some of the redundant code I
>> see pop among the drivers for these devices.
>
>Oh!
>This guy?
>https://en.wikipedia.org/wiki/Intel_8255
>
>Yeah that makes all kind of sense. We are living with the legacy
>of the first PCs every day when it comes own to EISA & friends...

That's the one! I see this interface a lot in the GPIO devices I handle.
It's very popular, which I believe is a testament to the popularity of
the IBM PC.

Nowadays, most devices I encounter implement this interface in an FPGA,
but I do occasionally come across the actual Intel 82C55 chip, such as
on the 104-DIO-48E; it's fascinating to see this physical chip still
popping up on circuit boards from time to time.

I would like to make a generic driver for this interface that will allow
it to be used both in the port I/O and memory I/O drivers out there.
Since I don't want to introduce too many changes in a single patchset
I've postponed it for now to get get_multiple support merged in for
these drivers, but I'll hopefully have something like a gpio-i8255
driver submitted soon enough.

William Breathitt Gray

>
>Yours,
>Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html