31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

14 Sep, 2018

1 commit


18 Dec, 2017

1 commit

  • The driver may sleep under a spinlock.
    The function call path is:
    tsi148_master_write \ tsi148_master_read (acquire the spinlock)
    vme_register_error_handler
    kmalloc(GFP_KERNEL) --> may sleep

    To fix it, GFP_KERNEL is replaced with GFP_ATOMIC.

    This bug is found by my static analysis tool(DSAC) and checked by my code review.

    Signed-off-by: Jia-Ju Bai
    Signed-off-by: Greg Kroah-Hartman

    Jia-Ju Bai
     

08 Nov, 2017

1 commit

  • The VME subsystem currently returns -EBUSY when trying to free a DMA
    resource that is busy, but returns -EINVAL when trying to free a DMA list
    that is in use. Switch to returning -EBUSY when trying to free a DMA list
    that is in use for consistency and correctness.

    Signed-off-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Martyn Welch
     

20 Oct, 2017

1 commit


14 Oct, 2017

5 commits


04 Oct, 2017

1 commit

  • The controversial part of this patch is that I've changed it so we now
    prevent integer overflows for VME_USER types and before we didn't. I
    view it as kernel-hardening. I looked at a couple places that used
    VME_USER types and they seemed pretty suspicious so I'm pretty sure
    preventing overflows here is a good idea.

    The most common problem which this function is for cases like VME_A16
    where we don't put an upper bound on "size" so you could have "size" set
    to U64_MAX and a valid vme_base would overflow the "vme_base + size"
    into the valid range as well.

    In the VME_A64 case, the integer overflow checking doesn't work because
    "U64_MAX + 1" has an integer overflow and it's just a complicated way of
    saying zero. That VME_A64 case is sort of interesting as well because
    there is a VME_A64_MAX define which is set to "U64_MAX + 1". The
    compiler will never let anyone use it since it can't be stored in a u64
    variable... With my patch it's now limited to just U64_MAX.

    Anyway, I put one integer overflow check at the start of the function
    and deleted all existing checks.

    Signed-off-by: Dan Carpenter
    Acked-by: Dmitry Kalinkin
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

17 Mar, 2017

1 commit


25 Jan, 2017

