1. 05 Nov, 2014 12 commits
    • Marcelo Leitner's avatar
      tcp: zero retrans_stamp if all retrans were acked · 1f37bf87
      Marcelo Leitner authored
      Ueki Kohei reported that when we are using NewReno with connections that
      have a very low traffic, we may timeout the connection too early if a
      second loss occurs after the first one was successfully acked but no
      data was transfered later. Below is his description of it:
      
      When SACK is disabled, and a socket suffers multiple separate TCP
      retransmissions, that socket's ETIMEDOUT value is calculated from the
      time of the *first* retransmission instead of the *latest*
      retransmission.
      
      This happens because the tcp_sock's retrans_stamp is set once then never
      cleared.
      
      Take the following connection:
      
                            Linux                    remote-machine
                              |                           |
               send#1---->(*1)|--------> data#1 --------->|
                        |     |                           |
                       RTO    :                           :
                        |     |                           |
                       ---(*2)|----> data#1(retrans) ---->|
                        | (*3)|<---------- ACK <----------|
                        |     |                           |
                        |     :                           :
                        |     :                           :
                        |     :                           :
                      16 minutes (or more)                :
                        |     :                           :
                        |     :                           :
                        |     :                           :
                        |     |                           |
               send#2---->(*4)|--------> data#2 --------->|
                        |     |                           |
                       RTO    :                           :
                        |     |                           |
                       ---(*5)|----> data#2(retrans) ---->|
                        |     |                           |
                        |     |                           |
                      RTO*2   :                           :
                        |     |                           |
                        |     |                           |
            ETIMEDOUT<----(*6)|                           |
      
      (*1) One data packet sent.
      (*2) Because no ACK packet is received, the packet is retransmitted.
      (*3) The ACK packet is received. The transmitted packet is acknowledged.
      
      At this point the first "retransmission event" has passed and been
      recovered from. Any future retransmission is a completely new "event".
      
      (*4) After 16 minutes (to correspond with retries2=15), a new data
      packet is sent. Note: No data is transmitted between (*3) and (*4).
      
      The socket's timeout SHOULD be calculated from this point in time, but
      instead it's calculated from the prior "event" 16 minutes ago.
      
      (*5) Because no ACK packet is received, the packet is retransmitted.
      (*6) At the time of the 2nd retransmission, the socket returns
      ETIMEDOUT.
      
      Therefore, now we clear retrans_stamp as soon as all data during the
      loss window is fully acked.
      
      Reported-by: Ueki Kohei
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarMarcelo Ricardo Leitner <mleitner@redhat.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Tested-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1f37bf87
    • David S. Miller's avatar
      Merge branch 'stmmac-net' · 46d38026
      David S. Miller authored
      Giuseppe Cavallaro says:
      
      ====================
      stmmac: review and fix lock and atomicity
      
      Recently some issues have been reported for the driver for locking mechanism
      and atomicity.
      
      In fact, enabling DEBUG support to prove lock and to verify if sleeping while
      atomic context some warnings occur at runtime. I have reproduced all on STi
      platforms.
      
      Concerning the tx path, I had provided a patch time ago but
      I discarded the idea to completely remove locks; in this patch-set we can have
      some useful fixes instead of.
      
      This patch-set is to fix the atomicity in the PM stuff where I tried to collect
      all the points and advice reported in the past weeks.
      As final result, on my side no warnings and no problem when suspend/resume the
      driver on STi boxes.
      
      I also added a patch that fixes the locks for the EEE.
      As pointed in some thread there was a design problem behind the eee
      initialization and I have tried to fix that before.
      As final result no issues when proving locks too.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      46d38026
    • Giuseppe CAVALLARO's avatar
      stmmac: fix atomicity in pm routines · 777da230
      Giuseppe CAVALLARO authored
      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: default avatarHao Liang <hliang1025@gmail.com>
      Signed-off-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
      Cc: Hao Liang <hliang1025@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      777da230
    • Giuseppe CAVALLARO's avatar
      stmmac: fix concurrency in eee initialization. · 4741cf9c
      Giuseppe CAVALLARO authored
      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: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4741cf9c
    • Giuseppe CAVALLARO's avatar
      stmmac: fix lock in stmmac_set_rx_mode · b9d73704
      Giuseppe CAVALLARO authored
      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: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Emilio Lopez <emilio@elopez.com.ar>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b9d73704
    • Fabrice Gasnier's avatar
      stmmac: release tx lock, in case of dma mapping error. · 758a0ab5
      Fabrice Gasnier authored
      Add missing spin_unlock when tx frames gets dropped.
      Signed-off-by: default avatarFabrice Gasnier <fabrice.gasnier@st.com>
      Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      758a0ab5
    • Fabrice Gasnier's avatar
      stmmac: fix stmmac_tx_avail should be called with TX locked · 16ee817e
      Fabrice Gasnier authored
      stmmac_tx_avail() may lie if used unprotected. It's using cur_tx
      and dirty_tx index. These index may be already in use by tx_clean
      when entering xmit routine. So, this should be called locked.
      
      This can cause transmit queue to be stuck, with following message:
      NETDEV WATCHDOG: eth0 (stmmaceth): transmit queue 0 timed out
      Signed-off-by: default avatarFabrice Gasnier <fabrice.gasnier@st.com>
      Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16ee817e
    • Chen Gang's avatar
      drivers: net: ethernet: xilinx: xilinx_emaclite: revert the original commit... · b994ca6b
      Chen Gang authored
      drivers: net: ethernet: xilinx: xilinx_emaclite: revert the original commit "1db3ddff"
      
      Microblaze is a fpga soft core, it can be customized easily, which may
      cause many various hardware version strings.
      
      So the original fix patch based on hard-coded compatible version strings
      is not a good idea (although it is correct for current issue). For it,
      there will be a new solving way soon (which based on the device tree).
      
      The original issue is related with qemu, so can only change the hardware
      version string in qemu for it, then keep the original driver no touch (
      qemu is for virtualization which has much easier life than real world).
      Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
      Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b994ca6b
    • Rasmus Villemoes's avatar
      include/linux/socket.h: Fix comment · 9cdb5dbf
      Rasmus Villemoes authored
      File descriptors are always closed on exit :-)
      Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9cdb5dbf
    • Loganaden Velvindron's avatar
      net: Add missing descriptions for fwmark_reflect for ipv4 and ipv6. · 219b5f29
      Loganaden Velvindron authored
      It was initially sent by Lorenzo Colitti, but was subsequently
      lost in the final diff he submitted.
      Signed-off-by: default avatarLoganaden Velvindron <logan@elandsys.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      219b5f29
    • Jesse Gross's avatar
      geneve: Unregister pernet subsys on module unload. · d3ca9eaf
      Jesse Gross authored
      The pernet ops aren't ever unregistered, which causes a memory
      leak and an OOPs if the module is ever reinserted.
      
      Fixes: 0b5e8b8e ("net: Add Geneve tunneling protocol driver")
      CC: Andy Zhou <azhou@nicira.com>
      Signed-off-by: default avatarJesse Gross <jesse@nicira.com>
      Acked-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d3ca9eaf
    • Jesse Gross's avatar
      geneve: Set GSO type on transmit. · 45cac46e
      Jesse Gross authored
      Geneve does not currently set the inner protocol type when
      transmitting packets. This causes GSO segmentation to fail on NICs
      that do not support Geneve offloading.
      
      CC: Andy Zhou <azhou@nicira.com>
      Signed-off-by: default avatarJesse Gross <jesse@nicira.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      45cac46e
  2. 04 Nov, 2014 4 commits
    • David S. Miller's avatar
      Merge branch 'xgene-net' · 15e4123b
      David S. Miller authored
      Iyappan Subramanian says:
      
      ====================
      drivers: net: xgene: Fix crash for backward compatibility
      
      This patch set fixes the following issues that were reported during regression.
      
      Patch 1,2 : Adds backward compatibility with the older firmware (<= 1.13.28).
      Patch 3   : Use separate hardware resources (descriptor ring, prefetch buffer)
      	   that are not shared with the firmware
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      15e4123b
    • Iyappan Subramanian's avatar
      drivers: net: xgene: fix: Use separate resources · bdd330f0
      Iyappan Subramanian authored
      This patch fixes the following kernel crash during SGMII based 1GbE probe.
      
      	BUG: Bad page state in process swapper/0  pfn:40fe6ad
      	page:ffffffbee37a75d8 count:-1 mapcount:0 mapping:          (null) index:0x0
      	flags: 0x0()
      	page dumped because: nonzero _count
      	Modules linked in:
      	CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.17.0+ #7
      	Call trace:
      	[<ffffffc000087fa0>] dump_backtrace+0x0/0x12c
      	[<ffffffc0000880dc>] show_stack+0x10/0x1c
      	[<ffffffc0004d981c>] dump_stack+0x74/0xc4
      	[<ffffffc00012fe70>] bad_page+0xd8/0x128
      	[<ffffffc000133000>] get_page_from_freelist+0x4b8/0x640
      	[<ffffffc000133260>] __alloc_pages_nodemask+0xd8/0x834
      	[<ffffffc0004194f8>] __netdev_alloc_frag+0x124/0x1b8
      	[<ffffffc00041bfdc>] __netdev_alloc_skb+0x90/0x10c
      	[<ffffffc00039ff30>] xgene_enet_refill_bufpool+0x11c/0x280
      	[<ffffffc0003a11a4>] xgene_enet_process_ring+0x168/0x340
      	[<ffffffc0003a1498>] xgene_enet_napi+0x1c/0x50
      	[<ffffffc00042b454>] net_rx_action+0xc8/0x18c
      	[<ffffffc0000b0880>] __do_softirq+0x114/0x24c
      	[<ffffffc0000b0c34>] irq_exit+0x94/0xc8
      	[<ffffffc0000e68a0>] __handle_domain_irq+0x8c/0xf4
      	[<ffffffc000081288>] gic_handle_irq+0x30/0x7c
      
      This was due to hardware resource sharing conflict with the firmware. This
      patch fixes this crash by using resources (descriptor ring, prefetch buffer)
      that are not shared.
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarKeyur Chudgar <kchudgar@apm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bdd330f0
    • Iyappan Subramanian's avatar
      drivers: net: xgene: Backward compatibility with older firmware · c3f4465d
      Iyappan Subramanian authored
      This patch adds support when used with older firmware (<= 1.13.28).
      
      - Added xgene_ring_mgr_init() to check whether ring manager is initialized
      - Calling xgene_ring_mgr_init() from xgene_port_ops.reset()
      - To handle errors, changed the return type of xgene_port_ops.reset()
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarKeyur Chudgar <kchudgar@apm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c3f4465d
    • Iyappan Subramanian's avatar
      dtb: xgene: fix: Backward compatibility with older firmware · 09c9e059
      Iyappan Subramanian authored
      The following kernel crash was reported when using older firmware (<= 1.13.28).
      
      [    0.980000] libphy: APM X-Gene MDIO bus: probed
      [    1.130000] Unhandled fault: synchronous external abort (0x96000010) at 0xffffff800009a17c
      [    1.140000] Internal error: : 96000010 [#1] SMP
      [    1.140000] Modules linked in:
      [    1.140000] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.17.0+ #21
      [    1.140000] task: ffffffc3f0110000 ti: ffffffc3f0064000 task.ti: ffffffc3f0064000
      [    1.140000] PC is at ioread32+0x58/0x68
      [    1.140000] LR is at xgene_enet_setup_ring+0x18c/0x1cc
      [    1.140000] pc : [<ffffffc0003cec68>] lr : [<ffffffc00053dad8>] pstate: a0000045
      [    1.140000] sp : ffffffc3f0067b20
      [    1.140000] x29: ffffffc3f0067b20 x28: ffffffc000aa8ea0
      [    1.140000] x27: ffffffc000bb2000 x26: ffffffc000a64270
      [    1.140000] x25: ffffffc000b05ad8 x24: ffffffc0ff99ba58
      [    1.140000] x23: 0000000000004000 x22: 0000000000004000
      [    1.140000] x21: 0000000000000200 x20: 0000000000200000
      [    1.140000] x19: ffffffc0ff99ba18 x18: ffffffc0007a6000
      [    1.140000] x17: 0000000000000007 x16: 000000000000000e
      [    1.140000] x15: 0000000000000001 x14: 0000000000000000
      [    1.140000] x13: ffffffbeedb71320 x12: 00000000ffffff80
      [    1.140000] x11: 0000000000000002 x10: 0000000000000000
      [    1.140000] x9 : 0000000000000000 x8 : ffffffc3eb2a4000
      [    1.140000] x7 : 0000000000000000 x6 : 0000000000000000
      [    1.140000] x5 : 0000000001080000 x4 : 000000007d654010
      [    1.140000] x3 : ffffffffffffffff x2 : 000000000003ffff
      [    1.140000] x1 : ffffff800009a17c x0 : ffffff800009a17c
      
      The issue was that the older firmware does not support 10GbE and
      SGMII based 1GBE interfaces.
      
      This patch changes the address length of the reg property of sgmii0 and xgmii
      nodes and serves as preparatory patch for the fix.
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarKeyur Chudgar <kchudgar@apm.com>
      Reported-by: default avatarDann Frazier <dann.frazier@canonical.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09c9e059
  3. 03 Nov, 2014 13 commits
    • Edward Cree's avatar
      sfc: don't BUG_ON efx->max_channels == 0 in probe · 9fd3d3a4
      Edward Cree authored
      efx_ef10_probe() was BUGging out if the BAR2 size was 0.  This is
       unnecessarily violent; instead we should just fail to probe the device.
      Kept a WARN_ON as this problem indicates a broken or misconfigured NIC.
      Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9fd3d3a4
    • David S. Miller's avatar
      Merge branch 'ipv6_tunnel_iflink_init' · c495d648
      David S. Miller authored
      Steffen Klassert says:
      
      ====================
      ipv6: Fix iflink setting for ipv6 tunnels
      
      The ipv6 tunnels do the dev->iflink setting too early, it gets
      overwritten by register_netdev(). So set dev->iflink from within
      a ndo_init function to keep the configured setting.
      
      This patchset fixes this for ip6_tunnel, vti6, sit and gre6.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c495d648
    • Steffen Klassert's avatar
      gre6: Move the setting of dev->iflink into the ndo_init functions. · f03eb128
      Steffen Klassert authored
      Otherwise it gets overwritten by register_netdev().
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f03eb128
    • Steffen Klassert's avatar
      sit: Use ipip6_tunnel_init as the ndo_init function. · ebe084aa
      Steffen Klassert authored
      ipip6_tunnel_init() sets the dev->iflink via a call to
      ipip6_tunnel_bind_dev(). After that, register_netdevice()
      sets dev->iflink = -1. So we loose the iflink configuration
      for ipv6 tunnels. Fix this by using ipip6_tunnel_init() as the
      ndo_init function. Then ipip6_tunnel_init() is called after
      dev->iflink is set to -1 from register_netdevice().
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ebe084aa
    • Steffen Klassert's avatar
      vti6: Use vti6_dev_init as the ndo_init function. · 16a0231b
      Steffen Klassert authored
      vti6_dev_init() sets the dev->iflink via a call to
      vti6_link_config(). After that, register_netdevice()
      sets dev->iflink = -1. So we loose the iflink configuration
      for vti6 tunnels. Fix this by using vti6_dev_init() as the
      ndo_init function. Then vti6_dev_init() is called after
      dev->iflink is set to -1 from register_netdevice().
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      16a0231b
    • Steffen Klassert's avatar
      ip6_tunnel: Use ip6_tnl_dev_init as the ndo_init function. · 6c6151da
      Steffen Klassert authored
      ip6_tnl_dev_init() sets the dev->iflink via a call to
      ip6_tnl_link_config(). After that, register_netdevice()
      sets dev->iflink = -1. So we loose the iflink configuration
      for ipv6 tunnels. Fix this by using ip6_tnl_dev_init() as the
      ndo_init function. Then ip6_tnl_dev_init() is called after
      dev->iflink is set to -1 from register_netdevice().
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6c6151da
    • Herbert Xu's avatar
      macvtap: Fix csum_start when VLAN tags are present · 3ce9b20f
      Herbert Xu authored
      When VLAN is in use in macvtap_put_user, we end up setting
      csum_start to the wrong place.  The result is that the whoever
      ends up doing the checksum setting will corrupt the packet instead
      of writing the checksum to the expected location, usually this
      means writing the checksum with an offset of -4.
      
      This patch fixes this by adjusting csum_start when VLAN tags are
      detected.
      
      Fixes: f09e2249 ("macvtap: restore vlan header on user read")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      
      Cheers,
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3ce9b20f
    • Nimrod Andy's avatar
      net: fec: fix suspend broken on multiple MACs sillicons · f4c4a4e0
      Nimrod Andy authored
      On i.MX6SX sdb platform, there has two same enet MACs, after system up,
      just eth0 is up, and then do suspend/resume test:
      
      [   50.437967] PM: Syncing filesystems ... done.
      [   50.476924] Freezing user space processes ... (elapsed 0.005 seconds) done.
      [   50.490093] Freezing remaining freezable tasks ... (elapsed 0.004 seconds) done.
      [   50.559771] ------------[ cut here ]------------
      [   50.564453] WARNING: CPU: 0 PID: 575 at drivers/clk/clk.c:851 __clk_disable+0x60/0x6c()
      [   50.572475] Modules linked in:
      [   50.575578] CPU: 0 PID: 575 Comm: sh Not tainted 3.18.0-rc2-next-20141031-00007-gf61135b #21
      [   50.584031] Backtrace:
      [   50.586550] [<80011ecc>] (dump_backtrace) from [<8001206c>] (show_stack+0x18/0x1c)
      [   50.594136]  r6:808a7a54 r5:00000000 r4:00000000 r3:00000000
      [   50.599920] [<80012054>] (show_stack) from [<806ab3c0>] (dump_stack+0x80/0x9c)
      [   50.607187] [<806ab340>] (dump_stack) from [<8002a3e8>] (warn_slowpath_common+0x6c/0x8c)
      [   50.615294]  r5:00000353 r4:00000000
      [   50.618940] [<8002a37c>] (warn_slowpath_common) from [<8002a42c>] (warn_slowpath_null+0x24/0x2c)
      [   50.627738]  r8:00000000 r7:be144c44 r6:be015600 r5:80070013 r4:be015600
      [   50.634573] [<8002a408>] (warn_slowpath_null) from [<804f8d4c>] (__clk_disable+0x60/0x6c)
      [   50.642777] [<804f8cec>] (__clk_disable) from [<804f8e5c>] (clk_disable+0x2c/0x38)
      [   50.650359]  r4:be015600 r3:00000000
      [   50.654006] [<804f8e30>] (clk_disable) from [<80420ab4>] (fec_enet_clk_enable+0xc4/0x258)
      [   50.662196]  r5:be3cb620 r4:be3cb000
      [   50.665838] [<804209f0>] (fec_enet_clk_enable) from [<80421178>] (fec_suspend+0x30/0x180)
      [   50.674026]  r7:be144c44 r6:be144c10 r5:8037f5a4 r4:be3cb000
      [   50.679802] [<80421148>] (fec_suspend) from [<8037f5d8>] (platform_pm_suspend+0x34/0x64)
      [   50.687906]  r10:00000000 r9:00000000 r8:00000000 r7:be144c44 r6:be144c10 r5:8037f5a4
      [   50.695852]  r4:be144c10 r3:80421148
      [   50.699511] [<8037f5a4>] (platform_pm_suspend) from [<8038784c>] (dpm_run_callback.isra.14+0x34/0x6c)
      [   50.708764] [<80387818>] (dpm_run_callback.isra.14) from [<80387f00>] (__device_suspend+0x12c/0x2a4)
      [   50.717909]  r9:8098ec8c r8:80973bec r6:00000002 r5:811c7038 r4:be144c10
      [   50.724746] [<80387dd4>] (__device_suspend) from [<803894fc>] (dpm_suspend+0x64/0x224)
      [   50.732675]  r8:80973bec r7:be144c10 r6:8098ec24 r5:811c7038 r4:be144cc4
      [   50.739509] [<80389498>] (dpm_suspend) from [<8038999c>] (dpm_suspend_start+0x60/0x68)
      [   50.747438]  r10:8082fa24 r9:00000000 r8:00000004 r7:00000003 r6:00000000 r5:8116ec80
      [   50.755386]  r4:00000002
      [   50.757969] [<8038993c>] (dpm_suspend_start) from [<800679d8>] (suspend_devices_and_enter+0x90/0x3ec)
      [   50.767202]  r4:00000003 r3:8116eca0
      [   50.770843] [<80067948>] (suspend_devices_and_enter) from [<80067f40>] (pm_suspend+0x20c/0x2a4)
      [   50.779553]  r8:00000004 r7:00000003 r6:00000000 r5:8116ec8c r4:00000003
      [   50.786394] [<80067d34>] (pm_suspend) from [<80066858>] (state_store+0x70/0xc0)
      [   50.793718]  r6:8116ec90 r5:00000003 r4:bd88a800 r3:0000006d
      [   50.799496] [<800667e8>] (state_store) from [<802b0384>] (kobj_attr_store+0x1c/0x28)
      [   50.807251]  r10:bd399f78 r8:00000000 r7:bd88a800 r6:bd88a800 r5:00000004 r4:bd085680
      [   50.815219] [<802b0368>] (kobj_attr_store) from [<80153090>] (sysfs_kf_write+0x54/0x58)
      [   50.823252] [<8015303c>] (sysfs_kf_write) from [<80151fd8>] (kernfs_fop_write+0xd0/0x194)
      [   50.831441]  r6:00000004 r5:bd08568c r4:bd085680 r3:8015303c
      [   50.837220] [<80151f08>] (kernfs_fop_write) from [<800eddb4>] (vfs_write+0xb8/0x1a8)
      [   50.844975]  r10:00000000 r9:00000000 r8:00000000 r7:bd399f78 r6:01336408 r5:00000004
      [   50.852924]  r4:bc584dc0
      [   50.855505] [<800edcfc>] (vfs_write) from [<800ee0b8>] (SyS_write+0x48/0x88)
      [   50.862567]  r10:00000000 r8:00000000 r7:01336408 r6:00000004 r5:bc584dc0 r4:bc584dc0
      [   50.870537] [<800ee070>] (SyS_write) from [<8000eb00>] (ret_fast_syscall+0x0/0x48)
      [   50.878120]  r9:bd398000 r8:8000ecc4 r7:00000004 r6:76f42b48 r5:01336408 r4:00000004
      [   50.885983] ---[ end trace 7545115d752a316a ]---
      [   50.890765] ------------[ cut here ]------------
      
      The root cause is that eth1 is not opened and clock is not enabled, and .suspend() still
      call .fec_enet_clk_enable() to disable clock.
      
      To avoid the broken, let it check network device up status by calling .netif_running()
      before disable/enable clocks.
      Signed-off-by: default avatarFugang Duan <B38611@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f4c4a4e0
    • David S. Miller's avatar
      Merge branch 'tun-net' · 2b11e678
      David S. Miller authored
      Herbert Xu says:
      
      ====================
      tun: Fix csum_start and TUN_PKT_STRIP
      
      The first patch fixes a serious problem that breaks checksum offload
      in VMs while the second patch fixes a problem that probably affects
      no one.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2b11e678
    • Herbert Xu's avatar
      tun: Fix TUN_PKT_STRIP setting · 2eb783c4
      Herbert Xu authored
      We set the flag TUN_PKT_STRIP if the user buffer provided is too
      small to contain the entire packet plus meta-data.  However, this
      has been broken ever since we added GSO meta-data.  VLAN acceleration
      also has the same problem.
      
      This patch fixes this by taking both into account when setting the
      TUN_PKT_STRIP flag.
      
      The fact that this has been broken for six years without anyone
      realising means that nobody actually uses this flag.
      
      Fixes: f43798c2 ("tun: Allow GSO using virtio_net_hdr")
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2eb783c4
    • Herbert Xu's avatar
      tun: Fix csum_start with VLAN acceleration · a8f9bfdf
      Herbert Xu authored
      When VLAN acceleration is in use on the xmit path, we end up
      setting csum_start to the wrong place.  The result is that the
      whoever ends up doing the checksum setting will corrupt the packet
      instead of writing the checksum to the expected location, usually
      this means writing the checksum with an offset of -4.
      
      This patch fixes this by adjusting csum_start when VLAN acceleration
      is detected.
      
      Fixes: 6680ec68 ("tuntap: hardware vlan tx support")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a8f9bfdf
    • stephen hemminger's avatar
      uapi: add missing network related headers to kbuild · 7071cf7f
      stephen hemminger authored
      The makefile for sanitizing kernel headers uses the kbuild file
      to determine which files to do. Several networking related headers
      were missing. Without these headers iproute2 build would break.
      Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7071cf7f
    • Guenter Roeck's avatar
      netfilter: nft_reject_bridge: Fix powerpc build error · c1207c04
      Guenter Roeck authored
      Fix:
      net/bridge/netfilter/nft_reject_bridge.c:
      In function 'nft_reject_br_send_v6_unreach':
      net/bridge/netfilter/nft_reject_bridge.c:240:3:
      	error: implicit declaration of function 'csum_ipv6_magic'
         csum_ipv6_magic(&nip6h->saddr, &nip6h->daddr,
         ^
      make[3]: *** [net/bridge/netfilter/nft_reject_bridge.o] Error 1
      
      Seen with powerpc:allmodconfig.
      
      Fixes: 523b929d ("netfilter: nft_reject_bridge: don't use IP stack to reject traffic")
      Cc: Pablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c1207c04
  4. 01 Nov, 2014 11 commits
    • Linus Walleij's avatar
      smc91x: retrieve IRQ and trigger flags in a modern way · d52fdbb7
      Linus Walleij authored
      The SMC91x is written to explicitly look up the IRQ resource
      from the platform device and extract the IRQ and flags, however
      the platform_get_irq() does additional things, like call
      of_irq_get() in the device tree case, which will translate
      the IRQ using the irqdomain and defer the probe if the
      IRQ host cannot be found.
      
      As we're not looking up the resource, this will not retrieve
      the IRQ flags, but that is better done using
      irqd_get_trigger_type(), as the trigger is what the driver
      wants to modify. We take care to preserve the semantics that
      will make the trigger type provided from the resource
      override any local specifier.
      
      Tested on the Nomadik NHK15 which has its SMC91x IRQ line
      connected to a STMPE2401 GPIO expander on I2C.
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d52fdbb7
    • Chen Gang's avatar
      drivers: net: ethernet: xilinx: xilinx_emaclite: Compatible with 'xlnx,... · 1db3ddff
      Chen Gang authored
      drivers: net: ethernet: xilinx: xilinx_emaclite: Compatible with 'xlnx, xps-ethernetlite-2.00.b' for QEMU using
      
      When use current latest upstream qemu (current version: 2.1.2), need let
      driver compatible with 'xlnx,xps-ethernetlite-2.00.b', or can not find
      net device in microblaze qemu. Related QEMU commands under fedora 20:
      
        yum install libvirt
        yum install tunctl
        tunctl -b
        ip link set tap0 up
        brctl addif virbr0 tap0
        ./microblaze-softmmu/qemu-system-microblaze -M petalogix-s3adsp1800 \
          -kernel ../linux-stable.microblaze/arch/microblaze/boot/linux.bin \
          -no-reboot -append "console=ttyUL0,115200 doreboot" -nographic \
          -net nic,vlan=0,model=xlnx.xps-ethernetlite,macaddr=00:16:35:AF:94:00 \
          -net tap,vlan=0,ifname=tap0,script=no,downscript=no
      
        in microblaze qemu bash (guest machine):
      
          ifconfig eth0 add 192.168.122.2 netmask 255.255.255.0
          ifconfig eth0 up
      
      After add this patch, can find the device, and can be used by 'telnetd'
      (need cross-build busybox with glibc for it), then outside can telnet to
      it without password.
      Signed-off-by: default avatarChen Gang <gang.chen.5i5j@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1db3ddff
    • David S. Miller's avatar
      Merge branch 'systemport-net' · 18688557
      David S. Miller authored
      Florian Fainelli says:
      
      ====================
      net: systemport: TX dma fixes
      
      This patch series contains two fixes for our transmit path, first one
      is a pretty nasty one since we were not allocating a large enough
      dma coherent pool for our transmit descriptors, which would work most of the
      time, since allocations are contiguous and we could have.
      
      Second patch fixes a less frequent, though highly likley crash when using
      CMA allocations.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      18688557
    • Florian Fainelli's avatar
      net: systemport: do not crash freeing an unitialized TX ring · 914adb55
      Florian Fainelli authored
      Callers of bcm_sysport_init_tx_ring() can currently fail, and will
      always call bcm_sysport_fini_tx_ring() in a loop ending at the number of
      TX queues (32) without checking if the TX ring was successfully
      initialized or not.
      
      Update bcm_sysport_fini_tx_ring() to return early and avoid a crash
      de-referencing ring->cbs if the TX ring was not initialized, since
      ring->cbs is the last part of the initialization done by
      bcm_sysport_init_tx_ring() that could fail.
      
      Fixes: 80105bef ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
      Reported-by: default avatarMaxime Bizon <mbizon@freebox.fr>
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      914adb55
    • Florian Fainelli's avatar
      net: systemport: fix DMA allocation/freeing sizes · 3e8fc38c
      Florian Fainelli authored
      We should not be allocating a single byte of DMA coherent memory, but
      instead a full-sized struct dma_desc (8 bytes).
      
      Fixes: 80105bef ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3e8fc38c
    • Sudip Mukherjee's avatar
      net: mvpp2: fix possible memory leak · 43737473
      Sudip Mukherjee authored
      we are allocating memory using kzalloc for struct mvpp2_prs_entry,
      but later when we are getting error we were just returning the error
      value without releasing the memory.
      Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      43737473
    • David S. Miller's avatar
      ec1f1276
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 9f935675
      Linus Torvalds authored
      Pull input updates from Dmitry Torokhov:
       "A bunch of fixes for minor defects reported by Coverity, a few driver
        fixups and revert of i8042.nomux change so that we are once again
        enable active MUX mode if box claims to support it"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Revert "Input: i8042 - disable active multiplexing by default"
        Input: altera_ps2 - use correct type for irq return value
        Input: altera_ps2 - write to correct register when disabling interrupts
        Input: max77693-haptic - fix potential overflow
        Input: psmouse - remove unneeded check in psmouse_reconnect()
        Input: vsxxxaa - fix code dropping bytes from queue
        Input: ims-pcu - fix dead code in ims_pcu_ofn_reg_addr_store()
        Input: opencores-kbd - fix error handling
        Input: wm97xx - adapt parameters to tosa touchscreen.
        Input: i8042 - quirks for Fujitsu Lifebook A544 and Lifebook AH544
        Input: stmpe-keypad - fix valid key line bitmask
        Input: soc_button_array - update calls to gpiod_get*()
      9f935675
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-3.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · ab01f963
      Linus Torvalds authored
      Pull ACPI and power management fixes from Rafael Wysocki:
       "These are fixes received after my previous pull request plus one that
        has been in the works for quite a while, but its previous version
        caused problems to happen, so it's been deferred till now.
      
        Fixed are two recent regressions (MFD enumeration and cpufreq-dt),
        ACPI EC regression introduced in 3.17, system suspend error code path
        regression introduced in 3.15, an older bug related to recovery from
        failing resume from hibernation and a cpufreq-dt driver issue related
        to operation performance points.
      
        Specifics:
      
         - Fix a crash on r8a7791/koelsch during resume from system suspend
           caused by a recent cpufreq-dt commit (Geert Uytterhoeven).
      
         - Fix an MFD enumeration problem introduced by a recent commit adding
           ACPI support to the MFD subsystem that exposed a weakness in the
           ACPI core causing ACPI enumeration to be applied to all devices
           associated with one ACPI companion object, although it should be
           used for one of them only (Mika Westerberg).
      
         - Fix an ACPI EC regression introduced during the 3.17 cycle causing
           some Samsung laptops to misbehave as a result of a workaround
           targeted at some Acer machines.  That includes a revert of a commit
           that went too far and a quirk for the Acer machines in question.
           From Lv Zheng.
      
         - Fix a regression in the system suspend error code path introduced
           during the 3.15 cycle that causes it to fail to take errors from
           asychronous execution of "late" suspend callbacks into account
           (Imre Deak).
      
         - Fix a long-standing bug in the hibernation resume error code path
           that fails to roll back everything correcty on "freeze" callback
           errors and leaves some devices in a "suspended" state causing more
           breakage to happen subsequently (Imre Deak).
      
         - Make the cpufreq-dt driver disable operation performance points
           that are not supported by the VR connected to the CPU voltage plane
           with acceptable tolerance instead of constantly failing voltage
           scaling later on (Lucas Stach)"
      
      * tag 'pm+acpi-3.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI / EC: Fix regression due to conflicting firmware behavior between Samsung and Acer.
        Revert "ACPI / EC: Add support to disallow QR_EC to be issued before completing previous QR_EC"
        cpufreq: cpufreq-dt: Restore default cpumask_setall(policy->cpus)
        PM / Sleep: fix recovery during resuming from hibernation
        PM / Sleep: fix async suspend_late/freeze_late error handling
        ACPI: Use ACPI companion to match only the first physical device
        cpufreq: cpufreq-dt: disable unsupported OPPs
      ab01f963
    • Linus Torvalds's avatar
      Merge tag 'pci-v3.18-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 08da742e
      Linus Torvalds authored
      Pull PCI fixes from Bjorn Helgaas:
       "These changes, intended for v3.18, fix:
      
        Sysfs
          - Fix "enable" filename change (Greg Kroah-Hartman)
      
            An unintentional sysfs filename change in commit 5136b2da
            ("PCI: convert bus code to use dev_groups"), which appeared in
            v3.13, changed "enable" to "enabled", and this changes it back.
      
            Old users of "enable" are currently broken and will be helped by
            this change.  Anything that started to use "enabled" after v3.13
            will be broken by this change.  If necessary, we can add a symlink
            to make both work, but this patch doesn't do that.
      
        PCI device hotplug
          - Revert duplicate merge (Kamal Mostafa)
      
            A mistaken duplicate merge that added a check twice.  Nothing's
            broken; this just removes the unnecessary code.
      
        Freescale i.MX6
          - Wait for clocks to stabilize after ref_en (Richard Zhu)
      
            An i.MX6 clock problem that prevents mx6 nitrogen boards from booting"
      
      * tag 'pci-v3.18-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        PCI: Rename sysfs 'enabled' file back to 'enable'
        PCI: imx6: Wait for clocks to stabilize after ref_en
        Revert duplicate "PCI: pciehp: Prevent NULL dereference during probe"
      08da742e
    • Andy Lutomirski's avatar
      x86_64, entry: Fix out of bounds read on sysenter · 653bc77a
      Andy Lutomirski authored
      Rusty noticed a Really Bad Bug (tm) in my NT fix.  The entry code
      reads out of bounds, causing the NT fix to be unreliable.  But, and
      this is much, much worse, if your stack is somehow just below the
      top of the direct map (or a hole), you read out of bounds and crash.
      
      Excerpt from the crash:
      
      [    1.129513] RSP: 0018:ffff88001da4bf88  EFLAGS: 00010296
      
        2b:*    f7 84 24 90 00 00 00     testl  $0x4000,0x90(%rsp)
      
      That read is deterministically above the top of the stack.  I
      thought I even single-stepped through this code when I wrote it to
      check the offset, but I clearly screwed it up.
      
      Fixes: 8c7aa698 ("x86_64, entry: Filter RFLAGS.NT on entry from userspace")
      Reported-by: default avatarRusty Russell <rusty@ozlabs.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      653bc77a