1. 16 May, 2013 1 commit
    • Eric Dumazet's avatar
      tcp: speedup tcp_fixup_rcvbuf() · d2cf4367
      Eric Dumazet authored
      tcp_fixup_rcvbuf() contains a loop to estimate initial socket
      rcv space needed for a given mss. With large MTU (like 64K on lo),
      we can loop ~500 times and consume a lot of cpu cycles.
      
      perf top of 200 concurrent netperf -t TCP_CRR
      
      5.62%  netperf  [kernel.kallsyms]  [k] tcp_init_buffer_space
      1.71%  netperf  [kernel.kallsyms]  [k] _raw_spin_lock
      1.55%  netperf  [kernel.kallsyms]  [k] kmem_cache_free
      1.51%  netperf  [kernel.kallsyms]  [k] tcp_transmit_skb
      1.50%  netperf  [kernel.kallsyms]  [k] tcp_ack
      
      Lets use a 100% factor, and remove the loop.
      
      100% is needed anyway for tcp_adv_win_scale=1
      default value, and is also the maximum factor.
      
      Refs: commit b49960a0
            ("tcp: change tcp_adv_win_scale and tcp_rmem[2]")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Neal Cardwell <ncardwell@google.com>
      Cc: Yuchung Cheng <ycheng@google.com>
      Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d2cf4367
  2. 13 May, 2013 14 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · dbbffe68
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Several small bug fixes all over:
      
         1) be2net driver uses wrong payload length when submitting MAC list
            get requests to the chip.  From Sathya Perla.
      
         2) Fix mwifiex memory leak on driver unload, from Amitkumar Karwar.
      
         3) Prevent random memory access in batman-adv, from Marek Lindner.
      
         4) batman-adv doesn't check for pskb_trim_rcsum() errors, also from
            Marek Lindner.
      
         5) Fix fec crashes on rapid link up/down, from Frank Li.
      
         6) Fix inner protocol grovelling in GSO, from Pravin B Shelar.
      
         7) Link event validation fix in qlcnic from Rajesh Borundia.
      
         8) Not all FEC chips can support checksum offload, fix from Shawn
            Guo.
      
         9) EXPORT_SYMBOL + inline doesn't make any sense, from Denis Efremov.
      
        10) Fix race in passthru mode during device removal in macvlan, from
            Jiri Pirko.
      
        11) Fix RCU hash table lookup socket state race in ipv6, leading to
            NULL pointer derefs, from Eric Dumazet.
      
        12) Add several missing HAS_DMA kconfig dependencies, from Geert
            Uyttterhoeven.
      
        13) Fix bogus PCI resource management in 3c59x driver, from Sergei
            Shtylyov.
      
        14) Fix info leak in ipv6 GRE tunnel driver, from Amerigo Wang.
      
        15) Fix device leak in ipv6 IPSEC policy layer, from Cong Wang.
      
        16) DMA mapping leak fix in qlge from Thadeu Lima de Souza Cascardo.
      
        17) Missing iounmap on probe failure in bna driver, from Wei Yongjun."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (40 commits)
        bna: add missing iounmap() on error in bnad_init()
        qlge: fix dma map leak when the last chunk is not allocated
        xfrm6: release dev before returning error
        ipv6,gre: do not leak info to user-space
        virtio_net: use default napi weight by default
        emac: Fix EMAC soft reset on 460EX/GT
        3c59x: fix PCI resource management
        caif: CAIF_VIRTIO should depend on HAS_DMA
        net/ethernet: MACB should depend on HAS_DMA
        net/ethernet: ARM_AT91_ETHER should depend on HAS_DMA
        net/wireless: ATH9K should depend on HAS_DMA
        net/ethernet: STMMAC_ETH should depend on HAS_DMA
        net/ethernet: NET_CALXEDA_XGMAC should depend on HAS_DMA
        ipv6: do not clear pinet6 field
        macvlan: fix passthru mode race between dev removal and rx path
        ipv4: ip_output: remove inline marking of EXPORT_SYMBOL functions
        net/mlx4: Strengthen VLAN tags/priorities enforcement in VST mode
        net/mlx4_core: Add missing report on VST and spoof-checking dev caps
        net: fec: enable hardware checksum only on imx6q-fec
        qlcnic: Fix validation of link event command.
        ...
      dbbffe68
    • Wei Yongjun's avatar
      bna: add missing iounmap() on error in bnad_init() · ba21fc69
      Wei Yongjun authored
      Add the missing iounmap() before return from bnad_init()
      in the error handling case.
      Introduced by commit 01b54b14
      (bna: tx rx cleanup fix).
      Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ba21fc69
    • Thadeu Lima de Souza Cascardo's avatar
      qlge: fix dma map leak when the last chunk is not allocated · ef380794
      Thadeu Lima de Souza Cascardo authored
      qlge allocates chunks from a page that it maps and unmaps that page when
      the last chunk is released. When the driver is unloaded or the card is
      removed, all chunks are released and the page is unmapped for the last
      chunk.
      
      However, when the last chunk of a page is not allocated and the device
      is removed, that page is not unmapped. In fact, its last reference is
      not put and there's also a page leak. This bug prevents a device from
      being properly hotplugged.
      
      When the DMA API debug option is enabled, the following messages show
      the pending DMA allocation after we remove the driver.
      
      This patch fixes the bug by unmapping and putting the page from the ring
      if its last chunk has not been allocated.
      
      pci 0005:98:00.0: DMA-API: device driver has pending DMA allocations while released from device [count=1]
      One of leaked entries details: [device address=0x0000000060a80000] [size=65536 bytes] [mapped with DMA_FROM_DEVICE] [mapped as page]
      ------------[ cut here ]------------
      WARNING: at lib/dma-debug.c:746
      Modules linked in: qlge(-) rpadlpar_io rpaphp pci_hotplug fuse [last unloaded: qlge]
      NIP: c0000000003fc3ec LR: c0000000003fc3e8 CTR: c00000000054de60
      REGS: c0000003ee9c74e0 TRAP: 0700   Tainted: G           O  (3.7.2)
      MSR: 8000000000029032 <SF,EE,ME,IR,DR,RI>  CR: 28002424  XER: 00000001
      SOFTE: 1
      CFAR: c0000000007a39c8
      TASK = c0000003ee8d5c90[8406] 'rmmod' THREAD: c0000003ee9c4000 CPU: 31
      GPR00: c0000000003fc3e8 c0000003ee9c7760 c000000000c789f8 00000000000000ee
      GPR04: 0000000000000000 00000000000000ef 0000000000004000 0000000000010000
      GPR08: 00000000000000be c000000000b22088 c000000000c4c218 00000000007c0000
      GPR12: 0000000028002422 c00000000ff26c80 0000000000000000 000001001b0f1b40
      GPR16: 00000000100cb9d8 0000000010093088 c000000000cdf910 0000000000000001
      GPR20: 0000000000000000 c000000000dbfc00 0000000000000000 c000000000dbfb80
      GPR24: c0000003fafc9d80 0000000000000001 000000000001ff80 c0000003f38f7888
      GPR28: c000000000ddfc00 0000000000000400 c000000000bd7790 c000000000ddfb80
      NIP [c0000000003fc3ec] .dma_debug_device_change+0x22c/0x2b0
      LR [c0000000003fc3e8] .dma_debug_device_change+0x228/0x2b0
      Call Trace:
      [c0000003ee9c7760] [c0000000003fc3e8] .dma_debug_device_change+0x228/0x2b0 (unreliable)
      [c0000003ee9c7840] [c00000000079a098] .notifier_call_chain+0x78/0xf0
      [c0000003ee9c78e0] [c0000000000acc20] .__blocking_notifier_call_chain+0x70/0xb0
      [c0000003ee9c7990] [c0000000004a9580] .__device_release_driver+0x100/0x140
      [c0000003ee9c7a20] [c0000000004a9708] .driver_detach+0x148/0x150
      [c0000003ee9c7ac0] [c0000000004a8144] .bus_remove_driver+0xc4/0x150
      [c0000003ee9c7b60] [c0000000004aa58c] .driver_unregister+0x8c/0xe0
      [c0000003ee9c7bf0] [c0000000004090b4] .pci_unregister_driver+0x34/0xf0
      [c0000003ee9c7ca0] [d000000002231194] .qlge_exit+0x1c/0x34 [qlge]
      [c0000003ee9c7d20] [c0000000000e36d8] .SyS_delete_module+0x1e8/0x290
      [c0000003ee9c7e30] [c0000000000098d4] syscall_exit+0x0/0x94
      Instruction dump:
      7f26cb78 e818003a e87e81a0 e8f80028 e9180030 796b1f24 78001f24 7d6a5a14
      7d2a002a e94b0020 483a7595 60000000 <0fe00000> 2fb80000 40de0048 80120050
      ---[ end trace 4294f9abdb01031d ]---
      Mapped at:
       [<d000000002222f54>] .ql_update_lbq+0x384/0x580 [qlge]
       [<d000000002227bd0>] .ql_clean_inbound_rx_ring+0x300/0xc60 [qlge]
       [<d0000000022288cc>] .ql_napi_poll_msix+0x39c/0x5a0 [qlge]
       [<c0000000006b3c50>] .net_rx_action+0x170/0x300
       [<c000000000081840>] .__do_softirq+0x170/0x300
      Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
      Acked-by: default avatarJitendra Kalsaria <Jitendra.kalsaria@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef380794
    • Linus Torvalds's avatar
      Merge tag 'spi-v3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 1f638766
      Linus Torvalds authored
      Pull spi updates from Mark Brown:
       "A few driver specific fixes plus improved error handling in the
        generic DT GPIO chipselect handling - not exciting but useful."
      
      * tag 'spi-v3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi/spi-atmel: BUG: fix doesn' support 16 bits transfers using PIO
        spi/davinci: fix module build error
        spi: Return error from of_spi_register_master on bad "cs-gpios" property
        spi: Initialize cs_gpio and cs_gpios with -ENOENT
        spi/atmel: fix speed_hz check in atmel_spi_transfer()
      1f638766
    • Linus Torvalds's avatar
      Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux · fea0f9ff
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Just a few straggling fixes I hoovered up, and an intel fixes pull
        from Daniel which fixes some regressions, and some mgag200 fixes from
        Matrox."
      
      * 'drm-next' of git://people.freedesktop.org/~airlied/linux:
        drm/mgag200: Fix framebuffer base address programming
        drm/mgag200: Convert counter delays to jiffies
        drm/mgag200: Fix writes into MGA1064_PIX_CLK_CTL register
        drm/mgag200: Don't change unrelated registers during modeset
        drm: Only print a debug message when the polled connector has changed
        drm: Make the HPD status updates debug logs more readable
        drm: Use names of ioctls in debug traces
        drm: Remove pointless '-' characters from drm_fb_helper documentation
        drm: Add kernel-doc for drm_fb_helper_funcs->initial_config
        drm: refactor call to request_module
        drm: Don't prune modes loudly when a connector is disconnected
        drm: Add missing break in the command line mode parsing code
        drm/i915: clear the stolen fb before resuming
        Revert "drm/i915: Calculate correct stolen size for GEN7+"
        drm/i915: hsw: fix link training for eDP on port-A
        Revert "drm/i915: revert eDP bpp clamping code changes"
        drm: don't check modeset locks in panic handler
        drm/i915: Fix pipe enabled mask for pipe C in WM calculations
        drm/mm: fix dump table BUG
        drm/i915: Always normalize return timeout for wait_timeout_ioctl
      fea0f9ff
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux · aef2ea91
      Linus Torvalds authored
      Pull virtio/lguest fixes from Rusty Russell:
       "Missing license tag and some fallout from the lguest pagetable rework"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
        lguest: clear cached last cpu when guest_set_pgd() called.
        Add missing module license tag to vring helpers.
      aef2ea91
    • Mark Brown's avatar
      88b0357d
    • Mark Brown's avatar
      0faa3146
    • Christopher Harvey's avatar
      drm/mgag200: Fix framebuffer base address programming · 9f1d0366
      Christopher Harvey authored
      Higher bits of the base address of framebuffers weren't being
      programmed properly. This caused framebuffers that didn't happen to be
      allocated at a low enough address to not be displayed properly.
      Signed-off-by: default avatarChristopher Harvey <charvey@matrox.com>
      Signed-off-by: default avatarMathieu Larouche <mathieu.larouche@matrox.com>
      Acked-by: default avatarJulia Lemire <jlemire@matrox.com>
      Tested-by: default avatarJulia Lemire <jlemire@matrox.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      9f1d0366
    • Christopher Harvey's avatar
    • Christopher Harvey's avatar
      drm/mgag200: Fix writes into MGA1064_PIX_CLK_CTL register · fb70a669
      Christopher Harvey authored
      The original line,
        WREG_DAC(MGA1064_PIX_CLK_CTL_CLK_DIS, tmp);
      wrote tmp into MGA1064_PIX_CLK_CTL_CLK_DIS, where
      MGA1064_PIX_CLK_CTL_CLK_DIS is an offset into
      MGA1064_PIX_CLK_CTL. Change the line to write properly into
      MGA1064_PIX_CLK_CTL. There were other chunks of code nearby that use
      the same pattern (but work correctly), so this patch updates them all
      to use this new (slightly more efficient) write pattern. The WREG_DAC
      macro was causing the DAC_INDEX register to be set to the same value
      twice. WREG8(DAC_DATA, foo) takes advantage of the fact that DAC_INDEX
      is already at the value we want.
      Signed-off-by: default avatarChristopher Harvey <charvey@matrox.com>
      Acked-by: default avatarJulia Lemire <jlemire@matrox.com>
      Tested-by: default avatarJulia Lemire <jlemire@matrox.com>
      Acked-by: default avatarMathieu Larouche <mathieu.larouche@matrox.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      fb70a669
    • Christopher Harvey's avatar
      drm/mgag200: Don't change unrelated registers during modeset · 9d8aa55f
      Christopher Harvey authored
      Registers in indices below 0x18 are totally unrelated to modesetting,
      so don't write 0's, or anything else into them on modeset. Most of
      these registers are hardware cursor related, so this existing code
      interferes with hardware cursor development.
      Signed-off-by: default avatarChristopher Harvey <charvey@matrox.com>
      Tested-by: default avatarJulia Lemire <jlemire@matrox.com>
      Acked-by: default avatarJulia Lemire <jlemire@matrox.com>
      Acked-by: default avatarMathieu Larouche <mathieu.larouche@matrox.com>
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      9d8aa55f
    • Lespiau, Damien's avatar
    • Lespiau, Damien's avatar
      drm: Make the HPD status updates debug logs more readable · ed7951dc
      Lespiau, Damien authored
      Instead of just printing "status updated from 1 to 2", make those enum
      numbers immediately readable.
      
      v2: Also patch output_poll_execute() (Daniel Vetter)
      v3: Use drm_get_connector_status_name (Ville Syrjälä)
      Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (for v1)
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      ed7951dc
  3. 12 May, 2013 7 commits
    • Cong Wang's avatar
      xfrm6: release dev before returning error · 84c4a9df
      Cong Wang authored
      We forget to call dev_put() on error path in xfrm6_fill_dst(),
      its caller doesn't handle this.
      
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      84c4a9df
    • Amerigo Wang's avatar
      ipv6,gre: do not leak info to user-space · 5dbd5068
      Amerigo Wang authored
      There is a hole in struct ip6_tnl_parm2, so we have to
      zero the struct on stack before copying it to user-space.
      
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5dbd5068
    • Amerigo Wang's avatar
      virtio_net: use default napi weight by default · d34710e3
      Amerigo Wang authored
      Since commit 82dc3c63 ("net: introduce NAPI_POLL_WEIGHT")
      we warn drivers when they use napi weight higher than NAPI_POLL_WEIGHT,
      but virtio_net still uses 128 by default. This patch makes its default
      value to NAPI_POLL_WEIGHT.
      
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarCong Wang <amwang@redhat.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d34710e3
    • Petri Gynther's avatar
      emac: Fix EMAC soft reset on 460EX/GT · 23fbb5a8
      Petri Gynther authored
      Fix EMAC soft reset on 460EX/GT to select the right PHY clock source
      before and after the soft reset.
      
      EMAC with PHY should use the clock from PHY during soft reset.
      EMAC without PHY should use the internal clock during soft reset.
      
      PPC460EX/GT Embedded Processor Advanced User's Manual
      section 28.10.1 Mode Register 0 (EMACx_MR0) states:
      Note: The PHY must provide a TX Clk in order to perform a soft reset
      of the EMAC. If none is present, select the internal clock
      (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1).
      After a soft reset, select the external clock.
      
      Without the fix, 460EX/GT-based boards with RGMII PHYs attached to
      EMACs experience EMAC interrupt storm and system watchdog reset when
      issuing "ifconfig eth0 down" + "ifconfig eth0 up" a few times.
      The system enters endless loop of serving emac_irq() with EMACx_ISR
      register stuck at value 0x10000000 (Rx parity error).
      
      With the fix, the above issue is no longer observed.
      Signed-off-by: default avatarPetri Gynther <pgynther@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23fbb5a8
    • Sergei Shtylyov's avatar
      3c59x: fix PCI resource management · 4b264a16
      Sergei Shtylyov authored
      The driver wrongly claimed I/O ports at an address returned by pci_iomap() --
      even if it was passed an MMIO address.  Fix this by claiming/releasing all PCI
      resources in the PCI driver's probe()/remove() methods instead and get rid of
      'must_free_region' flag weirdness (why would Cardbus claim anything for us?).
      Signed-off-by: default avatarSergei Shtylyov <sshtylyov@ru.mvista.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4b264a16
    • Linus Torvalds's avatar
      Linux 3.10-rc1 · f722406f
      Linus Torvalds authored
      f722406f
    • Linus Torvalds's avatar
      Merge tag 'trace-fixes-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 26b840ae
      Linus Torvalds authored
      Pull tracing/kprobes update from Steven Rostedt:
       "The majority of these changes are from Masami Hiramatsu bringing
        kprobes up to par with the latest changes to ftrace (multi buffering
        and the new function probes).
      
        He also discovered and fixed some bugs in doing so.  When pulling in
        his patches, I also found a few minor bugs as well and fixed them.
      
        This also includes a compile fix for some archs that select the ring
        buffer but not tracing.
      
        I based this off of the last patch you took from me that fixed the
        merge conflict error, as that was the commit that had all the changes
        I needed for this set of changes."
      
      * tag 'trace-fixes-v3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing/kprobes: Support soft-mode disabling
        tracing/kprobes: Support ftrace_event_file base multibuffer
        tracing/kprobes: Pass trace_probe directly from dispatcher
        tracing/kprobes: Increment probe hit-count even if it is used by perf
        tracing/kprobes: Use bool for retprobe checker
        ftrace: Fix function probe when more than one probe is added
        ftrace: Fix the output of enabled_functions debug file
        ftrace: Fix locking in register_ftrace_function_probe()
        tracing: Add helper function trace_create_new_event() to remove duplicate code
        tracing: Modify soft-mode only if there's no other referrer
        tracing: Indicate enabled soft-mode in enable file
        tracing/kprobes: Fix to increment return event probe hit-count
        ftrace: Cleanup regex_lock and ftrace_lock around hash updating
        ftrace, kprobes: Fix a deadlock on ftrace_regex_lock
        ftrace: Have ftrace_regex_write() return either read or error
        tracing: Return error if register_ftrace_function_probe() fails for event_enable_func()
        tracing: Don't succeed if event_enable_func did not register anything
        ring-buffer: Select IRQ_WORK
      26b840ae
  4. 11 May, 2013 18 commits
    • Geert Uytterhoeven's avatar
      caif: CAIF_VIRTIO should depend on HAS_DMA · 79e0c19e
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
      drivers/built-in.o: In function `cfv_destroy_genpool':
      drivers/net/caif/caif_virtio.c:364: undefined reference to `dma_free_coherent'
      drivers/built-in.o: In function `cfv_create_genpool':
      drivers/net/caif/caif_virtio.c:397: undefined reference to `dma_alloc_coherent'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      79e0c19e
    • Geert Uytterhoeven's avatar
      net/ethernet: MACB should depend on HAS_DMA · 822bc329
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
      drivers/built-in.o: In function `macb_free_consistent':
      drivers/net/ethernet/cadence/macb.c:878: undefined reference to `dma_free_coherent'
      drivers/net/ethernet/cadence/macb.c:883: undefined reference to `dma_free_coherent'
      drivers/net/ethernet/cadence/macb.c:888: undefined reference to `dma_free_coherent'
      drivers/built-in.o: In function `macb_alloc_consistent':
      drivers/net/ethernet/cadence/macb.c:905: undefined reference to `dma_alloc_coherent'
      drivers/built-in.o: In function `macb_tx_interrupt':
      drivers/net/ethernet/cadence/macb.c:515: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `macb_tx_error_task':
      drivers/net/ethernet/cadence/macb.c:457: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `macb_start_xmit':
      drivers/net/ethernet/cadence/macb.c:838: undefined reference to `dma_map_single'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: netdev@vger.kernel.org
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      822bc329
    • Geert Uytterhoeven's avatar
      net/ethernet: ARM_AT91_ETHER should depend on HAS_DMA · d914ae80
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
      drivers/built-in.o: In function `at91ether_start':
      drivers/net/ethernet/cadence/at91_ether.c:49: undefined reference to `dma_alloc_coherent'
      drivers/net/ethernet/cadence/at91_ether.c:60: undefined reference to `dma_free_coherent'
      drivers/built-in.o: In function `at91ether_interrupt':
      drivers/net/ethernet/cadence/at91_ether.c:250: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `at91ether_start_xmit':
      drivers/net/ethernet/cadence/at91_ether.c:169: undefined reference to `dma_map_single'
      drivers/built-in.o: In function `at91ether_close':
      drivers/net/ethernet/cadence/at91_ether.c:145: undefined reference to `dma_free_coherent'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: netdev@vger.kernel.org
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d914ae80
    • Geert Uytterhoeven's avatar
      net/wireless: ATH9K should depend on HAS_DMA · 4837ef42
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
      drivers/built-in.o: In function `ath9k_beacon_generate':
      drivers/net/wireless/ath/ath9k/beacon.c:146: undefined reference to `dma_unmap_single'
      drivers/net/wireless/ath/ath9k/beacon.c:174: undefined reference to `dma_map_single'
      drivers/net/wireless/ath/ath9k/beacon.c:176: undefined reference to `dma_mapping_error'
      drivers/built-in.o: In function `ath9k_beacon_remove_slot':
      drivers/net/wireless/ath/ath9k/beacon.c:252: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `ath_descdma_setup':
      drivers/net/wireless/ath/ath9k/init.c:382: undefined reference to `dmam_alloc_coherent'
      drivers/built-in.o: In function `ath_edma_get_buffers':
      drivers/net/wireless/ath/ath9k/recv.c:616: undefined reference to `dma_sync_single_for_cpu'
      drivers/built-in.o: In function `ath_get_next_rx_buf':
      drivers/net/wireless/ath/ath9k/recv.c:740: undefined reference to `dma_sync_single_for_cpu'
      drivers/built-in.o: In function `ath_rx_edma_cleanup':
      drivers/net/wireless/ath/ath9k/recv.c:176: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `ath_rx_cleanup':
      drivers/net/wireless/ath/ath9k/recv.c:340: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `ath_rx_edma_buf_link':
      drivers/net/wireless/ath/ath9k/recv.c:122: undefined reference to `dma_sync_single_for_cpu'
      drivers/built-in.o: In function `ath_rx_tasklet':
      drivers/net/wireless/ath/ath9k/recv.c:1275: undefined reference to `dma_map_single'
      drivers/net/wireless/ath/ath9k/recv.c:1277: undefined reference to `dma_mapping_error'
      drivers/net/wireless/ath/ath9k/recv.c:1283: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `ath_rx_edma_init':
      drivers/net/wireless/ath/ath9k/recv.c:226: undefined reference to `dma_map_single'
      drivers/net/wireless/ath/ath9k/recv.c:229: undefined reference to `dma_mapping_error'
      drivers/built-in.o: In function `ath_rx_init':
      drivers/net/wireless/ath/ath9k/recv.c:303: undefined reference to `dma_map_single'
      drivers/net/wireless/ath/ath9k/recv.c:306: undefined reference to `dma_mapping_error'
      drivers/built-in.o: In function `ath_tx_complete_buf':
      drivers/net/wireless/ath/ath9k/xmit.c:2088: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `ath_txstatus_setup':
      drivers/net/wireless/ath/ath9k/xmit.c:2344: undefined reference to `dmam_alloc_coherent'
      drivers/built-in.o: In function `ath_tx_set_retry':
      drivers/net/wireless/ath/ath9k/xmit.c:307: undefined reference to `dma_sync_single_for_cpu'
      drivers/built-in.o: In function `ath_tx_setup_buffer':
      drivers/net/wireless/ath/ath9k/xmit.c:1887: undefined reference to `dma_map_single'
      drivers/net/wireless/ath/ath9k/xmit.c:1889: undefined reference to `dma_mapping_error'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
      Cc: John W. Linville <linville@tuxdriver.com>
      Cc: linux-wireless@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4837ef42
    • Geert Uytterhoeven's avatar
      net/ethernet: STMMAC_ETH should depend on HAS_DMA · fd1eb9e6
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
      drivers/built-in.o: In function `dma_free_tx_skbufs':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1141: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `dma_free_rx_skbufs':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1120: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `free_dma_desc_resources':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1159: undefined reference to `dma_free_coherent'
      drivers/built-in.o: In function `stmmac_init_rx_buffers':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:980: undefined reference to `dma_map_single'
      drivers/built-in.o: In function `init_dma_desc_rings':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1015: undefined reference to `dma_alloc_coherent'
      drivers/built-in.o: In function `stmmac_tx_clean':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1250: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `stmmac_rx':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:2044: undefined reference to `dma_unmap_single'
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:2082: undefined reference to `dma_unmap_single'
      drivers/built-in.o: In function `stmmac_rx_refill':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1967: undefined reference to `dma_map_single'
      drivers/built-in.o: In function `stmmac_xmit':
      drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:1845: undefined reference to `dma_map_single'
      drivers/built-in.o: In function `skb_frag_dma_map':
      include/linux/skbuff.h:2184: undefined reference to `dma_map_page'
      drivers/built-in.o: In function `stmmac_jumbo_frm':
      drivers/net/ethernet/stmicro/stmmac/ring_mode.c:40: undefined reference to `dma_map_single'
      drivers/built-in.o: In function `stmmac_jumbo_frm':
      drivers/net/ethernet/stmicro/stmmac/chain_mode.c:48: undefined reference to `dma_map_single'
      drivers/net/ethernet/stmicro/stmmac/chain_mode.c:55: undefined reference to `dma_map_single'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fd1eb9e6
    • Geert Uytterhoeven's avatar
      net/ethernet: NET_CALXEDA_XGMAC should depend on HAS_DMA · 3b76b3c3
      Geert Uytterhoeven authored
      If NO_DMA=y:
      
      drivers/built-in.o: In function `xgmac_xmit':
      drivers/net/ethernet/calxeda/xgmac.c:1102: undefined reference to `dma_mapping_error'
      Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: netdev@vger.kernel.org
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3b76b3c3
    • Eric Dumazet's avatar
      ipv6: do not clear pinet6 field · f77d6021
      Eric Dumazet authored
      We have seen multiple NULL dereferences in __inet6_lookup_established()
      
      After analysis, I found that inet6_sk() could be NULL while the
      check for sk_family == AF_INET6 was true.
      
      Bug was added in linux-2.6.29 when RCU lookups were introduced in UDP
      and TCP stacks.
      
      Once an IPv6 socket, using SLAB_DESTROY_BY_RCU is inserted in a hash
      table, we no longer can clear pinet6 field.
      
      This patch extends logic used in commit fcbdf09d
      ("net: fix nulls list corruptions in sk_prot_alloc")
      
      TCP/UDP/UDPLite IPv6 protocols provide their own .clear_sk() method
      to make sure we do not clear pinet6 field.
      
      At socket clone phase, we do not really care, as cloning the parent (non
      NULL) pinet6 is not adding a fatal race.
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      f77d6021
    • Jiri Pirko's avatar
      macvlan: fix passthru mode race between dev removal and rx path · 233c7df0
      Jiri Pirko authored
      Currently, if macvlan in passthru mode is created and data are rxed and
      you remove this device, following panic happens:
      
      NULL pointer dereference at 0000000000000198
      IP: [<ffffffffa0196058>] macvlan_handle_frame+0x153/0x1f7 [macvlan]
      
      I'm using following script to trigger this:
      <script>
      while [ 1 ]
      do
      	ip link add link e1 name macvtap0 type macvtap mode passthru
      	ip link set e1 up
      	ip link set macvtap0 up
      	IFINDEX=`ip link |grep macvtap0 | cut -f 1 -d ':'`
      	cat /dev/tap$IFINDEX  >/dev/null &
      	ip link del dev macvtap0
      done
      </script>
      
      I run this script while "ping -f" is running on another machine to send
      packets to e1 rx.
      
      Reason of the panic is that list_first_entry() is blindly called in
      macvlan_handle_frame() even if the list was empty. vlan is set to
      incorrect pointer which leads to the crash.
      
      I'm fixing this by protecting port->vlans list by rcu and by preventing
      from getting incorrect pointer in case the list is empty.
      
      Introduced by: commit eb06acdc "macvlan: Introduce 'passthru' mode to takeover the underlying device"
      Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
      Acked-by: default avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      233c7df0
    • David S. Miller's avatar
      Merge tag 'batman-adv-fix-for-davem' of git://git.open-mesh.org/linux-merge · fb863b8b
      David S. Miller authored
      Included changes:
      - fix parsing of user typed protocol string to avoid random memory access in
        some cases
      - check pskb_trim_rcsum() return value
      - prevent DAT from sending ARP replies when not needed
      - reorder the main clean up routine to prevent race conditions
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      fb863b8b
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.10-rc0-tag-two' of... · 607eeb0b
      Linus Torvalds authored
      Merge tag 'stable/for-linus-3.10-rc0-tag-two' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      Pull Xen bug-fixes from Konrad Rzeszutek Wilk:
       - More fixes in the vCPU PVHVM hotplug path.
       - Add more documentation.
       - Fix various ARM related issues in the Xen generic drivers.
       - Updates in the xen-pciback driver per Bjorn's updates.
       - Mask the x2APIC feature for PV guests.
      
      * tag 'stable/for-linus-3.10-rc0-tag-two' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xen/pci: Used cached MSI-X capability offset
        xen/pci: Use PCI_MSIX_TABLE_BIR, not PCI_MSIX_FLAGS_BIRMASK
        xen: clear IRQ_NOAUTOEN and IRQ_NOREQUEST
        xen: mask x2APIC feature in PV
        xen: SWIOTLB is only used on x86
        xen/spinlock: Fix check from greater than to be also be greater or equal to.
        xen/smp/pvhvm: Don't point per_cpu(xen_vpcu, 33 and larger) to shared_info
        xen/vcpu: Document the xen_vcpu_info and xen_vcpu
        xen/vcpu/pvhvm: Fix vcpu hotplugging hanging.
      607eeb0b
    • Denis Efremov's avatar
      ipv4: ip_output: remove inline marking of EXPORT_SYMBOL functions · 2fbd9679
      Denis Efremov authored
      EXPORT_SYMBOL and inline directives are contradictory to each other.
      The patch fixes this inconsistency.
      
      Found by Linux Driver Verification project (linuxtesting.org).
      Signed-off-by: default avatarDenis Efremov <yefremov.denis@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2fbd9679
    • Rony Efraim's avatar
      net/mlx4: Strengthen VLAN tags/priorities enforcement in VST mode · 7677fc96
      Rony Efraim authored
      Make sure that the following steps are taken:
      
      - drop packets sent by the VF with vlan tag
      - block packets with vlan tag which are steered to the VF
      - drop/block tagged packets when the policy is priority-tagged
      - make sure VLAN stripping for received packets is set
      - make sure force UP bit for the VF QP is set
      
      Use enum values for all the above instead of numerical bit offsets.
      Signed-off-by: default avatarRony Efraim <ronye@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7677fc96
    • Or Gerlitz's avatar
      net/mlx4_core: Add missing report on VST and spoof-checking dev caps · 4e8cf5b8
      Or Gerlitz authored
      Commits e6b6a231 "net/mlx4: Add VF MAC spoof checking support" and
      3f7fb021 "net/mlx4: Add set VF default vlan ID and priority support"
      missed reporting in the device capabilities dump when these features
      are actually supported. Also two too noisy debug messages which produce
      message on every QP opened by a VF, were left in the code, fix that.
      Signed-off-by: default avatarRony Efraim <ronye@mellanox.com>
      Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4e8cf5b8
    • Shawn Guo's avatar
      net: fec: enable hardware checksum only on imx6q-fec · 48496255
      Shawn Guo authored
      Commit 4c09eed9 (net: fec: Enable imx6 enet checksum acceleration.)
      enables hardware checksum acceleration unconditionally for all fec
      variants.  This is inappropriate, because some variants like imx5 have
      no such support on hardware.  Consequently, fec is broken on these
      platforms.  Fix it by enabling hardware checksum only on imx6q-fec type
      of controllers.
      Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
      Reviewed-by: default avatarJim Baxter <jim_baxter@mentor.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      48496255
    • David S. Miller's avatar
      Merge branch 'qlcnic' · 1e9e9901
      David S. Miller authored
      Shahed Shaikh says:
      
      ====================
      This patch series has following bug fixes:
      * Fix a bug in unicast MAC address setting in adapter.
        Driver was not deleting older unicast MAC while adding new one.
      * Fix an ethtool stats string array by adding missing string entry
        and fix a typo.
      * Fix module paramter description. Bracket ')' was missing.
      * Fix port status provided though 'ethtool <device>' for 83xx adapter.
      * Fix reset recovery path in case of transmit timeout.
      * Fix reset recovery during diagnostic tests by preserving
        current device status information.
      * Fix mailbox response handling. Driver was not maintaining poll time properly.
      * Fix validation of link event command.
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1e9e9901
    • Rajesh Borundia's avatar
      qlcnic: Fix validation of link event command. · cbccb18f
      Rajesh Borundia authored
      o VF driver that has enabled asynchronous link events
        may not set BIT_8 in the request, if it does not require
        link state in the response.
      Signed-off-by: default avatarPratik Pujar <pratik.pujar@qlogic.com>
      Signed-off-by: default avatarRajesh Borundia <rajesh.borundia@qlogic.com>
      Signed-off-by: default avatarShahed Shaikh <shahed.shaikh@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cbccb18f
    • Rajesh Borundia's avatar
      qlcnic: Fix mailbox response handling. · 9106e5db
      Rajesh Borundia authored
      o Fix mailbox response poll time to maximum 5 seconds which
        includes mailbox response time as well as time required for
        processing AEN if any.
      o Driver need to read firmware control mailbox register instead
        of host control mailbox register.
      Signed-off-by: default avatarJitendra Kalsaria <jitendra.kalsaria@qlogic.com>
      Signed-off-by: default avatarRajesh Borundia <rajesh.borundia@qlogic.com>
      Signed-off-by: default avatarShahed Shaikh <shahed.shaikh@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9106e5db
    • Manish Chopra's avatar
      qlcnic: Fix bug in diagnostics test reset recovery path · 13a82b44
      Manish Chopra authored
      o In order to perform reset recovery during diagnostics tests,
        current device status information need to be preserved.
        This patch makes the required changes in diagnostics routines
      Signed-off-by: default avatarManish Chopra <manish.chopra@qlogic.com>
      Signed-off-by: default avatarShahed Shaikh <shahed.shaikh@qlogic.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      13a82b44