1. 27 Apr, 2015 7 commits
    • Amir Vadai's avatar
      net/mlx4_en: Prevent setting invalid RSS hash function · b3706909
      Amir Vadai authored
      mlx4_en_check_rxfh_func() was checking for hardware support before
      setting a known RSS hash function, but didn't do any check before
      setting unknown RSS hash function. Need to make it fail on such values.
      In this occasion, moved the actual setting of the new value from the
      check function into mlx4_en_set_rxfh().
      
      Fixes: 947cbb0a ("net/mlx4_en: Support for configurable RSS hash function")
      Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b3706909
    • Rojhalat Ibrahim's avatar
      mdio-mux-gpio: use new gpiod_get_array and gpiod_put_array functions · 33df10e2
      Rojhalat Ibrahim authored
      Use the new gpiod_get_array and gpiod_put_array functions
      (added to mainline in the v4.1 merge window) for obtaining and
      disposing of GPIO descriptors.
      
      Cc: David Miller <davem@davemloft.net>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarRojhalat Ibrahim <imr@rtschenk.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      33df10e2
    • David S. Miller's avatar
      netfilter; Add some missing default cases to switch statements in nft_reject. · 129d23a5
      David S. Miller authored
      This fixes:
      
      ====================
      net/netfilter/nft_reject.c: In function ‘nft_reject_dump’:
      net/netfilter/nft_reject.c:61:2: warning: enumeration value ‘NFT_REJECT_TCP_RST’ not handled in switch [-Wswitch]
        switch (priv->type) {
        ^
      net/netfilter/nft_reject.c:61:2: warning: enumeration value ‘NFT_REJECT_ICMPX_UNREACH’ not handled in switch [-Wswi\
      tch]
      net/netfilter/nft_reject_inet.c: In function ‘nft_reject_inet_dump’:
      net/netfilter/nft_reject_inet.c:105:2: warning: enumeration value ‘NFT_REJECT_TCP_RST’ not handled in switch [-Wswi\
      tch]
        switch (priv->type) {
        ^
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      129d23a5
    • David S. Miller's avatar
      Merge branch 'ppp_mppe_desync' · 8e9b29cc
      David S. Miller authored
      Sylvain Rochet says:
      
      ====================
      ppp: mppe: fixes MPPE desync on links which don't guarantee packet ordering
      
      I am currently having an issue with PPP over L2TP (UDP) and MPPE in
      stateless mode (default mode), UDP does not guarantee packet ordering so
      we might get out of order packet. MPPE needs to be continuously synched
      so we should drop late UDP packet.
      
      I added a printk on the number of time we rekeyed in MPPE decompressor,
      this is what we currently have if we receive a slightly out of order UDP
      packet:
      
      [1731001.049206] mppe_decompress[1]: ccount 1559
      [1731001.049216] mppe_decompress[1]: rekeyed 1 times
      
      [1731001.049228] mppe_decompress[1]: ccount 1560
      [1731001.049232] mppe_decompress[1]: rekeyed 1 times
      
      [1731001.050170] mppe_decompress[1]: ccount 1562
      [1731001.050182] mppe_decompress[1]: rekeyed 2 times
      
      [1731001.050191] mppe_decompress[1]: ccount 1561
      [1731001.062576] mppe_decompress[1]: rekeyed 4095 times
                                                   ^^^^
      This is obviously wrong, we missed packet 1561 and we already rekeyed 2
      times for 1562 we previously received, we can't recover the decryption
      key we need for 1561, we should drop it instead of rekeying 4095 times.
      
      This patch series drop any packet with are not within the 4096/2 forward
      window.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8e9b29cc
    • Sylvain Rochet's avatar
      ppp: mppe: discard late packet in stateless mode · 03654763
      Sylvain Rochet authored
      When PPP is used over a link which does not guarantee packet ordering,
      we might get late MPPE packets. This is a problem because MPPE must be
      kept synchronized and the current implementation does not drop them and
      rekey 4095 times instead of 0, which is wrong.
      
      In order to prevent rekeying about a whole count space times (~ 4095
      times), drop packets which are not within the forward 4096/2 window and
      increase sanity error counter.
      Signed-off-by: default avatarSylvain Rochet <sylvain.rochet@finsecur.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      03654763
    • Sylvain Rochet's avatar
      ppp: mppe: sanity error path rework · 32530189
      Sylvain Rochet authored
      We are going to need sanity error path a little further, rework to be
      able to use the sanity error path anywhere in decompressor.
      Signed-off-by: default avatarSylvain Rochet <sylvain.rochet@finsecur.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      32530189
    • Matan Barak's avatar
      net/bonding: Make DRV macros private · 73b5a6f2
      Matan Barak authored
      The bonding modules currently defines four macros with
      general names that pollute the global namespace:
      DRV_VERSION
      DRV_RELDATE
      DRV_NAME
      DRV_DESCRIPTION
      
      Fixing that by defining a private bonding_priv.h
      header files which includes those defines.
      Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      73b5a6f2
  2. 26 Apr, 2015 3 commits
    • Eric Dumazet's avatar
      net: rfs: fix crash in get_rps_cpus() · a31196b0
      Eric Dumazet authored
      Commit 567e4b79 ("net: rfs: add hash collision detection") had one
      mistake :
      
      RPS_NO_CPU is no longer the marker for invalid cpu in set_rps_cpu()
      and get_rps_cpu(), as @next_cpu was the result of an AND with
      rps_cpu_mask
      
      This bug showed up on a host with 72 cpus :
      next_cpu was 0x7f, and the code was trying to access percpu data of an
      non existent cpu.
      
      In a follow up patch, we might get rid of compares against nr_cpu_ids,
      if we init the tables with 0. This is silly to test for a very unlikely
      condition that exists only shortly after table initialization, as
      we got rid of rps_reset_sock_flow() and similar functions that were
      writing this RPS_NO_CPU magic value at flow dismantle : When table is
      old enough, it never contains this value anymore.
      
      Fixes: 567e4b79 ("net: rfs: add hash collision detection")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Tom Herbert <tom@herbertland.com>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a31196b0
    • Andreas Oetken's avatar
      altera tse: add support for fixed-links. · 7cdbc6f7
      Andreas Oetken authored
      Add support for fixed-links in configurations without PHY.
      (e.g. connection to a switch, SGMII point to point, SFPs)
      
      Check: Documentation/devicetree/bindings/net/fixed-link.txt.
      Signed-off-by: default avatarAndreas Oetken <ennoerlangen@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7cdbc6f7
    • Alexey Khoroshilov's avatar
      pxa168: fix double deallocation of managed resources · 0e03fd3e
      Alexey Khoroshilov authored
      Commit 43d3ddf8 ("net: pxa168_eth: add device tree support") starts
      to use managed resources by adding devm_clk_get() and
      devm_ioremap_resource(), but it leaves explicit iounmap() and clock_put()
      in pxa168_eth_remove() and in failure handling code of pxa168_eth_probe().
      As a result double free can happen.
      
      The patch removes explicit resource deallocation. Also it converts
      clk_disable() to clk_disable_unprepare() to make it symmetrical with
      clk_prepare_enable().
      
      Found by Linux Driver Verification project (linuxtesting.org).
      Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0e03fd3e
  3. 25 Apr, 2015 4 commits
    • Eric Dumazet's avatar
      net: fix crash in build_skb() · 2ea2f62c
      Eric Dumazet authored
      When I added pfmemalloc support in build_skb(), I forgot netlink
      was using build_skb() with a vmalloc() area.
      
      In this patch I introduce __build_skb() for netlink use,
      and build_skb() is a wrapper handling both skb->head_frag and
      skb->pfmemalloc
      
      This means netlink no longer has to hack skb->head_frag
      
      [ 1567.700067] kernel BUG at arch/x86/mm/physaddr.c:26!
      [ 1567.700067] invalid opcode: 0000 [#1] PREEMPT SMP KASAN
      [ 1567.700067] Dumping ftrace buffer:
      [ 1567.700067]    (ftrace buffer empty)
      [ 1567.700067] Modules linked in:
      [ 1567.700067] CPU: 9 PID: 16186 Comm: trinity-c182 Not tainted 4.0.0-next-20150424-sasha-00037-g4796e21 #2167
      [ 1567.700067] task: ffff880127efb000 ti: ffff880246770000 task.ti: ffff880246770000
      [ 1567.700067] RIP: __phys_addr (arch/x86/mm/physaddr.c:26 (discriminator 3))
      [ 1567.700067] RSP: 0018:ffff8802467779d8  EFLAGS: 00010202
      [ 1567.700067] RAX: 000041000ed8e000 RBX: ffffc9008ed8e000 RCX: 000000000000002c
      [ 1567.700067] RDX: 0000000000000004 RSI: 0000000000000000 RDI: ffffffffb3fd6049
      [ 1567.700067] RBP: ffff8802467779f8 R08: 0000000000000019 R09: ffff8801d0168000
      [ 1567.700067] R10: ffff8801d01680c7 R11: ffffed003a02d019 R12: ffffc9000ed8e000
      [ 1567.700067] R13: 0000000000000f40 R14: 0000000000001180 R15: ffffc9000ed8e000
      [ 1567.700067] FS:  00007f2a7da3f700(0000) GS:ffff8801d1000000(0000) knlGS:0000000000000000
      [ 1567.700067] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1567.700067] CR2: 0000000000738308 CR3: 000000022e329000 CR4: 00000000000007e0
      [ 1567.700067] Stack:
      [ 1567.700067]  ffffc9000ed8e000 ffff8801d0168000 ffffc9000ed8e000 ffff8801d0168000
      [ 1567.700067]  ffff880246777a28 ffffffffad7c0a21 0000000000001080 ffff880246777c08
      [ 1567.700067]  ffff88060d302e68 ffff880246777b58 ffff880246777b88 ffffffffad9a6821
      [ 1567.700067] Call Trace:
      [ 1567.700067] build_skb (include/linux/mm.h:508 net/core/skbuff.c:316)
      [ 1567.700067] netlink_sendmsg (net/netlink/af_netlink.c:1633 net/netlink/af_netlink.c:2329)
      [ 1567.774369] ? sched_clock_cpu (kernel/sched/clock.c:311)
      [ 1567.774369] ? netlink_unicast (net/netlink/af_netlink.c:2273)
      [ 1567.774369] ? netlink_unicast (net/netlink/af_netlink.c:2273)
      [ 1567.774369] sock_sendmsg (net/socket.c:614 net/socket.c:623)
      [ 1567.774369] sock_write_iter (net/socket.c:823)
      [ 1567.774369] ? sock_sendmsg (net/socket.c:806)
      [ 1567.774369] __vfs_write (fs/read_write.c:479 fs/read_write.c:491)
      [ 1567.774369] ? get_lock_stats (kernel/locking/lockdep.c:249)
      [ 1567.774369] ? default_llseek (fs/read_write.c:487)
      [ 1567.774369] ? vtime_account_user (kernel/sched/cputime.c:701)
      [ 1567.774369] ? rw_verify_area (fs/read_write.c:406 (discriminator 4))
      [ 1567.774369] vfs_write (fs/read_write.c:539)
      [ 1567.774369] SyS_write (fs/read_write.c:586 fs/read_write.c:577)
      [ 1567.774369] ? SyS_read (fs/read_write.c:577)
      [ 1567.774369] ? __this_cpu_preempt_check (lib/smp_processor_id.c:63)
      [ 1567.774369] ? trace_hardirqs_on_caller (kernel/locking/lockdep.c:2594 kernel/locking/lockdep.c:2636)
      [ 1567.774369] ? trace_hardirqs_on_thunk (arch/x86/lib/thunk_64.S:42)
      [ 1567.774369] system_call_fastpath (arch/x86/kernel/entry_64.S:261)
      
      Fixes: 79930f58 ("net: do not deplete pfmemalloc reserve")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2ea2f62c
    • Chee Nouk Phoon's avatar
      net: eth: altera: Resolve false errors from MSGDMA to TSE · 20d96964
      Chee Nouk Phoon authored
      This patch resolves false errors from MSGDMA in TX mSGDMA MM to ST
      mode, and is a continuation of the patch recently submitted by Andrea
      Oetken. The MSGDMA had a logic bug that masked detection of this issue
      prior to Quartus 14.1/Build 164. When the MSGDMA logic bug was addressed
      in Quartus 14.1/Build 164, the driver problem was exposed.
      
      The problem is corrected by making sure MSGDMA_DESC_CTL_TR_ERR_IRQ is not
      set for any of the transmit DMA descriptors, and only used for receive
      descriptors.
      
      Fixes: 71cd26e7 altera tse: Error-Bit on tx-avalon-stream always set.
      Signed-off-by: default avatarChee Nouk Phoon <cnphoon@altera.com>
      Signed-off-by: Vince Bridgers <vbridger@opensource.altera.com>a
      Cc: Andreas Oetken <ennoerlangen@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      20d96964
    • Michael Ellerman's avatar
      ehea: Fix memory hook reference counting crashes · 3051f392
      Michael Ellerman authored
      The recent commit to only register the EHEA memory hotplug hooks on
      adapter probe has a few problems.
      
      Firstly the reference counting is wrong for multiple adapters, in that
      the hooks are registered multiple times. Secondly the check in the tear
      down path is backward. Finally the error path doesn't decrement the
      count.
      
      The multiple registration of the hooks is the biggest problem, as it
      leads to oopses when the system is rebooted, and/or errors during memory
      hotplug, eg:
      
        $ ./mem-on-off-test.sh -r 2
        ...
        ehea: memory is going offline
        ehea: LPAR memory changed - re-initializing driver
        ehea: re-initializing driver complete
        ehea: memory is going offline
        ehea: LPAR memory changed - re-initializing driver
        ehea: opcode=26c ret=fffffffffffffffc arg1=8000000003000003 arg2=0 arg3=700000060000d600 arg4=3fded0000 arg5=200 arg6=0 arg7=0
        ehea: register_rpage_mr failed
        ehea: registering mr failed
        ehea: register MR failed - driver inoperable!
        ehea: memory is going offline
      
      Fixes: aa183323 ("ehea: Register memory hotplug, reboot and crash hooks on adapter probe")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3051f392
    • Gavin Shan's avatar
      net/tg3: Release IRQs on permanent error · dfc8f370
      Gavin Shan authored
      When having permanent EEH error, the PCI device will be removed
      from the system. For this case, we shouldn't set pcierr_recovery
      to true wrongly, which blocks the driver to release the allocated
      interrupts and their handlers. Eventually, we can't disable MSI
      or MSIx successfully because of the MSI or MSIx interrupts still
      have associated interrupt actions, which is turned into following
      stack dump.
      
      Oops: Exception in kernel mode, sig: 5 [#1]
              :
      [c0000000003b76a8] .free_msi_irqs+0x80/0x1a0 (unreliable)
      [c00000000039f388] .pci_remove_bus_device+0x98/0x110
      [c0000000000790f4] .pcibios_remove_pci_devices+0x9c/0x128
      [c000000000077b98] .handle_eeh_events+0x2d8/0x4b0
      [c0000000000782d0] .eeh_event_handler+0x130/0x1c0
      [c000000000022bd4] .kernel_thread+0x54/0x70
      Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
      Acked-by: default avatarPrashant Sreedharan <prashant@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      dfc8f370
  4. 24 Apr, 2015 5 commits
    • Vivien Didelot's avatar
      net: mdio-gpio: support access that may sleep · 2d6c9091
      Vivien Didelot authored
      Some systems using mdio-gpio may use gpio on message based busses, which
      require sleeping (e.g. gpio from an I2C I/O expander).
      
      Since this driver does not use IRQ handler, it is safe to use the
      _cansleep suffixed gpio accessors.
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2d6c9091
    • Eric Dumazet's avatar
      inet: fix possible panic in reqsk_queue_unlink() · b357a364
      Eric Dumazet authored
      [ 3897.923145] BUG: unable to handle kernel NULL pointer dereference at
       0000000000000080
      [ 3897.931025] IP: [<ffffffffa9f27686>] reqsk_timer_handler+0x1a6/0x243
      
      There is a race when reqsk_timer_handler() and tcp_check_req() call
      inet_csk_reqsk_queue_unlink() on the same req at the same time.
      
      Before commit fa76ce73 ("inet: get rid of central tcp/dccp listener
      timer"), listener spinlock was held and race could not happen.
      
      To solve this bug, we change reqsk_queue_unlink() to not assume req
      must be found, and we return a status, to conditionally release a
      refcount on the request sock.
      
      This also means tcp_check_req() in non fastopen case might or not
      consume req refcount, so tcp_v6_hnd_req() & tcp_v4_hnd_req() have
      to properly handle this.
      
      (Same remark for dccp_check_req() and its callers)
      
      inet_csk_reqsk_queue_drop() is now too big to be inlined, as it is
      called 4 times in tcp and 3 times in dccp.
      
      Fixes: fa76ce73 ("inet: get rid of central tcp/dccp listener timer")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarYuchung Cheng <ycheng@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b357a364
    • Johannes Berg's avatar
      rhashtable: don't attempt to grow when at max_size · 1d8dc3d3
      Johannes Berg authored
      The conversion of mac80211's station table to rhashtable had a bug
      that I found by accident in code review, that hadn't been found as
      rhashtable apparently managed to have a maximum hash chain length
      of one (!) in all our testing.
      
      In order to test the bug and verify the fix I set my rhashtable's
      max_size very low (4) in order to force getting hash collisions.
      
      At that point, rhashtable WARNed in rhashtable_insert_rehash() but
      didn't actually reject the hash table insertion. This caused it to
      lose insertions - my master list of stations would have 9 entries,
      but the rhashtable only had 5. This may warrant a deeper look, but
      that WARN_ON() just shouldn't happen.
      
      Fix this by not returning true from rht_grow_above_100() when the
      rhashtable's max_size has been reached - in this case the user is
      explicitly configuring it to be at most that big, so even if it's
      now above 100% it shouldn't attempt to resize.
      
      This fixes the "lost insertion" issue and consequently allows my
      code to display its error (and verify my fix for it.)
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Acked-by: default avatarThomas Graf <tgraf@suug.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1d8dc3d3
    • Rafał Miłecki's avatar
      bgmac: fix requests for extra polling calls from NAPI · e580267d
      Rafał Miłecki authored
      After d75b1ade ("net: less interrupt masking in NAPI") polling
      function has to return whole budget when it wants NAPI to call it again.
      Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
      Cc: Felix Fietkau <nbd@openwrt.org>
      Fixes: eb64e292 ("bgmac: leave interrupts disabled as long as there is work to do")
      Acked-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e580267d
    • Eric Dumazet's avatar
      tcp: avoid looping in tcp_send_fin() · 845704a5
      Eric Dumazet authored
      Presence of an unbound loop in tcp_send_fin() had always been hard
      to explain when analyzing crash dumps involving gigantic dying processes
      with millions of sockets.
      
      Lets try a different strategy :
      
      In case of memory pressure, try to add the FIN flag to last packet
      in write queue, even if packet was already sent. TCP stack will
      be able to deliver this FIN after a timeout event. Note that this
      FIN being delivered by a retransmit, it also carries a Push flag
      given our current implementation.
      
      By checking sk_under_memory_pressure(), we anticipate that cooking
      many FIN packets might deplete tcp memory.
      
      In the case we could not allocate a packet, even with __GFP_WAIT
      allocation, then not sending a FIN seems quite reasonable if it allows
      to get rid of this socket, free memory, and not block the process from
      eventually doing other useful work.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      845704a5
  5. 23 Apr, 2015 11 commits
    • Luis R. Rodriguez's avatar
      ethernet: myri10ge: use arch_phys_wc_add() · e4b6c303
      Luis R. Rodriguez authored
      This driver already uses ioremap_wc() on the same range
      so when write-combining is available that will be used
      instead.
      
      Cc: Hyong-Youb Kim <hykim@myri.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Suresh Siddha <sbsiddha@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: netdev@vger.kernel.org
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Antonino Daplas <adaplas@gmail.com>
      Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-kernel@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e4b6c303
    • Geert Uytterhoeven's avatar
      can: CAN_GRCAN should depend on HAS_DMA · 2fb42aab
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
          drivers/built-in.o: In function `grcan_free_dma_buffers':
          grcan.c:(.text+0x2d7716): undefined reference to `dma_free_coherent'
          drivers/built-in.o: In function `grcan_allocate_dma_buffers':
          grcan.c:(.text+0x2d779c): undefined reference to `dma_alloc_coherent'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fb42aab
    • Geert Uytterhoeven's avatar
      ethernet: arc: ARC_EMAC and EMAC_ROCKCHIP should depend on HAS_DMA · 0357cc1d
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
          drivers/built-in.o: In function `arc_emac_tx_clean':
          emac_main.c:(.text+0x2decde): undefined reference to `dma_unmap_single'
          drivers/built-in.o: In function `arc_emac_rx':
          emac_main.c:(.text+0x2dee1c): undefined reference to `dma_unmap_single'
          emac_main.c:(.text+0x2dee72): undefined reference to `dma_map_single'
          emac_main.c:(.text+0x2dee7e): undefined reference to `dma_mapping_error'
          drivers/built-in.o: In function `arc_emac_probe':
          (.text+0x2df2ee): undefined reference to `dmam_alloc_coherent'
          drivers/built-in.o: In function `arc_emac_open':
          emac_main.c:(.text+0x2df6d8): undefined reference to `dma_map_single'
          emac_main.c:(.text+0x2df6e4): undefined reference to `dma_mapping_error'
          drivers/built-in.o: In function `arc_emac_tx':
          emac_main.c:(.text+0x2df9e4): undefined reference to `dma_map_single'
          emac_main.c:(.text+0x2df9f0): undefined reference to `dma_mapping_error'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0357cc1d
    • Geert Uytterhoeven's avatar
      ethernet: amd: AMD_XGBE should depend on HAS_DMA · 61e77d29
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
          drivers/built-in.o: In function `xgbe_probe':
          xgbe-main.c:(.text+0x2def0a): undefined reference to `dma_set_mask'
          xgbe-main.c:(.text+0x2def20): undefined reference to `dma_supported'
          drivers/built-in.o: In function `xgbe_rx_poll':
          xgbe-drv.c:(.text+0x2e0320): undefined reference to `dma_sync_single_for_cpu'
          xgbe-drv.c:(.text+0x2e035e): undefined reference to `dma_sync_single_for_cpu'
          drivers/built-in.o: In function `xgbe_unmap_rdata':
          xgbe-desc.c:(.text+0x2e5fe4): undefined reference to `dma_unmap_page'
          xgbe-desc.c:(.text+0x2e5ffa): undefined reference to `dma_unmap_single'
          xgbe-desc.c:(.text+0x2e604a): undefined reference to `dma_unmap_page'
          xgbe-desc.c:(.text+0x2e6084): undefined reference to `dma_unmap_page'
          drivers/built-in.o: In function `xgbe_alloc_pages':
          xgbe-desc.c:(.text+0x2e6156): undefined reference to `dma_map_page'
          xgbe-desc.c:(.text+0x2e6164): undefined reference to `dma_mapping_error'
          drivers/built-in.o: In function `xgbe_free_ring':
          xgbe-desc.c:(.text+0x2e63d4): undefined reference to `dma_unmap_page'
          xgbe-desc.c:(.text+0x2e640e): undefined reference to `dma_unmap_page'
          xgbe-desc.c:(.text+0x2e644a): undefined reference to `dma_free_coherent'
          drivers/built-in.o: In function `xgbe_init_ring':
          xgbe-desc.c:(.text+0x2e64d4): undefined reference to `dma_alloc_coherent'
          drivers/built-in.o: In function `xgbe_map_tx_skb':
          xgbe-desc.c:(.text+0x2e6628): undefined reference to `dma_map_single'
          xgbe-desc.c:(.text+0x2e6638): undefined reference to `dma_mapping_error'
          xgbe-desc.c:(.text+0x2e66b2): undefined reference to `dma_map_single'
          xgbe-desc.c:(.text+0x2e66c2): undefined reference to `dma_mapping_error'
          xgbe-desc.c:(.text+0x2e6762): undefined reference to `dma_map_page'
          xgbe-desc.c:(.text+0x2e6772): undefined reference to `dma_mapping_error'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61e77d29
    • Jason Eastman's avatar
      net: unix: garbage: fixed several comment and whitespace style issues · d1ab39f1
      Jason Eastman authored
      fixed several comment and whitespace style issues
      Signed-off-by: default avatarJason Eastman <eastman.jason.linux@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d1ab39f1
    • David S. Miller's avatar
      Merge branch 'tipc-fixes' · 37a06a87
      David S. Miller authored
      Jon Maloy says:
      
      ====================
      tipc: three bug fixes
      
      A set of unrelated corrections; one for the tipc netns implementation,
      one regarding problems with random link resets, and one removing a
      an erroneous refcount decrement when reading link statistsics via
      netlink.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      37a06a87
    • Erik Hugne's avatar
      tipc: fix node refcount issue · 73a31737
      Erik Hugne authored
      When link statistics is dumped over netlink, we iterate over
      the list of peer nodes and append each links statistics to
      the netlink msg. In the case where the dump is resumed after
      filling up a nlmsg, the node refcnt is decremented without
      having been incremented previously which may cause the node
      reference to be freed. When this happens, the following
      info/stacktrace will be generated, followed by a crash or
      undefined behavior.
      We fix this by removing the erroneous call to tipc_node_put
      inside the loop that iterates over nodes.
      
      [  384.312303] INFO: trying to register non-static key.
      [  384.313110] the code is fine but needs lockdep annotation.
      [  384.313290] turning off the locking correctness validator.
      [  384.313290] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.0.0+ #13
      [  384.313290] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
      [  384.313290]  ffff88003c6d0290 ffff88003cc03ca8 ffffffff8170adf1 0000000000000007
      [  384.313290]  ffffffff82728730 ffff88003cc03d38 ffffffff810a6a6d 00000000001d7200
      [  384.313290]  ffff88003c6d0ab0 ffff88003cc03ce8 0000000000000285 0000000000000001
      [  384.313290] Call Trace:
      [  384.313290]  <IRQ>  [<ffffffff8170adf1>] dump_stack+0x4c/0x65
      [  384.313290]  [<ffffffff810a6a6d>] __lock_acquire+0xf3d/0xf50
      [  384.313290]  [<ffffffff810a7375>] lock_acquire+0xd5/0x290
      [  384.313290]  [<ffffffffa0043e8c>] ? link_timeout+0x1c/0x170 [tipc]
      [  384.313290]  [<ffffffffa0043e70>] ? link_state_event+0x4e0/0x4e0 [tipc]
      [  384.313290]  [<ffffffff81712890>] _raw_spin_lock_bh+0x40/0x80
      [  384.313290]  [<ffffffffa0043e8c>] ? link_timeout+0x1c/0x170 [tipc]
      [  384.313290]  [<ffffffffa0043e8c>] link_timeout+0x1c/0x170 [tipc]
      [  384.313290]  [<ffffffff810c4698>] call_timer_fn+0xb8/0x490
      [  384.313290]  [<ffffffff810c45e0>] ? process_timeout+0x10/0x10
      [  384.313290]  [<ffffffff810c5a2c>] run_timer_softirq+0x21c/0x420
      [  384.313290]  [<ffffffffa0043e70>] ? link_state_event+0x4e0/0x4e0 [tipc]
      [  384.313290]  [<ffffffff8105a954>] __do_softirq+0xf4/0x630
      [  384.313290]  [<ffffffff8105afdd>] irq_exit+0x5d/0x60
      [  384.313290]  [<ffffffff8103ade1>] smp_apic_timer_interrupt+0x41/0x50
      [  384.313290]  [<ffffffff817144a0>] apic_timer_interrupt+0x70/0x80
      [  384.313290]  <EOI>  [<ffffffff8100db10>] ? default_idle+0x20/0x210
      [  384.313290]  [<ffffffff8100db0e>] ? default_idle+0x1e/0x210
      [  384.313290]  [<ffffffff8100e61a>] arch_cpu_idle+0xa/0x10
      [  384.313290]  [<ffffffff81099803>] cpu_startup_entry+0x2c3/0x530
      [  384.313290]  [<ffffffff810d2893>] ? clockevents_register_device+0x113/0x200
      [  384.313290]  [<ffffffff81038b0f>] start_secondary+0x13f/0x170
      
      Fixes: 8a0f6ebe ("tipc: involve reference counter for node structure")
      Signed-off-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      73a31737
    • Erik Hugne's avatar
      tipc: fix random link reset problem · 9871b27f
      Erik Hugne authored
      In the function tipc_sk_rcv(), the stack variable 'err'
      is only initialized to TIPC_ERR_NO_PORT for the first
      iteration over the link input queue. If a chain of messages
      are received from a link, failure to lookup the socket for
      any but the first message will cause the message to bounce back
      out on a random link.
      We fix this by properly initializing err.
      Signed-off-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9871b27f
    • Ying Xue's avatar
      tipc: fix topology server broken issue · def81f69
      Ying Xue authored
      When a new topology server is launched in a new namespace, its
      listening socket is inserted into the "init ns" namespace's socket
      hash table rather than the one owned by the new namespace. Although
      the socket's namespace is forcedly changed to the new namespace later,
      the socket is still stored in the socket hash table of "init ns"
      namespace. When a client created in the new namespace connects
      its own topology server, the connection is failed as its server's
      socket could not be found from its own namespace's socket table.
      
      If __sock_create() instead of original sock_create_kern() is used
      to create the server's socket through specifying an expected namesapce,
      the socket will be inserted into the specified namespace's socket
      table, thereby avoiding to the topology server broken issue.
      
      Fixes: 76100a8a ("tipc: fix netns refcnt leak")
      Reported-by: default avatarErik Hugne <erik.hugne@ericsson.com>
      Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
      Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      def81f69
    • David Gibson's avatar
      ibmveth: Fix off-by-one error in ibmveth_change_mtu() · 4fce1482
      David Gibson authored
      AFAIK the PAPR document which defines the virtual device interface used by
      the ibmveth driver doesn't specify a specific maximum MTU.  So, in the
      ibmveth driver, the maximum allowed MTU is determined by the maximum
      allocated buffer size of 64k (corresponding to one page in the common case)
      minus the per-buffer overhead IBMVETH_BUFF_OH (which has value 22 for 14
      bytes of ethernet header, plus 8 bytes for an opaque handle).
      
      This suggests a maximum allowable MTU of 65514 bytes, but in fact the
      driver only permits a maximum MTU of 65513.  This is because there is a <
      instead of an <= in ibmveth_change_mtu(), which only permits an MTU which
      is strictly smaller than the buffer size, rather than allowing the buffer
      to be completely filled.
      
      This patch fixes the buglet.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4fce1482
    • Johannes Berg's avatar
      netdev_alloc_pcpu_stats: use less common iterator variable · ec65aafb
      Johannes Berg authored
      With the CPU iteration variable called 'i', it's relatively easy
      to have variable shadowing which sparse will warn about. Avoid
      that by renaming the variable to __cpu which is less likely to
      be used in the surrounding context.
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ec65aafb
  6. 22 Apr, 2015 10 commits