04 Jul, 2013

1 commit


26 Jun, 2013

1 commit


25 Jun, 2013

2 commits

  • In a SMP case there was a race condition issue between
    uio_pdrv_genirq_irqcontrol() running on one CPU and irq handler on
    another CPU. Fix it by spin_locking shared resources access inside irq
    handler. Also:
    - Change disable_irq to disable_irq_nosync to avoid deadlock, because
    disable_irq waits for the completion of the irq handler;
    - Change atomic bit-manipulation routines to their non-atomic
    counterparts as we already are guarding the code by spinlock.

    Signed-off-by: Vitalii Demianets
    Reviewed-by: Pavel Machek
    Signed-off-by: Greg Kroah-Hartman

    Vitalii Demianets
     
  • This eliminates having an #ifdef returning NULL for the case
    when OF is disabled.

    Signed-off-by: Sachin Kamat
    Acked-by: Damian Hobson-Garcia
    Signed-off-by: Greg Kroah-Hartman

    Sachin Kamat
     

19 Jun, 2013

2 commits

  • If device is initialized from device tree, but has no interrupt
    assigned, uio will still try to request and interrupt old way,
    fails, and fails registration.

    This is wrong; don't try initializing irq using platform data if
    device tree is available.

    Simplified code based on suggestion by Grant Likely.

    Fixed memory leak in "irq can not be registered" error path.

    Signed-off-by: Pavel Machek
    Reported-by: Detlev Zundel
    Signed-off-by: Greg Kroah-Hartman

    Pavel Machek
     
  • This adds ability to bind uio driver to given open firmware device
    using command line option. Thus, userspace driver can be developed and
    used without modifying the kernel.

    Signed-off-by: Pavel Machek
    Tested-by: Detlev Zundel
    Signed-off-by: Greg Kroah-Hartman

    Pavel Machek
     

07 Jun, 2013

1 commit


27 May, 2013

1 commit


22 May, 2013

6 commits


30 Mar, 2013

1 commit

  • Until recently uio_get_minor() returned 0 for success and
    a negative value on failure. This became non-negative for suceess and
    negative for failure. Restore the original return value spec so that we can
    successfully initialize UIO devices with a non-zero minor device
    number.

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

    Damian Hobson-Garcia
     

28 Feb, 2013

1 commit


14 Feb, 2013

1 commit


13 Dec, 2012

1 commit

  • Pull ARM SoC updates from Olof Johansson:
    "This contains the bulk of new SoC development for this merge window.

    Two new platforms have been added, the sunxi platforms (Allwinner A1x
    SoCs) by Maxime Ripard, and a generic Broadcom platform for a new
    series of ARMv7 platforms from them, where the hope is that we can
    keep the platform code generic enough to have them all share one mach
    directory. The new Broadcom platform is contributed by Christian
    Daudt.

    Highbank has grown support for Calxeda's next generation of hardware,
    ECX-2000.

    clps711x has seen a lot of cleanup from Alexander Shiyan, and he's
    also taken on maintainership of the platform.

    Beyond this there has been a bunch of work from a number of people on
    converting more platforms to IRQ domains, pinctrl conversion, cleanup
    and general feature enablement across most of the active platforms."

    Fix up trivial conflicts as per Olof.

    * tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (174 commits)
    mfd: vexpress-sysreg: Remove LEDs code
    irqchip: irq-sunxi: Add terminating entry for sunxi_irq_dt_ids
    clocksource: sunxi_timer: Add terminating entry for sunxi_timer_dt_ids
    irq: versatile: delete dangling variable
    ARM: sunxi: add missing include for mdelay()
    ARM: EXYNOS: Avoid early use of of_machine_is_compatible()
    ARM: dts: add node for PL330 MDMA1 controller for exynos4
    ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
    ARM: EXYNOS: add UART3 to DEBUG_LL ports
    ARM: S3C24XX: Add clkdev entry for camif-upll clock
    ARM: SAMSUNG: Add s3c24xx/s3c64xx CAMIF GPIO setup helpers
    ARM: sunxi: Add missing sun4i.dtsi file
    pinctrl: samsung: Do not initialise statics to 0
    ARM i.MX6: remove gate_mask from pllv3
    ARM i.MX6: Fix ethernet PLL clocks
    ARM i.MX6: rename PLLs according to datasheet
    ARM i.MX6: Add pwm support
    ARM i.MX51: Add pwm support
    ARM i.MX53: Add pwm support
    ARM: mx5: Replace clk_register_clkdev with clock DT lookup
    ...

    Linus Torvalds
     

22 Nov, 2012

8 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
     
  • CONFIG_HOTPLUG is going away as an option so __devexit is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinitdata is no
    longer needed.

    Signed-off-by: Bill Pemberton
    Cc: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devinit is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     
  • CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
    needed.

    Signed-off-by: Bill Pemberton
    Cc: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Bill Pemberton
     

16 Nov, 2012

1 commit

  • If uio_pdrv[_genirq] is used, the uio maps have currently no name set.
    This patch sets the uio_mem name to the name of the memory resource.

    Signed-off-by: Manuel Traut
    Reported-by: Stefan Staedtler
    Tested-by: Stefan Staedtler
    Signed-off-by: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Manuel Traut
     

27 Oct, 2012

1 commit


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
     

09 Oct, 2012

1 commit

  • A long time ago, in v2.4, VM_RESERVED kept swapout process off VMA,
    currently it lost original meaning but still has some effects:

    | effect | alternative flags
    -+------------------------+---------------------------------------------
    1| account as reserved_vm | VM_IO
    2| skip in core dump | VM_IO, VM_DONTDUMP
    3| do not merge or expand | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP
    4| do not mlock | VM_IO, VM_DONTEXPAND, VM_HUGETLB, VM_PFNMAP

    This patch removes reserved_vm counter from mm_struct. Seems like nobody
    cares about it, it does not exported into userspace directly, it only
    reduces total_vm showed in proc.

    Thus VM_RESERVED can be replaced with VM_IO or pair VM_DONTEXPAND | VM_DONTDUMP.

    remap_pfn_range() and io_remap_pfn_range() set VM_IO|VM_DONTEXPAND|VM_DONTDUMP.
    remap_vmalloc_range() set VM_DONTEXPAND | VM_DONTDUMP.

    [akpm@linux-foundation.org: drivers/vfio/pci/vfio_pci.c fixup]
    Signed-off-by: Konstantin Khlebnikov
    Cc: Alexander Viro
    Cc: Carsten Otte
    Cc: Chris Metcalf
    Cc: Cyrill Gorcunov
    Cc: Eric Paris
    Cc: H. Peter Anvin
    Cc: Hugh Dickins
    Cc: Ingo Molnar
    Cc: James Morris
    Cc: Jason Baron
    Cc: Kentaro Takeda
    Cc: Matt Helsley
    Cc: Nick Piggin
    Cc: Oleg Nesterov
    Cc: Peter Zijlstra
    Cc: Robert Richter
    Cc: Suresh Siddha
    Cc: Tetsuo Handa
    Cc: Venkatesh Pallipadi
    Acked-by: Linus Torvalds
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Konstantin Khlebnikov
     

15 May, 2012

1 commit


12 Jan, 2012

1 commit

  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (80 commits)
    x86/PCI: Expand the x86_msi_ops to have a restore MSIs.
    PCI: Increase resource array mask bit size in pcim_iomap_regions()
    PCI: DEVICE_COUNT_RESOURCE should be equal to PCI_NUM_RESOURCES
    PCI: pci_ids: add device ids for STA2X11 device (aka ConneXT)
    PNP: work around Dell 1536/1546 BIOS MMCONFIG bug that breaks USB
    x86/PCI: amd: factor out MMCONFIG discovery
    PCI: Enable ATS at the device state restore
    PCI: msi: fix imbalanced refcount of msi irq sysfs objects
    PCI: kconfig: English typo in pci/pcie/Kconfig
    PCI/PM/Runtime: make PCI traces quieter
    PCI: remove pci_create_bus()
    xtensa/PCI: convert to pci_scan_root_bus() for correct root bus resources
    x86/PCI: convert to pci_create_root_bus() and pci_scan_root_bus()
    x86/PCI: use pci_scan_bus() instead of pci_scan_bus_parented()
    x86/PCI: read Broadcom CNB20LE host bridge info before PCI scan
    sparc32, leon/PCI: convert to pci_scan_root_bus() for correct root bus resources
    sparc/PCI: convert to pci_create_root_bus()
    sh/PCI: convert to pci_scan_root_bus() for correct root bus resources
    powerpc/PCI: convert to pci_create_root_bus()
    powerpc/PCI: split PHB part out of pcibios_map_io_space()
    ...

    Fix up conflicts in drivers/pci/msi.c and include/linux/pci_regs.h due
    to the same patches being applied in other branches.

    Linus Torvalds
     

