25 Mar, 2015

1 commit


28 Aug, 2013

1 commit


22 Aug, 2013

1 commit

  • These functions are being open-coded in 3 different places in the driver
    core, and other driver subsystems will want to start doing this as well,
    so move it to the sysfs core to keep it all in one place, where we know
    it is written properly.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

13 Aug, 2013

1 commit

  • attribute groups are much more flexible than just a list of attributes,
    due to their support for visibility of the attributes, and binary
    attributes. Add drv_groups to struct bus_type which should be used
    instead of drv_attrs.

    drv_attrs will be removed from the structure soon.

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

18 Jul, 2012

1 commit


17 Jul, 2012

1 commit


14 May, 2012

1 commit

  • driver_find_device() can be called with an unregistered driver. Need
    to check driver_private to see if it's populated or not, especially
    under deferrable probe.

    In the case that there are 2 drivers, one depends on the other. With
    -EPROBE_DEFER, two drivers can use deferred probe to ensure that their
    relative probe order doesn't matter. If dependee driver is probed
    first, then the dependant's driver_find_device('dependee')
    succeeds. If the dependant is probed first, then the dependant's
    driver_find_device('dependee') should return NULL, and the dependant
    should get -EPROBE_DEFER. driver_find_device() needs to return NULL if
    it's not populated.

    In [PATCHv5 2/3] ARM: tegra: Add SMMU enabler in AHB:
    http://article.gmane.org/gmane.linux.ports.tegra/4658

    "tegra_ahb_driver" may not be populated when it's called.

    For more SMMU/AHB specific discussion, refer to the following thread:
    https://lkml.org/lkml/2012/5/10/21

    Signed-off-by: Hiroshi DOYU
    Cc: Stephen Warren
    Signed-off-by: Greg Kroah-Hartman

    Hiroshi DOYU
     

20 Apr, 2012

1 commit


19 Apr, 2012

1 commit

  • klist_iter_init_node() takes a node as a start argument.
    However, this node might not be valid anymore.
    This patch updates the klist_iter_init_node() and
    dependent functions to return an error if so.
    All calling functions have been audited to check
    for a return code here.

    Signed-off-by: Hannes Reinecke
    Cc: Greg Kroah-Hartmann
    Cc: Kay Sievers
    Cc: Stable Kernel
    Cc: Linux Kernel
    Signed-off-by: Greg Kroah-Hartman

    Hannes Reinecke
     

22 Mar, 2012

1 commit

  • Pull powerpc merge from Benjamin Herrenschmidt:
    "Here's the powerpc batch for this merge window. It is going to be a
    bit more nasty than usual as in touching things outside of
    arch/powerpc mostly due to the big iSeriesectomy :-) We finally got
    rid of the bugger (legacy iSeries support) which was a PITA to
    maintain and that nobody really used anymore.

    Here are some of the highlights:

    - Legacy iSeries is gone. Thanks Stephen ! There's still some bits
    and pieces remaining if you do a grep -ir series arch/powerpc but
    they are harmless and will be removed in the next few weeks
    hopefully.

    - The 'fadump' functionality (Firmware Assisted Dump) replaces the
    previous (equivalent) "pHyp assisted dump"... it's a rewrite of a
    mechanism to get the hypervisor to do crash dumps on pSeries, the
    new implementation hopefully being much more reliable. Thanks
    Mahesh Salgaonkar.

    - The "EEH" code (pSeries PCI error handling & recovery) got a big
    spring cleaning, motivated by the need to be able to implement a
    new backend for it on top of some new different type of firwmare.

    The work isn't complete yet, but a good chunk of the cleanups is
    there. Note that this adds a field to struct device_node which is
    not very nice and which Grant objects to. I will have a patch soon
    that moves that to a powerpc private data structure (hopefully
    before rc1) and we'll improve things further later on (hopefully
    getting rid of the need for that pointer completely). Thanks Gavin
    Shan.

    - I dug into our exception & interrupt handling code to improve the
    way we do lazy interrupt handling (and make it work properly with
    "edge" triggered interrupt sources), and while at it found & fixed
    a wagon of issues in those areas, including adding support for page
    fault retry & fatal signals on page faults.

    - Your usual random batch of small fixes & updates, including a bunch
    of new embedded boards, both Freescale and APM based ones, etc..."

    I fixed up some conflicts with the generalized irq-domain changes from
    Grant Likely, hopefully correctly.

    * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (141 commits)
    powerpc/ps3: Do not adjust the wrapper load address
    powerpc: Remove the rest of the legacy iSeries include files
    powerpc: Remove the remaining CONFIG_PPC_ISERIES pieces
    init: Remove CONFIG_PPC_ISERIES
    powerpc: Remove FW_FEATURE ISERIES from arch code
    tty/hvc_vio: FW_FEATURE_ISERIES is no longer selectable
    powerpc/spufs: Fix double unlocks
    powerpc/5200: convert mpc5200 to use of_platform_populate()
    powerpc/mpc5200: add options to mpc5200_defconfig
    powerpc/mpc52xx: add a4m072 board support
    powerpc/mpc5200: update mpc5200_defconfig to fit for charon board
    Documentation/powerpc/mpc52xx.txt: Checkpatch cleanup
    powerpc/44x: Add additional device support for APM821xx SoC and Bluestone board
    powerpc/44x: Add support PCI-E for APM821xx SoC and Bluestone board
    MAINTAINERS: Update PowerPC 4xx tree
    powerpc/44x: The bug fixed support for APM821xx SoC and Bluestone board
    powerpc: document the FSL MPIC message register binding
    powerpc: add support for MPIC message register API
    powerpc/fsl: Added aliased MSIIR register address to MSI node in dts
    powerpc/85xx: mpc8548cds - add 36-bit dts
    ...

    Linus Torvalds
     

