Re: [PATCH] Staging: comedi: comedi_fops: fixed a spacing coding style issue

2022-06-09 Thread Ian Abbott
..3f70e5dfac39 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c comedi moved out of "drivers/staging" in the 5.13 kernel. -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Re

Re: [PATCH] staging: comedi: das800: fix request_irq() warn

2021-03-17 Thread Ian Abbott
userspace, so we are changing the parameters passed to request_irq() Suggested-by: Ian Abbott Signed-off-by: Tong Zhang --- drivers/staging/comedi/drivers/das800.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging

Re: [PATCH] staging: comedi: replace slash in name

2021-03-16 Thread Ian Abbott
name argument of request_irq(), but that is "cio-das802/16" for one of the boards supported by the driver. On Mon, Mar 15, 2021 at 6:48 AM Ian Abbott wrote: On 15/03/2021 10:44, Ian Abbott wrote: On 14/03/2021 03:57, Tong Zhang wrote: request_irq() wont accept a name which contains slas

Re: [PATCH v2] staging: comedi: cb_pcidas64: fix request_irq() warn

2021-03-16 Thread Ian Abbott
] proc_mkdir+0x18/0x20 [1.576629] request_threaded_irq+0xfe/0x160 [1.576859] auto_attach+0x60a/0xc40 [cb_pcidas64] Suggested-by: Ian Abbott Signed-off-by: Tong Zhang --- v2: revert changes to .name field so that we dont break userspace drivers/staging/comedi/drivers/cb_pcidas64.c | 2

Re: [PATCH v2] staging: comedi: cb_pcidas: fix request_irq() warn

2021-03-16 Thread Ian Abbott
] proc_mkdir+0x18/0x20 [1.641946] request_threaded_irq+0xfe/0x160 [1.642186] cb_pcidas_auto_attach+0xf4/0x610 [cb_pcidas] Suggested-by: Ian Abbott Signed-off-by: Tong Zhang --- v2: revert changes to .name field so that we dont break userspace drivers/staging/comedi/drivers/cb_pcidas.c | 2

Re: [PATCH] staging: comedi: cb_pcidas: replace slash in name

2021-03-15 Thread Ian Abbott
.name = "pci-das1602/16/jr", > + .name = "pci-das1602-16-jr", > .ai_speed = 5000, > .fifo_size = 512, > .is_16bit = 1, > As for cb_pcidas64, the board name may be

Re: [PATCH] staging: comedi: replace slash in name

2021-03-15 Thread Ian Abbott
On 15/03/2021 10:44, Ian Abbott wrote: > On 14/03/2021 03:57, Tong Zhang wrote: >> request_irq() wont accept a name which contains slash so we need to >> repalce it with something else -- otherwise it will trigger a warning >> and the entry in /proc/irq/ will not be create

Re: [PATCH] staging: comedi: replace slash in name

2021-03-15 Thread Ian Abbott
nst struct pcidas64_board pcidas64_boards[] = { > .has_8255 = 0, > }, > [BOARD_PCIDAS4020_12] = { > - .name = "pci-das4020/12", > + .name = "pci-das4020-12", > .ai_se_chan

[PATCH 6/6] staging: comedi: dt2814: Clear stale AI data on detach

2021-03-01 Thread Ian Abbott
h" handler `dt2814_detach()` to do that if an interrupt handler has been set up. (There is no need to do it if no interrupt handler was set up because Comedi asynchronous command support is disabled in that case.) Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 15 +

[PATCH 5/6] staging: comedi: dt2814: Remove struct dt2814_private

2021-03-01 Thread Ian Abbott
ion and remove the definition of `struct dt2814_private` since they are no longer needed. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 12 1 file changed, 12 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt281

[PATCH 4/6] staging: comedi: dt2814: Fix asynchronous command interrupt handling

2021-03-01 Thread Ian Abbott
the Control register, leaving the current channel selected. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 72 ++--- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drive

[PATCH 3/6] staging: comedi: dt2814: Call dt2814_ai_clear() during initialization

2021-03-01 Thread Ian Abbott
hen clears any unread data or error condition. A non-zero return value from `dt2814_ai_clear()` indicates a time-out while waiting for the A/D converter to become non-busy. Return an error in that case. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 5 + 1 file

[PATCH 2/6] staging: comedi: dt2814: Don't wait for conversion in interrupt handler

2021-03-01 Thread Ian Abbott
the functions for handling Comedi read instructions and for setting up asynchronous commands now call `dt2814_ai_clear()` to wait for and discard any spurious A/D conversion, let's remove that code from the interrupt handler. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 14

[PATCH 1/6] staging: comedi: dt2814: Clear stale AI data before operation

2021-03-01 Thread Ian Abbott
the stale data. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2814.c | 39 + 1 file changed, 39 insertions(+) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index bd329d7b4893..7e73aa094eea 100644 --- a/drivers

[PATCH 0/6] staging: comedi: dt2814: Fix broken AI command support

2021-03-01 Thread Ian Abbott
The DT2814 board is an old analog-to-digital ISA card supported by the Comedi "dt2814" driver. The board has a timed acquisition mode, and an end-of-conversion interrupt. The interrupt can be disabled by removing the jumper that sets the IRQ level. In Comedi, the board is a manually configured

[PATCH 14/14] staging: comedi: pcl726: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
f a 32-bit integer `>state`. On bigendian machines, this will copy 2 bytes from the wrong end of the 32-bit integer. This isn't really a problem since `s->state` will always be 0 for this subdevice, but clean it up by using a 16-bit variable initialized to 0 to pass the value. Signed-of

[PATCH 13/14] staging: comedi: ni_65xx: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
f a 32-bit integer `>state`. On bigendian machines, this will copy 2 bytes from the wrong end of the 32-bit integer. This isn't really a problem since `s->state` will always be 0 for this subdevice, but clean it up by using a 16-bit variable initialized to 0 to pass the value. Signed-of

[PATCH 12/14] staging: comedi: ni_6527: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
f a 32-bit integer `>state`. On bigendian machines, this will copy 2 bytes from the wrong end of the 32-bit integer. This isn't really a problem since `s->state` will always be 0 for this subdevice, but clean it up by using a 16-bit variable initialized to 0 to pass the value. Signed-of

[PATCH 11/14] staging: comedi: comedi_parport: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
ss of a 32-bit integer `>state`. On bigendian machines, this will copy 2 bytes from the wrong end of the 32-bit integer. This isn't really a problem since `s->state` will always be 0 for this subdevice, but clean it up by using a 16-bit variable initialized to 0 to pass the value. Signed-of

[PATCH 10/14] staging: comedi: amplc_pc236_common: Use 16-bit 0 for interrupt data

2021-02-23 Thread Ian Abbott
lue. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/amplc_pc236_common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/amplc_pc236_common.c b/drivers/staging/comedi/drivers/amplc_pc236_common.c index 043752663188..981

[PATCH 09/14] staging: comedi: pcl818: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
l818: introduce pcl818_ai_write_sample()").] Fixes: d615416de615 ("staging: comedi: pcl818: introduce pcl818_ai_write_sample()") Cc: # 4.0+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/pcl818.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/s

[PATCH 08/14] staging: comedi: pcl711: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
. Fix it by changing the type of the variable holding the sample value to `unsigned short`. Fixes: 1f44c034de2e ("staging: comedi: pcl711: use comedi_buf_write_samples()") Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/pcl711.c | 2 +- 1 file changed, 1 inser

[PATCH 07/14] staging: comedi: me4000: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
. Fix it by changing the type of the variable holding the sample value to `unsigned short`. Fixes: de88924f67d ("staging: comedi: me4000: use comedi_buf_write_samples()") Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/me4000.c | 2 +- 1 file changed, 1 inser

[PATCH 06/14] staging: comedi: dmm32at: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
eadadcbe6e ("staging: comedi: dmm32at: introduce dmm32_ai_get_sample()").] Fixes: 0c0eadadcbe6e ("staging: comedi: dmm32at: introduce dmm32_ai_get_sample()") Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dmm32at.c | 2 +- 1 file changed, 1 insertion

[PATCH 04/14] staging: comedi: das6402: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
. Fix it by changing the type of the variable holding the sample value to `unsigned short`. Fixes: d1d24cb65ee3 ("staging: comedi: das6402: read analog input samples in interrupt handler") Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/das6402.c | 2 +- 1 file

[PATCH 02/14] staging: comedi: addi_apci_1500: Fix endian problem for command sample

2021-02-23 Thread Ian Abbott
Cc: #4.0+ Signed-off-by: Ian Abbott --- .../staging/comedi/drivers/addi_apci_1500.c| 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c index 11efb21555e3..b04c15dcf

