RE: [PATCH 3/3] staging: comedi: ni_mio_common: only do counter commands for ni_pcimio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, May 10, 2013 6:07 AM, Ian Abbott wrote:
> "ni_mio_common.c" holds common code included by "ni_pcimio.c",
> "ni_atmio.c" and "ni_mio_cs.c", including a common initialization
> function `ni_E_init()`.  Amongst other things, this initializes some
> counter subdevices to support comedi instructions and asynchronous
> commands.  However, even though it sets up the handlers to support
> asynchronous commands on these subdevices, the handlers will return an
> error unless the `PCIDMA` macro is defined (which is defined only in
> "ni_pcimio.c").  If the `PCIDMA` macro is not defined, the comedi core
> will needlessly allocate buffers to support the asynchronous commands.
> Also, `s->async_dma_dir` is set to `DMA_BIDIRECTIONAL`, causing the
> physical pages for the buffers to be allocated using
> `dma_alloc_coherent()`.
>
> If the comedi core cannot call `dma_alloc_coherent()` because
> `CONFIG_HAS_DMA` is not defined, it will fail to allocate the buffers,
> which ultimately causes `ni_E_init()` to fail.
>
> Avoid the wastage and prevent the failure by only setting up
> asynchronous command support for the counter subdevices if the `PCIDMA`
> macro is defined.
>
> Signed-off-by: Ian Abbott <abbotti@xxxxxxxxx>
> ---
>  drivers/staging/comedi/drivers/ni_mio_common.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)

Ian,

Other than the minor comments on patches 1/3 and 2/3, I don't see any
issues with this series.

It should fix Geert Uytterhoeven's build problem and it keeps comedi from
globaly depending on HAS_DMA.

I plan on looking over the National drivers and cleaning up the complexity
caused by the mite, ni_tio, ni_tiocmd, and ni_mio_common modules. For
now this should work.

Thanks,

Reviewed-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux