1. 18 3月, 2016 2 次提交
  2. 17 3月, 2016 8 次提交
  3. 15 3月, 2016 27 次提交
    • A
      smc91x: avoid self-comparison warning · e3ebd894
      Arnd Bergmann 提交于
      The smc91x driver defines a macro that compares its argument to
      itself, apparently to get a true result while using its argument
      to avoid a warning about unused local variables.
      
      Unfortunately, this triggers a warning with gcc-6, as the comparison
      is obviously useless:
      
      drivers/net/ethernet/smsc/smc91x.c: In function 'smc_hardware_send_pkt':
      drivers/net/ethernet/smsc/smc91x.c:563:14: error: self-comparison always evaluates to true [-Werror=tautological-compare]
        if (!smc_special_trylock(&lp->lock, flags)) {
      
      This replaces the macro with another one that behaves similarly,
      with a cast to (void) to ensure the argument is used, and using
      a literal 'true' as its value.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3ebd894
    • V
      net: dsa: make port_bridge_leave return void · 16bfa702
      Vivien Didelot 提交于
      netdev_upper_dev_unlink() which notifies NETDEV_CHANGEUPPER, returns
      void, as well as del_nbp(). So there's no advantage to catch an eventual
      error from the port_bridge_leave routine at the DSA level.
      
      Make this routine void for the DSA layer and its existing drivers.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16bfa702
    • V
      net: dsa: rename port_*_bridge routines · 71327a4e
      Vivien Didelot 提交于
      Rename DSA port_join_bridge and port_leave_bridge routines to
      respectively port_bridge_join and port_bridge_leave in order to respect
      an implicit Port::Bridge namespace.
      Signed-off-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Acked-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      71327a4e
    • S
      sh_eth: kill useless initializers · 4fa8c3cc
      Sergei Shtylyov 提交于
      Some of the local variable intializers in the driver turned out to be
      pointless,  kill 'em.
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4fa8c3cc
    • D
      net: mvneta: replace magic numbers by existing macros · a3703fb3
      Dmitri Epshtein 提交于
      Some literal values are actually already defined by macros, so let's use
      them.
      
      [gregory.clement@free-electrons.com: split intial commit in two
      individual changes]
      Signed-off-by: NDmitri Epshtein <dima@marvell.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3703fb3
    • D
      net: mvneta: fix error messages in mvneta_port_down function · 0838abb3
      Dmitri Epshtein 提交于
      This commit corrects error printing when shutting down the port.
      
      [gregory.clement@free-electrons.com: split initial commit in two
      individual changes]
      Signed-off-by: NDmitri Epshtein <dima@marvell.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0838abb3
    • D
      net: mvneta: enable change MAC address when interface is up · 928b6519
      Dmitri Epshtein 提交于
      Function eth_prepare_mac_addr_change() is called as part of MAC
      address change. This function check if interface is running.
      To enable change MAC address when interface is running:
      IFF_LIVE_ADDR_CHANGE flag must be set to dev->priv_flags field
      
      Fixes: c5aff182 ("net: mvneta: driver for Marvell Armada 370/XP
      network unit")
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitri Epshtein <dima@marvell.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      928b6519
    • G
      net: mvneta: Fix spinlock usage · 1c2722a9
      Gregory CLEMENT 提交于
      In the previous patch, the spinlock was not initialized. While it didn't
      cause any trouble yet it could be a problem to use it uninitialized.
      
      The most annoying part was the critical section protected by the spinlock
      in mvneta_stop(). Some of the functions could sleep as pointed when
      activated CONFIG_DEBUG_ATOMIC_SLEEP. Actually, in mvneta_stop() we only
      need to protect the is_stopped flagged, indeed the code of the notifier
      for CPU online is protected by the same spinlock, so when we get the
      lock, the notifer work is done.
      Reported-by: NPatrick Uiterwijk <patrick@puiterwijk.org>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c2722a9
    • A
      phy: fixed: Fix removal of phys. · 5bcbe0f3
      Andrew Lunn 提交于
      The fixed phys delete function simply removed the fixed phy from the
      internal linked list and freed the memory. It however did not
      unregister the associated phy device. This meant it was still possible
      to find the phy device on the mdio bus.
      
      Make fixed_phy_del() an internal function and add a
      fixed_phy_unregister() to unregisters the phy device and then uses
      fixed_phy_del() to free resources.
      
      Modify DSA to use this new API function, so we don't leak phys.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5bcbe0f3
    • A
      dsa: Rename mv88e6123_61_65 to mv88e6123 to be consistent · ca3dfa51
      Andrew Lunn 提交于
      All the drivers support multiple chips, but mv88e6123_61_65 is the
      only one that reflects this in its naming. Change it to be consistent
      with the other drivers.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ca3dfa51
    • D
      phy: mdio-thunder: Add driver for Cavium Thunder SoC MDIO buses. · 379d7ac7
      David Daney 提交于
      The Cavium Thunder SoCs have multiple MIDO buses that are part of a
      single PCI device.  To model this in the device tree we call the PCI
      parent device a "cavium,thunder-8890-mdio-nexus", it has several
      children, one for each MDIO bus.
      
      The MDIO bus hardware is identical to that found in the OCTEON SoCs,
      so we use that code for things that are not part of the PCI driver
      probe/remove
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      379d7ac7
    • D
      phy: mdio-octeon: Refactor into two files/modules · 1eefee90
      David Daney 提交于
      A follow-on patch uses PCI probing to find the Thunder MDIO hardware.
      In preparation for this, split out the common code into a new file
      mdio-cavium.c, which will be used by both the existing OCTEON driver,
      and the new Thunder PCI based driver.
      
      As part of the refactoring simplify the struct cavium_mdiobus by
      removing fields that are only ever used in the probe function and can
      just as well be local variables.
      
      Use readq/writeq in preference to readq_relaxed/writeq_relaxed as the
      relaxed form was an optimization for an early chip revision, and the
      MDIO drivers are not performance bottlenecks that need optimization in
      the first place.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1eefee90
    • D
      net: thunderx: Cleanup PHY probing code. · 5fc7cf17
      David Daney 提交于
      Remove the call to force the octeon-mdio driver to be loaded.  Allow
      the standard driver loading mechanisms to load the PHY drivers, and
      use -EPROBE_DEFER to cause the BGX driver to be probed only after the
      PHY drivers are available.
      
      Reorder the setting of MAC addresses and PHY probing to allow BGX
      LMACs with no attached PHY to still be assigned a MAC address.
      Signed-off-by: NDavid Daney <david.daney@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5fc7cf17
    • A
      net: mvneta: Add missing hotplug notifier transition · 0df83e7a
      Anna-Maria Gleixner 提交于
      The mvneta_percpu_notifier() hotplug callback lacks handling of the
      CPU_DOWN_FAILED case. That means, if CPU_DOWN_PREPARE failes, the
      driver is not well configured on the CPU.
      
      Add handling for CPU_DOWN_FAILED[_FROZEN] hotplug notifier transition
      to setup the driver.
      
      Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Cc: netdev@vger.kernel.org
      Signed-off-by: NAnna-Maria Gleixner <anna-maria@linutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0df83e7a
    • I
      fsl/fman: fix dtsec_set_tx_pause_frames · 7c82a7b9
      Igal Liberman 提交于
      Fix a bug introduced in e06a03bd (fsl/fman: fix the pause_time test)
      When pause_time is set to '0' - pause frames are disabled and
      there's no need to apply dTSEC-A003 Errata workaround.
      Signed-off-by: NIgal Liberman <igal.liberman@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7c82a7b9
    • A
      vmxnet3: fix lock imbalance in vmxnet3_tq_xmit() · efc21d95
      Arnd Bergmann 提交于
      A recent bug fix rearranged the code in vmxnet3_tq_xmit() in a
      way that left the error handling for oversized headers unlock
      a lock that had not been taken yet. Gcc warns about the incorrect
      use of the 'flags' variable because of that:
      
      drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_tq_xmit.constprop':
      include/linux/spinlock.h:246:3: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      
      This changes the error handling path to 'goto' the end of the function
      beyond the lock/unlock pair.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: cec05562 ("vmxnet3: avoid calling pskb_may_pull with interrupts disabled")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      efc21d95
    • A
      ath9k: fix misleading indentation · 362210e0
      Arnd Bergmann 提交于
      A cleanup patch in linux-3.18 moved around some code in the ath9k
      driver and left some code to be indented in a misleading way,
      made worse by the addition of some new code for p2p mode, as
      discovered by a new gcc-6 warning:
      
      drivers/net/wireless/ath/ath9k/init.c: In function 'ath9k_set_hw_capab':
      drivers/net/wireless/ath/ath9k/init.c:851:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
          hw->wiphy->iface_combinations = if_comb;
          ^~
      drivers/net/wireless/ath/ath9k/init.c:847:3: note: ...this 'if' clause, but it is not
         if (ath9k_is_chanctx_enabled())
         ^~
      
      The code is in fact correct, but the indentation is not, so I'm
      reformatting it as it should have been after the original cleanup.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 499afacc ("ath9k: Isolate ath9k_use_chanctx module parameter")
      Fixes: eb61f9f6 ("ath9k: advertise p2p dev support when chanctx")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      362210e0
    • A
      ath9k: fix buffer overrun for ar9287 · 83d6f1f1
      Arnd Bergmann 提交于
      Code that was added back in 2.6.38 has an obvious overflow
      when accessing a static array, and at the time it was added
      only a code comment was put in front of it as a reminder
      to have it reviewed properly.
      
      This has not happened, but gcc-6 now points to the specific
      overflow:
      
      drivers/net/wireless/ath/ath9k/eeprom.c: In function 'ath9k_hw_get_gain_boundaries_pdadcs':
      drivers/net/wireless/ath/ath9k/eeprom.c:483:44: error: array subscript is above array bounds [-Werror=array-bounds]
           maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4];
                         ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
      
      It turns out that the correct array length exists in the local
      'intercepts' variable of this function, so we can just use that
      instead of hardcoding '4', so this patch changes all three
      instances to use that variable. The other two instances were
      already correct, but it's more consistent this way.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 940cd2c1 ("ath9k_hw: merge the ar9287 version of ath9k_hw_get_gain_boundaries_pdadcs")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      83d6f1f1
    • A
      farsync: fix off-by-one bug in fst_add_one · e725a66c
      Arnd Bergmann 提交于
      gcc-6 finds an out of bounds access in the fst_add_one function
      when calculating the end of the mmio area:
      
      drivers/net/wan/farsync.c: In function 'fst_add_one':
      drivers/net/wan/farsync.c:418:53: error: index 2 denotes an offset greater than size of 'u8[2][8192] {aka unsigned char[2][8192]}' [-Werror=array-bounds]
       #define BUF_OFFSET(X)   (BFM_BASE + offsetof(struct buf_window, X))
                                                           ^
      include/linux/compiler-gcc.h:158:21: note: in definition of macro '__compiler_offsetof'
        __builtin_offsetof(a, b)
                           ^
      drivers/net/wan/farsync.c:418:37: note: in expansion of macro 'offsetof'
       #define BUF_OFFSET(X)   (BFM_BASE + offsetof(struct buf_window, X))
                                           ^~~~~~~~
      drivers/net/wan/farsync.c:2519:36: note: in expansion of macro 'BUF_OFFSET'
                                        + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER][0]);
                                          ^~~~~~~~~~
      
      The warning is correct, but not critical because this appears
      to be a write-only variable that is set by each WAN driver but
      never accessed afterwards.
      
      I'm taking the minimal fix here, using the correct pointer by
      pointing 'mem_end' to the last byte inside of the register area
      as all other WAN drivers do, rather than the first byte outside of
      it. An alternative would be to just remove the mem_end member
      entirely.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e725a66c
    • A
      mlx4: add missing braces in verify_qp_parameters · baefd701
      Arnd Bergmann 提交于
      The implementation of QP paravirtualization back in linux-3.7 included
      some code that looks very dubious, and gcc-6 has grown smart enough
      to warn about it:
      
      drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'verify_qp_parameters':
      drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:3154:5: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
           if (optpar & MLX4_QP_OPTPAR_ALT_ADDR_PATH) {
           ^~
      drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:3144:4: note: ...this 'if' clause, but it is not
          if (slave != mlx4_master_func_num(dev))
      
      >From looking at the context, I'm reasonably sure that the indentation
      is correct but that it should have contained curly braces from the
      start, as the update_gid() function in the same patch correctly does.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: 54679e14 ("mlx4: Implement QP paravirtualization and maintain phys_pkey_cache for smp_snoop")
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      baefd701
    • A
      net: mediatek: check device_reset return code · 916848ca
      Arnd Bergmann 提交于
      The device_reset() function may fail, so we have to check
      its return value, e.g. to make deferred probing work correctly.
      gcc warns about it because of the warn_unused_result attribute:
      
      drivers/net/ethernet/mediatek/mtk_eth_soc.c: In function 'mtk_probe':
      drivers/net/ethernet/mediatek/mtk_eth_soc.c:1679:2: error: ignoring return value of 'device_reset', declared with attribute warn_unused_result [-Werror=unused-result]
      
      This adds the trivial error check to propagate the return value
      to the generic platform device probe code.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      916848ca
    • A
      net: mediatek: remove incorrect dma_mask assignment · a25cdc0d
      Arnd Bergmann 提交于
      Device drivers should not mess with the DMA mask directly,
      but instead call dma_set_mask() etc if needed.
      
      In case of the mtk_eth_soc driver, the mask already gets set
      correctly when the device is created, and setting it again
      is against the documented API.
      
      This removes the incorrect setting.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a25cdc0d
    • A
      net: mediatek: use dma_addr_t correctly · 6aab1a62
      Arnd Bergmann 提交于
      dma_alloc_coherent() expects a dma_addr_t pointer as its argument,
      not an 'unsigned int', and gcc correctly warns about broken
      code in the mtk_init_fq_dma function:
      
      drivers/net/ethernet/mediatek/mtk_eth_soc.c: In function 'mtk_init_fq_dma':
      drivers/net/ethernet/mediatek/mtk_eth_soc.c:463:13: error: passing argument 3 of 'dma_alloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types]
      
      This changes the type of the local variable to dma_addr_t.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6aab1a62
    • S
      net: thunderx: Adjust nicvf structure to reduce cache misses · 1d368790
      Sunil Goutham 提交于
      Adjusted nicvf structure such that all elements used in hot
      path like napi, xmit e.t.c fall into same cache line. This reduced
      no of cache misses and resulted in ~2% increase in no of packets
      handled on a core.
      
      Also modified elements with :1 notation to boolean, to be
      consistent with other element definitions.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1d368790
    • S
      net: thunderx: Set recevie buffer page usage count in bulk · 5c2e26f6
      Sunil Goutham 提交于
      Instead of calling get_page() for every receive buffer carved out
      of page, set page's usage count at the end, to reduce no of atomic
      calls.
      Signed-off-by: NSunil Goutham <sgoutham@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5c2e26f6
    • G
      net: mvneta: Use the new hwbm framework · baa11ebc
      Gregory CLEMENT 提交于
      Now that the hardware buffer management framework had been introduced,
      let's use it.
      Tested-by: NSebastian Careba <nitroshift@yahoo.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      baa11ebc
    • M
      net: mvneta: bm: add support for hardware buffer management · dc35a10f
      Marcin Wojtas 提交于
      Buffer manager (BM) is a dedicated hardware unit that can be used by all
      ethernet ports of Armada XP and 38x SoC's. It allows to offload CPU on RX
      path by sparing DRAM access on refilling buffer pool, hardware-based
      filling of descriptor ring data and better memory utilization due to HW
      arbitration for using 'short' pools for small packets.
      
      Tests performed with A388 SoC working as a network bridge between two
      packet generators showed increase of maximum processed 64B packets by
      ~20k (~555k packets with BM enabled vs ~535 packets without BM). Also
      when pushing 1500B-packets with a line rate achieved, CPU load decreased
      from around 25% without BM to 20% with BM.
      
      BM comprise up to 4 buffer pointers' (BP) rings kept in DRAM, which
      are called external BP pools - BPPE. Allocating and releasing buffer
      pointers (BP) to/from BPPE is performed indirectly by write/read access
      to a dedicated internal SRAM, where internal BP pools (BPPI) are placed.
      BM hardware controls status of BPPE automatically, as well as assigning
      proper buffers to RX descriptors. For more details please refer to
      Functional Specification of Armada XP or 38x SoC.
      
      In order to enable support for a separate hardware block, common for all
      ports, a new driver has to be implemented ('mvneta_bm'). It provides
      initialization sequence of address space, clocks, registers, SRAM,
      empty pools' structures and also obtaining optional configuration
      from DT (please refer to device tree binding documentation). mvneta_bm
      exposes also a necessary API to mvneta driver, as well as a dedicated
      structure with BM information (bm_priv), whose presence is used as a
      flag notifying of BM usage by port. It has to be ensured that mvneta_bm
      probe is executed prior to the ones in ports' driver. In case BM is not
      used or its probe fails, mvneta falls back to use software buffer
      management.
      
      A sequence executed in mvneta_probe function is modified in order to have
      an access to needed resources before possible port's BM initialization is
      done. According to port-pools mapping provided by DT appropriate registers
      are configured and the buffer pools are filled. RX path is modified
      accordingly. Becaues the hardware allows a wide variety of configuration
      options, following assumptions are made:
      * using BM mechanisms can be selectively disabled/enabled basing
        on DT configuration among the ports
      * 'long' pool's single buffer size is tied to port's MTU
      * using 'long' pool by port is obligatory and it cannot be shared
      * using 'short' pool for smaller packets is optional
      * one 'short' pool can be shared among all ports
      
      This commit enables hardware buffer management operation cooperating with
      existing mvneta driver. New device tree binding documentation is added and
      the one of mvneta is updated accordingly.
      
      [gregory.clement@free-electrons.com: removed the suspend/resume part]
      Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc35a10f
  4. 14 3月, 2016 3 次提交