]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
comedi: pcl730: Add sanity checks for I/O base address
authorIan Abbott <abbotti@mev.co.uk>
Fri, 30 Jan 2026 16:48:00 +0000 (16:48 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2026 13:49:39 +0000 (15:49 +0200)
commitb5218a9897f5c381f513ea906a65655977a9c1b3
tree0df7bfc68e8de50d0f46c38b131caee836a97c8c
parent588b6ffa7775ed90d4afd4d2903fd49a6bb3cfbb
comedi: pcl730: Add sanity checks for I/O base address

The "pcl730" driver uses an admin-supplied configuration option
(`it->options[0]`) to configure the I/O port base address of various
relay output and digital input ISA board from Advantech, ADLINK, ICP
DAS, and Diamond Systems.  It currently allows any base address to be
configured but the hardware devices have restrictions on the base
addresses (configured by on-board DIP switches or jumpers), including
the alignment, which can be larger than the board's I/O register address
span.  The Diamond Systems IR104-PBF board is particularly restricted to
4 different base addresses with different sized gaps between the
possible addresses.

Store the minimum supported I/O base addresses and alignment in the
static board information array elements and add a sanity check to ensure
the device is not configured at an unsupported base address.  For the
IR104-PBF board, add a special check that the base address is one of the
4 supported base addresses for that board.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Link: https://patch.msgid.link/20260130170416.49994-36-abbotti@mev.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/comedi/drivers/pcl730.c