02 Jun, 2020

1 commit


30 Jan, 2020

1 commit

  • Pull driver core updates from Greg KH:
    "Here is a small set of changes for 5.6-rc1 for the driver core and
    some firmware subsystem changes.

    Included in here are:
    - device.h splitup like you asked for months ago
    - devtmpfs minor cleanups
    - firmware core minor changes
    - debugfs fix for lockdown mode
    - kernfs cleanup fix
    - cpu topology minor fix

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'driver-core-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (22 commits)
    firmware: Rename FW_OPT_NOFALLBACK to FW_OPT_NOFALLBACK_SYSFS
    devtmpfs: factor out common tail of devtmpfs_{create,delete}_node
    devtmpfs: initify a bit
    devtmpfs: simplify initialization of mount_dev
    devtmpfs: factor out setup part of devtmpfsd()
    devtmpfs: fix theoretical stale pointer deref in devtmpfsd()
    driver core: platform: fix u32 greater or equal to zero comparison
    cpu-topology: Don't error on more than CONFIG_NR_CPUS CPUs in device tree
    debugfs: Return -EPERM when locked down
    driver core: Print device when resources present in really_probe()
    driver core: Fix test_async_driver_probe if NUMA is disabled
    driver core: platform: Prevent resouce overflow from causing infinite loops
    fs/kernfs/dir.c: Clean code by removing always true condition
    component: do not dereference opaque pointer in debugfs
    drivers/component: remove modular code
    debugfs: Fix warnings when building documentation
    device.h: move 'struct driver' stuff out to device/driver.h
    device.h: move 'struct class' stuff out to device/class.h
    device.h: move 'struct bus' stuff out to device/bus.h
    device.h: move dev_printk()-like functions to dev_printk.h
    ...

    Linus Torvalds
     

17 Jan, 2020

1 commit

  • Currently the property entry kunit tests are built if CONFIG_KUNIT=y.
    This will cause warnings when merged with the kunit tree that now
    supports tristate CONFIG_KUNIT. While the tests appear to compile
    as a module, we get a warning about missing module license.

    It's better to have a per-test suite CONFIG variable so that
    we can do selective building of kunit-based suites, and can
    also avoid merge issues like this.

    Fixes: c032ace71c29 ("software node: add basic tests for property entries")
    Reported-by: Stephen Rothwell
    Reported-by: Randy Dunlap
    Signed-off-by: Alan Maguire
    Signed-off-by: Rafael J. Wysocki

    Alan Maguire
     

14 Jan, 2020

1 commit

  • Since commit 57ea974fb871 ("driver core: Rewrite test_async_driver_probe
    to cover serialization and NUMA affinity"), running the test with NUMA
    disabled results in warning messages similar to the following.

    test_async_driver test_async_driver.12: NUMA node mismatch -1 != 0

    If CONFIG_NUMA=n, dev_to_node(dev) returns -1, and numa_node_id()
    returns 0. Both are widely used, so it appears risky to change return
    values. Augment the check with IS_ENABLED(CONFIG_NUMA) instead
    to fix the problem.

    Cc: Alexander Duyck
    Fixes: 57ea974fb871 ("driver core: Rewrite test_async_driver_probe to cover serialization and NUMA affinity")
    Signed-off-by: Guenter Roeck
    Cc: stable
    Acked-by: Alexander Duyck
    Link: https://lore.kernel.org/r/20191127202453.28087-1-linux@roeck-us.net
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     

07 Jan, 2020

1 commit

  • Commit c032ace71c29 ("software node: add basic tests for property
    entries") introduced a global-out-of-bounds error because it forgot to
    add a terminator of "nodes "for software_node_register_nodes() to
    process.

    # Subtest: property-entry
    1..7
    ok 1 - pe_test_uints
    ok 2 - pe_test_uint_arrays
    ok 3 - pe_test_strings
    ok 4 - pe_test_bool
    ok 5 - pe_test_move_inline_u8
    ok 6 - pe_test_move_inline_str
    ==================================================================
    BUG: KASAN: global-out-of-bounds in
    software_node_register_nodes+0x41/0x80
    Read of size 8 at addr ffffffff989ef250 by task kunit_try_catch/316

    CPU: 17 PID: 316 Comm: kunit_try_catch Not tainted
    5.5.0-rc4-next-20200106+ #1
    Hardware name: HPE ProLiant DL385 Gen10/ProLiant DL385 Gen10, BIOS A40
    03/09/2018
    Call Trace:
    dump_stack+0xa0/0xea
    print_address_description.constprop.5.cold.7+0x64/0x384
    __kasan_report.cold.8+0x7a/0xc0
    kasan_report+0x12/0x20
    __asan_load8+0x71/0xa0
    software_node_register_nodes+0x41/0x80
    pe_test_reference+0x1eb/0x1200
    kunit_try_run_case+0x6b/0xd1
    kunit_generic_run_threadfn_adapter+0x29/0x50
    kthread+0x1e6/0x210
    ret_from_fork+0x27/0x50

    The buggy address belongs to the variable:
    nodes.21544+0x30/0x920

    Memory state around the buggy address:
    ffffffff989ef100: fa fa fa fa 00 04 fa fa fa fa fa fa 00 00 00 00
    ffffffff989ef180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    >ffffffff989ef200: fa fa fa fa 00 00 00 00 00 00 fa fa fa fa fa fa
    ^
    ffffffff989ef280: 00 06 fa fa fa fa fa fa 00 00 04 fa fa fa fa fa
    ffffffff989ef300: 00 00 fa fa fa fa fa fa 00 05 fa fa fa fa fa fa
    ==================================================================
    Disabling lock debugging due to kernel taint
    ok 7 - pe_test_reference
    ok 8 - property-entry

    Fixes: c032ace71c29 ("software node: add basic tests for property entries")
    Signed-off-by: Qian Cai
    Reviewed-by: Dmitry Torokhov
    Signed-off-by: Rafael J. Wysocki

    Qian Cai
     

20 Dec, 2019

1 commit


05 Apr, 2019

1 commit


31 Jan, 2019

1 commit

  • The current async_probe test code is only testing one device allocated
    prior to driver load and only loading one device afterwards. Instead of
    doing things this way it makes much more sense to load one device per CPU
    in order to actually stress the async infrastructure. By doing this we
    should see delays significantly increase in the event of devices being
    serialized.

    In addition I have updated the test to verify that we are trying to place
    the work on the correct NUMA node when we are running in async mode. By
    doing this we can verify the best possible outcome for device and driver
    load times.

    I have added a timeout value that is used to disable the sleep and instead
    cause the probe routine to report an error indicating it timed out. By
    doing this we limit the maximum runtime for the test to 20 seconds or less.

    The last major change in this set is that I have gone through and tuned it
    for handling the massive number of possible events that will be scheduled.
    Instead of reporting the sleep for each individual device it is moved to
    only being displayed if we enable debugging.

    With this patch applied below are what a failing test and a passing test
    should look like. I elided a few hundred lines in the failing test that
    were duplicated since the system I was testing on had a massive number of
    CPU cores:

    -- Failing --
    [ 243.524697] test_async_driver_probe: registering first set of asynchronous devices...
    [ 243.535625] test_async_driver_probe: registering asynchronous driver...
    [ 243.543038] test_async_driver_probe: registration took 0 msecs
    [ 243.549559] test_async_driver_probe: registering second set of asynchronous devices...
    [ 243.568350] platform test_async_driver.447: registration took 9 msecs
    [ 243.575544] test_async_driver_probe: registering first synchronous device...
    [ 243.583454] test_async_driver_probe: registering synchronous driver...
    [ 248.825920] test_async_driver_probe: registration took 5235 msecs
    [ 248.825922] test_async_driver_probe: registering second synchronous device...
    [ 248.825928] test_async_driver test_async_driver.443: NUMA node mismatch 3 != 1
    [ 248.825932] test_async_driver test_async_driver.445: NUMA node mismatch 3 != 1
    [ 248.825935] test_async_driver test_async_driver.446: NUMA node mismatch 3 != 1
    [ 248.825939] test_async_driver test_async_driver.440: NUMA node mismatch 3 != 1
    [ 248.825943] test_async_driver test_async_driver.441: NUMA node mismatch 3 != 1
    ...
    [ 248.827150] test_async_driver test_async_driver.229: NUMA node mismatch 0 != 1
    [ 248.827158] test_async_driver test_async_driver.228: NUMA node mismatch 0 != 1
    [ 248.827220] test_async_driver test_async_driver.281: NUMA node mismatch 2 != 1
    [ 248.827229] test_async_driver test_async_driver.282: NUMA node mismatch 2 != 1
    [ 248.827240] test_async_driver test_async_driver.280: NUMA node mismatch 2 != 1
    [ 253.945834] test_async_driver test_async_driver.1: NUMA node mismatch 0 != 1
    [ 253.945878] test_sync_driver test_sync_driver.1: registration took 5119 msecs
    [ 253.961693] test_async_driver_probe: async events still pending, forcing timeout and synchronize
    [ 259.065839] test_async_driver test_async_driver.2: NUMA node mismatch 0 != 1
    [ 259.073786] test_async_driver test_async_driver.3: async probe took too long
    [ 259.081669] test_async_driver test_async_driver.3: NUMA node mismatch 0 != 1
    [ 259.089569] test_async_driver test_async_driver.4: async probe took too long
    [ 259.097451] test_async_driver test_async_driver.4: NUMA node mismatch 0 != 1
    [ 259.105338] test_async_driver test_async_driver.5: async probe took too long
    [ 259.113204] test_async_driver test_async_driver.5: NUMA node mismatch 0 != 1
    [ 259.121089] test_async_driver test_async_driver.6: async probe took too long
    [ 259.128961] test_async_driver test_async_driver.6: NUMA node mismatch 0 != 1
    [ 259.136850] test_async_driver test_async_driver.7: async probe took too long
    ...
    [ 262.124062] test_async_driver test_async_driver.221: async probe took too long
    [ 262.132130] test_async_driver test_async_driver.221: NUMA node mismatch 3 != 1
    [ 262.140206] test_async_driver test_async_driver.222: async probe took too long
    [ 262.148277] test_async_driver test_async_driver.222: NUMA node mismatch 3 != 1
    [ 262.156351] test_async_driver test_async_driver.223: async probe took too long
    [ 262.164419] test_async_driver test_async_driver.223: NUMA node mismatch 3 != 1
    [ 262.172630] test_async_driver_probe: Test failed with 222 errors and 336 warnings

    -- Passing --
    [ 105.419247] test_async_driver_probe: registering first set of asynchronous devices...
    [ 105.432040] test_async_driver_probe: registering asynchronous driver...
    [ 105.439718] test_async_driver_probe: registration took 0 msecs
    [ 105.446239] test_async_driver_probe: registering second set of asynchronous devices...
    [ 105.477986] platform test_async_driver.447: registration took 22 msecs
    [ 105.485276] test_async_driver_probe: registering first synchronous device...
    [ 105.493169] test_async_driver_probe: registering synchronous driver...
    [ 110.597981] test_async_driver_probe: registration took 5097 msecs
    [ 110.604806] test_async_driver_probe: registering second synchronous device...
    [ 115.707490] test_sync_driver test_sync_driver.1: registration took 5094 msecs
    [ 115.715478] test_async_driver_probe: completed successfully

    Signed-off-by: Alexander Duyck
    Signed-off-by: Greg Kroah-Hartman

    Alexander Duyck
     

08 Dec, 2017

2 commits

  • Now that the SPDX tag is in all driver core files, that identifies the
    license in a specific and legally-defined manner. So the extra GPL text
    wording can be removed as it is no longer needed at all.

    This is done on a quest to remove the 700+ different ways that files in
    the kernel describe the GPL license text. And there's unneeded stuff
    like the address (sometimes incorrect) for the FSF which is never
    needed.

    No copyright headers or other non-license-description text was removed.

    Cc: Johannes Berg
    Cc: "Luis R. Rodriguez"
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • It's good to have SPDX identifiers in all files to make it easier to
    audit the kernel tree for correct licenses.

    Update the driver core files files with the correct SPDX license
    identifier based on the license text in the file itself. The SPDX
    identifier is a legally binding shorthand, which can be used instead of
    the full boiler plate text.

    This work is based on a script and data from Thomas Gleixner, Philippe
    Ombredanne, and Kate Stewart.

    Cc: Johannes Berg
    Cc: "Luis R. Rodriguez"
    Cc: William Breathitt Gray
    Cc: Thomas Gleixner
    Cc: Kate Stewart
    Cc: Philippe Ombredanne
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

17 Nov, 2017

1 commit

  • Pull driver core updates from Greg KH:
    "Here is the set of driver core / debugfs patches for 4.15-rc1.

    Not many here, mostly all are debugfs fixes to resolve some
    long-reported problems with files going away with references to them
    in userspace. There's also some SPDX cleanups for the debugfs code, as
    well as a few other minor driver core changes for issues reported by
    people.

    All of these have been in linux-next for a week or more with no
    reported issues"

    * tag 'driver-core-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    driver core: Fix device link deferred probe
    debugfs: Remove redundant license text
    debugfs: add SPDX identifiers to all debugfs files
    debugfs: defer debugfs_fsdata allocation to first usage
    debugfs: call debugfs_real_fops() only after debugfs_file_get()
    debugfs: purge obsolete SRCU based removal protection
    IB/hfi1: convert to debugfs_file_get() and -put()
    debugfs: convert to debugfs_file_get() and -put()
    debugfs: debugfs_real_fops(): drop __must_hold sparse annotation
    debugfs: implement per-file removal protection
    debugfs: add support for more elaborate ->d_fsdata
    driver core: Move device_links_purge() after bus_remove_device()
    arch_topology: Fix section miss match warning due to free_raw_capacity()
    driver-core: pr_err() strings should end with newlines

    Linus Torvalds
     

02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

20 Oct, 2017

1 commit


30 Nov, 2016

2 commits


11 Nov, 2016

1 commit

  • This test module tries to test asynchronous driver probing by having a
    driver that sleeps for an extended period of time (5 secs) in its
    probe() method. It measures the time needed to register this driver
    (with device already registered) and a new device (with driver already
    registered). The module will fail to load if the time spent in register
    call is more than half the probing sleep time.

    As a sanity check the driver will then try to synchronously register
    driver and device and fail if registration takes less than half of the
    probing sleep time.

    Signed-off-by: Dmitry Torokhov
    Reviewed-by: Olof Johansson
    Signed-off-by: Guenter Roeck
    Signed-off-by: Thierry Escande
    Signed-off-by: Greg Kroah-Hartman

    Dmitry Torokhov