31 Aug, 2013

1 commit


25 Jun, 2013

1 commit


22 Nov, 2012

4 commits

  • The same condition should be used both when allocating and freeing the
    driver private data. When dev.of_node is non NULL, allocate a new
    private data structure, otherwise use the values from the platform data.

    Reported-by: Fengguang Wu
    Signed-off-by: Damian Hobson-Garcia
    Cc: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Damian Hobson-Garcia
     
  • The uio device should not fail on open just because one memory allocation
    fails. The device might export several regions, the failure of some of
    which may or may not be a problem for the user space driver. Failing
    regions will remain unmapped, and successful regions will be mapped and
    exported to user space. Also deals with the case where failing to map
    a region after successfully allocating others would not unmap the
    successfully allocated regions before dying.

    Signed-off-by: Damian Hobson-Garcia
    Cc: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Damian Hobson-Garcia
     
  • DMA_ERROR_CODE is not defined on all architectures and is architecture
    specific. Instead, use the constant, ~0 to indicate unmapped regions.

    Reported-by: Fengguang Wu
    Reported-by: Geert Uytterhoeven
    Signed-off-by: Damian Hobson-Garcia
    Cc: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Damian Hobson-Garcia
     
  • Assigning the virtual address returned from dma_alloc_coherent to the the
    internal_addr element of uioinfo produces the following sparse errors since
    internal_addr is a void __iomem * and dma_alloc_coherent returns void *.

    + drivers/uio/uio_dmem_genirq.c:65:39: sparse: incorrect type in assignment (different address spaces)
    drivers/uio/uio_dmem_genirq.c:65:39: expected void [noderef] *internal_addr
    drivers/uio/uio_dmem_genirq.c:65:39: got void *[assigned] addr
    + drivers/uio/uio_dmem_genirq.c:93:17: sparse: incorrect type in argument 3 (different address spaces)
    drivers/uio/uio_dmem_genirq.c:93:17: expected void *vaddr
    drivers/uio/uio_dmem_genirq.c:93:17: got void [noderef] *internal_addr

    Store the void * in the driver's private data instead.

    Reported-by: Fengguang Wu
    Signed-off-by: Damian Hobson-Garcia
    Cc: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Damian Hobson-Garcia
     

25 Oct, 2012

1 commit

  • This device extends the uio_pdrv_genirq driver to provide limited
    dynamic memory allocation for UIO devices. This allows UIO devices
    to use CMA and IOMMU allocated memory regions. This driver is based
    on the uio_pdrv_genirq driver and provides the same generic interrupt
    handling capabilities. Like uio_prdv_genirq,
    a fixed number of memory regions, defined in the platform device's
    .resources field are exported to userpace. This driver adds the ability
    to export additional regions whose number and size are known at boot time,
    but whose memory is not allocated until the uio device file is opened for
    the first time. When the device file is closed, the allocated memory block
    is freed. Physical (DMA) addresses for the dynamic regions are provided to
    the userspace via /sys/class/uio/uioX/maps/mapY/addr in the same way as
    static addresses are when the uio device file is open, when no processes
    are holding the device file open, the address returned to userspace is
    DMA_ERROR_CODE.

    Signed-off-by: Damian Hobson-Garcia
    Signed-off-by: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Damian Hobson-Garcia