[PATCH 05/14] staging: comedi: das800: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
. Fix it by changing the type of the variable holding the sample value to `unsigned short`. Fixes: ad9eb43c93d8 ("staging: comedi: das800: use comedi_buf_write_samples()" Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/das800.c | 2 +- 1 file changed, 1 inser

[PATCH 03/14] staging: comedi: adv_pci1710: Fix endian problem for AI command data

2021-02-23 Thread Ian Abbott
` since its address is passed to `pci1710_ai_read_sample()`. Fixes: a9c3a015c12f ("staging: comedi: adv_pci1710: use comedi_buf_write_samples()") Cc: # 4.0+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/adv_pci1710.c | 10 +- 1 file changed, 5 insertions(+), 5

[PATCH 01/14] staging: comedi: addi_apci_1032: Fix endian problem for COS sample

2021-02-23 Thread Ian Abbott
ong end of the 32-bit integer. Fix it by transferring the value via a 16-bit integer. Fixes: 6bb45f2b0c86 ("staging: comedi: addi_apci_1032: use comedi_buf_write_samples()" Cc: # 3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/addi_apci_1032.c | 4 +++- 1 fi

[PATCH 00/14] staging: comedi: Fix some command data endian problems

2021-02-23 Thread Ian Abbott
The `comedi_buf_read_samples()` and `comedi_buf_write_samples()` functions can read/write either 16-bit or 32-bit values from/to the Comedi buffer used for Comedi asynchonous command data. The width of the value depends on whether the subdevice sets the `SDF_LSAMPL` flag (indicating 32-bit

Re: [PATCH -next] staging: comedi dt2814: Removed unused variables

2021-02-22 Thread Ian Abbott
s commands in this driver has always been broken. I'm tempted to remove the code for handling asynchronous commands in this driver altogether for that reason. (The naive fix of writing the data to the Comedi buffer is insufficient without an additional check that the command is running. The end-of-convers

Re: [PATCH] staging: comedi: cast to (unsigned int *)

2021-02-19 Thread Ian Abbott
mbers, which would look a bit odd. The union also kind of hides the problem. -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=- -=( Bir

Re: [PATCH] Staging: comedi: Replaced strlcpy to strscpy

2021-02-18 Thread Ian Abbott
EN); > + strscpy(devinfo.driver_name, dev->driver->driver_name, COMEDI_NAMELEN); > + strscpy(devinfo.board_name, dev->board_name, COMEDI_NAMELEN); > > s = comedi_file_read_subdevice(file); > if (s) > Thanks, but you are too late. It has already been fixe

Re: [PATCH] staging: comedi: cast to (unsigned int *)

2021-02-18 Thread Ian Abbott
the unused `data` and `data_len` members (which need to be kept in the user version of the struct for compatibility reasons). -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building 67, Europa Busi

Re: [PATCH v2 1/2] staging: comedi: cast function output to assigned variable type

2021-02-18 Thread Ian Abbott
eebe3 ("staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings") by B K Karthik. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9d5d041eebe3dcf7591ff7004896c329eb841ca6 -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in

Re: [PATCH] drivers: staging: comedi: Fixed side effects from macro definition.

2021-02-18 Thread Ian Abbott
in constant expressions. -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=- -=( Bird Hall Lane, STOCKPORT, SK3 0XA,

[PATCH 2/2] staging: comedi: adv_pci_dio: Support falling edge triggers

2021-01-18 Thread Ian Abbott
of the asynchronous command for the subdevice, using the `CR_INVERT` bit of `scan_begin_arg` to indicate falling edge when set, or rising edge when clear. Also allow the `CR_EDGE` bit to be set, but ignore it. All other bits of `scan_begin_arg` must be zero. Signed-off-by: Ian Abbott --- drivers

[PATCH 1/2] staging: comedi: adv_pci_dio: Add interrupt handling for PCI-1730

2021-01-18 Thread Ian Abbott
digital inputs. For IDI0 and IDI1, use the 16 isolated digital inputs.) Currently, only rising edge triggers are supported. Support could be added for the PCI-1733 and PCI-1736. Signed-off-by: Bernd Harries Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/adv_pci_dio.c | 273

[PATCH 0/2] staging: comedi: adv_pci_dio: Interrupt handling for PCI-1730

2021-01-18 Thread Ian Abbott
myself (Ian Abbott). My changes have bene tested by Bernd. The second patch allows the comedi asynchronous command to choose either the rising edge or the falling edge of the external digital input as the trigger source. 1) staging: comedi: adv_pci_dio: Add interrupt handling for PCI-1730 2

[PATCH] staging: comedi: adl_pci7x3x: Add interrupt handling for PCI-7230

2021-01-18 Thread Ian Abbott
y all have two interrupt sources, although for PCI-7233 each interrupt source is triggered by a change of state of 16 digital inputs (0-15 and 16-31). The "clear IRQ" register is at a different offset for some boards. Signed-off-by: Bernd Harries Signed-off-by: Ian Abbott --- dr

[PATCH] staging: comedi: mf6x4: Fix AI end-of-conversion detection

2020-12-07 Thread Ian Abbott
: 04b565021a83 ("comedi: Humusoft MF634 and MF624 DAQ cards driver") Cc: # v4.4+ Cc: Rostislav Lisovy Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/mf6x4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/mf6x4.c b/drive

Re: [PATCH] staging: comedi: cb_pcidas: reinstate delay removed from trimpot setting

2020-11-04 Thread Ian Abbott
On 02/11/2020 11:16, Ian Abbott wrote: On 02/11/2020 10:25, Ian Abbott wrote: On 29/10/2020 14:18, Ian Abbott wrote: Commit eddd2a4c675c ("staging: comedi: cb_pcidas: refactor write_calibration_bitstream()") inadvertently removed one of the `udelay(1)` calls when writing to the c

Re: [PATCH] staging: comedi: cb_pcidas: reinstate delay removed from trimpot setting

2020-11-02 Thread Ian Abbott
On 02/11/2020 10:25, Ian Abbott wrote: On 29/10/2020 14:18, Ian Abbott wrote: Commit eddd2a4c675c ("staging: comedi: cb_pcidas: refactor write_calibration_bitstream()") inadvertently removed one of the `udelay(1)` calls when writing to the calibration register in `cb_pcidas_c

Re: [PATCH] staging: comedi: cb_pcidas: reinstate delay removed from trimpot setting

2020-11-02 Thread Ian Abbott
On 29/10/2020 14:18, Ian Abbott wrote: Commit eddd2a4c675c ("staging: comedi: cb_pcidas: refactor write_calibration_bitstream()") inadvertently removed one of the `udelay(1)` calls when writing to the calibration register in `cb_pcidas_calib_write()`. Reinstate the delay. It may se

[PATCH] staging: comedi: cb_pcidas: reinstate delay removed from trimpot setting

2020-10-29 Thread Ian Abbott
like the most likely culprit. Fixes: eddd2a4c675c ("staging: comedi: cb_pcidas: refactor write_calibration_bitstream()") Cc: Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pcidas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/comedi/drivers/cb_pcid

[PATCH] staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice

2020-10-21 Thread Ian Abbott
set it. This limits commands to use a single channel (either channel 0 or 1), but the limit should be two channels. Set the AO subdevice's `len_chanlist` member to be the same value as the `n_chan` member, which will be 2. Cc: Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/cb_pc

Re: [PATCH v2] staging: comedi: Simplify conditional evaluation

2020-10-19 Thread Ian Abbott
--- Changes since v1: - Corrected wrongly inverted tests. Feedback from Ian Abbott. - Note: This patch was sent earlier as part of a patch set containing 2 patches. The second patch of the patch set is dropped. Hence sending this standalone patch as v2 version. This is based

Re: [Outreachy kernel] Re: [PATCH 2/2] staging: comedi: combine split lines for improved readability

2020-10-19 Thread Ian Abbott
On 19/10/2020 12:49, Deepak R Varma wrote: On Mon, Oct 19, 2020 at 12:34:15PM +0100, Ian Abbott wrote: On 19/10/2020 11:57, Deepak R Varma wrote: On Mon, Oct 19, 2020 at 12:41:14PM +0200, Julia Lawall wrote: On Mon, 19 Oct 2020, Ian Abbott wrote: On 18/10/2020 20:49, Deepak R Varma wrote

Re: [Outreachy kernel] Re: [PATCH 2/2] staging: comedi: combine split lines for improved readability

2020-10-19 Thread Ian Abbott
On 19/10/2020 11:57, Deepak R Varma wrote: On Mon, Oct 19, 2020 at 12:41:14PM +0200, Julia Lawall wrote: On Mon, 19 Oct 2020, Ian Abbott wrote: On 18/10/2020 20:49, Deepak R Varma wrote: Instructions split on multiple lines can be combined on a single line for improved readability

Re: [PATCH 2/2] staging: comedi: combine split lines for improved readability

2020-10-19 Thread Ian Abbott
O(8), T), "find last source"); } void test_ni_check_trigger_arg(void) Is it worth breaking the 80-column limit for this? -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Build

Re: [PATCH 1/2] staging: comedi: Simplify conditional evaluation

2020-10-19 Thread Ian Abbott
nd last source"); } NAK. It looks like you have inadvertently inverted some of the tests. -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=- -=( Bird

Re: [PATCH] drivers: staging: comedi: fixed duplicate words from checkpatch

2020-08-24 Thread Ian Abbott
* multiple reads on the status register to achieve this). */ while (--loops) { status = inb(dev->iobase + DAQP_STATUS_REG); -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 0

[PATCH 1/4] staging: comedi: ni_6527: fix INSN_CONFIG_DIGITAL_TRIG support

2020-07-17 Thread Ian Abbott
less than that and everything from bit 24 upwards is ignored by `ni6527_set_edge_detection()` anyway. Fixes: 110f9e687c1a8 ("staging: comedi: ni_6527: support INSN_CONFIG_DIGITAL_TRIG") Cc: # 3.17+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_6527.c | 2 +- 1 file changed, 1 inse

[PATCH 3/4] staging: comedi: addi_apci_1564: check INSN_CONFIG_DIGITAL_TRIG shift

2020-07-17 Thread Ian Abbott
code to deal with this. Fixes: 1e15687ea472 ("staging: comedi: addi_apci_1564: add Change-of-State interrupt subdevice and required functions" Cc: #3.17+ Signed-off-by: Ian Abbott --- .../staging/comedi/drivers/addi_apci_1564.c | 20 +-- 1 file changed, 14 insert

[PATCH 2/4] staging: comedi: addi_apci_1032: check INSN_CONFIG_DIGITAL_TRIG shift

2020-07-17 Thread Ian Abbott
code to deal with this. Fixes: 33cdce6293dcc ("staging: comedi: addi_apci_1032: conform to new INSN_CONFIG_DIGITAL_TRIG" Cc: #3.8+ Signed-off-by: Ian Abbott --- .../staging/comedi/drivers/addi_apci_1032.c | 20 +-- 1 file changed, 14 insertions(+), 6 deletions(-)

[PATCH 4/4] staging: comedi: addi_apci_1500: check INSN_CONFIG_DIGITAL_TRIG shift

2020-07-17 Thread Ian Abbott
") Cc: #4.0+: ef75e14a6c93: staging: comedi: verify array index is correct before using it Cc: #4.0+ Signed-off-by: Ian Abbott --- .../staging/comedi/drivers/addi_apci_1500.c | 24 +++ 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/staging/come

[PATCH 0/4] staging: comedi: INSN_CONFIG_DIGITAL_TRIG fixes

2020-07-17 Thread Ian Abbott
These patches correct problems with INSN_CONFIG_DIGITAL_TRIG comedi configuration instructions in various comedi drivers, in particular the use of unconstrained bit shift amounts from userspace leading to undefined behaviour (although hopefully not the kernel crashy sort). The patches have been

Re: [PATCH v4] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings

2020-07-17 Thread Ian Abbott
t((unsigned int __user *)cmd->chanlist); v32.chanlist_len = cmd->chanlist_len; v32.data = ptr_to_compat(cmd->data); v32.data_len = cmd->data_len; Still looks good. Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a

Re: [PATCH v2] staging: comedi: comedi_fops.c: added casts to get rid of sparse warnings

2020-07-16 Thread Ian Abbott
ser *)cmd->chanlist); v32.chanlist_len = cmd->chanlist_len; v32.data = ptr_to_compat(cmd->data); v32.data_len = cmd->data_len; Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=(

Re: [PATCH] staging: comedi: comedi_fops.c: changed type in assignment to unsigned int *

2020-07-15 Thread Ian Abbott
->chanlist); Those changes will get rid of the sparse warnings. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park Road

Re: [PATCH v2] staging: comedi: s626: Remove pci-dma-compat wrapper APIs.

2020-07-14 Thread Ian Abbott
vpriv->ana_buf.physical_base); + dma_free_coherent(>dev, S626_DMABUF_SIZE, + devpriv->ana_buf.logical_base, + devpriv->ana_buf.physical_base); } static int s626_initialize(struct comedi_device *dev) Lo

