02 Oct, 2020

1 commit


30 Sep, 2020

2 commits

  • The usage of in_interrupt() in non-core code is phased out. Ideally the
    information of the calling context should be passed by the callers or the
    functions be split as appropriate.

    cfhsi_rx_desc() and cfhsi_rx_pld() use in_interrupt() to distinguish if
    they should use netif_rx() or netif_rx_ni() for receiving packets.

    The attempt to consolidate the code by passing an arguemnt or by
    distangling it failed due lack of knowledge about this driver and because
    the call chains are hard to follow.

    As a stop gap use netif_rx_any_context() which invokes the correct code path
    depending on context and confines the in_interrupt() usage to core code.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Thomas Gleixner
    Signed-off-by: David S. Miller

    Sebastian Andrzej Siewior
     
  • While chasing in_interrupt() (ab)use in drivers it turned out that the
    caif_spi driver has never been in use since the driver was merged 10 years
    ago. There never was any matching code which provides a platform device.

    The driver has not seen any update (asided of treewide changes and
    cleanups) since 8 years and the maintainers vanished from the planet.

    So analysing the potential contexts and the (in)correctness of
    in_interrupt() usage is just a pointless exercise.

    Remove the cruft.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: David S. Miller

    Thomas Gleixner
     

29 Jun, 2020

4 commits

  • The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
    which is a typedef for an enum type, but the implementation in this
    driver returns an 'int'.

    Fix this by returning 'netdev_tx_t' in this driver too.

    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: David S. Miller

    Luc Van Oostenryck
     
  • The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
    which is a typedef for an enum type, but the implementation in this
    driver returns an 'int'.

    Fix this by returning 'netdev_tx_t' in this driver too and
    returning NETDEV_TX_OK instead of 0 accordingly.

    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: David S. Miller

    Luc Van Oostenryck
     
  • The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
    which is a typedef for an enum type, but the implementation in this
    driver returns an 'int'.

    Fix this by returning 'netdev_tx_t' in this driver too.

    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: David S. Miller

    Luc Van Oostenryck
     
  • The method ndo_start_xmit() is defined as returning an 'netdev_tx_t',
    which is a typedef for an enum type, but the implementation in this
    driver returns an 'int'.

    Fix this by returning 'netdev_tx_t' in this driver too and
    returning NETDEV_TX_OK instead of 0 accordingly.

    Signed-off-by: Luc Van Oostenryck
    Signed-off-by: David S. Miller

    Luc Van Oostenryck
     

14 Jun, 2020

1 commit

  • Since commit 84af7a6194e4 ("checkpatch: kconfig: prefer 'help' over
    '---help---'"), the number of '---help---' has been gradually
    decreasing, but there are still more than 2400 instances.

    This commit finishes the conversion. While I touched the lines,
    I also fixed the indentation.

    There are a variety of indentation styles found.

    a) 4 spaces + '---help---'
    b) 7 spaces + '---help---'
    c) 8 spaces + '---help---'
    d) 1 space + 1 tab + '---help---'
    e) 1 tab + '---help---' (correct indentation)
    f) 1 tab + 1 space + '---help---'
    g) 1 tab + 2 spaces + '---help---'

    In order to convert all of them to 1 tab + 'help', I ran the
    following commend:

    $ find . -name 'Kconfig*' | xargs sed -i 's/^[[:space:]]*---help---/\thelp/'

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

11 Jun, 2020

1 commit

  • Pull virtio updates from Michael Tsirkin:

    - virtio-mem: paravirtualized memory hotplug

    - support doorbell mapping for vdpa

    - config interrupt support in ifc

    - fixes all over the place

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (40 commits)
    vhost/test: fix up after API change
    virtio_mem: convert device block size into 64bit
    virtio-mem: drop unnecessary initialization
    ifcvf: implement config interrupt in IFCVF
    vhost: replace -1 with VHOST_FILE_UNBIND in ioctls
    vhost_vdpa: Support config interrupt in vdpa
    ifcvf: ignore continuous setting same status value
    virtio-mem: Don't rely on implicit compiler padding for requests
    virtio-mem: Try to unplug the complete online memory block first
    virtio-mem: Use -ETXTBSY as error code if the device is busy
    virtio-mem: Unplug subblocks right-to-left
    virtio-mem: Drop manual check for already present memory
    virtio-mem: Add parent resource for all added "System RAM"
    virtio-mem: Better retry handling
    virtio-mem: Offline and remove completely unplugged memory blocks
    mm/memory_hotplug: Introduce offline_and_remove_memory()
    virtio-mem: Allow to offline partially unplugged memory blocks
    mm: Allow to offline unmovable PageOffline() pages via MEM_GOING_OFFLINE
    virtio-mem: Paravirtualized memory hotunplug part 2
    virtio-mem: Paravirtualized memory hotunplug part 1
    ...

    Linus Torvalds
     