09 Mar, 2012

1 commit


25 Jan, 2012

2 commits

  • Now that there are no users of get_driver() or put_driver(), this
    patch (as1513) removes those routines completely.

    Signed-off-by: Alan Stern
    CC: Dmitry Torokhov
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • As part of the removal of get_driver()/put_driver(), this patch
    (as1510) changes driver_find(); it now drops the reference it acquires
    before returning. The patch also adjusts all the callers of
    driver_find() to remove the now unnecessary calls to put_driver().

    In addition, the patch adds a warning to driver_find(): Callers must
    make sure the driver they are searching for does not get unloaded
    while they are using it. This has always been the case; driver_find()
    has never prevented a driver from being unregistered or unloaded.
    Hence the patch will not introduce any new bugs. The existing callers
    all seem to be okay in this respect, however I don't understand the
    video drivers well enough to be certain about them.

    Signed-off-by: Alan Stern
    CC: Dmitry Torokhov
    CC: Kyungmin Park
    CC: Andy Walls
    CC: Martin Schwidefsky
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

24 Dec, 2009

1 commit


31 Oct, 2009

1 commit

  • In this patch:
    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=16dc42e018c2868211b4928f20a957c0c216126c
    the check was added for another driver to already claim the same device
    on the same bus. But the returned error code was wrong: to modprobe, the
    -EEXIST means that _this_ driver is already installed. It therefore
    doesn't produce the needed error message when _another_ driver is trying
    to register for the same device. Returning -EBUSY fixes the problem.

    Signed-off-by: Stas Sergeev
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Stas Sergeev
     

16 Sep, 2009

1 commit


29 May, 2009

1 commit


25 Mar, 2009

2 commits


10 Jan, 2009

1 commit


07 Jan, 2009

1 commit


22 Aug, 2008

1 commit


01 May, 2008

1 commit


29 Mar, 2008

1 commit

  • The Coverity checker spotted that we leak the storage allocated to 'name' in
    int driver_add_kobj(). The leak looks legit to me - this is the code :

    int driver_add_kobj(struct device_driver *drv, struct kobject *kobj,
    const char *fmt, ...)
    {
    va_list args;
    char *name;
    int ret;

    va_start(args, fmt);
    name = kvasprintf(GFP_KERNEL, fmt, args);
    ^^^^^^^^ This dynamically allocates space...

    va_end(args);

    if (!name)
    return -ENOMEM;

    return kobject_add(kobj, &drv->p->kobj, "%s", name);
    ^^^^^^^^ This neglects to free the space allocated
    }

    Inside kobject_add() a copy of 'name' will be made and used. As far as I can
    see, Coverity is correct in flagging this as a leak, but I'd like some
    configmation before the patch is applied.

    This should fix it.

    Signed-off-by: Jesper Juhl
    Cc: Greg KH
    Cc: Kay Sievers
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     

22 Feb, 2008

1 commit

  • Fix drivers/base/ missing kernel-doc parameters:
    Warning(linux-2.6.24-git12//drivers/base/driver.c:133): No description found for parameter 'drv'
    Warning(linux-2.6.24-git12//drivers/base/driver.c:133): No description found for parameter 'kobj'
    Warning(linux-2.6.24-git12//drivers/base/driver.c:133): No description found for parameter 'fmt'
    Warning(linux-2.6.24-git12//drivers/base/power/main.c:530): No description found for parameter 'state'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     

03 Feb, 2008

1 commit


25 Jan, 2008

7 commits


28 Apr, 2007

1 commit

  • The completion in the driver release path is due to ancient history in
    the _very_ early 2.5 days when we were not tracking the module reference
    count of attributes. It is not needed at all and can be removed.

    Note, we now have an empty release function for the driver structure.
    This is due to the fact that drivers are statically allocated in the
    system at this point in time, something which I want to change in the
    future. But remember, drivers are really code, which is reference
    counted by the module, unlike devices, which are data and _must_ be
    reference counted properly in order to work correctly.

    Cc: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

02 Apr, 2007

1 commit


26 Sep, 2006

1 commit

  • This patch (as783) simplifies the driver core slightly by removing four
    unnecessary _get and _put methods.

    It is vital that when a driver is removed from its bus's klist of
    registered drivers, or when a device is removed from a driver's klist
    of bound devices, that the klist updates complete synchronously.
    Otherwise the kernel might try binding an unregistered driver to a
    newly-registered device, or adding a device to the klist for a new
    driver before it has been removed from the old driver's klist.

    Since the removals must be synchronous, they don't need to update any
    reference counts. Hence the _get and _put methods can be dispensed
    with.

    Signed-off-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     

01 Jul, 2006

1 commit


14 Jan, 2006

1 commit

  • Add bus_type probe, remove and shutdown methods to replace the
    corresponding methods in struct device_driver. This matches
    the way we handle the suspend/resume methods.

    Since the bus methods override the device_driver methods, warn
    if a device driver is registered whose methods will not be
    called.

    The long-term idea is to remove the device_driver methods entirely.

    Signed-off-by: Russell King
    Signed-off-by: Greg Kroah-Hartman

    Russell King
     

29 Oct, 2005

1 commit