07 Jan, 2012

2 commits

  • The new PCI API provides both generic probing for 2.3 masking support
    and check&mask in the interrupt handler.

    Acked-by: Michael S. Tsirkin
    Signed-off-by: Jan Kiszka
    Signed-off-by: Jesse Barnes

    Jan Kiszka
     
  • pci_block_user_cfg_access was designed for the use case that a single
    context, the IPR driver, temporarily delays user space accesses to the
    config space via sysfs. This assumption became invalid by the time
    pci_dev_reset was added as locking instance. Today, if you run two loops
    in parallel that reset the same device via sysfs, you end up with a
    kernel BUG as pci_block_user_cfg_access detect the broken assumption.

    This reworks the pci_block_user_cfg_access to a sleeping service
    pci_cfg_access_lock and an atomic-compatible variant called
    pci_cfg_access_trylock. The former not only blocks user space access as
    before but also waits if access was already locked. The latter service
    just returns false in this case, allowing the caller to resolve the
    conflict instead of raising a BUG.

    Adaptions of the ipr driver were originally written by Brian King.

    Acked-by: Brian King
    Acked-by: Michael S. Tsirkin
    Signed-off-by: Jan Kiszka
    Signed-off-by: Jesse Barnes

    Jan Kiszka
     

27 Nov, 2011

1 commit


01 Nov, 2011

1 commit


19 Oct, 2011

1 commit

  • To support >32-bit physical addresses for UIO_MEM_PHYS type we need to
    extend the width of 'addr' in struct uio_mem. Numerous platforms like
    embedded PPC, ARM, and X86 have support for systems with larger physical
    address than logical.

    Since 'addr' may contain a physical, logical, or virtual address the
    easiest solution is to just change the type to 'phys_addr_t' which
    should always be greater than or equal to the sizeof(void *) such that
    it can properly hold any of the address types.

    For physical address we can support up to a 44-bit physical address on a
    typical 32-bit system as we utilize remap_pfn_range() for the mapping of
    the memory region and pfn's are represnted by shifting the address by
    the page size (typically 4k).

    Signed-off-by: Kai Jiang
    Signed-off-by: Minghuan Lian
    Signed-off-by: Kumar Gala
    Signed-off-by: Hans J. Koch
    Signed-off-by: Greg Kroah-Hartman

    Kai Jiang
     

23 Aug, 2011

3 commits

  • Remove the __devinitconst to fix the section mismatch.

    WARNING: drivers/uio/built-in.o(.data+0x2e8): Section mismatch in
    reference from the variable uio_pdrv_genirq to the variable
    .devinit.rodata:uio_of_genirq_match
    The variable uio_pdrv_genirq references
    the variable __devinitconst uio_of_genirq_match
    If the reference is valid then annotate the
    variable with __init* or __refdata (see linux/init.h) or name the
    variable:
    *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one,
    *_console

    Signed-off-by: Wanlong Gao
    Signed-off-by: Greg Kroah-Hartman

    Wanlong Gao
     
  • Remove one *goto* label in uio.c.

    Signed-off-by: Wanlong Gao
    Signed-off-by: "Hans J. Koch"
    Signed-off-by: Greg Kroah-Hartman

    Wanlong Gao
     
  • The spin_lock in uio_pci_generic.c is only used in the interrupt
    handler, which cannot be executed twice at the same time.
    That makes the lock rather pointless. This patch removes it.

    Cc: "Michael S. Tsirkin"
    Cc: Chris Wright
    Cc: Jesse Barnes
    Cc: Sebastian Andrzej Siewior
    Cc: Anthony Foiani
    Reported-by: Anthony Foiani
    Reported-by: Sebastian Andrzej Siewior
    Signed-off-by: Hans J. Koch
    Acked-by: Michael S. Tsirkin
    Signed-off-by: Greg Kroah-Hartman

    Hans J. Koch