1. 09 Mar, 2015 9 commits
  2. 06 Mar, 2015 7 commits
  3. 05 Mar, 2015 7 commits
    • Mark Salter's avatar
      net: eth: xgene: fix booting with devicetree · b0ab0afa
      Mark Salter authored
      Commit de7b5b3d ("net: eth: xgene: change APM X-Gene SoC platform
      ethernet to support ACPI") breaks booting with devicetree with UEFI
      firmware. In that case, I get:
      
      Unhandled fault: synchronous external abort (0x96000010) at 0xfffffc0000620010
       Internal error: : 96000010 [#1] SMP
       Modules linked in: vfat fat xfs libcrc32c ahci_xgene libahci_platform libahci
       CPU: 7 PID: 634 Comm: NetworkManager Not tainted 4.0.0-rc1+ #4
       Hardware name: AppliedMicro Mustang/Mustang, BIOS 1.1.0-rh-0.14 Mar  1 2015
       task: fffffe03d4c7e100 ti: fffffe03d4e24000 task.ti: fffffe03d4e24000
       PC is at xgene_enet_rd_mcx_mac.isra.11+0x58/0xd4
       LR is at xgene_gmac_tx_enable+0x2c/0x50
       pc : [<fffffe000069d6fc>] lr : [<fffffe000069dcc4>] pstate: 80000145
       sp : fffffe03d4e27590
       x29: fffffe03d4e27590 x28: 0000000000000000
       x27: fffffe03d4e277c0 x26: fffffe03da8fda10
       x25: fffffe03d4e2760c x24: fffffe03d49e28c0
       x23: fffffc0000620004 x22: 0000000000000000
       x21: fffffc0000620000 x20: fffffc0000620010
       x19: 000000000000000b x18: 000003ffd4a96020
       x17: 000003ff7fc1f7a0 x16: fffffe000079b9cc
       x15: 0000000000000000 x14: 0000000000000000
       x13: 0000000000000000 x12: fffffe03d4e24000
       x11: fffffe03d4e27da0 x10: 0000000000000001
       x9 : 0000000000000000 x8 : fffffe03d4e27a20
       x7 : 0000000000000000 x6 : 00000000ffffffef
       x5 : fffffe000105f7d0 x4 : fffffe00007ca8c8
       x3 : fffffe03d4e2760c x2 : 0000000000000000
       x1 : fffffc0000620000 x0 : 0000000040000000
      
       Process NetworkManager (pid: 634, stack limit = 0xfffffe03d4e24028)
       Stack: (0xfffffe03d4e27590 to 0xfffffe03d4e28000)
       ...
       Call trace:
       [<fffffe000069d6fc>] xgene_enet_rd_mcx_mac.isra.11+0x58/0xd4
       [<fffffe000069dcc0>] xgene_gmac_tx_enable+0x28/0x50
       [<fffffe00006a112c>] xgene_enet_open+0x2c/0x130
       [<fffffe00007b9254>] __dev_open+0xc8/0x148
       [<fffffe00007b956c>] __dev_change_flags+0x90/0x158
       [<fffffe00007b9664>] dev_change_flags+0x30/0x70
       [<fffffe00007c8ab8>] do_setlink+0x278/0x870
       [<fffffe00007c95bc>] rtnl_newlink+0x404/0x6a8
       [<fffffe00007c8040>] rtnetlink_rcv_msg+0x98/0x218
       [<fffffe00007e78e4>] netlink_rcv_skb+0xe0/0xf8
       [<fffffe00007c7f94>] rtnetlink_rcv+0x30/0x44
       [<fffffe00007e6f2c>] netlink_unicast+0xfc/0x210
       [<fffffe00007e75b8>] netlink_sendmsg+0x498/0x5ac
       [<fffffe00007990b8>] do_sock_sendmsg+0xa4/0xcc
       [<fffffe000079a958>] ___sys_sendmsg+0x1fc/0x208
       [<fffffe000079b984>] __sys_sendmsg+0x4c/0x94
       [<fffffe000079b9f8>] SyS_sendmsg+0x2c/0x3c
      
      The problem here is that the enet hw clocks are not getting
      initialized because of a test to avoid the initialization if
      UEFI is used to boot. This is an incorrect test. When booting
      with UEFI and devicetree, the kernel must still initialize
      the enet hw clocks. If booting with ACPI, the clock hw is
      not exposed to the kernel and it is that case where we want
      to avoid initializing clocks.
      Signed-off-by: default avatarMark Salter <msalter@redhat.com>
      Acked-by: default avatarFeng Kan <fkan@apm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0ab0afa
    • Brian King's avatar
      bnx2x: Force fundamental reset for EEH recovery · da293700
      Brian King authored
      EEH recovery for bnx2x based adapters is not reliable on all Power
      systems using the default hot reset, which can result in an
      unrecoverable EEH error. Forcing the use of fundamental reset
      during EEH recovery fixes this.
      
      Cc: stable<stable@vger.kernel.org>
      Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      da293700
    • David S. Miller's avatar
      Merge branch 'xen-netback' · 08c852c4
      David S. Miller authored
      David Vrabel says:
      
      ====================
      xen-netback: fix ethtool stats and memory leak
      
      A couple of bug fixes for netback:
      - make ethool stats to report the correct values.
      - don't leak 1 MiB every time a VIF is destroyed.
      
      Changes in v2:
      - Split 2nd patch into leak fix and refactor patches
      ====================
      Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      08c852c4
    • David Vrabel's avatar
      xen-netback: refactor xenvif_handle_frag_list() · b0c21bad
      David Vrabel authored
      When handling a from-guest frag list, xenvif_handle_frag_list()
      replaces the frags before calling the destructor to clean up the
      original (foreign) frags.  Whilst this is safe (the destructor doesn't
      actually use the frags), it looks odd.
      
      Reorder the function to be less confusing.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0c21bad
    • David Vrabel's avatar
      xen-netback: unref frags when handling a from-guest skb with a frag list · 49d9991a
      David Vrabel authored
      Every time a VIF is destroyed up to 256 pages may be leaked if packets
      with more than MAX_SKB_FRAGS frags were transmitted from the guest.
      Even worse, if another user of ballooned pages allocated one of these
      ballooned pages it would not handle the unexpectedly >1 page count
      (e.g., gntdev would deadlock when unmapping a grant because the page
      count would never reach 1).
      
      When handling a from-guest skb with a frag list, unref the frags
      before releasing them so they are freed correctly when the VIF is
      destroyed.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      49d9991a
    • David Vrabel's avatar
      xen-netback: return correct ethtool stats · d63951d7
      David Vrabel authored
      Use correct pointer arithmetic to get the pointer to each stat.
      Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d63951d7
    • Arnd Bergmann's avatar
      ARM: fix typos in smc91x platform data · 04b91701
      Arnd Bergmann authored
      I recently did a rework of the smc91x driver and did some build-testing
      by compiling hundreds of randconfig kernels. Unfortunately, my script
      was wrong and did not actually test the configurations that mattered,
      so I introduced stupid typos in almost every file I touched.
      
      I fixed my script now, built all configurations that actually matter
      and fixed all the typos, this is the result.
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Fixes: b70661c7 ("net: smc91x: use run-time configuration on all ARM machines")
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      04b91701
  4. 04 Mar, 2015 17 commits
    • Jiri Pirko's avatar
      team: don't traverse port list using rcu in team_set_mac_address · 9215f437
      Jiri Pirko authored
      Currently the list is traversed using rcu variant. That is not correct
      since dev_set_mac_address can be called which eventually calls
      rtmsg_ifinfo_build_skb and there, skb allocation can sleep. So fix this
      by remove the rcu usage here.
      
      Fixes: 3d249d4c "net: introduce ethernet teaming device"
      Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9215f437
    • Fugang Duan's avatar
      net: fec: fix rcv is not last issue when do suspend/resume test · 61615cd2
      Fugang Duan authored
      When do suspend/resume stress test, some log shows "rcv is not +last".
      The issue is that enet suspend will disable phy clock, phy link down,
      after resume back, enet MAC redo initial and ready to tx/rx packet,
      but phy still is not ready which is doing auto-negotiation. When phy
      link is not up, don't schdule napi soft irq.
      
      [Peter]
      It has fixed kernel panic after long time suspend/resume test
      with nfs rootfs.
      
      [ 8864.429458] fec 2188000.ethernet eth0: rcv is not +last
      [ 8864.434799] fec 2188000.ethernet eth0: rcv is not +last
      [ 8864.440088] fec 2188000.ethernet eth0: rcv is not +last
      [ 8864.445424] fec 2188000.ethernet eth0: rcv is not +last
      [ 8864.450782] fec 2188000.ethernet eth0: rcv is not +last
      [ 8864.456111] Unable to handle kernel NULL pointer dereference at virtual address 00000000
      [ 8864.464225] pgd = 80004000
      [ 8864.466997] [00000000] *pgd=00000000
      [ 8864.470627] Internal error: Oops: 17 [#1] SMP ARM
      [ 8864.475353] Modules linked in: evbug
      [ 8864.479006] CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 4.0.0-rc1-00044-g7a2a1d2 #234
      [ 8864.486854] Hardware name: Freescale i.MX6 SoloX (Device Tree)
      [ 8864.492709] task: be069380 ti: be07a000 task.ti: be07a000
      [ 8864.498137] PC is at memcpy+0x80/0x330
      [ 8864.501919] LR is at gro_pull_from_frag0+0x34/0xa8
      [ 8864.506735] pc : [<802bb080>]    lr : [<8057c204>]    psr: 00000113
      [ 8864.506735] sp : be07bbd4  ip : 00000010  fp : be07bc0c
      [ 8864.518235] r10: 0000000e  r9 : 00000000  r8 : 809c7754
      [ 8864.523479] r7 : 809c7754  r6 : bb43c040  r5 : bd280cc0  r4 : 00000012
      [ 8864.530025] r3 : 00000804  r2 : fffffff2  r1 : 00000000  r0 : bb43b83c
      [ 8864.536575] Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      [ 8864.543904] Control: 10c5387d  Table: bd14c04a  DAC: 00000015
      [ 8864.549669] Process ksoftirqd/0 (pid: 3, stack limit = 0xbe07a210)
      [ 8864.555869] Stack: (0xbe07bbd4 to 0xbe07c000)
      [ 8864.560250] bbc0:                                              bd280cc0 bb43c040 809c7754
      [ 8864.568455] bbe0: 809c7754 bb43b83c 00000012 8057c204 00000000 bd280cc0 bd8a0718 00000003
      [ 8864.576658] bc00: be07bc5c be07bc10 8057ebf0 8057c1dc 00000000 00000000 8057ecc4 bef59760
      [ 8864.584863] bc20: 00000002 bd8a0000 be07bc64 809c7754 00000000 bd8a0718 bd280cc0 bd8a0000
      [ 8864.593066] bc40: 00000000 0000001c 00000000 bd8a0000 be07bc74 be07bc60 8057f148 8057eb90
      [ 8864.601268] bc60: bf0810a0 00000000 be07bcf4 be07bc78 8044e7b4 8057f12c 00000000 8007df6c
      [ 8864.609470] bc80: bd8a0718 00000040 00000000 bd280a80 00000002 00000019 bd8a0600 bd8a1214
      [ 8864.617672] bca0: bd8a0690 bf0810a0 00000000 00000000 bd8a1000 00000000 00000027 bd280cc0
      [ 8864.625874] bcc0: 80062708 800625cc 000943db bd8a0718 00000001 000d1166 00000040 be7c1ec0
      [ 8864.634077] bce0: 0000012c be07bd00 be07bd3c be07bcf8 8057fc98 8044e3ac 809c2ec0 3ddff000
      [ 8864.642280] bd00: be07bd00 be07bd00 be07bd08 be07bd08 00000000 00000020 809c608c 00000003
      [ 8864.650481] bd20: 809c6080 40000001 809c6088 00200100 be07bd84 be07bd40 8002e690 8057fac8
      [ 8864.658684] bd40: be07bd64 be07bd50 00000001 04208040 000d1165 0000000a be07bd84 809c0d7c
      [ 8864.666885] bd60: 00000000 809c6af8 00000000 00000001 be008000 00000000 be07bd9c be07bd88
      [ 8864.675087] bd80: 8002eb64 8002e564 00000125 809c0d7c be07bdc4 be07bda0 8006f100 8002eaac
      [ 8864.683291] bda0: c080e10c be07bde8 809c6c6c c080e100 00000002 00000000 be07bde4 be07bdc8
      [ 8864.691492] bdc0: 800087a0 8006f098 806f2934 20000013 ffffffff be07be1c be07be44 be07bde8
      [ 8864.699695] bde0: 800133a4 80008784 00000001 00000001 00000000 00000000 be7c1680 00000000
      [ 8864.707896] be00: be0cfe00 bd93eb40 00000002 00000000 00000000 be07be44 be07be00 be07be30
      [ 8864.716098] be20: 8006278c 806f2934 20000013 ffffffff be069380 be7c1680 be07be7c be07be48
      [ 8864.724300] be40: 80049cfc 806f2910 00000001 00000000 80049cb4 00000000 be07be7c be7c1680
      [ 8864.732502] be60: be3289c0 be069380 bd23b600 be0cfe00 be07bebc be07be80 806ed614 80049c68
      [ 8864.740706] be80: be07a000 0000020a 809c608c 00000003 00000001 8002e858 be07a000 be035740
      [ 8864.748907] bea0: 00000000 00000001 809d4598 00000000 be07bed4 be07bec0 806edd0c 806ed440
      [ 8864.757110] bec0: be07a000 be07a000 be07bee4 be07bed8 806edd68 806edcf0 be07bef4 be07bee8
      [ 8864.765311] bee0: 8002e860 806edd34 be07bf24 be07bef8 800494b0 8002e828 be069380 00000000
      [ 8864.773512] bf00: be035780 be035740 8004938c 00000000 00000000 00000000 be07bfac be07bf28
      [ 8864.781715] bf20: 80045928 80049398 be07bf44 00000001 00000000 be035740 00000000 00030003
      [ 8864.789917] bf40: dead4ead ffffffff ffffffff 80a2716c 80b59b00 00000000 8088c954 be07bf5c
      [ 8864.798120] bf60: be07bf5c 00000000 00000000 dead4ead ffffffff ffffffff 80a2716c 00000000
      [ 8864.806320] bf80: 00000000 8088c954 be07bf88 be07bf88 be035780 8004584c 00000000 00000000
      [ 8864.814523] bfa0: 00000000 be07bfb0 8000ed10 80045858 00000000 00000000 00000000 00000000
      [ 8864.822723] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      [ 8864.830925] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 5ffbb5f7 f9fcf5e7
      [ 8864.839115] Backtrace:
      [ 8864.841631] [<8057c1d0>] (gro_pull_from_frag0) from [<8057ebf0>] (dev_gro_receive+0x6c/0x3f8)
      [ 8864.850173]  r6:00000003 r5:bd8a0718 r4:bd280cc0 r3:00000000
      [ 8864.855958] [<8057eb84>] (dev_gro_receive) from [<8057f148>] (napi_gro_receive+0x28/0xac)
      [ 8864.864152]  r10:bd8a0000 r9:00000000 r8:0000001c r7:00000000 r6:bd8a0000 r5:bd280cc0
      [ 8864.872115]  r4:bd8a0718
      [ 8864.874713] [<8057f120>] (napi_gro_receive) from [<8044e7b4>] (fec_enet_rx_napi+0x414/0xc74)
      [ 8864.883167]  r5:00000000 r4:bf0810a0
      [ 8864.886823] [<8044e3a0>] (fec_enet_rx_napi) from [<8057fc98>] (net_rx_action+0x1dc/0x2ec)
      [ 8864.895016]  r10:be07bd00 r9:0000012c r8:be7c1ec0 r7:00000040 r6:000d1166 r5:00000001
      [ 8864.902982]  r4:bd8a0718
      [ 8864.905570] [<8057fabc>] (net_rx_action) from [<8002e690>] (__do_softirq+0x138/0x2c4)
      [ 8864.913417]  r10:00200100 r9:809c6088 r8:40000001 r7:809c6080 r6:00000003 r5:809c608c
      [ 8864.921382]  r4:00000020
      [ 8864.923966] [<8002e558>] (__do_softirq) from [<8002eb64>] (irq_exit+0xc4/0x138)
      [ 8864.931289]  r10:00000000 r9:be008000 r8:00000001 r7:00000000 r6:809c6af8 r5:00000000
      [ 8864.939252]  r4:809c0d7c
      [ 8864.941841] [<8002eaa0>] (irq_exit) from [<8006f100>] (__handle_domain_irq+0x74/0xe8)
      [ 8864.949688]  r4:809c0d7c r3:00000125
      [ 8864.953342] [<8006f08c>] (__handle_domain_irq) from [<800087a0>] (gic_handle_irq+0x28/0x68)
      [ 8864.961707]  r9:00000000 r8:00000002 r7:c080e100 r6:809c6c6c r5:be07bde8 r4:c080e10c
      [ 8864.969597] [<80008778>] (gic_handle_irq) from [<800133a4>] (__irq_svc+0x44/0x5c)
      [ 8864.977097] Exception stack(0xbe07bde8 to 0xbe07be30)
      [ 8864.982173] bde0:                   00000001 00000001 00000000 00000000 be7c1680 00000000
      [ 8864.990377] be00: be0cfe00 bd93eb40 00000002 00000000 00000000 be07be44 be07be00 be07be30
      [ 8864.998573] be20: 8006278c 806f2934 20000013 ffffffff
      [ 8865.003638]  r7:be07be1c r6:ffffffff r5:20000013 r4:806f2934
      [ 8865.009447] [<806f2904>] (_raw_spin_unlock_irq) from [<80049cfc>] (finish_task_switch+0xa0/0x160)
      [ 8865.018334]  r4:be7c1680 r3:be069380
      [ 8865.021993] [<80049c5c>] (finish_task_switch) from [<806ed614>] (__schedule+0x1e0/0x5dc)
      [ 8865.030098]  r8:be0cfe00 r7:bd23b600 r6:be069380 r5:be3289c0 r4:be7c1680
      [ 8865.036942] [<806ed434>] (__schedule) from [<806edd0c>] (preempt_schedule_common+0x28/0x44)
      [ 8865.045307]  r9:00000000 r8:809d4598 r7:00000001 r6:00000000 r5:be035740 r4:be07a000
      [ 8865.053197] [<806edce4>] (preempt_schedule_common) from [<806edd68>] (_cond_resched+0x40/0x48)
      [ 8865.061822]  r4:be07a000 r3:be07a000
      [ 8865.065472] [<806edd28>] (_cond_resched) from [<8002e860>] (run_ksoftirqd+0x44/0x64)
      [ 8865.073252] [<8002e81c>] (run_ksoftirqd) from [<800494b0>] (smpboot_thread_fn+0x124/0x190)
      [ 8865.081550] [<8004938c>] (smpboot_thread_fn) from [<80045928>] (kthread+0xdc/0xf8)
      [ 8865.089133]  r10:00000000 r9:00000000 r8:00000000 r7:8004938c r6:be035740 r5:be035780
      [ 8865.097097]  r4:00000000 r3:be069380
      [ 8865.100752] [<8004584c>] (kthread) from [<8000ed10>] (ret_from_fork+0x14/0x24)
      [ 8865.107990]  r7:00000000 r6:00000000 r5:8004584c r4:be035780
      [ 8865.113767] Code: e320f000 e4913004 e4914004 e4915004 (e4916004)
      [ 8865.120006] ---[ end trace b0a4c6bd499288ca ]---
      [ 8865.124697] Kernel panic - not syncing: Fatal exception in interrupt
      [ 8865.131084] ---[ end Kernel panic - not syncing: Fatal exception in interrupt
      
      Cc: [v3.19+] stable@vger.kernel.org
      Tested-by: default avatarPeter Chen <peter.chen@freescale.com>
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      Signed-off-by: default avatarFugang Duan <B38611@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61615cd2
    • David S. Miller's avatar
      Merge branch 'xgene' · 485acc2c
      David S. Miller authored
      Iyappan Subramanian says:
      
      ====================
      drivers: net: xgene: Fix backward compatibility of newer firmware with older kernel
      
      Kernel 3.17 driver supports only RGMII ethernet interface.
      Since the Tianocore DT contains same compatibility string for RGMII,
      SGMII based 1G and XFI based 10G interfaces, crash happens when probe called
      on SGMII based 1G and XFI based 10G interface.
      
      This patch fixes the backward compatibility of the older driver with the
      newer firmware by making the binding unique so that the older driver won't
      recognize the non-supported interfaces.
      
      v2: Address comments from v1
      * updated cover letter subject line with net: xgene
      * Documentation: formatted compatible string values as list
      
      v1:
      * Initial version
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      485acc2c
    • Iyappan Subramanian's avatar
      drivers: net: xgene: fix new firmware backward compatibility with older driver · ecadf4e7
      Iyappan Subramanian authored
      This patch fixes the backward compatibile of the older driver with the
      newer firmware by making the binding unique so that the older driver won't
      recognize the non-supported interfaces.
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarKeyur Chudgar <kchudgar@apm.com>
      Tested-by: default avatarMark Langsdorf <mlangsdo@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ecadf4e7
    • Iyappan Subramanian's avatar
      dtb: change binding name to match with newer firmware DT · 2a91eb72
      Iyappan Subramanian authored
      This patch fixes the backward compatibility of the older driver with the
      newer firmware by making the binding unique so that the older driver won't
      recognize the non-supported interfaces.
      
      The new bindings are in sync with the newer firmware.
      Signed-off-by: default avatarIyappan Subramanian <isubramanian@apm.com>
      Signed-off-by: default avatarKeyur Chudgar <kchudgar@apm.com>
      Tested-by: default avatarMark Langsdorf <mlangsdo@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a91eb72
    • Iyappan Subramanian's avatar
    • Lorenzo Colitti's avatar
      net: ping: Return EAFNOSUPPORT when appropriate. · 9145736d
      Lorenzo Colitti authored
      1. For an IPv4 ping socket, ping_check_bind_addr does not check
         the family of the socket address that's passed in. Instead,
         make it behave like inet_bind, which enforces either that the
         address family is AF_INET, or that the family is AF_UNSPEC and
         the address is 0.0.0.0.
      2. For an IPv6 ping socket, ping_check_bind_addr returns EINVAL
         if the socket family is not AF_INET6. Return EAFNOSUPPORT
         instead, for consistency with inet6_bind.
      3. Make ping_v4_sendmsg and ping_v6_sendmsg return EAFNOSUPPORT
         instead of EINVAL if an incorrect socket address structure is
         passed in.
      4. Make IPv6 ping sockets be IPv6-only. The code does not support
         IPv4, and it cannot easily be made to support IPv4 because
         the protocol numbers for ICMP and ICMPv6 are different. This
         makes connect(::ffff:192.0.2.1) fail with EAFNOSUPPORT instead
         of making the socket unusable.
      
      Among other things, this fixes an oops that can be triggered by:
      
          int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP);
          struct sockaddr_in6 sin6 = {
              .sin6_family = AF_INET6,
              .sin6_addr = in6addr_any,
          };
          bind(s, (struct sockaddr *) &sin6, sizeof(sin6));
      
      Change-Id: If06ca86d9f1e4593c0d6df174caca3487c57a241
      Signed-off-by: default avatarLorenzo Colitti <lorenzo@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9145736d
    • Nicolas Schichan's avatar
      bcm63xx_enet: fix poll callback. · cd33ccf5
      Nicolas Schichan authored
      In case there was some tx buffer reclaimed and not enough rx packets
      to consume the whole budget, napi_complete would not be called and
      interrupts would be kept disabled, effectively resulting in the
      network core never to call the poll callback again and no rx/tx
      interrupts to be fired either.
      
      Fix that by only accounting the rx work done in the poll callback.
      Signed-off-by: default avatarNicolas Schichan <nschichan@freebox.fr>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cd33ccf5
    • Alexey Brodkin's avatar
      stmmac: check IRQ availability early on probe · 8f02d8da
      Alexey Brodkin authored
      Currently we're getting IRQs after lots of resources are already
      allocated:
       * netdev
       * clocks
       * MDIO bus
      Also HW gets initialized by the time when checking IRQs as well.
      
      Now there's a possibility for master interrupt controller to be not
      probed yet. This will lead to exit from GMAC probe routine with "-
      EPROBE_DEFER" and so deferred probe will hapen later on.
      
      But since we exited the first GMAC probe without release of all
      allocated resources there could be conflicts on subsequent probes.
      
      For example this is what happens for me:
       --->8---
       stmmaceth e0018000.ethernet: no reset control found
       stmmac - user ID: 0x10, Synopsys ID: 0x37
        Ring mode enabled
        DMA HW capability register supported
        Normal descriptors
        RX Checksum Offload Engine supported (type 2)
        TX Checksum insertion supported
        Enable RX Mitigation via HW Watchdog Timer
       libphy: stmmac: probed
       eth0: PHY ID 20005c7a at 1 IRQ POLL (stmmac-0:01) active
       platform e0018000.ethernet: Driver stmmaceth requests probe deferral
       ...
       ...
       ...
       stmmaceth e0018000.ethernet: no reset control found
       stmmac - user ID: 0x10, Synopsys ID: 0x37
        Ring mode enabled
        DMA HW capability register supported
        Normal descriptors
        RX Checksum Offload Engine supported (type 2)
        TX Checksum insertion supported
        Enable RX Mitigation via HW Watchdog Timer
       ------------[ cut here ]------------
       WARNING: CPU: 0 PID: 6 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x4e/0x68()
       sysfs: cannot create duplicate filename
      '/devices/platform/axs10x_mb/e0018000.ethernet/mdio_bus/stmmac-0'
       CPU: 0 PID: 6 Comm: kworker/u2:0 Not tainted 4.0.0-rc1-next-20150303+#8
       Workqueue: deferwq deferred_probe_work_func
      
       Stack Trace:
        arc_unwind_core+0xb8/0x114
        warn_slowpath_common+0x5a/0x8c
        warn_slowpath_fmt+0x2e/0x38
        sysfs_warn_dup+0x4e/0x68
        sysfs_create_dir_ns+0x98/0xa0
        kobject_add_internal+0x8c/0x2e8
        kobject_add+0x4a/0x8c
        device_add+0xc6/0x448
        mdiobus_register+0x6c/0x164
        stmmac_mdio_register+0x112/0x264
        stmmac_dvr_probe+0x6c0/0x85c
        stmmac_pltfr_probe+0x2e4/0x50c
        platform_drv_probe+0x26/0x5c
        really_probe+0x76/0x1dc
        bus_for_each_drv+0x42/0x7c
        device_attach+0x64/0x6c
        bus_probe_device+0x74/0xa4
        deferred_probe_work_func+0x50/0x84
        process_one_work+0xf8/0x2cc
        worker_thread+0x110/0x478
        kthread+0x8a/0x9c
        ret_from_fork+0x14/0x18
       ---[ end trace a2dfaa7d630c8be1 ]---
       ------------[ cut here ]------------
       WARNING: CPU: 0 PID: 6 at lib/kobject.c:240
      kobject_add_internal+0x218/0x2e8()
       kobject_add_internal failed for stmmac-0 with -EEXIST, don't try to
      register things with the same name in the same di.
       CPU: 0 PID: 6 Comm: kworker/u2:0 Tainted: G        W
      4.0.0-rc1-next-20150303+ #8
       Workqueue: deferwq deferred_probe_work_func
      
       Stack Trace:
        arc_unwind_core+0xb8/0x114
        warn_slowpath_common+0x5a/0x8c
        warn_slowpath_fmt+0x2e/0x38
        kobject_add_internal+0x218/0x2e8
        kobject_add+0x4a/0x8c
        device_add+0xc6/0x448
        mdiobus_register+0x6c/0x164
        stmmac_mdio_register+0x112/0x264
        stmmac_dvr_probe+0x6c0/0x85c
        stmmac_pltfr_probe+0x2e4/0x50c
        platform_drv_probe+0x26/0x5c
        really_probe+0x76/0x1dc
        bus_for_each_drv+0x42/0x7c
        device_attach+0x64/0x6c
        bus_probe_device+0x74/0xa4
        deferred_probe_work_func+0x50/0x84
        process_one_work+0xf8/0x2cc
        worker_thread+0x110/0x478
        kthread+0x8a/0x9c
        ret_from_fork+0x14/0x18
       ---[ end trace a2dfaa7d630c8be2 ]---
       libphy: mii_bus stmmac-0 failed to register
       : Cannot register as MDIO bus
       stmmac_pltfr_probe: main driver probe failed
       stmmaceth: probe of e0018000.ethernet failed with error -22
       --->8---
      
      Essential fix is to check for IRQs availability as early as possible and
      then safely go to deferred probe if IRQs are not there yet.
      Signed-off-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Sonic Zhang <sonic.zhang@analog.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8f02d8da
    • Linus Torvalds's avatar
      Merge tag 'dma-buf-for-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/sumits/dma-buf · 6587457b
      Linus Torvalds authored
      Pull dma-buf fixes from Sumit Semwal:
       "Minor timeout & other fixes on reservation/fence"
      
      * tag 'dma-buf-for-4.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/sumits/dma-buf:
        reservation: Remove shadowing local variable 'ret'
        dma-buf/fence: don't wait when specified timeout is zero
        reservation: wait only with non-zero timeout specified (v3)
      6587457b
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/virt/kvm/kvm · b8e81a3b
      Linus Torvalds authored
      Pull KVM fixes from Marcelo Tosatti:
       "KVM bug fixes, including a SVM interrupt injection regression fix,
        MIPS and ARM bug fixes"
      
      * git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: MIPS: Enable after disabling interrupt
        KVM: MIPS: Fix trace event to save PC directly
        KVM: SVM: fix interrupt injection (apic->isr_count always 0)
        KVM: emulate: fix CMPXCHG8B on 32-bit hosts
        KVM: VMX: fix build without CONFIG_SMP
        arm/arm64: KVM: Add exit reaons to kvm_exit event tracing
        ARM: KVM: Fix size check in __coherent_cache_guest_page
      b8e81a3b
    • Pablo Neira Ayuso's avatar
      netfilter: nf_tables: fix error handling of rule replacement · 59900e0a
      Pablo Neira Ayuso authored
      In general, if a transaction object is added to the list successfully,
      we can rely on the abort path to undo what we've done. This allows us to
      simplify the error handling of the rule replacement path in
      nf_tables_newrule().
      
      This implicitly fixes an unnecessary removal of the old rule, which
      needs to be left in place if we fail to replace.
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      59900e0a
    • Patrick McHardy's avatar
      netfilter: nf_tables: fix userdata length overflow · 86f1ec32
      Patrick McHardy authored
      The NFT_USERDATA_MAXLEN is defined to 256, however we only have a u8
      to store its size. Introduce a struct nft_userdata which contains a
      length field and indicate its presence using a single bit in the rule.
      
      The length field of struct nft_userdata is also a u8, however we don't
      store zero sized data, so the actual length is udata->len + 1.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      86f1ec32
    • Patrick McHardy's avatar
      netfilter: nf_tables: check for overflow of rule dlen field · 9889840f
      Patrick McHardy authored
      Check that the space required for the expressions doesn't exceed the
      size of the dlen field, which would lead to the iterators crashing.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      9889840f
    • Patrick McHardy's avatar
      netfilter: nf_tables: fix transaction race condition · 8670c3a5
      Patrick McHardy authored
      A race condition exists in the rule transaction code for rules that
      get added and removed within the same transaction.
      
      The new rule starts out as inactive in the current and active in the
      next generation and is inserted into the ruleset. When it is deleted,
      it is additionally set to inactive in the next generation as well.
      
      On commit the next generation is begun, then the actions are finalized.
      For the new rule this would mean clearing out the inactive bit for
      the previously current, now next generation.
      
      However nft_rule_clear() clears out the bits for *both* generations,
      activating the rule in the current generation, where it should be
      deactivated due to being deleted. The rule will thus be active until
      the deletion is finalized, removing the rule from the ruleset.
      
      Similarly, when aborting a transaction for the same case, the undo
      of insertion will remove it from the RCU protected rule list, the
      deletion will clear out all bits. However until the next RCU
      synchronization after all operations have been undone, the rule is
      active on CPUs which can still see the rule on the list.
      
      Generally, there may never be any modifications of the current
      generations' inactive bit since this defeats the entire purpose of
      atomicity. Change nft_rule_clear() to only touch the next generations
      bit to fix this.
      Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      8670c3a5
    • Linus Torvalds's avatar
      Merge tag 'arc-4.0-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · f2cb4777
      Linus Torvalds authored
      Pull ARC fixes from Vineet Gupta:
       - Fix for /proc/<pid>/maps "stack" vma annotation
       - sched stats not printing correct sleeping task PC
       - perf not reporting page faults
      
      * tag 'arc-4.0-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARC: Fix thread_saved_pc()
        ARC: Fix KSTK_ESP()
        ARC: perf: Enable generic software events
        ARC: Make arc_unwind_core accessible externally
      f2cb4777
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux · 97754e3c
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       - Fix for dynticks.
       - Fix for smpboot bug.
       - Fix for IOMMU group refcounting.
      
      * tag 'powerpc-4.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mpe/linux:
        powerpc/iommu: Remove IOMMU device references via bus notifier
        powerpc/smp: Wait until secondaries are active & online
        powerpc: Re-enable dynticks
      97754e3c