1. 05 11月, 2015 2 次提交
  2. 04 11月, 2015 1 次提交
  3. 03 11月, 2015 3 次提交
    • S
      sh_eth: fix typo in RX descriptor bit name · c238041f
      Sergei Shtylyov 提交于
      The correct name of the RX descriptor 0 bit 30 is RDLE (receive descriptor
      list end),  not  RDEL.
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c238041f
    • S
      sh_eth: fix WARNING in dma_common_free_remap() · b61ed8fd
      Sergei Shtylyov 提交于
      Iff the first dma_alloc_coherent()  call fails in sh_eth_ring_init(), the
      following  is printed to the kernel console:
      
      WARNING: CPU: 0 PID: 1 at drivers/base/dma-mapping.c:334 dma_common_free_remap+0x48/0x6c()
      trying to free invalid coherent area:   (null)
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.3.0-rc7-dirty #969
      Hardware name: Generic R8A7791 (Flattened Device Tree)
      Backtrace:
      [<c0013820>] (dump_backtrace) from [<c00139bc>] (show_stack+0x18/0x1c)
       r6:c0662856 r5:00000009 r4:00000000 r3:00204140
      [<c00139a4>] (show_stack) from [<c0227510>] (dump_stack+0x74/0x90)
      [<c022749c>] (dump_stack) from [<c0026ef4>] (warn_slowpath_common+0x8c/0xb8)
       r4:ee84dce0 r3:c0712774
      [<c0026e68>] (warn_slowpath_common) from [<c0026fc4>] (warn_slowpath_fmt+0x38/0x40)
       r8:ee7f8000 r7:c0734520 r6:00001000 r5:20000008 r4:00000000
      [<c0026f90>] (warn_slowpath_fmt) from [<c02df404>] (dma_common_free_remap+0x48/0x6c)
       r3:00000000 r2:c0662871
      [<c02df3bc>] (dma_common_free_remap) from [<c001b9fc>] (__arm_dma_free+0xb8/0xd4)
      r6:00000001 r5:00000000 r4:00001000 r3:ee8c5584
      [<c001b944>] (__arm_dma_free) from [<c001ba68>] (arm_dma_free+0x24/0x2c)
       r10:0000016b r8:00000000 r7:ee9bc830 r6:00000000 r5:00000400 r4:ee9bc800
      [<c001ba44>] (arm_dma_free) from [<c032ebf0>] (sh_eth_ring_init+0x110/0x138)
      [<c032eae0>] (sh_eth_ring_init) from [<c033179c>] (sh_eth_open+0x94/0x1f4)
       r6:00000000 r5:ee9bcd18 r4:ee9bc800
      [<c0331708>] (sh_eth_open) from [<c041bf7c>] (__dev_open+0x84/0x104)
       r6:c0565c50 r5:00000000 r4:ee9bc800
      [<c041bef8>] (__dev_open) from [<c041c208>] (__dev_change_flags+0x94/0x13c)
       r7:00001002 r6:00000001 r5:00001003 r4:ee9bc800
      [<c041c174>] (__dev_change_flags) from [<c041c2e8>] (dev_change_flags+0x20/0x50)
       r7:c072c8a0 r6:00000138 r5:00001002 r4:ee9bc800
      [<c041c2c8>] (dev_change_flags) from [<c06e8d4c>] (ip_auto_config+0x174/0xf7c)
       r8:00001002 r7:c072c8a0 r6:c0700040 r5:00000001 r4:ee9bc800 r3:00000101
      [<c06e8bd8>] (ip_auto_config) from [<c000a810>] (do_one_initcall+0x100/0x1c8)
       r10:c06f883c r9:00000000 r8:c06e8bd8 r7:c0734000 r6:c070e918 r5:c070e918
       r4:ee083640
      [<c000a710>] (do_one_initcall) from [<c06c9ddc>] (kernel_init_freeable+0x11c/0x1ec)
       r10:c06f883c r9:00000000 r8:00000099 r7:c0734000 r6:c070372c r5:c06f8834
       r4:00000007
      [<c06c9cc0>] (kernel_init_freeable) from [<c0514d78>] (kernel_init+0x14/0xec)
       r10:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c0514d64 r4:c0734000
      [<c0514d64>] (kernel_init) from [<c0010458>] (ret_from_fork+0x14/0x3c)
       r4:00000000 r3:ee84c000
      
      This is because the code jumps to a wrong label and so tries to free yet
      unallocated coherent memory.  Fix the *goto* in question.
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b61ed8fd
    • S
      sh_eth: fix uninitialized arrays in sh_eth_ring_init() · 2c94e856
      Sergei Shtylyov 提交于
      sh_eth_ring_free()  called in the sh_eth_ring_init()'s error path expects
      the arrays pointed  to  by 'sh_eth_private::[rt]x_skbuff' to be initialized
      with NULLs but they are allocated with just kmalloc_array() and so are left
      filled with random data. Use kcalloc() instead.
      Signed-off-by: NSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c94e856
  4. 27 10月, 2015 2 次提交
  5. 29 8月, 2015 1 次提交
  6. 05 3月, 2015 5 次提交
  7. 03 3月, 2015 4 次提交
  8. 01 3月, 2015 1 次提交
    • G
      sh_eth: Fix lost MAC address on kexec · a14c7d15
      Geert Uytterhoeven 提交于
      Commit 740c7f31 ("sh_eth: Ensure DMA engines are stopped before
      freeing buffers") added a call to sh_eth_reset() to the
      sh_eth_set_ringparam() and sh_eth_close() paths.
      
      However, setting the software reset bit(s) in the EDMR register resets
      the MAC Address Registers to zero. Hence after kexec, the new kernel
      doesn't detect a valid MAC address and assigns a random MAC address,
      breaking DHCP.
      
      Set the MAC address again after the reset in sh_eth_dev_exit() to fix
      this.
      
      Tested on r8a7740/armadillo (GETHER) and r8a7791/koelsch (FAST_RCAR).
      
      Fixes: 740c7f31 ("sh_eth: Ensure DMA engines are stopped before freeing buffers")
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a14c7d15
  9. 27 1月, 2015 10 次提交
  10. 20 1月, 2015 2 次提交
    • B
      sh_eth: Fix ethtool operation crash when net device is down · 4f9dce23
      Ben Hutchings 提交于
      The driver connects and disconnects the PHY device whenever the
      net device is brought up and down.  The ethtool get_settings,
      set_settings and nway_reset operations will dereference a null
      or dangling pointer if called while it is down.
      
      I think it would be preferable to keep the PHY connected, but there
      may be good reasons not to.
      
      As an immediate fix for this bug:
      - Set the phydev pointer to NULL after disconnecting the PHY
      - Change those three operations to return -ENODEV while the PHY is
        not connected
      Signed-off-by: NBen Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4f9dce23
    • B
      sh_eth: Fix promiscuous mode on chips without TSU · b37feed7
      Ben Hutchings 提交于
      Currently net_device_ops::set_rx_mode is only implemented for
      chips with a TSU (multiple address table).  However we do need
      to turn the PRM (promiscuous) flag on and off for other chips.
      
      - Remove the unlikely() from the TSU functions that we may safely
        call for chips without a TSU
      - Make setting of the MCT flag conditional on the tsu capability flag
      - Rename sh_eth_set_multicast_list() to sh_eth_set_rx_mode() and plumb
        it into both net_device_ops structures
      - Remove the previously-unreachable branch in sh_eth_rx_mode() that
        would otherwise reset the flags to defaults for non-TSU chips
      Signed-off-by: NBen Hutchings <ben.hutchings@codethink.co.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b37feed7
  11. 16 1月, 2015 2 次提交
  12. 09 1月, 2015 2 次提交
  13. 10 12月, 2014 2 次提交
  14. 30 11月, 2014 2 次提交
    • M
      sh_eth: Fix sleeping function called from invalid context · 7fa2955f
      Mitsuhiro Kimura 提交于
      This resolves the following bug which can be reproduced by building the
      kernel with CONFIG_DEBUG_ATOMIC_SLEEP=y and reading network statistics
      while the network interface is down.
      
      e.g.:
      
      ifconfig eth0 down
      cat /sys/class/net/eth0/statistics/tx_errors
      
      ----
      [ 1238.161349] BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:952
      [ 1238.188279] in_atomic(): 1, irqs_disabled(): 0, pid: 1388, name: cat
      [ 1238.207425] CPU: 0 PID: 1388 Comm: cat Not tainted 3.10.31-ltsi-00046-gefa0b46 #1087
      [ 1238.230737] Backtrace:
      [ 1238.238123] [<c0012e64>] (dump_backtrace+0x0/0x10c) from [<c0013000>] (show_stack+0x18/0x1c)
      [ 1238.263499]  r6:000003b8 r5:c06160c0 r4:c0669e00 r3:00404000
      [ 1238.280583] [<c0012fe8>] (show_stack+0x0/0x1c) from [<c04515a4>] (dump_stack+0x20/0x28)
      [ 1238.304631] [<c0451584>] (dump_stack+0x0/0x28) from [<c004970c>] (__might_sleep+0xf8/0x118)
      [ 1238.329734] [<c0049614>] (__might_sleep+0x0/0x118) from [<c02465ac>] (__pm_runtime_resume+0x38/0x90)
      [ 1238.357170]  r7:d616f000 r6:c049c458 r5:00000004 r4:d6a17210
      [ 1238.374251] [<c0246574>] (__pm_runtime_resume+0x0/0x90) from [<c029b1c4>] (sh_eth_get_stats+0x44/0x280)
      [ 1238.402468]  r7:d616f000 r6:c049c458 r5:d5c21000 r4:d5c21000
      [ 1238.419552] [<c029b180>] (sh_eth_get_stats+0x0/0x280) from [<c03ae39c>] (dev_get_stats+0x54/0x88)
      [ 1238.446204]  r5:d5c21000 r4:d5ed7e08
      [ 1238.456980] [<c03ae348>] (dev_get_stats+0x0/0x88) from [<c03c677c>] (netstat_show.isra.15+0x54/0x9c)
      [ 1238.484413]  r6:d5c21000 r5:d5c21238 r4:00000028 r3:00000001
      [ 1238.501495] [<c03c6728>] (netstat_show.isra.15+0x0/0x9c) from [<c03c69b8>] (show_tx_errors+0x18/0x1c)
      [ 1238.529196]  r7:d5f945d8 r6:d5f945c0 r5:c049716c r4:c0650e7c
      [ 1238.546279] [<c03c69a0>] (show_tx_errors+0x0/0x1c) from [<c023963c>] (dev_attr_show+0x24/0x50)
      [ 1238.572157] [<c0239618>] (dev_attr_show+0x0/0x50) from [<c010c148>] (sysfs_read_file+0xb0/0x140)
      [ 1238.598554]  r5:c049716c r4:d5c21240
      [ 1238.609326] [<c010c098>] (sysfs_read_file+0x0/0x140) from [<c00b9ee4>] (vfs_read+0xb0/0x13c)
      [ 1238.634679] [<c00b9e34>] (vfs_read+0x0/0x13c) from [<c00ba0ac>] (SyS_read+0x44/0x74)
      [ 1238.657944]  r8:bef45bf0 r7:00000000 r6:d6ac0600 r5:00000000 r4:00000000
      [ 1238.678172] [<c00ba068>] (SyS_read+0x0/0x74) from [<c000eec0>] (ret_fast_syscall+0x0/0x30)
      ----
      Signed-off-by: NMitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>
      Signed-off-by: NYoshihiro Kaneko <ykaneko0929@gmail.com>
      Signed-off-by: NSimon Horman <horms+renesas@verge.net.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7fa2955f
    • M
      sh_eth: Fix skb alloc size and alignment adjust rule. · 4d6a949c
      Mitsuhiro Kimura 提交于
      In the current driver, allocation size of skb does not care the alignment
      adjust after allocation.
      And also, in the current implementation, buffer alignment method by
      sh_eth_set_receive_align function has a bug that this function displace
      buffer start address forcedly when the alignment is corrected.
      In the result, tail of the skb will exceed allocated area and kernel panic
      will be occurred.
      This patch fix this issue.
      Signed-off-by: NMitsuhiro Kimura <mitsuhiro.kimura.kc@renesas.com>
      Signed-off-by: NYoshihiro Kaneko <ykaneko0929@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4d6a949c
  15. 14 11月, 2014 1 次提交