1. 03 3月, 2016 5 次提交
  2. 16 12月, 2015 2 次提交
    • P
      stmmac: Fix calculations for ptp counters when clock input = 50Mhz. · 19d857c9
      Phil Reid 提交于
      stmmac_config_sub_second_increment set the sub second increment to 20ns.
      Driver is configured to use the fine adjustment method where the sub second
      register is incremented when the acculumator incremented by the addend
      register wraps overflows. This accumulator is update on every ptp clk
      cycle. If a ptp clk with a period of greater than 20ns was used the
      sub second register would not get updated correctly.
      
      Instead set the sub sec increment to twice the period of the ptp clk.
      This result in the addend register being set mid range and overflow
      the accumlator every 2 clock cycles.
      Signed-off-by: NPhil Reid <preid@electromag.com.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      19d857c9
    • T
      net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK · a188222b
      Tom Herbert 提交于
      The name NETIF_F_ALL_CSUM is a misnomer. This does not correspond to the
      set of features for offloading all checksums. This is a mask of the
      checksum offload related features bits. It is incorrect to set both
      NETIF_F_HW_CSUM and NETIF_F_IP_CSUM or NETIF_F_IPV6 at the same time for
      features of a device.
      
      This patch:
        - Changes instances of NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK (where
          NETIF_F_ALL_CSUM is being used as a mask).
        - Changes bonding, sfc/efx, ipvlan, macvlan, vlan, and team drivers to
          use NEITF_F_HW_CSUM in features list instead of NETIF_F_ALL_CSUM.
      Signed-off-by: NTom Herbert <tom@herbertland.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a188222b
  3. 06 12月, 2015 1 次提交
  4. 01 12月, 2015 3 次提交
  5. 05 10月, 2015 1 次提交
  6. 23 9月, 2015 1 次提交
  7. 10 9月, 2015 1 次提交
    • A
      stmmac: fix check for phydev being open · dfc50fca
      Alexey Brodkin 提交于
      Current check of phydev with IS_ERR(phydev) may make not much sense
      because of_phy_connect() returns NULL on failure instead of error value.
      
      Still for checking result of phy_connect() IS_ERR() makes perfect sense.
      
      So let's use combined check IS_ERR_OR_NULL() that covers both cases.
      
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: stable@vger.kernel.org
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dfc50fca
  8. 21 7月, 2015 1 次提交
  9. 24 6月, 2015 1 次提交
    • A
      stmmac: troubleshoot unexpected bits in des0 & des1 · f1590670
      Alexey Brodkin 提交于
      Current implementation of descriptor init procedure only takes
      care about setting/clearing ownership flag in "des0"/"des1"
      fields while it is perfectly possible to get unexpected bits
      set because of the following factors:
      
       [1] On driver probe underlying memory allocated with
           dma_alloc_coherent() might not be zeroed and so
           it will be filled with garbage.
      
       [2] During driver operation some bits could be set by SD/MMC
           controller (for example error flags etc).
      
      And unexpected and/or randomly set flags in "des0"/"des1"
      fields may lead to unpredictable behavior of GMAC DMA block.
      
      This change addresses both items above with:
      
       [1] Use of dma_zalloc_coherent() instead of simple
           dma_alloc_coherent() to make sure allocated memory is
           zeroed. That shouldn't affect performance because
           this allocation only happens once on driver probe.
      
       [2] Do explicit zeroing of both "des0" and "des1" fields
           of all buffer descriptors during initialization of
           DMA transfer.
      
      And while at it fixed identation of dma_free_coherent()
      counterpart as well.
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: arc-linux-dev@synopsys.com
      Cc: linux-kernel@vger.kernel.org
      Cc: stable@vger.kernel.org
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f1590670
  10. 31 5月, 2015 2 次提交
  11. 26 5月, 2015 1 次提交
    • M
      net: stmmac: create one debugfs dir per net-device · 466c5ac8
      Mathieu Olivari 提交于
      stmmac DebugFS entries are currently global to the driver. As a result,
      having more than one stmmac device in the system creates the following
      error:
      * ERROR stmmaceth, debugfs create directory failed
      * stmmac_hw_setup: failed debugFS registration
      
      This also results in being able to access the debugfs information for
      the first registered device only.
      
      This patch changes the debugfs structure to have one sub-directory per
      net-device. Files under "/sys/kernel/debug/stmmaceth" will now show-up
      under /sys/kernel/debug/stmmaceth/ethN/.
      Signed-off-by: NMathieu Olivari <mathieu@codeaurora.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      466c5ac8
  12. 22 5月, 2015 4 次提交
  13. 17 4月, 2015 2 次提交
  14. 09 4月, 2015 1 次提交
  15. 09 3月, 2015 1 次提交
  16. 02 3月, 2015 1 次提交
    • V
      net: stmmac: Use setup_timer and mod_timer · ccb36da1
      Vaishali Thakkar 提交于
      Use timer API functions setup_timer and mod_timer instead
      of structure assignments as they are standard way to set
      the timer and to update the expire field of an active timer
      respectively.
      
      This is done using Coccinelle and semantic patch used for
      this is as follows:
      
      // <smpl>
      @@
      expression x,y,z,a,b;
      @@
      
      -init_timer (&x);
      +setup_timer (&x, y, z);
      +mod_timer (&a, b);
      -x.function = y;
      -x.data = z;
      -x.expires = b;
      -add_timer(&a);
      // </smpl>
      Signed-off-by: NVaishali Thakkar <vthakkar1994@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccb36da1
  17. 02 2月, 2015 1 次提交
  18. 28 1月, 2015 1 次提交
  19. 27 1月, 2015 3 次提交
  20. 23 12月, 2014 1 次提交
    • H
      stmmac: Don't init ptp again when resume from suspend/hibernation · fe131929
      Huacai Chen 提交于
      Both stmmac_open() and stmmac_resume() call stmmac_hw_setup(), and
      stmmac_hw_setup() call stmmac_init_ptp() unconditionally. However, only
      stmmac_release() calls stmmac_release_ptp(). Since stmmac_suspend()
      doesn't call stmmac_release_ptp(), stmmac_resume() also needn't call
      stmmac_init_ptp().
      
      This patch also fix a "scheduling while atomic" problem when resume
      from suspend/hibernation. Because stmmac_init_ptp() will trigger
      scheduling while stmmac_resume() hold a spinlock.
      
      Callgraph of "scheduling while atomic":
      stmmac_resume() --> stmmac_hw_setup() --> stmmac_init_ptp() -->
      stmmac_ptp_register() --> ptp_clock_register() --> device_create() -->
      device_create_groups_vargs() --> device_add() --> devtmpfs_create_node()
      --> wait_for_common() --> schedule_timeout() --> __schedule()
      Signed-off-by: NHuacai Chen <chenhc@lemote.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fe131929
  21. 20 11月, 2014 1 次提交
  22. 12 11月, 2014 1 次提交
  23. 08 11月, 2014 1 次提交
  24. 06 11月, 2014 3 次提交
    • G
      stmmac: fix atomicity in pm routines · 777da230
      Giuseppe CAVALLARO 提交于
      This patch is to fix the atomicity when suspend and resume the
      driver. The clk api have been changed (as reported by Hao Liang)
      and the skb allocation is done out of the hw setup function and
      taking care about the GFP flags.
      Reported-by: NHao Liang <hliang1025@gmail.com>
      Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
      Cc: Hao Liang <hliang1025@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      777da230
    • G
      stmmac: fix concurrency in eee initialization. · 4741cf9c
      Giuseppe CAVALLARO 提交于
      This patch aims to fix the concurrency in eee initialization
      inside the stmmac driver and related warnings when enable
      DEBUG_ATOMIC_SLEEP.
      
      Prior this patch, the stmmac_eee_init could be called in several places
      as shown below:
      
      stmmac_open  stmmac_resume         PHY Layer
          |            |                     |
        stmmac_hw_setup           stmmac_adjust_link
          |                                  |           stmmac ethtool
          |__________________________|______________|
                                             |
                                       stmmac_eee_init
      
      The patch removes the stmmac_eee_init call inside the stmmac_hw_setup
      that is unnecessary. It is sufficient to call it in the adjust_link to
      always guarantee that EEE is always configured at mac level too.
      
      Fixing the lock protection now it is covered another case (not
      considered before). The stmmac_eee_init could be called by the ethtool
      so critical sections must be protected inside this function too.
      Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4741cf9c
    • G
      stmmac: fix lock in stmmac_set_rx_mode · b9d73704
      Giuseppe CAVALLARO 提交于
      When compile with CONFIG_PROVE_LOCKING the following warnings happen:
      
      [snip]
      
          HARDIRQ-ON-W at:
                              [<c0480c1c>] _raw_spin_lock+0x3c/0x4c
                              [<c02c2828>] stmmac_set_rx_mode+0x18/0x3c
                              [<c038b2cc>] dev_set_rx_mode+0x1c/0x28
                              [<c038b38c>] __dev_open+0xb4/0xf8
                              [<c038b5a8>] __dev_change_flags+0x94/0x128
                              [<c038b6a8>] dev_change_flags+0x10/0x48
                              [<c062afe0>] ip_auto_config+0x1d4/0x1084
                              [<c000873c>] do_one_initcall+0x108/0x15c
                              [<c060ec50>] kernel_init_freeable+0x1a8/0x248
                              [<c0472cc0>] kernel_init+0x8/0x160
                              [<c000dfc8>] ret_from_fork+0x14/0x2c
           INITIAL USE at:
                             [<c0480c1c>] _raw_spin_lock+0x3c/0x4c
                             [<c02c2828>] stmmac_set_rx_mode+0x18/0x3c
                             [<c038b2cc>] dev_set_rx_mode+0x1c/0x28
                             [<c038b38c>] __dev_open+0xb4/0xf8
                             [<c038b5a8>] __dev_change_flags+0x94/0x128
                             [<c038b6a8>] dev_change_flags+0x10/0x48
                             [<c062afe0>] ip_auto_config+0x1d4/0x1084
                             [<c000873c>] do_one_initcall+0x108/0x15c
                             [<c060ec50>] kernel_init_freeable+0x1a8/0x248
                             [<c0472cc0>] kernel_init+0x8/0x160
                             [<c000dfc8>] ret_from_fork+0x14/0x2c
      
      so the patch just removes the lock protection in the stmmac_set_rx_mode
      Signed-off-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Emilio Lopez <emilio@elopez.com.ar>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b9d73704