Re: [PATCH] staging: comedi: s626: Remove pci-dma-compat wrapper APIs.

2020-07-13 Thread Ian Abbott
mory allocation using GFP_KERNEL. So it is likely that using GFP_KERNEL in your proposal is also valid. Indeed, GFP_KERNEL is perfectly fine here. It could be done as a follow-up patch, or done in a v2 of this patch with a mention in the patch description. -- -=( Ian Abbott || Web: www.mev.

Re: [PATCH] Staging: comedi: driver: Remove condition with no effect

2020-07-13 Thread Ian Abbott
else {' part that follows this part. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=- _

Re: [PATCH] staging: comedi: verify array index is correct before using it

2020-07-09 Thread Ian Abbott
pt = devpriv->pt[trig] & old_mask; + pp = devpriv->pp[trig] & old_mask; + switch (data[2]) { case COMEDI_DIGITAL_TRIG_DISABLE: /* clear trigger configuration */ Nice catch! Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk

Re: [PATCH] staging: comedi: Fix comedi_device refcnt leak in comedi_open

2020-04-20 Thread Ian Abbott
*file) } cfp = kzalloc(sizeof(*cfp), GFP_KERNEL); - if (!cfp) + if (!cfp) { + comedi_dev_put(dev); return -ENOMEM; + } cfp->dev = dev; Thanks for spotting that! Signed-off-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.u

[PATCH] staging: comedi: dt2815: fix writing hi byte of analog output

2020-04-06 Thread Ian Abbott
. Also add a "FIXME" comment about setting bit 0 of the low byte of the command. Supposedly, it is used to choose between voltage output and current output, but the current driver always sets it to 1. Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt2815.c | 3 +++ 1 fi

Re: [PATCH] Staging: comedi: dt2815: remove set but not used variable 'hi'

2020-04-06 Thread Ian Abbott
lue to the hardware! I think I know how to fix it. I'll send a patch. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=- _

[PATCH 4/4] staging: comedi: ni_pcimio: add routes for NI PCIe-6251 and PCIe-6259

2020-02-07 Thread Ian Abbott
ively. Cc: Éric Piel Cc: Spencer E. Olson Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_pcimio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c index 14b26fffe049..7c82d5f97

[PATCH 2/4] staging: comedi: ni_routes: Allow alternate board name for routes

2020-02-07 Thread Ian Abbott
on Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_660x.c | 2 +- .../staging/comedi/drivers/ni_mio_common.c| 2 +- drivers/staging/comedi/drivers/ni_routes.c| 21 +-- drivers/staging/comedi/drivers/ni_routes.h| 1 + 4 files changed, 22 insert

[PATCH 0/4] staging: comedi: ni_routes: Share routing information between boards

2020-02-07 Thread Ian Abbott
We do not have or provide routing information for all supported NI boards. Some of the boards for which we currently provide routing information actually have identical routes to similar boards for which we do provide routing information. Rather than duplicating the routing data for such boards

[PATCH 1/4] staging: comedi: ni_routes: Refactor ni_find_valid_routes()

2020-02-07 Thread Ian Abbott
ions above return `NULL` if the information is not found (as we do not currently have the routing information available for all supported boards). Cc: Éric Piel Cc: Spencer E. Olson Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_routes.c | 44 +- 1 file c

[PATCH 3/4] staging: comedi: ni_mio_common: Allow alternate board name for routes

2020-02-07 Thread Ian Abbott
the `alt_route_name` member value to `ni_assign_device_routes()` as the `alt_board_name` parameter, which it will use if no routing information could be found for the actual board name. Cc: Éric Piel Cc: Spencer E. Olson Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_mio_common.c | 3

[PATCH 2/2] staging: comedi: ni_routes: allow partial routing information

2020-01-14 Thread Ian Abbott
ssing routing information. Fixes: 347e244884c3 ("staging: comedi: tio: implement global tio/ctr routing") Fixes: 56d0b826d39f ("staging: comedi: ni_mio_common: implement new routing for TRIG_EXT"). Cc: # 4.20+ Cc: Spencer E. Olson Signed-off-by: Ian Abbott --- drivers/

[PATCH 1/2] staging: comedi: ni_routes: fix null dereference in ni_find_route_source()

2020-01-14 Thread Ian Abbott
be addressed by another patch. Fixes: 4bb90c87abbe ("staging: comedi: add interface to ni routing table information") Cc: # 4.20+ Cc: Spencer E. Olson Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/ni_routes.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/

[PATCH 0/2] staging: comedi: ni_routes: fix some regressions

2020-01-14 Thread Ian Abbott
Fix some regressions resulting from the routing functionality implemented for the National Instruments comedi drivers in kernel 4.20 when board-specific routing information is absent. Patch 1 fixes a null pointer dereference, but the set-up of asynchronous commands that use external triggers on

[PATCH] staging: comedi: adv_pci1710: fix AI channels 16-31 for PCI-1713

2019-12-27 Thread Ian Abbott
that the channel numbers will have been range checked already, so the bit-mask isn't really needed. Fixes: 92c65e5553ed ("staging: comedi: adv_pci1710: define the mux control register bits") Reported-by: Dmytro Fil Cc: # v4.5+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/adv_pci

[PATCH] staging: comedi: gsc_hpdi: check dma_alloc_coherent() return value

2019-12-16 Thread Ian Abbott
c: #4.6+ Signed-off-by: Ian Abbott --- Note: Bug is also present in kernel 4.5 and earlier, but the patch will not apply cleanly to those (the gsc_hpdi driver used to call `pci_alloc_consistent()` instead of `dma_alloc_coherent()`). --- drivers/staging/comedi/drivers/gsc_hpdi.c | 10 ++

Re: [PATCH] staging: comedi: drivers: Fix memory leak in gsc_hpdi_auto_attach

2019-12-16 Thread Ian Abbott
e calls to dma_alloc_coherent() returned NULL. If any of the calls to dma_alloc_coherent() returns NULL, gsc_hpdi_auto_attach() needs to return an error (-ENOMEM). The subsequent call to gsc_hpdi_detach() will then free whatever DMA coherent buffers where allocated. -- -=( Ian Abbott || Web

Re: [PATCH] staging: comedi: comedi_test: return error when comedi_test_init fails

2019-12-10 Thread Ian Abbott
o zero. I'm happy with the change of behaviour, but would suggest changing the 'pr_warn()' calls to 'pr_err()' to match this change. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=

Re: [PATCH] staging: comedi: usbduxfast: usbduxfast_ai_cmdtest rounding error

2019-11-19 Thread Ian Abbott
t the patch body is the same. The previous version with subject line "[PATCH] staging: comedi: usbduxsigma: usbduxfast_ai_cmdtest rounding error" can therefore be dropped. I guess this can be applied to stable to fix problems with round-trip rounding. If so, the following can be added:

Re: [PATCH] staging: comedi: usbduxsigma: usbduxfast_ai_cmdtest rounding error

2019-11-18 Thread Ian Abbott
_arg, arg); + } if (cmd->stop_src == TRIG_COUNT) err |= comedi_check_trigger_arg_min(>stop_arg, 1); The actual patch looks good. A 'Cc:' line for "stable" kernel versions 4.4 and later could be added: Cc: # 4.4+ Please mark the updated patch as '[P

