New GPIO adapter / Patch submission guide?

Michael Schwingen <[email protected]> Sun, 14 Jul 2024 19:05:59 +0200
Newsgroups gmane.linux.hardware.gpib.general
Message-ID <[email protected]>
Hi,

are there any guidelines on how to submit patches, and the formatting style
preferred?

I have built another GPIO-based GPIB adapter:

https://www.schwingen.org/yoga-gpib/

I did the first development/testing on a simple adapter using only series
resistors and noticed several problems - mostly hangs due to missing
interrupts, but also kernel crashes due to the interrupt handlers sometimes
transferring more bytes than the buffer size. While this mostly occurred on
a non-working bus (device powered down), I got hangs and lost interrupts
even on a simple setup with only 1 working device attached.

After some search with a logic analyzer, I came to the conclusion that the
use of edge-triggered interrupts on an asynchronous bus with slow edges does
not really work reliably. I re-wrote the interrupt handlers in
gpib_bitbang.c to be level-sensitive, enabling/disabling them as required on
the fly.

The resulting code works reliably in my tests both with the simple
series-resistor-based adapter as well as my YOGA adapter with level
shifters, and has been in use for some weeks now in our EMC lab at work.

As a RFQ, the current code is at

https://github.com/mschwingen/hardware/blob/master/YOGA_GPIB/software/gpib_bitbang.c

I can provide patches as required. Currently, this is one big patch that
contains
 - the interrupt rewrite
 - modified GPIO setup, since my adapter needs a different GPIO pin layout,
   with gaps in the used GPIOs
 - LED handling is changed from direct GPIO access to using kernel LED
   triggers, allowing to use the LED from system bootup and then switching
   to GPIB function as required.

I am unsure about SRQ interrupt handling, as I don't understand how this is
supposed to work and I can't test it, so I left that as-is.

I am looking for guidance on how to go forward with this.

thanks,
Michael Schwingen