02 Jun, 2020

1 commit


29 Apr, 2020

1 commit


20 Apr, 2020

1 commit

  • vhost is currently broken on the some ARM configs.

    The reason is that the ring element addresses are passed between
    components with different alignments assumptions. Thus, if
    guest selects a pointer and host then gets and dereferences
    it, then alignment assumed by the host's compiler might be
    greater than the actual alignment of the pointer.
    compiler on the host from assuming pointer is aligned.

    This actually triggers on ARM with -mabi=apcs-gnu - which is a
    deprecated configuration. With this OABI, compiler assumes that
    all structures are 4 byte aligned - which is stronger than
    virtio guarantees for available and used rings, which are
    merely 2 bytes. Thus a guest without -mabi=apcs-gnu running
    on top of host with -mabi=apcs-gnu will be broken.

    The correct fix is to force alignment of structures - however
    that is an intrusive fix that's best deferred until the next release.

    We didn't previously support such ancient systems at all - this surfaced
    after vdpa support prompted removing dependency of vhost on
    VIRTULIZATION. So for now, let's just add something along the lines of

    depends on !ARM || AEABI

    to the virtio Kconfig declaration, and add a comment that it has to do
    with struct member alignment.

    Note: we can't make VHOST and VHOST_RING themselves have
    a dependency since these are selected. Add a new symbol for that.

    We should be able to drop this dependency down the road.

    Fixes: 20c384f1ea1a0bc7 ("vhost: refine vhost and vringh kconfig")
    Suggested-by: Ard Biesheuvel
    Suggested-by: Richard Earnshaw
    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     

09 Apr, 2020

1 commit

  • Pull virtio updates from Michael Tsirkin:

    - Some bug fixes

    - The new vdpa subsystem with two first drivers

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    virtio-balloon: Revert "virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM"
    vdpa: move to drivers/vdpa
    virtio: Intel IFC VF driver for VDPA
    vdpasim: vDPA device simulator
    vhost: introduce vDPA-based backend
    virtio: introduce a vDPA based transport
    vDPA: introduce vDPA bus
    vringh: IOTLB support
    vhost: factor out IOTLB
    vhost: allow per device message handler
    vhost: refine vhost and vringh kconfig
    virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
    virtio-net: Introduce hash report feature
    virtio-net: Introduce RSS receive steering feature
    virtio-net: Introduce extended RSC feature
    tools/virtio: option to build an out of tree module

    Linus Torvalds
     

02 Apr, 2020

1 commit

  • Currently, CONFIG_VHOST depends on CONFIG_VIRTUALIZATION. But vhost is
    not necessarily for VM since it's a generic userspace and kernel
    communication protocol. Such dependency may prevent archs without
    virtualization support from using vhost.

    To solve this, a dedicated vhost menu is created under drivers so
    CONIFG_VHOST can be decoupled out of CONFIG_VIRTUALIZATION.

    While at it, also squash Kconfig.vringh into vhost Kconfig file. This
    avoids the trick of conditional inclusion from VOP or CAIF. Then it
    will be easier to introduce new vringh users and common dependency for
    both vringh and vhost.

    Signed-off-by: Jason Wang
    Link: https://lore.kernel.org/r/20200326140125.19794-2-jasowang@redhat.com
    Signed-off-by: Michael S. Tsirkin

    Jason Wang
     

16 Mar, 2020

1 commit


17 Dec, 2019

1 commit


28 Nov, 2019

