This is a note to let you know that I've just added the patch titled staging: comedi: addi_apci_1500: Fix endian problem for command sample to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: staging-comedi-addi_apci_1500-fix-endian-problem-for-command-sample.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From ac0bbf55ed3be75fde1f8907e91ecd2fd589bde3 Mon Sep 17 00:00:00 2001 From: Ian Abbott <abbotti@xxxxxxxxx> Date: Tue, 23 Feb 2021 14:30:43 +0000 Subject: staging: comedi: addi_apci_1500: Fix endian problem for command sample From: Ian Abbott <abbotti@xxxxxxxxx> commit ac0bbf55ed3be75fde1f8907e91ecd2fd589bde3 upstream. The digital input subdevice supports Comedi asynchronous commands that read interrupt status information. This uses 16-bit Comedi samples (of which only the bottom 8 bits contain status information). However, the interrupt handler is calling `comedi_buf_write_samples()` with the address of a 32-bit variable `unsigned int status`. On a bigendian machine, this will copy 2 bytes from the wrong end of the variable. Fix it by changing the type of the variable to `unsigned short`. Fixes: a8c66b684efa ("staging: comedi: addi_apci_1500: rewrite the subdevice support functions") Cc: <stable@xxxxxxxxxxxxxxx> #4.0+ Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx> Link: https://lore.kernel.org/r/20210223143055.257402-3-abbotti@xxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/staging/comedi/drivers/addi_apci_1500.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) --- a/drivers/staging/comedi/drivers/addi_apci_1500.c +++ b/drivers/staging/comedi/drivers/addi_apci_1500.c @@ -208,7 +208,7 @@ static irqreturn_t apci1500_interrupt(in struct comedi_device *dev = d; struct apci1500_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; - unsigned int status = 0; + unsigned short status = 0; unsigned int val; val = inl(devpriv->amcc + AMCC_OP_REG_INTCSR); @@ -238,14 +238,14 @@ static irqreturn_t apci1500_interrupt(in * * Mask Meaning * ---------- ------------------------------------------ - * 0x00000001 Event 1 has occurred - * 0x00000010 Event 2 has occurred - * 0x00000100 Counter/timer 1 has run down (not implemented) - * 0x00001000 Counter/timer 2 has run down (not implemented) - * 0x00010000 Counter 3 has run down (not implemented) - * 0x00100000 Watchdog has run down (not implemented) - * 0x01000000 Voltage error - * 0x10000000 Short-circuit error + * 0b00000001 Event 1 has occurred + * 0b00000010 Event 2 has occurred + * 0b00000100 Counter/timer 1 has run down (not implemented) + * 0b00001000 Counter/timer 2 has run down (not implemented) + * 0b00010000 Counter 3 has run down (not implemented) + * 0b00100000 Watchdog has run down (not implemented) + * 0b01000000 Voltage error + * 0b10000000 Short-circuit error */ comedi_buf_write_samples(s, &status, 1); comedi_handle_events(dev, s); Patches currently in stable-queue which might be from abbotti@xxxxxxxxx are queue-5.10/staging-comedi-addi_apci_1500-fix-endian-problem-for-command-sample.patch queue-5.10/staging-comedi-das800-fix-endian-problem-for-ai-command-data.patch queue-5.10/staging-comedi-pcl818-fix-endian-problem-for-ai-command-data.patch queue-5.10/staging-comedi-dmm32at-fix-endian-problem-for-ai-command-data.patch queue-5.10/staging-comedi-pcl711-fix-endian-problem-for-ai-command-data.patch queue-5.10/staging-comedi-das6402-fix-endian-problem-for-ai-command-data.patch queue-5.10/staging-comedi-me4000-fix-endian-problem-for-ai-command-data.patch queue-5.10/staging-comedi-addi_apci_1032-fix-endian-problem-for-cos-sample.patch queue-5.10/staging-comedi-adv_pci1710-fix-endian-problem-for-ai-command-data.patch