Re: [PATCH v2] staging: comedi: rewrite macro function with GNU extension typeof

2019-11-04 Thread Ian Abbott
r uapi headers (mainly in netfilter stuff), so I guess it's OK. However, it does mean that user code that uses these macros will no longer compile unless GNU extensions are enabled. Does anyone know any "best practices" regarding use of GNU extensions in user header files under Li

Re: [PATCH -next] staging: comedi: dt2814: remove set but not used variables 'data'

2019-10-23 Thread Ian Abbott
(lo >> 4); + inb(dev->iobase + DT2814_DATA); + inb(dev->iobase + DT2814_DATA); if (!(--devpriv->ntrig)) { int i; Those variables are currently unused due to a bug that I need to fix. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( ME

Re: [PATCH -next] staging: comedi: remove unused variable 'route_table_size'

2019-10-23 Thread Ian Abbott
Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park Road, Bramhall, STOCKPORT, SK7 3JZ, UK. )=- ___ devel mai

Re: [PATCH v2 6/6] staging: comedi: Remove set but not used variable 'aref'

2019-10-08 Thread Ian Abbott
i++) data[i] = dt3k_readsingle(dev, DPR_SUBSYS_AI, chan, gain); -- 2.7.4 That looks fine, thanks. Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registere

Re: [PATCH v2 5/6] staging: comedi: Remove set but not used variable 'hi'