1 commit

  • Pull driver core updates from Greg KH:
    "Here is the "big" set of driver core patches for 5.5-rc1

    There's a few minor cleanups and fixes in here, but the majority of
    the patches in here fall into two buckets:

    - debugfs api cleanups and fixes

    - driver core device link support for boot dependancy issues

    The debugfs api cleanups are working to slowly refactor the debugfs
    apis so that it is even harder to use incorrectly. That work has been
    happening for the past few kernel releases and will continue over
    time, it's a long-term project/goal

    The driver core device link support missed 5.4 by just a bit, so it's
    been sitting and baking for many months now. It's from Saravana Kannan
    to help resolve the problems that DT-based systems have at boot time
    with dependancy graphs and kernel modules. Turns out that no one has
    actually tried to build a generic arm64 kernel with loads of modules
    and have it "just work" for a variety of platforms (like a distro
    kernel). The big problem turned out to be a lack of dependency
    information between different areas of DT entries, and the work here
    resolves that problem and now allows devices to boot properly, and
    quicker than a monolith kernel.

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

    * tag 'driver-core-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (68 commits)
    tracing: Remove unnecessary DEBUG_FS dependency
    of: property: Add device link support for interrupt-parent, dmas and -gpio(s)
    debugfs: Fix !DEBUG_FS debugfs_create_automount
    of: property: Add device link support for "iommu-map"
    of: property: Fix the semantics of of_is_ancestor_of()
    i2c: of: Populate fwnode in of_i2c_get_board_info()
    drivers: base: Fix Kconfig indentation
    firmware_loader: Fix labels with comma for builtin firmware
    driver core: Allow device link operations inside sync_state()
    driver core: platform: Declare ret variable only once
    cpu-topology: declare parse_acpi_topology in
    crypto: hisilicon: no need to check return value of debugfs_create functions
    driver core: platform: use the correct callback type for bus_find_device
    firmware_class: make firmware caching configurable
    driver core: Clarify documentation for fwnode_operations.add_links()
    mailbox: tegra: Fix superfluous IRQ error message
    net: caif: Fix debugfs on 64-bit platforms
    mac80211: Use debugfs_create_xul() helper
    media: c8sectpfe: no need to check return value of debugfs_create functions
    of: property: Add device link support for iommus, mboxes and io-channels
    ...

    Linus Torvalds
     

22 Nov, 2019

1 commit


09 Nov, 2019

1 commit

  • "ser_device.state" is "unsigned long", i.e. 32-bit or 64-bit, depending
    on the platform. Hence casting its address to "u32 *", and calling
    debugfs_create_x32() breaks operation on 64-bit platforms.

    Fix this by using the new debugfs_create_xul() helper instead.

    Fixes: 9b27105b4a44c54b ("net-caif-driver: add CAIF serial driver (ldisc)")
    Signed-off-by: Geert Uytterhoeven
    Link: https://lore.kernel.org/r/20191025094130.26033-4-geert+renesas@glider.be
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     

03 Oct, 2019

2 commits


12 Aug, 2019

1 commit


18 Jul, 2019

1 commit


31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    license terms gnu general public license gpl version 2

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

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

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Alexios Zavras
    Reviewed-by: Steve Winslow
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190528170027.447718015@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


13 Feb, 2019

1 commit

  • The DMA API generally relies on a struct device to work properly, and
    only barely works without one for legacy reasons. Pass the easily
    available struct device from the platform_device to remedy this.

    Also use the proper Kconfig symbol to check for DMA API availability.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: David S. Miller

    Christoph Hellwig
     

30 Jan, 2019

1 commit


27 Mar, 2018

1 commit


22 Jan, 2018

1 commit

  • The pointer pfrm is initialized and then later re-assigned the same
    value and hence the second assignment is redundant and can be removed.

    Cleans up clang warning:
    drivers/net/caif/caif_hsi.c:222:6: warning: Value stored to 'pfrm'
    during its initialization is never read

    Signed-off-by: Colin Ian King
    Signed-off-by: David S. Miller

    Colin Ian King
     

22 Nov, 2017