1 commit

  • Commit 050c3d52cc7810d9d17b8cd231708609af6876ae ("vme: make core
    vme support explicitly non-modular") dropped the remove function
    because it appeared as if it was for removal of the bus, which is
    not supported.

    However, vme_bus_remove() is called when a VME device is removed
    from the bus and not when the bus is removed; as it calls the VME
    device driver's cleanup function. Without this function, the
    remove() in the VME device driver is never called and VME device
    drivers cannot be reloaded again.

    Here we restore the remove function that was deleted in that
    commit, and the reference to the function in the bus structure.

    Fixes: 050c3d52cc78 ("vme: make core vme support explicitly non-modular")
    Cc: Manohar Vanga
    Acked-by: Martyn Welch
    Cc: devel@driverdev.osuosl.org
    Signed-off-by: Stefano Babic
    Signed-off-by: Paul Gortmaker
    Cc: stable # 4.9
    Signed-off-by: Greg Kroah-Hartman

    Stefano Babic
     

28 Oct, 2016

1 commit


31 Aug, 2016

2 commits

  • The Kconfig currently controlling compilation of this code is:

    drivers/vme/Kconfig:menuconfig VME_BUS
    drivers/vme/Kconfig: bool "VME bridge support"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the modular code that is essentially orphaned, so that
    when reading the driver there is no doubt it is builtin-only.

    We replace module.h and moduleparam.h (unused) with init.h and also
    export.h ; the latter since this file does export some syms.

    Since this is a struct bus_type and not a platform_driver, we don't
    have any ".suppress_bind_attrs" to be concerned about when we
    drop the ".remove" code from this file.

    Since module_init was not in use by this code, the init ordering
    remains unchanged with this commit.

    Cc: Manohar Vanga
    Signed-off-by: Paul Gortmaker
    Acked-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Paul Gortmaker
     
  • Make the location monitor callback function prototype more useful by
    changing the argument from an integer to a void pointer.

    All VME bridge drivers were simply passing the location monitor index
    (e.g. 0-3) as the argument to these callbacks. It is much more useful
    to pass back a pointer to data that the callback-registering driver
    cares about.

    There appear to be no in-kernel callers of vme_lm_attach (or
    vme_lme_request for that matter), so this change only affects the VME
    subsystem and bridge drivers.

    This has been tested with Tsi148 hardware, but the CA91Cx42 changes
    have only been compiled.

    Signed-off-by: Aaron Sierra
    Acked-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Aaron Sierra
     

02 May, 2016

2 commits

  • Consolidate vme_bridge structure setup that every bridge was required
    to do itself. This came about because .irq_mtx is only used within the
    VME core, but was required to be setup externally.

    This returns the structure passed in to support shorthand like this:

    bridge = vme_init_bridge(&priv->bridge);

    Signed-off-by: Aaron Sierra
    Acked-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Aaron Sierra
     
  • Fix a typo in the spurious interrupt warning and consistently capitalize
    VME, PCI, and DMA acronyms.

    Signed-off-by: Aaron Sierra
    Acked-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Aaron Sierra
     

05 Oct, 2015

4 commits

  • This will enable error messages for accesses done through mmap.

    Signed-off-by: Dmitry Kalinkin
    Acked-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Kalinkin
     
  • The current VME bus error handler adds errors to the bridge error list.
    vme_master_{read,write} then traverses that list to look for relevant
    errors.

    Such scheme didn't work well for accesses going through vme_master_mmap
    because they would also allocate a vme_bus_error, but have no way to do
    vme_clear_errors call to free that memory.

    This changes the error handling process to be other way around: now
    vme_master_{read,write} defines a window in VME address space that will
    catch possible errors. VME bus error interrupt only traverses these
    windows and marks those that had errors in them.

    Signed-off-by: Dmitry Kalinkin
    Cc: Igor Alekseev
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Kalinkin
     
  • Also changes vme_bus_error_handler to take generic address modifier code
    instead of raw contents of a device-specific attribute register.

    Signed-off-by: Dmitry Kalinkin
    Cc: Igor Alekseev
    Acked-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Kalinkin
     
  • Error handling code found in tsi148 is not device specific. In fact it
    already relies on shared vme_bus_error struct and vme_bridge.vme_errors
    field. The other bridge driver could reuse this code if it is shared.

    This introduces a slight behavior change: vme error message won't be
    triggered in a rare case when err_chk=1 and kmalloc fails.

    Signed-off-by: Dmitry Kalinkin
    Cc: Igor Alekseev
    Acked-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Kalinkin
     

13 Jun, 2015

2 commits


07 Mar, 2015

1 commit


12 Jan, 2015

1 commit

  • Replace a misspelled function name by %s and then __func__.

    This is the get function, not the set function, as was indicated by the
    string.

    This was done using Coccinelle, including the use of Levenshtein distance,
    as proposed by Rasmus Villemoes.

    Signed-off-by: Julia Lawall
    Signed-off-by: Greg Kroah-Hartman

    Julia Lawall
     

18 Dec, 2013

1 commit

  • Previously, VME bridge support was treated as any other driver (using
    module_init() macro), but if VME bridge and vme_user (staging) drivers
    were compiled into the kernel, then vme_user would attempt to register
    itself before the VME core support had been loaded. This would result
    in a kernel panic.

    The load order of these built-in drivers is based on the order in which
    drivers/staging/vme and driver/vme are compiled.

    This patch changes the VME core driver to use the subsys_initcall()
    macro which ensures that it is loaded before all other VME drivers
    regardless of the order in which they are compiled.

    Tested-by: Aaron Sierra
    Signed-off-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Aaron Sierra
     

04 Dec, 2013

2 commits

  • Traditionally the "get" functions increment the reference count of the
    object that is returned, which does not happen with vme_slot_get. The
    function vme_slot_get returns the physical VME slot associated with a
    particular struct vme_dev. Rename vme_slot_num to avoid any confusion.

    Signed-off-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Martyn Welch
     
  • The match function for vme_user is completely wrong. It will blindly bind
    against the first VME slot on each bus (at this point that would be just the
    first bus as the driver can only handle one bus).

    The original intention (before some major subsystem changes) was that the
    driver bind against the slot to which the bridge was attached in the VME
    system and to the bus(es) provided via the "bus" module parameter.

    To do this cleanly (i.e. without poking arround in the subsystems internal
    stuctures) a functionality has been added to provide access to the bus
    enumeration.

    Signed-off-by: Martyn Welch
    Signed-off-by: Greg Kroah-Hartman

    Martyn Welch
     

07 Jun, 2013

1 commit


15 Feb, 2013

1 commit


27 Apr, 2012

1 commit

  • This moves the VME core, VME board drivers, and VME bridge drivers out
    of the drivers/staging/vme/ area to drivers/vme/.

    The VME device drivers have not moved out yet due to some API questions
    they are still working through, that should happen soon, hopefully.

    Cc: Martyn Welch
    Cc: Manohar Vanga
    Cc: Vincent Bossier
    Cc: "Emilio G. Cota"
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman