diff options
| author | Dave Penkler <[email protected]> | 2025-09-28 09:18:18 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2025-10-13 08:53:52 +0000 |
| commit | d3c4c1f29aadccf2f43530bfa1e60a6d8030fd4a (patch) | |
| tree | 7cc66dbcc05f9a31c7a8759b9a73caf79538c9d0 /scripts/basic/docproc.c | |
| parent | Linux 6.18-rc1 (diff) | |
| download | kernel-d3c4c1f29aadccf2f43530bfa1e60a6d8030fd4a.tar.gz kernel-d3c4c1f29aadccf2f43530bfa1e60a6d8030fd4a.zip | |
staging: gpib: Fix no EOI on 1 and 2 byte writes
EOI (End Or Identify) is a hardware line on the GPIB bus that can be
asserted with the last byte of a message to indicate the end of the
transfer to the receiving device.
In this driver, a write with send_eoi true is done in 3 parts:
Send first byte directly
Send remaining but 1 bytes using the fifo
Send the last byte directly with EOI asserted
The first byte in a write is always sent by writing to the tms9914
chip directly to setup for the subsequent fifo transfer. We were not
checking for a 1 byte write with send_eoi true resulting in EOI not
being asserted. Since the fifo transfer was not executed
(fifotransfersize == 0) the retval in the test after the fifo transfer
code was still 1 from the preceding direct write. This caused it to
return without executing the final direct write which would have sent
an unsollicited extra byte.
For a 2 byte message the first byte was sent directly. But since the
fifo transfer was not executed (fifotransfersize == 1) and the retval
in the test after the fifo transfer code was still 1 from the
preceding first byte write it returned before the final direct byte
write with send_eoi true. The second byte was then sent as a separate
1 byte write to complete the 2 byte write count again without EOI
being asserted as above.
Only send the first byte directly if more than 1 byte is to be
transferred with send_eoi true.
Also check for retval < 0 for the error return in case the fifo code
is not used (1 or 2 byte message with send_eoi true).
Fixes: 09a4655ee1eb ("staging: gpib: Add HP/Agilent/Keysight 8235xx PCI GPIB driver")
Cc: stable <[email protected]>
Tested-by: Dave Penkler <[email protected]>
Signed-off-by: Dave Penkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'scripts/basic/docproc.c')
0 files changed, 0 insertions, 0 deletions