1 commit

  • This converts all remaining cases of the old setup_timer() API into using
    timer_setup(), where the callback argument is the structure already
    holding the struct timer_list. These should have no behavioral changes,
    since they just change which pointer is passed into the callback with
    the same available pointers after conversion. It handles the following
    examples, in addition to some other variations.

    Casting from unsigned long:

    void my_callback(unsigned long data)
    {
    struct something *ptr = (struct something *)data;
    ...
    }
    ...
    setup_timer(&ptr->my_timer, my_callback, ptr);

    and forced object casts:

    void my_callback(struct something *ptr)
    {
    ...
    }
    ...
    setup_timer(&ptr->my_timer, my_callback, (unsigned long)ptr);

    become:

    void my_callback(struct timer_list *t)
    {
    struct something *ptr = from_timer(ptr, t, my_timer);
    ...
    }
    ...
    timer_setup(&ptr->my_timer, my_callback, 0);

    Direct function assignments:

    void my_callback(unsigned long data)
    {
    struct something *ptr = (struct something *)data;
    ...
    }
    ...
    ptr->my_timer.function = my_callback;

    have a temporary cast added, along with converting the args:

    void my_callback(struct timer_list *t)
    {
    struct something *ptr = from_timer(ptr, t, my_timer);
    ...
    }
    ...
    ptr->my_timer.function = (TIMER_FUNC_TYPE)my_callback;

    And finally, callbacks without a data assignment:

    void my_callback(unsigned long data)
    {
    ...
    }
    ...
    setup_timer(&ptr->my_timer, my_callback, 0);

    have their argument renamed to verify they're unused during conversion:

    void my_callback(struct timer_list *unused)
    {
    ...
    }
    ...
    timer_setup(&ptr->my_timer, my_callback, 0);

    The conversion is done with the following Coccinelle script:

    spatch --very-quiet --all-includes --include-headers \
    -I ./arch/x86/include -I ./arch/x86/include/generated \
    -I ./include -I ./arch/x86/include/uapi \
    -I ./arch/x86/include/generated/uapi -I ./include/uapi \
    -I ./include/generated/uapi --include ./include/linux/kconfig.h \
    --dir . \
    --cocci-file ~/src/data/timer_setup.cocci

    @fix_address_of@
    expression e;
    @@

    setup_timer(
    -&(e)
    +&e
    , ...)

    // Update any raw setup_timer() usages that have a NULL callback, but
    // would otherwise match change_timer_function_usage, since the latter
    // will update all function assignments done in the face of a NULL
    // function initialization in setup_timer().
    @change_timer_function_usage_NULL@
    expression _E;
    identifier _timer;
    type _cast_data;
    @@

    (
    -setup_timer(&_E->_timer, NULL, _E);
    +timer_setup(&_E->_timer, NULL, 0);
    |
    -setup_timer(&_E->_timer, NULL, (_cast_data)_E);
    +timer_setup(&_E->_timer, NULL, 0);
    |
    -setup_timer(&_E._timer, NULL, &_E);
    +timer_setup(&_E._timer, NULL, 0);
    |
    -setup_timer(&_E._timer, NULL, (_cast_data)&_E);
    +timer_setup(&_E._timer, NULL, 0);
    )

    @change_timer_function_usage@
    expression _E;
    identifier _timer;
    struct timer_list _stl;
    identifier _callback;
    type _cast_func, _cast_data;
    @@

    (
    -setup_timer(&_E->_timer, _callback, _E);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E->_timer, &_callback, _E);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E->_timer, _callback, (_cast_data)_E);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E->_timer, &_callback, (_cast_data)_E);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E->_timer, (_cast_func)_callback, _E);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E->_timer, (_cast_func)&_callback, _E);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E->_timer, (_cast_func)_callback, (_cast_data)_E);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E->_timer, (_cast_func)&_callback, (_cast_data)_E);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E._timer, _callback, (_cast_data)_E);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_E._timer, _callback, (_cast_data)&_E);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_E._timer, &_callback, (_cast_data)_E);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_E._timer, &_callback, (_cast_data)&_E);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)_E);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_E._timer, (_cast_func)_callback, (_cast_data)&_E);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)_E);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_E._timer, (_cast_func)&_callback, (_cast_data)&_E);
    +timer_setup(&_E._timer, _callback, 0);
    |
    _E->_timer@_stl.function = _callback;
    |
    _E->_timer@_stl.function = &_callback;
    |
    _E->_timer@_stl.function = (_cast_func)_callback;
    |
    _E->_timer@_stl.function = (_cast_func)&_callback;
    |
    _E._timer@_stl.function = _callback;
    |
    _E._timer@_stl.function = &_callback;
    |
    _E._timer@_stl.function = (_cast_func)_callback;
    |
    _E._timer@_stl.function = (_cast_func)&_callback;
    )

    // callback(unsigned long arg)
    @change_callback_handle_cast
    depends on change_timer_function_usage@
    identifier change_timer_function_usage._callback;
    identifier change_timer_function_usage._timer;
    type _origtype;
    identifier _origarg;
    type _handletype;
    identifier _handle;
    @@

    void _callback(
    -_origtype _origarg
    +struct timer_list *t
    )
    {
    (
    ... when != _origarg
    _handletype *_handle =
    -(_handletype *)_origarg;
    +from_timer(_handle, t, _timer);
    ... when != _origarg
    |
    ... when != _origarg
    _handletype *_handle =
    -(void *)_origarg;
    +from_timer(_handle, t, _timer);
    ... when != _origarg
    |
    ... when != _origarg
    _handletype *_handle;
    ... when != _handle
    _handle =
    -(_handletype *)_origarg;
    +from_timer(_handle, t, _timer);
    ... when != _origarg
    |
    ... when != _origarg
    _handletype *_handle;
    ... when != _handle
    _handle =
    -(void *)_origarg;
    +from_timer(_handle, t, _timer);
    ... when != _origarg
    )
    }

    // callback(unsigned long arg) without existing variable
    @change_callback_handle_cast_no_arg
    depends on change_timer_function_usage &&
    !change_callback_handle_cast@
    identifier change_timer_function_usage._callback;
    identifier change_timer_function_usage._timer;
    type _origtype;
    identifier _origarg;
    type _handletype;
    @@

    void _callback(
    -_origtype _origarg
    +struct timer_list *t
    )
    {
    + _handletype *_origarg = from_timer(_origarg, t, _timer);
    +
    ... when != _origarg
    - (_handletype *)_origarg
    + _origarg
    ... when != _origarg
    }

    // Avoid already converted callbacks.
    @match_callback_converted
    depends on change_timer_function_usage &&
    !change_callback_handle_cast &&
    !change_callback_handle_cast_no_arg@
    identifier change_timer_function_usage._callback;
    identifier t;
    @@

    void _callback(struct timer_list *t)
    { ... }

    // callback(struct something *handle)
    @change_callback_handle_arg
    depends on change_timer_function_usage &&
    !match_callback_converted &&
    !change_callback_handle_cast &&
    !change_callback_handle_cast_no_arg@
    identifier change_timer_function_usage._callback;
    identifier change_timer_function_usage._timer;
    type _handletype;
    identifier _handle;
    @@

    void _callback(
    -_handletype *_handle
    +struct timer_list *t
    )
    {
    + _handletype *_handle = from_timer(_handle, t, _timer);
    ...
    }

    // If change_callback_handle_arg ran on an empty function, remove
    // the added handler.
    @unchange_callback_handle_arg
    depends on change_timer_function_usage &&
    change_callback_handle_arg@
    identifier change_timer_function_usage._callback;
    identifier change_timer_function_usage._timer;
    type _handletype;
    identifier _handle;
    identifier t;
    @@

    void _callback(struct timer_list *t)
    {
    - _handletype *_handle = from_timer(_handle, t, _timer);
    }

    // We only want to refactor the setup_timer() data argument if we've found
    // the matching callback. This undoes changes in change_timer_function_usage.
    @unchange_timer_function_usage
    depends on change_timer_function_usage &&
    !change_callback_handle_cast &&
    !change_callback_handle_cast_no_arg &&
    !change_callback_handle_arg@
    expression change_timer_function_usage._E;
    identifier change_timer_function_usage._timer;
    identifier change_timer_function_usage._callback;
    type change_timer_function_usage._cast_data;
    @@

    (
    -timer_setup(&_E->_timer, _callback, 0);
    +setup_timer(&_E->_timer, _callback, (_cast_data)_E);
    |
    -timer_setup(&_E._timer, _callback, 0);
    +setup_timer(&_E._timer, _callback, (_cast_data)&_E);
    )

    // If we fixed a callback from a .function assignment, fix the
    // assignment cast now.
    @change_timer_function_assignment
    depends on change_timer_function_usage &&
    (change_callback_handle_cast ||
    change_callback_handle_cast_no_arg ||
    change_callback_handle_arg)@
    expression change_timer_function_usage._E;
    identifier change_timer_function_usage._timer;
    identifier change_timer_function_usage._callback;
    type _cast_func;
    typedef TIMER_FUNC_TYPE;
    @@

    (
    _E->_timer.function =
    -_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E->_timer.function =
    -&_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E->_timer.function =
    -(_cast_func)_callback;
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E->_timer.function =
    -(_cast_func)&_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E._timer.function =
    -_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E._timer.function =
    -&_callback;
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E._timer.function =
    -(_cast_func)_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    |
    _E._timer.function =
    -(_cast_func)&_callback
    +(TIMER_FUNC_TYPE)_callback
    ;
    )

    // Sometimes timer functions are called directly. Replace matched args.
    @change_timer_function_calls
    depends on change_timer_function_usage &&
    (change_callback_handle_cast ||
    change_callback_handle_cast_no_arg ||
    change_callback_handle_arg)@
    expression _E;
    identifier change_timer_function_usage._timer;
    identifier change_timer_function_usage._callback;
    type _cast_data;
    @@

    _callback(
    (
    -(_cast_data)_E
    +&_E->_timer
    |
    -(_cast_data)&_E
    +&_E._timer
    |
    -_E
    +&_E->_timer
    )
    )

    // If a timer has been configured without a data argument, it can be
    // converted without regard to the callback argument, since it is unused.
    @match_timer_function_unused_data@
    expression _E;
    identifier _timer;
    identifier _callback;
    @@

    (
    -setup_timer(&_E->_timer, _callback, 0);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E->_timer, _callback, 0L);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E->_timer, _callback, 0UL);
    +timer_setup(&_E->_timer, _callback, 0);
    |
    -setup_timer(&_E._timer, _callback, 0);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_E._timer, _callback, 0L);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_E._timer, _callback, 0UL);
    +timer_setup(&_E._timer, _callback, 0);
    |
    -setup_timer(&_timer, _callback, 0);
    +timer_setup(&_timer, _callback, 0);
    |
    -setup_timer(&_timer, _callback, 0L);
    +timer_setup(&_timer, _callback, 0);
    |
    -setup_timer(&_timer, _callback, 0UL);
    +timer_setup(&_timer, _callback, 0);
    |
    -setup_timer(_timer, _callback, 0);
    +timer_setup(_timer, _callback, 0);
    |
    -setup_timer(_timer, _callback, 0L);
    +timer_setup(_timer, _callback, 0);
    |
    -setup_timer(_timer, _callback, 0UL);
    +timer_setup(_timer, _callback, 0);
    )

    @change_callback_unused_data
    depends on match_timer_function_unused_data@
    identifier match_timer_function_unused_data._callback;
    type _origtype;
    identifier _origarg;
    @@

    void _callback(
    -_origtype _origarg
    +struct timer_list *unused
    )
    {
    ... when != _origarg
    }

    Signed-off-by: Kees Cook

    Kees Cook
     