2019-10-08 Thread Ian Abbott
i] & 0xff0) >> 4; ret = comedi_timeout(dev, s, insn, dt2815_ao_status, 0x00); if (ret) -- 2.7.4 There is something fishy going on in this one too. It should be writing the 'hi' value to the card registers. Please could you omit this patch from the series

Re: [PATCH v2 4/6] staging: comedi: Remove set but not used variable 'data'

2019-10-08 Thread Ian Abbott
to a buffer. Can I suggest omitting this patch from the series so I can investigate and supply a proper fix? -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=

Re: [PATCH] staging: comedi: drivers: prevent memory leak

2019-09-17 Thread Ian Abbott
module); 1002 } 1003 /* On success, the driver module count has been incremented. */ Yes, everything should be freed properly by comedi_device_detach(). From comedi_device_detach(), some of the stuff is freed by dev->driver->detach(), and the remainder is freed

Re: [PATCH] staging: comedi: usbduxsigma: remove redundant assignment to variable fx2delay

2019-08-15 Thread Ian Abbott
x2delay = 255; + int fx2delay; if (period < MIN_PWM_PERIOD) return -EAGAIN; Looks fine, thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268.

[PATCH] staging: comedi: dt3000: Fix rounding up of timer divisor

2019-08-12 Thread Ian Abbott
"improvement". Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/dt3000.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c index 2edf3ee91300..8621e3833ad5 100644 --- a

