1. Sep 03, 2019
    • Colin Ian King's avatar
      rtw88: remove redundant assignment to pointer debugfs_topdir · 9f7d65fb
      Colin Ian King authored
      
      
      Pointer debugfs_topdir is initialized to a value that is never read
      and it is re-assigned later. The initialization is redundant and can
      be removed.
      
      Addresses-Coverity: ("Unused value")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      9f7d65fb
    • Guenter Roeck's avatar
      rtw88: drop unused rtw_coex_coex_dm_reset() · d74d0767
      Guenter Roeck authored
      0day reports:
      
      sparse warnings:
      
      drivers/net/wireless/realtek/rtw88/coex.c:2457:6: sparse:
      	symbol 'rtw_coex_coex_dm_reset' was not declared. Should it be static?
      
      rtw_coex_coex_dm_reset() is not called. Remove it.
      
      Fixes: 4136214f
      
       ("rtw88: add BT co-existence support")
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Signed-off-by: default avatarGuenter Roeck <groeck@chromium.org>
      Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      d74d0767
    • Dan Carpenter's avatar
      rtw88: Fix an error message · 52929cad
      Dan Carpenter authored
      The WARN_ON() macro takes a condition, not a warning message.  I've
      changed this to use WARN() instead.
      
      Fixes: 4136214f
      
       ("rtw88: add BT co-existence support")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      52929cad
    • Larry Finger's avatar
      rtlwifi: rtl8192ce: Fix incorrect returned values · fe025ef7
      Larry Finger authored
      In commit 98fd8db5 ("rtlwifi: rtl8192ce: Convert macros that set
      descriptor"), all the routines that get fields from a descriptor
      were changed to return signed integer values. This is incorrect for the
      routines that get the entire 32-bit word. In this case, an unsigned
      quantity is required.
      
      Fixes: 98fd8db5
      
       ("rtlwifi: rtl8192ce: Convert macros that set descriptor")
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      fe025ef7
    • Larry Finger's avatar
      rtlwifi: rtl8188ee: Fix incorrect returned values · 38fcdcbd
      Larry Finger authored
      In commit 36eda756 ("rtlwifi: rtl8188ee: Convert macros that set
      descriptor"), all the routines that get fields from a descriptor were
      changed to return signed integer values. This is incorrect for the
      routines that get the entire 32-bit word. In this case, an unsigned
      quantity is required.
      
      Fixes: 36eda756
      
       ("rtlwifi: rtl8188ee: Convert macros that set descriptor")
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      38fcdcbd
    • Larry Finger's avatar
      rtlwifi: rtl8821ae: Fix incorrect returned values · 3bf404b4
      Larry Finger authored
      In commit bd421dab ("rtlwifi: rtl8821ae: Convert macros that set
      descriptor"), all the routines that get fields from a descriptor
      were changed to return signed integer values. This is incorrect for the
      routines that get the entire 32-bit word. In this case, an unsigned
      quantity is required.
      
      Fixes: bd421dab
      
       ("rtlwifi: rtl8821ae: Convert macros that set descriptor")
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      3bf404b4
    • Larry Finger's avatar
      rtlwifi: rtl8192cu: Convert inline routines to little-endian words · afd708f7
      Larry Finger authored
      
      
      In this step, the read/write routines for the descriptors are converted
      to use __le32 quantities, thus a lot of casts can be removed. Callback
      routines still use the 8-bit arrays, but these are changed within the
      specified routine.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      afd708f7
    • Larry Finger's avatar
      rtlwifi: rtl8192cu: Convert macros that set descriptor · 3925ae06
      Larry Finger authored
      
      
      As a first step in the conversion, the macros that set the RX and TX
      descriptors are converted to static inline routines, and the names are
      changed from upper to lower case. To minimize the changes in a given
      step, the input descriptor information is left as as a byte array
      (u8 *), even though it should be a little-endian word array (__le32 *).
      That will be changed in the next patch.
      
      Several places where checkpatch.pl complains about a space after a cast
      and other warnings are fixed.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      3925ae06
    • Larry Finger's avatar
      rtlwifi: rtl8192cu: Replace local bit manipulation macros · 08142049
      Larry Finger authored
      
      
      This driver uses a set of local macros to manipulate the TX and RX
      descriptors, which are all little-endian quantities. These macros
      are replaced by the bitfield macros le32p_replace_bits() and
      le32_get_bits(). In several places, the macros operated on an entire
      32-bit word. In these cases, a direct read or replacement is used.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      08142049
    • Larry Finger's avatar
      rtlwifi: rtl8192cu: Remove unused GET_XXX and SET_XXX · 4170941e
      Larry Finger authored
      
      
      As the first step in converting from macros that get/set information
      in the RX and TX descriptors, unused macros are being removed.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      4170941e
    • Larry Finger's avatar
      rtlwifi: rtl8192ee: Remove some variable initializations · 9dc35d8a
      Larry Finger authored
      
      
      A number of variables are initialized when declared that set later in the
      routine, thus the initialization can be removed.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      9dc35d8a
    • Larry Finger's avatar
      rtlwifi: rtl8192ee: Convert inline routines to little-endian words · 200e8bd4
      Larry Finger authored
      
      
      In this step, the read/write routines for the descriptors are converted
      to use __le32 quantities, thus a lot of casts can be removed. Callback
      routines still use the 8-bit arrays, but these are changed within the
      specified routine.
      
      The macro that cleared a descriptor has now been converted into an inline
      routine.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      200e8bd4
    • Larry Finger's avatar
      rtlwifi: rtl8192ee: Convert macros that set descriptor · 7f1c7460
      Larry Finger authored
      
      
      As a first step in the conversion, the macros that set the RX and TX
      descriptors are converted to static inline routines, and the names are
      changed from upper to lower case. To minimize the changes in a given
      step, the input descriptor information is left as as a byte array
      (u8 *), even though it should be a little-endian word array (__le32 *).
      That will be changed in the next patch.
      
      Several places where checkpatch.pl reports lines too long are fixed.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      7f1c7460
    • Larry Finger's avatar
      rtlwifi: rtl8192ee: Replace local bit manipulation macros · 11f92ca1
      Larry Finger authored
      
      
      This driver uses a set of local macros to manipulate the RX and TX
      descriptors, which are all little-endian quantities. These macros
      are replaced by the bitfield macros le32p_replace_bits() and
      le32_get_bits(). In several places, the macros operated on an entire
      32-bit word. In these cases, a direct read or replacement is used.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      11f92ca1
    • Larry Finger's avatar
      rtlwifi: rtl8192ee: Remove unused GET_XXX and SET_XXX · 8ef113ff
      Larry Finger authored
      
      
      As the first step in converting from macros that get/set information
      in the RX and TX descriptors, unused macros are being removed.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      8ef113ff
    • Larry Finger's avatar
      rtlwifi: rtl_pci: Fix memory leak when hardware init fails · 8cc782cd
      Larry Finger authored
      
      
      If the call to hw_init() fails for any of the drivers, the driver will
      leak memory that was allocated in BT coexistence setup. Technically, each
      of the drivers should have done this free; however placing it in rtl_pci
      fixes all the drivers with only a single patch.
      
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      8cc782cd
    • YueHaibing's avatar
      rtlwifi: remove unused variables 'RTL8712_SDIO_EFUSE_TABLE' and 'MAX_PGPKT_SIZE' · 84d31d3b
      YueHaibing authored
      
      
      drivers/net/wireless/realtek/rtlwifi/efuse.c:16:31:
       warning: RTL8712_SDIO_EFUSE_TABLE defined but not used [-Wunused-const-variable=]
      drivers/net/wireless/realtek/rtlwifi/efuse.c:9:17:
       warning: MAX_PGPKT_SIZE defined but not used [-Wunused-const-variable=]
      
      They are never used, so can be removed.
      
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      84d31d3b
    • Larry Finger's avatar
      rtlwifi: rtl8192cu: Fix value set in descriptor · 01bb31de
      Larry Finger authored
      In the process of converting the bit manipulation macros were converted
      to use GENMASK(), the compiler reported a value too big for the field.
      The offending statement was trying to write 0x100 into a 5-bit field.
      An accompaning comment says to set bit 3, thus the code is changed
      appropriately.
      
      This error has been in the driver since its initial submission.
      
      Fixes: 29d00a3e
      
       ("rtlwifi: rtl8192cu: Add routine trx")
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      01bb31de
    • Valdis Klētnieks's avatar
      rtlwifi: fix non-kerneldoc comment in usb.c · b6326fc0
      Valdis Klētnieks authored
      
      
      Fix spurious warning message when building with W=1:
      
        CC [M]  drivers/net/wireless/realtek/rtlwifi/usb.o
      drivers/net/wireless/realtek/rtlwifi/usb.c:243: warning: Cannot understand  * on line 243 - I thought it was a doc line
      drivers/net/wireless/realtek/rtlwifi/usb.c:760: warning: Cannot understand  * on line 760 - I thought it was a doc line
      drivers/net/wireless/realtek/rtlwifi/usb.c:790: warning: Cannot understand  * on line 790 - I thought it was a doc line
      
      Clean up the comment format.
      
      Signed-off-by: default avatarValdis Kletnieks <valdis.kletnieks@vt.edu>
      Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
      b6326fc0
    • David S. Miller's avatar
      Merge branch 'mvpp2-per-cpu-buffers' · 67538eb5
      David S. Miller authored
      
      
      Matteo Croce says:
      
      ====================
      mvpp2: per-cpu buffers
      
      This patchset workarounds an PP2 HW limitation which prevents to use
      per-cpu rx buffers.
      The first patch is just a refactor to prepare for the second one.
      The second one allocates percpu buffers if the following conditions are met:
      - CPU number is less or equal 4
      - no port is using jumbo frames
      
      If the following conditions are not met at load time, of jumbo frame is enabled
      later on, the shared allocation is reverted.
      ====================
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      67538eb5
    • Matteo Croce's avatar
      mvpp2: percpu buffers · 7d04b0b1
      Matteo Croce authored
      
      
      Every mvpp2 unit can use up to 8 buffers mapped by the BM (the HW buffer
      manager). The HW will place the frames in the buffer pool depending on the
      frame size: short (< 128 bytes), long (< 1664) or jumbo (up to 9856).
      
      As any unit can have up to 4 ports, the driver allocates only 2 pools,
      one for small and one long frames, and share them between ports.
      When the first port MTU is set higher than 1664 bytes, a third pool is
      allocated for jumbo frames.
      
      This shared allocation makes impossible to use percpu allocators,
      and creates contention between HW queues.
      
      If possible, i.e. if the number of possible CPU are less than 8 and jumbo
      frames are not used, switch to a new scheme: allocate 8 per-cpu pools for
      short and long frames and bind every pool to an RXQ.
      
      When the first port MTU is set higher than 1664 bytes, the allocation
      scheme is reverted to the old behaviour (3 shared pools), and when all
      ports MTU are lowered, the per-cpu buffers are allocated again.
      
      Signed-off-by: default avatarMatteo Croce <mcroce@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7d04b0b1
    • Matteo Croce's avatar
      mvpp2: refactor BM pool functions · 13616361
      Matteo Croce authored
      
      
      Refactor mvpp2_bm_pool_create(), mvpp2_bm_pool_destroy() and
      mvpp2_bm_pools_init() so that they accept a struct device instead
      of a struct platform_device, as they just need platform_device->dev.
      
      Removing such dependency makes the BM code more reusable in context
      where we don't have a pointer to the platform_device.
      
      Signed-off-by: default avatarMatteo Croce <mcroce@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13616361
    • Vladimir Oltean's avatar
      net: dsa: Fix off-by-one number of calls to devlink_port_unregister · 4ba0ebbc
      Vladimir Oltean authored
      When a function such as dsa_slave_create fails, currently the following
      stack trace can be seen:
      
      [    2.038342] sja1105 spi0.1: Probed switch chip: SJA1105T
      [    2.054556] sja1105 spi0.1: Reset switch and programmed static config
      [    2.063837] sja1105 spi0.1: Enabled switch tagging
      [    2.068706] fsl-gianfar soc:ethernet@2d90000 eth2: error -19 setting up slave phy
      [    2.076371] ------------[ cut here ]------------
      [    2.080973] WARNING: CPU: 1 PID: 21 at net/core/devlink.c:6184 devlink_free+0x1b4/0x1c0
      [    2.088954] Modules linked in:
      [    2.092005] CPU: 1 PID: 21 Comm: kworker/1:1 Not tainted 5.3.0-rc6-01360-g41b52e38d2b6-dirty #1746
      [    2.100912] Hardware name: Freescale LS1021A
      [    2.105162] Workqueue: events deferred_probe_work_func
      [    2.110287] [<c03133a4>] (unwind_backtrace) from [<c030d8cc>] (show_stack+0x10/0x14)
      [    2.117992] [<c030d8cc>] (show_stack) from [<c10b08d8>] (dump_stack+0xb4/0xc8)
      [    2.125180] [<c10b08d8>] (dump_stack) from [<c0349d04>] (__warn+0xe0/0xf8)
      [    2.132018] [<c0349d04>] (__warn) from [<c0349e34>] (warn_slowpath_null+0x40/0x48)
      [    2.139549] [<c0349e34>] (warn_slowpath_null) from [<c0f19d74>] (devlink_free+0x1b4/0x1c0)
      [    2.147772] [<c0f19d74>] (devlink_free) from [<c1064fc0>] (dsa_switch_teardown+0x60/0x6c)
      [    2.155907] [<c1064fc0>] (dsa_switch_teardown) from [<c1065950>] (dsa_register_switch+0x8e4/0xaa8)
      [    2.164821] [<c1065950>] (dsa_register_switch) from [<c0ba7fe4>] (sja1105_probe+0x21c/0x2ec)
      [    2.173216] [<c0ba7fe4>] (sja1105_probe) from [<c0b35948>] (spi_drv_probe+0x80/0xa4)
      [    2.180920] [<c0b35948>] (spi_drv_probe) from [<c0a4c1cc>] (really_probe+0x108/0x400)
      [    2.188711] [<c0a4c1cc>] (really_probe) from [<c0a4c694>] (driver_probe_device+0x78/0x1bc)
      [    2.196933] [<c0a4c694>] (driver_probe_device) from [<c0a4a3dc>] (bus_for_each_drv+0x58/0xb8)
      [    2.205414] [<c0a4a3dc>] (bus_for_each_drv) from [<c0a4c024>] (__device_attach+0xd0/0x168)
      [    2.213637] [<c0a4c024>] (__device_attach) from [<c0a4b1d0>] (bus_probe_device+0x84/0x8c)
      [    2.221772] [<c0a4b1d0>] (bus_probe_device) from [<c0a4b72c>] (deferred_probe_work_func+0x84/0xc4)
      [    2.230686] [<c0a4b72c>] (deferred_probe_work_func) from [<c03650a4>] (process_one_work+0x218/0x510)
      [    2.239772] [<c03650a4>] (process_one_work) from [<c03660d8>] (worker_thread+0x2a8/0x5c0)
      [    2.247908] [<c03660d8>] (worker_thread) from [<c036b348>] (kthread+0x148/0x150)
      [    2.255265] [<c036b348>] (kthread) from [<c03010e8>] (ret_from_fork+0x14/0x2c)
      [    2.262444] Exception stack(0xea965fb0 to 0xea965ff8)
      [    2.267466] 5fa0:                                     00000000 00000000 00000000 00000000
      [    2.275598] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      [    2.283729] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000
      [    2.290333] ---[ end trace ca5d506728a0581a ]---
      
      devlink_free is complaining right here:
      
      	WARN_ON(!list_empty(&devlink->port_list));
      
      This happens because devlink_port_unregister is no longer done right
      away in dsa_port_setup when a DSA_PORT_TYPE_USER has failed.
      Vivien said about this change that:
      
          Also no need to call devlink_port_unregister from within dsa_port_setup
          as this step is inconditionally handled by dsa_port_teardown on error.
      
      which is not really true. The devlink_port_unregister function _is_
      being called unconditionally from within dsa_port_setup, but not for
      this port that just failed, just for the previous ones which were set
      up.
      
      ports_teardown:
      	for (i = 0; i < port; i++)
      		dsa_port_teardown(&ds->ports[i]);
      
      Initially I was tempted to fix this by extending the "for" loop to also
      cover the port that failed during setup. But this could have potentially
      unforeseen consequences unrelated to devlink_port or even other types of
      ports than user ports, which I can't really test for. For example, if
      for some reason devlink_port_register itself would fail, then
      unconditionally unregistering it in dsa_port_teardown would not be a
      smart idea. The list might go on.
      
      So just make dsa_port_setup undo the setup it had done upon failure, and
      let the for loop undo the work of setting up the previous ports, which
      are guaranteed to be brought up to a consistent state.
      
      Fixes: 955222ca
      
       ("net: dsa: use a single switch statement for port setup")
      Signed-off-by: default avatarVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4ba0ebbc
    • Jiri Pirko's avatar
      mlx5: Add missing init_net check in FIB notifier · a21cf11b
      Jiri Pirko authored
      
      
      Take only FIB events that are happening in init_net into account. No other
      namespaces are supported.
      
      Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
      Acked-by: default avatarRoi Dayan <roid@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a21cf11b
    • David S. Miller's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 765b7590
      David S. Miller authored
      
      
      r8152 conflicts are the NAPI fixes in 'net' overlapping with
      some tasklet stuff in net-next
      
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      765b7590
    • Linus Torvalds's avatar
      Linux 5.3-rc7 · 089cf7f6
      Linus Torvalds authored
      089cf7f6
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 49ffdb4c
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char and misc driver fixes for reported issues for
        5.3-rc7
      
        Also included in here is the documentation for how we are handling
        hardware issues under embargo that everyone has finally agreed on, as
        well as a MAINTAINERS update for the suckers who agreed to handle the
        LICENSES/ files.
      
        All of these have been in linux-next last week with no reported
        issues"
      
      * tag 'char-misc-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        fsi: scom: Don't abort operations for minor errors
        vmw_balloon: Fix offline page marking with compaction
        VMCI: Release resource if the work is already queued
        Documentation/process: Embargoed hardware security issues
        lkdtm/bugs: fix build error in lkdtm_EXHAUST_STACK
        mei: me: add Tiger Lake point LP device ID
        intel_th: pci: Add Tiger Lake support
        intel_th: pci: Add support for another Lewisburg PCH
        stm class: Fix a double free of stm_source_device
        MAINTAINERS: add entry for LICENSES and SPDX stuff
        fpga: altera-ps-spi: Fix getting of optional confd gpio
      49ffdb4c
    • Linus Torvalds's avatar
      Merge tag 'usb-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 2c248f92
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small USB fixes that have been in linux-next this past
        week for 5.3-rc7
      
        They fix the usual xhci, syzbot reports, and other small issues that
        have come up last week.
      
        All have been in linux-next with no reported issues"
      
      * tag 'usb-5.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: cdc-wdm: fix race between write and disconnect due to flag abuse
        usb: host: xhci: rcar: Fix typo in compatible string matching
        usb: host: xhci-tegra: Set DMA mask correctly
        USB: storage: ums-realtek: Whitelist auto-delink support
        USB: storage: ums-realtek: Update module parameter description for auto_delink_en
        usb: host: ohci: fix a race condition between shutdown and irq
        usb: hcd: use managed device resources
        typec: tcpm: fix a typo in the comparison of pdo_max_voltage
        usb-storage: Add new JMS567 revision to unusual_devs
        usb: chipidea: udc: don't do hardware access if gadget has stopped
        usbtmc: more sanity checking for packet size
        usb: udc: lpc32xx: silence fall-through warning
      2c248f92
  2. Sep 02, 2019