04 Nov, 2017

1 commit


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
     

22 Sep, 2017

1 commit


06 Jul, 2017

1 commit

  • Pull networking updates from David Miller:
    "Reasonably busy this cycle, but perhaps not as busy as in the 4.12
    merge window:

    1) Several optimizations for UDP processing under high load from
    Paolo Abeni.

    2) Support pacing internally in TCP when using the sch_fq packet
    scheduler for this is not practical. From Eric Dumazet.

    3) Support mutliple filter chains per qdisc, from Jiri Pirko.

    4) Move to 1ms TCP timestamp clock, from Eric Dumazet.

    5) Add batch dequeueing to vhost_net, from Jason Wang.

    6) Flesh out more completely SCTP checksum offload support, from
    Davide Caratti.

    7) More plumbing of extended netlink ACKs, from David Ahern, Pablo
    Neira Ayuso, and Matthias Schiffer.

    8) Add devlink support to nfp driver, from Simon Horman.

    9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa
    Prabhu.

    10) Add stack depth tracking to BPF verifier and use this information
    in the various eBPF JITs. From Alexei Starovoitov.

    11) Support XDP on qed device VFs, from Yuval Mintz.

    12) Introduce BPF PROG ID for better introspection of installed BPF
    programs. From Martin KaFai Lau.

    13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann.

    14) For loads, allow narrower accesses in bpf verifier checking, from
    Yonghong Song.

    15) Support MIPS in the BPF selftests and samples infrastructure, the
    MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David
    Daney.

    16) Support kernel based TLS, from Dave Watson and others.

    17) Remove completely DST garbage collection, from Wei Wang.

    18) Allow installing TCP MD5 rules using prefixes, from Ivan
    Delalande.

    19) Add XDP support to Intel i40e driver, from Björn Töpel

    20) Add support for TC flower offload in nfp driver, from Simon
    Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub
    Kicinski, and Bert van Leeuwen.

    21) IPSEC offloading support in mlx5, from Ilan Tayari.

    22) Add HW PTP support to macb driver, from Rafal Ozieblo.

    23) Networking refcount_t conversions, From Elena Reshetova.

    24) Add sock_ops support to BPF, from Lawrence Brako. This is useful
    for tuning the TCP sockopt settings of a group of applications,
    currently via CGROUPs"

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits)
    net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap
    dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap
    cxgb4: Support for get_ts_info ethtool method
    cxgb4: Add PTP Hardware Clock (PHC) support
    cxgb4: time stamping interface for PTP
    nfp: default to chained metadata prepend format
    nfp: remove legacy MAC address lookup
    nfp: improve order of interfaces in breakout mode
    net: macb: remove extraneous return when MACB_EXT_DESC is defined
    bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case
    bpf: fix return in load_bpf_file
    mpls: fix rtm policy in mpls_getroute
    net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_route.refcount from atomic_t to refcount_t
    net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t
    net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t
    net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t
    ...

    Linus Torvalds
     

04 Jul, 2017

1 commit

  • Pull driver core updates from Greg KH:
    "Here is the big driver core update for 4.13-rc1.

    The large majority of this is a lot of cleanup of old fields in the
    driver core structures and their remaining usages in random drivers.
    All of those fixes have been reviewed by the various subsystem
    maintainers. There's also some small firmware updates in here, a new
    kobject uevent api interface that makes userspace interaction easier,
    and a few other minor things.

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

    * tag 'driver-core-4.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (56 commits)
    arm: mach-rpc: ecard: fix build error
    zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()
    driver-core: remove struct bus_type.dev_attrs
    powerpc: vio_cmo: use dev_groups and not dev_attrs for bus_type
    powerpc: vio: use dev_groups and not dev_attrs for bus_type
    USB: usbip: convert to use DRIVER_ATTR_RW
    s390: drivers: convert to use DRIVER_ATTR_RO/WO
    platform: thinkpad_acpi: convert to use DRIVER_ATTR_RO/RW
    pcmcia: ds: convert to use DRIVER_ATTR_RO
    wireless: ipw2x00: convert to use DRIVER_ATTR_RW
    net: ehea: convert to use DRIVER_ATTR_RO
    net: caif: convert to use DRIVER_ATTR_RO
    TTY: hvc: convert to use DRIVER_ATTR_RW
    PCI: pci-driver: convert to use DRIVER_ATTR_WO
    IB: nes: convert to use DRIVER_ATTR_RW
    HID: hid-core: convert to use DRIVER_ATTR_RO and drv_groups
    arm: ecard: fix dev_groups patch typo
    tty: serdev: use dev_groups and not dev_attrs for bus_type
    sparc: vio: use dev_groups and not dev_attrs for bus_type
    hid: intel-ish-hid: use dev_groups and not dev_attrs for bus_type
    ...

    Linus Torvalds
     

27 Jun, 2017

2 commits


21 Jun, 2017

1 commit


16 Jun, 2017

1 commit

  • A common pattern with skb_put() is to just want to memcpy()
    some data into the new space, introduce skb_put_data() for
    this.

    An spatch similar to the one for skb_put_zero() converts many
    of the places using it:

    @@
    identifier p, p2;
    expression len, skb, data;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, len);
    |
    -memcpy(p, data, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb, data;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, sizeof(*p));
    |
    -memcpy(p, data, sizeof(*p));
    )

    @@
    expression skb, len, data;
    @@
    -memcpy(skb_put(skb, len), data, len);
    +skb_put_data(skb, data, len);

    (again, manually post-processed to retain some comments)

    Reviewed-by: Stephen Hemminger
    Signed-off-by: Johannes Berg
    Signed-off-by: David S. Miller

    Johannes Berg
     

12 Jun, 2017

1 commit