[PATCH] staging: comedi: dt3000: Fix signed integer overflow 'divider * base'

2019-08-12 Thread Ian Abbott
stance of this calculation in the same function. Reported-by: David Binderman Cc: Signed-off-by: Ian Abbott --- N.B. Greg: The original report suggested an actual build error, so may be prudent to queue this on your 'staging-linus' queue. drivers/staging/comedi/drivers/dt3000.c | 2 +- 1 file changed, 1 ins

Re: linux-5.3-rc4/drivers/staging/comedi/drivers/dt3000.c:373: (error) Signed integer overflow for expression 'divider*base'

2019-08-12 Thread Ian Abbott
to use longs. It wouldn't do any harm to change the `int` variables to `unsigned int`. Regards David Binderman time-_Base seems to be 50 or 100. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Re

Re: [PATCH v2 3/3] staging: comedi: mite: Replace function mite_request_channel_in_range()

2019-07-01 Thread Ian Abbott
file changed, 10 insertions(+), 17 deletions(-) And this one looks good too, thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West

Re: [PATCH v2 2/3] staging: comedi: amplc_dio200: Remove function gat_sce()

2019-07-01 Thread Ian Abbott
. drivers/staging/comedi/drivers/amplc_dio200_common.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) This one looks good too, thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Regist

Re: [PATCH v2 1/3] staging: comedi: amplc_dio200: Remove function clk_sce()

2019-07-01 Thread Ian Abbott
/staging/comedi/drivers/amplc_dio200_common.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) Looks good, thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 0286

[PATCH] staging: comedi: dt282x: fix a null pointer deref on interrupt

2019-06-26 Thread Ian Abbott
staging: comedi: dt282x: use comedi_handle_events()") Cc: # v3.19+ Signed-off-by: Ian Abbott --- Note: A similar patch will be required for stable v3.16.x, but that calls cfc_handle_events() instead of comedi_handle_events(). --- drivers/staging/comedi/drivers/dt282x.c | 3 ++- 1 file changed, 2 i

[PATCH] staging: comedi: amplc_pci230: fix null pointer deref on interrupt

2019-06-26 Thread Ian Abbott
_ao);` and `pci230_handle_ao_fifo(dev, s_ao);` will never be reached for a PCI260, so they are safe. Fixes: 39064f23284c ("staging: comedi: amplc_pci230: use comedi_handle_events()") Cc: # v3.19+ Signed-off-by: Ian Abbott --- drivers/staging/comedi/drivers/amplc_pci230.c | 3 ++- 1 file changed, 2 insertions(+

Re: [PATCH] staging: comedi: use dma_mmap_coherent for DMA-able buffer mmap

2019-06-25 Thread Ian Abbott
, in which case it doesn't need to be marked as Reserved. Thanks for the hint. I'll take a look at that. -- -=( Ian Abbott || Web: www.mev.co.uk )=- -=( MEV Ltd. is a company registered in England & Wales. )=- -=( Registered number: 02862268. Registered address:)=- -=( 15 West Park

Re: [PATCH] staging: comedi: use dma_mmap_coherent for DMA-able buffer mmap

2019-06-25 Thread Ian Abbott
On 25/06/2019 12:47, Dan Carpenter wrote: On Tue, Jun 25, 2019 at 12:26:59PM +0100, Ian Abbott wrote: drivers/staging/comedi/comedi_buf.c | 150 ++- drivers/staging/comedi/comedi_fops.c | 39 --- 2 files changed, 125 insertions(+), 64 deletions(-) diff --git

[PATCH] staging: comedi: use dma_mmap_coherent for DMA-able buffer mmap

2019-06-25 Thread Ian Abbott
pages (since they are contiguous anyway). Cc: Christoph Hellwig Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_buf.c | 150 ++- drivers/staging/comedi/comedi_fops.c | 39 --- 2 files changed, 125 insertions(+), 64 deletions(-) diff --git a/drivers

  1   2   3   4   5   6   7   8   9   10   >