1. 24 4月, 2018 1 次提交
  2. 23 4月, 2018 2 次提交
  3. 20 4月, 2018 4 次提交
    • V
      bnxt_en: Fix memory fault in bnxt_ethtool_init() · a60faa60
      Vasundhara Volam 提交于
      In some firmware images, the length of BNX_DIR_TYPE_PKG_LOG nvram type
      could be greater than the fixed buffer length of 4096 bytes allocated by
      the driver.  This was causing HWRM_NVM_READ to copy more data to the buffer
      than the allocated size, causing general protection fault.
      
      Fix the issue by allocating the exact buffer length returned by
      HWRM_NVM_FIND_DIR_ENTRY, instead of 4096.  Move the kzalloc() call
      into the bnxt_get_pkgver() function.
      
      Fixes: 3ebf6f0a ("bnxt_en: Add installed-package firmware version reporting via Ethtool GDRVINFO")
      Signed-off-by: NVasundhara Volam <vasundhara-v.volam@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a60faa60
    • D
      net: hns: Avoid action name truncation · f4ea8911
      dann frazier 提交于
      When longer interface names are used, the action names exposed in
      /proc/interrupts and /proc/irq/* maybe truncated. For example, when
      using the predictable name algorithm in systemd on a HiSilicon D05,
      I see:
      
        ubuntu@d05-3:~$  grep enahisic2i0-tx /proc/interrupts | sed 's/.* //'
        enahisic2i0-tx0
        enahisic2i0-tx1
        [...]
        enahisic2i0-tx8
        enahisic2i0-tx9
        enahisic2i0-tx1
        enahisic2i0-tx1
        enahisic2i0-tx1
        enahisic2i0-tx1
        enahisic2i0-tx1
        enahisic2i0-tx1
      
      Increase the max ring name length to allow for an interface name
      of IFNAMSIZE. After this change, I now see:
      
        $ grep enahisic2i0-tx /proc/interrupts | sed 's/.* //'
        enahisic2i0-tx0
        enahisic2i0-tx1
        enahisic2i0-tx2
        [...]
        enahisic2i0-tx8
        enahisic2i0-tx9
        enahisic2i0-tx10
        enahisic2i0-tx11
        enahisic2i0-tx12
        enahisic2i0-tx13
        enahisic2i0-tx14
        enahisic2i0-tx15
      Signed-off-by: Ndann frazier <dann.frazier@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f4ea8911
    • J
      net: stmmac: Disable ACS Feature for GMAC >= 4 · 565020aa
      Jose Abreu 提交于
      ACS Feature is currently enabled for GMAC >= 4 but the llc_snap status
      is never checked in descriptor rx_status callback. This will cause
      stmmac to always strip packets even that ACS feature is already
      stripping them.
      
      Lets be safe and disable the ACS feature for GMAC >= 4 and always strip
      the packets for this GMAC version.
      
      Fixes: 477286b5 ("stmmac: add GMAC4 core support")
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      565020aa
    • M
      net: mvpp2: Fix DMA address mask size · da42bb27
      Maxime Chevallier 提交于
      PPv2 TX/RX descriptors uses 40bits DMA addresses, but 41 bits masks were
      used (GENMASK_ULL(40, 0)).
      
      This commit fixes that by using the correct mask.
      
      Fixes: e7c5359f ("net: mvpp2: introduce PPv2.2 HW descriptors and adapt accessors")
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      da42bb27
  4. 19 4月, 2018 1 次提交
    • S
      net: qualcomm: rmnet: Fix warning seen with fill_info · 64e86fec
      Subash Abhinov Kasiviswanathan 提交于
      When the last rmnet device attached to a real device is removed, the
      real device is unregistered from rmnet. As a result, the real device
      lookup fails resulting in a warning when the fill_info handler is
      called as part of the rmnet device unregistration.
      
      Fix this by returning the rmnet flags as 0 when no real device is
      present.
      
      WARNING: CPU: 0 PID: 1779 at net/core/rtnetlink.c:3254
      rtmsg_ifinfo_build_skb+0xca/0x10d
      Modules linked in:
      CPU: 0 PID: 1779 Comm: ip Not tainted 4.16.0-11872-g7ce23672 #1
      Stack:
       7fe655f0 60371ea3 00000000 00000000
       60282bc6 6006b116 7fe65600 60371ee8
       7fe65660 6003a68c 00000000 900000000
      Call Trace:
       [<6006b116>] ? printk+0x0/0x94
       [<6001f375>] show_stack+0xfe/0x158
       [<60371ea3>] ? dump_stack_print_info+0xe8/0xf1
       [<60282bc6>] ? rtmsg_ifinfo_build_skb+0xca/0x10d
       [<6006b116>] ? printk+0x0/0x94
       [<60371ee8>] dump_stack+0x2a/0x2c
       [<6003a68c>] __warn+0x10e/0x13e
       [<6003a82c>] warn_slowpath_null+0x48/0x4f
       [<60282bc6>] rtmsg_ifinfo_build_skb+0xca/0x10d
       [<60282c4d>] rtmsg_ifinfo_event.part.37+0x1e/0x43
       [<60282c2f>] ? rtmsg_ifinfo_event.part.37+0x0/0x43
       [<60282d03>] rtmsg_ifinfo+0x24/0x28
       [<60264e86>] dev_close_many+0xba/0x119
       [<60282cdf>] ? rtmsg_ifinfo+0x0/0x28
       [<6027c225>] ? rtnl_is_locked+0x0/0x1c
       [<6026ca67>] rollback_registered_many+0x1ae/0x4ae
       [<600314be>] ? unblock_signals+0x0/0xae
       [<6026cdc0>] ? unregister_netdevice_queue+0x19/0xec
       [<6026ceec>] unregister_netdevice_many+0x21/0xa1
       [<6027c765>] rtnl_delete_link+0x3e/0x4e
       [<60280ecb>] rtnl_dellink+0x262/0x29c
       [<6027c241>] ? rtnl_get_link+0x0/0x3e
       [<6027f867>] rtnetlink_rcv_msg+0x235/0x274
      
      Fixes: be81a85f ("net: qualcomm: rmnet: Implement fill_info")
      Signed-off-by: NSubash Abhinov Kasiviswanathan <subashab@codeaurora.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      64e86fec
  5. 18 4月, 2018 1 次提交
  6. 16 4月, 2018 2 次提交
    • T
      ibmvnic: Clear pending interrupt after device reset · f23e0643
      Thomas Falcon 提交于
      Due to a firmware bug, the hypervisor can send an interrupt to a
      transmit or receive queue just prior to a partition migration, not
      allowing the device enough time to handle it and send an EOI. When
      the partition migrates, the interrupt is lost but an "EOI-pending"
      flag for the interrupt line is still set in firmware. No further
      interrupts will be sent until that flag is cleared, effectively
      freezing that queue. To workaround this, the driver will disable the
      hardware interrupt and send an H_EOI signal prior to re-enabling it.
      This will flush the pending EOI and allow the driver to continue
      operation.
      Signed-off-by: NThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f23e0643
    • M
      net: mvpp2: Fix TCAM filter reserved range · 982e0500
      Maxime Chevallier 提交于
      Marvell's PPv2 controller has a Packet Header parser, which uses a
      fixed-size TCAM array of filter entries.
      
      The mvpp2 driver reserves some ranges among the 256 TCAM entries to
      perform MAC and VID filtering. The rest of the TCAM ids are freely usable
      for other features, such as IPv4 proto matching.
      
      This commit fixes the MVPP2_PE_LAST_FREE_TID define that sets the end of
      the "free range", which included the MAC range. This could therefore allow
      some other features to use entries dedicated to MAC filtering,
      lowering the number of unicast/multicast addresses that could be allowed
      before switching to promiscuous mode.
      
      Fixes: 10fea26c ("net: mvpp2: Add support for unicast filtering")
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      982e0500
  7. 15 4月, 2018 3 次提交
  8. 13 4月, 2018 7 次提交
  9. 12 4月, 2018 6 次提交
  10. 11 4月, 2018 2 次提交
    • I
      net: aquantia: oops when shutdown on already stopped device · 9a11aff2
      Igor Russkikh 提交于
      In case netdev is closed at the moment of pci shutdown, aq_nic_stop
      gets called second time. napi_disable in that case hangs indefinitely.
      In other case, if device was never opened at all, we get oops because
      of null pointer access.
      
      We should invoke aq_nic_stop conditionally, only if device is running
      at the moment of shutdown.
      Reported-by: NDavid Arcari <darcari@redhat.com>
      Fixes: 90869ddf ("net: aquantia: Implement pci shutdown callback")
      Signed-off-by: NIgor Russkikh <igor.russkikh@aquantia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a11aff2
    • I
      net: aquantia: Regression on reset with 1.x firmware · cce96d18
      Igor Russkikh 提交于
      On ASUS XG-C100C with 1.5.44 firmware a special mode called "dirty wake"
      is active. With this mode when motherboard gets powered (but no poweron
      happens yet), NIC automatically enables powersave link and watches
      for WOL packet.
      This normally allows to powerup the PC after AC power failures.
      
      Not all motherboards or bios settings gives power to PCI slots,
      so this mode is not enabled on all the hardware.
      
      4.16 linux driver introduced full hardware reset sequence
      This is required since before that we had no NIC hardware
      reset implemented and there were side effects of "not clean start".
      
      But this full reset is incompatible with "dirty wake" WOL feature
      it keeps the PHY link in a special mode forever. As a consequence,
      driver sees no link and no traffic.
      
      To fix this we forcibly change FW state to idle state before doing
      the full reset. This makes FW to restore link state.
      
      Fixes: c8c82eb3 net: aquantia: Introduce global AQC hardware reset sequence
      Signed-off-by: NIgor Russkikh <igor.russkikh@aquantia.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cce96d18
  11. 09 4月, 2018 8 次提交
    • V
      net: thunderx: rework mac addresses list to u64 array · 9b5c4dfb
      Vadim Lomovtsev 提交于
      It is too expensive to pass u64 values via linked list, instead
      allocate array for them by overall number of mac addresses from netdev.
      
      This eventually removes multiple kmalloc() calls, aviod memory
      fragmentation and allow to put single null check on kmalloc
      return value in order to prevent a potential null pointer dereference.
      
      Addresses-Coverity-ID: 1467429 ("Dereference null return value")
      Fixes: 37c3347e ("net: thunderx: add ndo_set_rx_mode callback implementation for VF")
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NVadim Lomovtsev <Vadim.Lomovtsev@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9b5c4dfb
    • J
      devlink: convert occ_get op to separate registration · fc56be47
      Jiri Pirko 提交于
      This resolves race during initialization where the resources with
      ops are registered before driver and the structures used by occ_get
      op is initialized. So keep occ_get callbacks registered only when
      all structs are initialized.
      
      The example flows, as it is in mlxsw:
      1) driver load/asic probe:
         mlxsw_core
            -> mlxsw_sp_resources_register
              -> mlxsw_sp_kvdl_resources_register
                -> devlink_resource_register IDX
         mlxsw_spectrum
            -> mlxsw_sp_kvdl_init
              -> mlxsw_sp_kvdl_parts_init
                -> mlxsw_sp_kvdl_part_init
                  -> devlink_resource_size_get IDX (to get the current setup
                                                    size from devlink)
              -> devlink_resource_occ_get_register IDX (register current
                                                        occupancy getter)
      2) reload triggered by devlink command:
        -> mlxsw_devlink_core_bus_device_reload
          -> mlxsw_sp_fini
            -> mlxsw_sp_kvdl_fini
      	-> devlink_resource_occ_get_unregister IDX
          (struct mlxsw_sp *mlxsw_sp is freed at this point, call to occ get
           which is using mlxsw_sp would cause use-after free)
          -> mlxsw_sp_init
            -> mlxsw_sp_kvdl_init
              -> mlxsw_sp_kvdl_parts_init
                -> mlxsw_sp_kvdl_part_init
                  -> devlink_resource_size_get IDX (to get the current setup
                                                    size from devlink)
              -> devlink_resource_occ_get_register IDX (register current
                                                        occupancy getter)
      
      Fixes: d9f9b9a4 ("devlink: Add support for resource abstraction")
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fc56be47
    • E
      net/fsl_pq_mdio: Allow explicit speficition of TBIPA address · 21481189
      Esben Haabendal 提交于
      This introduces a simpler and generic method for for finding (and mapping)
      the TBIPA register.
      
      Instead of relying of complicated logic for finding the TBIPA register
      address based on the MDIO or MII register block base
      address, which even in some cases relies on undocumented shadow registers,
      a second "reg" entry for the mdio bus devicetree node specifies the TBIPA
      register.
      
      Backwards compatibility is kept, as the existing logic is applied when
      only a single "reg" mapping is specified.
      Signed-off-by: NEsben Haabendal <eha@deif.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      21481189
    • N
      ibmvnic: Do not reset CRQ for Mobility driver resets · 30f79625
      Nathan Fontenot 提交于
      When resetting the ibmvnic driver after a partition migration occurs
      there is no requirement to do a reset of the main CRQ. The current
      driver code does the required re-enable of the main CRQ, then does
      a reset of the main CRQ later.
      
      What we should be doing for a driver reset after a migration is to
      re-enable the main CRQ, release all the sub-CRQs, and then allocate
      new sub-CRQs after capability negotiation.
      
      This patch updates the handling of mobility resets to do the proper
      work and not reset the main CRQ. To do this the initialization/reset
      of the main CRQ had to be moved out of the ibmvnic_init routine
      and in to the ibmvnic_probe and do_reset routines.
      Signed-off-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      30f79625
    • T
      ibmvnic: Fix failover case for non-redundant configuration · 5a18e1e0
      Thomas Falcon 提交于
      There is a failover case for a non-redundant pseries VNIC
      configuration that was not being handled properly. The current
      implementation assumes that the driver will always have a redandant
      device to communicate with following a failover notification. There
      are cases, however, when a non-redundant configuration can receive
      a failover request. If that happens, the driver should wait until
      it receives a signal that the device is ready for operation.
      
      The driver is agnostic of its backing hardware configuration,
      so this fix necessarily affects all device failover management.
      The driver needs to wait until it receives a signal that the device
      is ready for resetting. A flag is introduced to track this intermediary
      state where the driver is waiting for an active device.
      Signed-off-by: NThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a18e1e0
    • T
      ibmvnic: Fix reset scheduler error handling · af894d23
      Thomas Falcon 提交于
      In some cases, if the driver is waiting for a reset following
      a device parameter change, failure to schedule a reset can result
      in a hang since a completion signal is never sent.
      
      If the device configuration is being altered by a tool such
      as ethtool or ifconfig, it could cause the console to hang
      if the reset request does not get scheduled. Add some additional
      error handling code to exit the wait_for_completion if there is
      one in progress.
      Signed-off-by: NThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af894d23
    • T
      ibmvnic: Zero used TX descriptor counter on reset · 41f71467
      Thomas Falcon 提交于
      The counter that tracks used TX descriptors pending completion
      needs to be zeroed as part of a device reset. This change fixes
      a bug causing transmit queues to be stopped unnecessarily and in
      some cases a transmit queue stall and timeout reset. If the counter
      is not reset, the remaining descriptors will not be "removed",
      effectively reducing queue capacity. If the queue is over half full,
      it will cause the queue to stall if stopped.
      Signed-off-by: NThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41f71467
    • T
      ibmvnic: Fix DMA mapping mistakes · 37e40fa8
      Thomas Falcon 提交于
      Fix some mistakes caught by the DMA debugger. The first change
      fixes a unnecessary unmap that should have been removed in an
      earlier update. The next hunk fixes another bad unmap by zeroing
      the bit checked to determine that an unmap is needed. The final
      change fixes some buffers that are unmapped with the wrong
      direction specified.
      Signed-off-by: NThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      37e40fa8
  12. 08 4月, 2018 1 次提交
    • L
      treewide: fix up files incorrectly marked executable · 90fda63f
      Linus Torvalds 提交于
      Joe Perches noted that we have a few source files that for some
      inexplicable reason (read: I'm too lazy to even go look at the history)
      are marked executable:
      
        drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
        drivers/net/ethernet/cadence/macb_ptp.c
      
      A simple git command line to show executable C/asm/header files is this:
      
          git ls-files -s '*.[chsS]' | grep '^100755'
      
      and then you can fix them up with scripting by just feeding that output
      into:
      
          | cut -f2 | xargs chmod -x
      
      and commit it.
      
      Which is exactly what this commit does.
      Reported-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      90fda63f
  13. 06 4月, 2018 2 次提交