1. 28 Apr, 2012 4 commits
    • Will Deacon's avatar
      ARM: 7406/1: hotplug: copy the affinity mask when forcefully migrating IRQs · 5e7371de
      Will Deacon authored
      When a CPU is hotplugged off, we migrate any IRQs currently affine to it
      away and onto another online CPU by calling the irq_set_affinity
      function of the relevant interrupt controller chip. This function
      returns either IRQ_SET_MASK_OK or IRQ_SET_MASK_OK_NOCOPY, to indicate
      whether irq_data.affinity was updated.
      
      If we are forcefully migrating an interrupt (because the affinity mask
      no longer identifies any online CPUs) then we should update the IRQ
      affinity mask to reflect the new CPU set. Failure to do so can
      potentially leave /proc/irq/n/smp_affinity identifying only offline
      CPUs, which may confuse userspace IRQ balancing daemons.
      
      This patch updates migrate_one_irq to copy the affinity mask when
      the interrupt chip returns IRQ_SET_MASK_OK after forcefully changing the
      affinity of an interrupt.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarLeif Lindholm <leif.lindholm@arm.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      5e7371de
    • Will Deacon's avatar
      ARM: 7405/1: kexec: call platform_cpu_kill on the killer rather than the victim · 6fa99b7f
      Will Deacon authored
      When performing a kexec on an SMP system, the secondary cores are stopped
      by calling machine_shutdown(), which in turn issues IPIs to offline the
      other CPUs. Unfortunately, this isn't enough to reboot the cores into
      a new kernel (since they are just executing a cpu_relax loop somewhere
      in memory) so we make use of platform_cpu_kill, part of the CPU hotplug
      implementation, to place the cores somewhere safe. This function expects
      to be called on the killing CPU for each core that it takes out.
      
      This patch moves the platform_cpu_kill callback out of the IPI handler
      and into smp_send_stop, therefore ensuring that it executes on the
      killing CPU rather than on the victim, matching what the hotplug code
      requires.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      6fa99b7f
    • Will Deacon's avatar
      ARM: 7403/1: tls: remove covert channel via TPIDRURW · 6a1c5312
      Will Deacon authored
      TPIDRURW is a user read/write register forming part of the group of
      thread registers in more recent versions of the ARM architecture (~v6+).
      
      Currently, the kernel does not touch this register, which allows tasks
      to communicate covertly by reading and writing to the register without
      context-switching affecting its contents.
      
      This patch clears TPIDRURW when TPIDRURO is updated via the set_tls
      macro, which is called directly from __switch_to. Since the current
      behaviour makes the register useless to userspace as far as thread
      pointers are concerned, simply clearing the register (rather than saving
      and restoring it) will not cause any problems to userspace.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      6a1c5312
    • Stephen Boyd's avatar
      ARM: 7401/1: mm: Fix section mismatches · 14904927
      Stephen Boyd authored
      WARNING: vmlinux.o(.text+0x111b8): Section mismatch in reference
      from the function arm_memory_present() to the function
      .init.text:memory_present()
      The function arm_memory_present() references
      the function __init memory_present().
      This is often because arm_memory_present lacks a __init
      annotation or the annotation of memory_present is wrong.
      
      WARNING: arch/arm/mm/built-in.o(.text+0x1edc): Section mismatch
      in reference from the function alloc_init_pud() to the function
      .init.text:alloc_init_section()
      The function alloc_init_pud() references
      the function __init alloc_init_section().
      This is often because alloc_init_pud lacks a __init
      annotation or the annotation of alloc_init_section is wrong.
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      14904927
  2. 23 Apr, 2012 16 commits
    • Russell King's avatar
      ARM: OMAP: fix DMA vs memory ordering · 35453584
      Russell King authored
      Using coherent DMA memory with the OMAP DMA engine results in
      unpredictable behaviour due to memory ordering issues; as things stand,
      there is no guarantee that data written to coherent DMA memory will be
      visible to the DMA hardware.
      
      This is because the OMAP dma_write() accessor contains no barriers,
      necessary on ARMv6 and above.  The effect of this can be seen in comments
      in the OMAP serial driver, which incorrectly talks about cache flushing
      for the coherent DMA stuff.
      
      Rather than adding barriers to the accessors, add it in the DMA support
      code just before we enable DMA, and just after we disable DMA.  This
      avoids having barriers for every DMA register access.
      Acked-by: default avatarTony Lindgren <tony@atomide.com>
      Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      35453584
    • Linus Walleij's avatar
      ARM: 7390/1: dts: versatile-pb/ab fix MMC IRQs · 754aba43
      Linus Walleij authored
      The MMCI driver will not work without two IRQs since this is not
      flagged as a single-irq variant. Looking through the complex IRQ
      definition for the MMCI on the versatile (including an #if 1
      statement forcing MMCI IRQ0 to the VIC) this appears to the the
      correct IRQ number for both models.
      
      Cc: Niklas Hernaeus <niklas.hernaeus@linaro.org>
      Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      754aba43
    • Will Deacon's avatar
      ARM: 7400/1: vfp: clear fpscr length and stride bits on entry to sig handler · ff9a184c
      Will Deacon authored
      The ARM PCS mandates that the length and stride bits of the fpscr are
      cleared on entry to and return from a public interface. Although signal
      handlers run asynchronously with respect to the interrupted function,
      the handler itself expects to run as though it has been called like a
      normal function.
      
      This patch updates the state mirroring the VFP hardware before entry to
      a signal handler so that it adheres to the PCS. Furthermore, we disable
      VFP to ensure that we trap on any floating point operation performed by
      the signal handler and synchronise the hardware appropriately. A check
      is inserted after the signal handler to avoid redundant flushing if VFP
      was not used.
      Reported-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      ff9a184c
    • Will Deacon's avatar
      ARM: 7399/1: vfp: move user vfp state save/restore code out of signal.c · 2498814f
      Will Deacon authored
      The user VFP state must be preserved (subject to ucontext modifications)
      across invocation of a signal handler and this is currently handled by
      vfp_{preserve,restore}_context in signal.c
      
      Since this code requires intimate low-level knowledge of the VFP state,
      this patch moves it into vfpmodule.c.
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      2498814f
    • Will Deacon's avatar
      ARM: 7398/1: l2x0: only write to debug registers on PL310 · ab4d5368
      Will Deacon authored
      PL310 errata #588369 and #727915 require writes to the debug registers
      of the cache controller to work around known problems. Writing these
      registers on L220 may cause deadlock, so ensure that we only perform
      this operation when we identify a PL310 at probe time.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      ab4d5368
    • Will Deacon's avatar
      ARM: 7397/1: l2x0: only apply workaround for erratum #753970 on PL310 · f154fe9b
      Will Deacon authored
      The workaround for PL310 erratum #753970 can lead to deadlock on systems
      with an L220 cache controller.
      
      This patch makes the workaround effective only when the cache controller
      is identified as a PL310 at probe time.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      f154fe9b
    • Will Deacon's avatar
      ARM: 7396/1: errata: only handle ARM erratum #326103 on affected cores · f0c4b8d6
      Will Deacon authored
      Erratum #326103 ("FSR write bit incorrect on a SWP to read-only memory")
      only affects the ARM 1136 core prior to r1p0. The workaround
      disassembles the faulting instruction to determine whether it was a read
      or write access on all v6 cores.
      
      An issue has been reported on the ARM 11MPCore whereby loading the
      faulting instruction may happen in parallel with that page being
      unmapped, resulting in a deadlock due to the lack of TLB broadcasting
      in hardware:
      
      http://lists.infradead.org/pipermail/linux-arm-kernel/2012-March/091561.html
      
      This patch limits the workaround so that it is only used on affected
      cores, which are known to be UP only. Other v6 cores can rely on the
      FSR to indicate the access type correctly.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
      f0c4b8d6
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.linaro.org/people/rmk/linux-arm · e895bd79
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "Here's my usual Sunday push, just for one revert which PeterZ hollered
        about after last weeks push.  Other than that, all seems strangely
        quiet as far as fixes go in non-platform ARM land at the moment."
      
      * 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
        Revert "ARM: 7359/2: smp_twd: Only wait for reprogramming on active cpus"
      e895bd79
    • Linus Torvalds's avatar
      Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc · 205b9c9c
      Linus Torvalds authored
      Pull powerpc fixes from Benjamin Herrenschmidt:
       "Here are a few fixes for powerpc.  Note the addition to the generic
        irq.h.  This is part of a 3-patches regression fix for mpic due to
        changes in how IRQ_TYPE_NONE is being handled.  Thomas agreed to the
        addition of the new IRQ_TYPE_DEFAULT contant, however he hasn't
        replied with an Ack to the actual patch yet.  I don't to wait much
        longer with these patches tho."
      
      * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
        powerpc/mpic: Properly set default triggers
        irq: Add IRQ_TYPE_DEFAULT for use by PIC drivers
        powerpc/mpic: Fix confusion between hw_irq and virq
        powerpc/pmac: Don't add_timer() twice
        powerpc/eeh: Fix crash caused by null eeh_dev
        powerpc/mpc85xx: add MPIC message dts node
        powerpc/mpic_msgr: fix offset error when setting mer register
        powerpc/mpic_msgr: add lock for MPIC message global variable
        powerpc/mpic_msgr: fix compile error when SMP disabled
        powerpc: fix build when CONFIG_BOOKE_WDT is enabled
        powerpc/85xx: don't call of_platform_bus_probe() twice
      205b9c9c
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · 7e296295
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) Fix namespace init and cleanup in phonet to fix some oopses, from
          Eric W. Biederman.
      
       2) Missing kfree_skb() in AF_KEY, from Julia Lawall.
      
       3) Refcount leak and source address handling fix in l2tp from James
          Chapman.
      
       4) Memory leak fix in CAIF from Tomasz Gregorek.
      
       5) When routes are cloned from ipv6 addrconf routes, we don't process
          expirations properly.  Fix from Gao Feng.
      
       6) Fix panic on DMA errors in atl1 driver, from Tony Zelenoff.
      
       7) Only enable interrupts in 8139cp driver after we've registered the
          IRQ handler.  From Jason Wang.
      
       8) Fix too many reads of KS_CIDER register in ks8851 during probe,
          fixing crashes on spurious interrupts.  From Matt Renzelmann.
      
       9) Missing include in ath5k driver and missing iounmap on probe
          failure, from Jonathan Bither.
      
      10) Fix RX packet handling in smsc911x driver, from Will Deacon.
      
      11) Fix ixgbe WoL on fiber by leaving the laser on during shutdown.
      
      12) ks8851 needs MAX_RECV_FRAMES increased otherwise the internal MAC
          buffers are easily overflown.  Fix from Davide Cimingahi.
      
      13) Fix memory leaks in peak_usb CAN driver, from Jesper Juhl.
      
      14) gred packet scheduler can dump in WRED more when doing a netlink
          dump.  Fix from David Ward.
      
      15) Fix MTU in USB smsc75xx driver, from Stephane Fillod.
      
      16) Dummy device needs ->ndo_uninit handler to properly handle
          ->ndo_init failures.  From Hiroaki SHIMODA.
      
      17) Fix TX fragmentation in ath9k driver, from Sujith Manoharan.
      
      18) Missing RTNL lock in ixgbe PM resume, from Benjamin Poirier.
      
      19) Missing iounmap in farsync WAN driver, from Julia Lawall.
      
      20) With LRO/GRO, tcp_grow_window() is easily tricked into not growing
          the receive window properly, and this hurts performance.  Fix from
          Eric Dumazet.
      
      21) Network namespace init failure can leak net_generic data, fix from
          Julian Anastasov.
      
      22) Fix skb_over_panic due to mis-accounting in TCP for partially ACK'd
          SKBs.  From Eric Dumazet.
      
      23) New IDs for qmi_wwan driver, from Bjørn Mork.
      
      24) Fix races in ax25_exit(), from Eric W. Biederman.
      
      25) IPV6 TCP doesn't handle TCP_MAXSEG socket option properly, copy over
          logic from the IPV4 side.  From Neal Cardwell.
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (59 commits)
        tcp: fix TCP_MAXSEG for established IPv6 passive sockets
        drivers/net: Do not free an IRQ if its request failed
        drop_monitor: allow more events per second
        ks8851: Fix request_irq/free_irq mismatch
        net/hyperv: Adding cancellation to ensure rndis filter is closed
        ks8851: Fix mutex deadlock in ks8851_net_stop()
        net ax25: Reorder ax25_exit to remove races.
        icplus: fix interrupt for IC+ 101A/G and 1001LF
        net: qmi_wwan: support Sierra Wireless MC77xx devices in QMI mode
        bnx2x: off by one in bnx2x_ets_e3b0_sp_pri_to_cos_set()
        ksz884x: don't copy too much in netdev_set_mac_address()
        tcp: fix retransmit of partially acked frames
        netns: do not leak net_generic data on failed init
        net/sock.h: fix sk_peek_off kernel-doc warning
        tcp: fix tcp_grow_window() for large incoming frames
        drivers/net/wan/farsync.c: add missing iounmap
        davinci_mdio: Fix MDIO timeout check
        ipv6: clean up rt6_clean_expires
        ipv6: fix rt6_update_expires
        arcnet: rimi: Fix device name in debug output
        ...
      7e296295
    • Benjamin Herrenschmidt's avatar
      powerpc/mpic: Properly set default triggers · 446f6d06
      Benjamin Herrenschmidt authored
      This gets rid of the unused default senses array, and replaces the
      incorrect use of IRQ_TYPE_NONE with the new IRQ_TYPE_DEFAULT for
      the initial set_trigger() call when mapping an interrupt.
      
      This in turn makes us read the HW state and update the irq desc
      accordingly.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      446f6d06
    • Benjamin Herrenschmidt's avatar
      irq: Add IRQ_TYPE_DEFAULT for use by PIC drivers · 3fca40c7
      Benjamin Herrenschmidt authored
      This is meant typically to allow a PIC driver's irq domain map() callback
      to establish sane defaults for the interrupt (and make sure that the HW
      and the irq_desc are in sync as far as the trigger is concerned).
      
      The irq core may not call the set_trigger callback if it thinks the
      trigger is already set to the right setting, so we need to ensure new
      descriptors are properly synchronized with the hardware.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3fca40c7
    • Benjamin Herrenschmidt's avatar
      powerpc/mpic: Fix confusion between hw_irq and virq · 3a2b4f7c
      Benjamin Herrenschmidt authored
      mpic_is_ipi() takes a virq and immediately converts it to a hw_irq.
      
      However, one of the two call sites calls it with a ... hw_irq. The
      other call site also happens to have the hw_irq at hand, so let's
      change it to just take that as an argument. Also change mpic_is_tm()
      for consistency.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3a2b4f7c
    • Benjamin Herrenschmidt's avatar
      powerpc/pmac: Don't add_timer() twice · 3027691e
      Benjamin Herrenschmidt authored
      If the interrupt and the timeout happen roughly at the same
      time, we can get into a situation where the timer function
      is run while the interrupt has already been processed. In
      this case, the timer function might end up doing an add_timer
      on an already pending timer, causing a BUG_ON() to trigger.
      
      Instead, just skip the whole timeout operation if we see that
      the timer is pending. The spinlock ensures that the only way
      that happens is if we already started a new operation and thus
      the timeout can be ignored.
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3027691e
    • Gavin Shan's avatar
      powerpc/eeh: Fix crash caused by null eeh_dev · 2ef822c5
      Gavin Shan authored
      The problem was reported by Anton Blanchard. While EEH error
      happened to the PCI device without the corresponding device
      driver, kernel crash was seen. Eventually, I successfully
      reproduced the problem on Firebird-L machine with utility
      "errinjct". Initially, the device driver for Emulex ethernet
      MAC has been disabled from .config and force data parity on
      the Emulex ethernet MAC with help of "errinjct". Eventually,
      I saw the kernel crash after issueing couple of "lspci -v"
      command.
      
      The root cause behind is that the PCI device, including the
      reference to the corresponding eeh device, will be removed
      from the system while EEH does recovery. Afterwards, the
      PCI device will be probed again and added into the system
      accordingly. So it's not safe to retrieve the eeh device from
      the corresponding PCI device after the PCI device has been removed
      and not added again.
      
      The patch fixes the issue and retrieve the eeh device from OF node
      instead of PCI device after the PCI device has been removed.
      Signed-off-by: default avatarGavin Shan <shangw@linux.vnet.ibm.com>
      Tested-by: default avatarAnton Blanchard <anton@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2ef822c5
    • Benjamin Herrenschmidt's avatar
  3. 22 Apr, 2012 1 commit
  4. 21 Apr, 2012 19 commits
    • Linus Torvalds's avatar
      Linux 3.4-rc4 · 66f75a5d
      Linus Torvalds authored
      66f75a5d
    • Lee Jones's avatar
      drivers/net: Do not free an IRQ if its request failed · 163faf31
      Lee Jones authored
      Refrain from attempting to free an interrupt line if the request
      fails and hence, there is no IRQ to free.
      
      CC: netdev@vger.kernel.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      163faf31
    • Yong Zhang's avatar
      sparc32,leon: add notify_cpu_starting() · e9a5ea18
      Yong Zhang authored
      Otherwise cpu_active_mask will not set, which lead to other issue.
      Signed-off-by: default avatarYong Zhang <yong.zhang0@gmail.com>
      Signed-off-by: default avatarKonrad Eisele <konrad@gaisler.com>
      Reviewed-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e9a5ea18
    • Eric Dumazet's avatar
      drop_monitor: allow more events per second · bbe362be
      Eric Dumazet authored
      It seems there is a logic error in trace_drop_common(), since we store
      only 64 drops, even if they are from same location.
      
      This fix is a one liner, but we probably need more work to avoid useless
      atomic dec/inc
      
      Now I can watch 1 Mpps drops through dropwatch...
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      bbe362be
    • Matt Renzelmann's avatar
      ks8851: Fix request_irq/free_irq mismatch · e8195b24
      Matt Renzelmann authored
      The dev_id parameter passed to free_irq needs to match the one passed
      to the corresponding request_irq.
      Signed-off-by: default avatarMatt Renzelmann <mjr@cs.wisc.edu>
      Acked-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e8195b24
    • Linus Torvalds's avatar
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 8f4f9d4d
      Linus Torvalds authored
      Pull "ARM: SoC fixes" from Olof Johansson:
       * at91, ux500, imx, omap and bcmring:
        - at91 fixes for =m driver build issues, irqdomain fixes and config
          dependency fixes
        - ux500 kconfig dependency fixes and a  smp wakeup bugfix
        - imx idle bugfix and build fix due to irq domain changes
        - omap uart pinmux fixes, softreset regression revert and misc fixes
        - bcmring build error regression fix
      
       * ux500 and imx had some small defconfig updates in this branch
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (27 commits)
        ARM: bcmring: fix UART declarations
        ARM: imx: Fix imx5 idle logic bug
        ARM: imx27-dt: Fix build due to removal of irq_domain_add_simple()
        ARM: imx_v4_v5_defconfig: Add support for CONFIG_REGULATOR_FIXED_VOLTAGE
        ARM: OMAP1: DMTIMER: fix broken timer clock source selection
        ARM: OMAP: serial: Fix the ocp smart idlemode handling bug
        ARM: OMAP2+: UART: Fix incorrect population of default uart pads
        ARM: OMAP: sram: fix BUG in dpll code for !PM case
        dmaengine: Kconfig: fix Atmel at_hdmac entry
        USB: gadget/at91_udc: add gpio_to_irq() function to vbus interrupt
        USB: ohci-at91: change annotations for probe/remove functions
        leds-atmel-pwm.c: Make pwmled_probe() __devinit
        ARM: at91: fix at91sam9261ek Ethernet dm9000 irq
        ARM: at91: fix rm9200ek flash size
        ARM: at91: remove empty at91_init_serial function
        ARM: at91: fix typo in at91_pmc_base assembly declaration
        ARM: at91: Export at91_matrix_base
        ARM: at91: Export at91_pmc_base
        ARM: at91: Export at91_ramc_base
        ARM: at91: Export at91_st_base
        ...
      8f4f9d4d
    • Linus Torvalds's avatar
      Merge tag 'mmc-fixes-for-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc · 126a3483
      Linus Torvalds authored
      Pull MMC fixes from Chris Ball:
       - Build fix for omap_hsmmc with OF against 3.4-rc1.
       - Fix CONFIG_MMC_UNSAFE_RESUME semantics regression against 3.3, which
         broke hotplug card detection when UNSAFE_RESUME is set.
       - Fix a race condition in omap_hsmmc with runtime PM.
       - Fix two libertas SDIO-powered-resume regressions.
       - Small fixes for discard/sanitize, dw_mmc, cd-gpio and esdhc-imx.
      
      * tag 'mmc-fixes-for-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
        mmc: core: Do not pre-claim host in suspend
        mmc: dw_mmc: prevent NULL dereference for dma_ops
        mmc: unbreak sdhci-esdhc-imx on i.MX25
        mmc: cd-gpio: Include header to pickup exported symbol prototypes
        mmc: sdhci: refine non-removable card checking for card detection
        mmc: dw_mmc: Fix switch from DMA to PIO
        mmc: remove MMC bus legacy suspend/resume method
        mmc: omap_hsmmc: Get rid of of_have_populated_dt() usage
        mmc: omap_hsmmc: build fix for CONFIG_OF=y and CONFIG_MMC_OMAP_HS=m
        mmc: fixes for eMMC v4.5 sanitize operation
        mmc: fixes for eMMC v4.5 discard operation
      126a3483
    • Linus Torvalds's avatar
      Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 88981596
      Linus Torvalds authored
      Pull media fixes from Mauro Carvalho Chehab:
       - Fixes a regression at DVB core when switching from DVB-S2 to DVB-S on
         Kaffeine (Fedora 16 Bugzilla #812895);
       - Fixes a mutex unlock at an error condition at drx-k;
       - Fix winbond-cir set mode;
       - mt9m032: Fix a compilation breakage with some random Kconfig;
       - mt9m032: fix two dead locks;
       - xc5000: don't require an special firmware (that won't be provided by
         the vendor) just because the xtal frequency is different;
       - V4L DocBook: fix some typos at multi-plane formats description.
      
      * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
        [media] xc5000: support 32MHz & 31.875MHz xtal using the 41.024.5 firmware
        [media] V4L: mt9m032: fix compilation breakage
        [media] V4L: DocBook: Fix typos in the multi-plane formats description
        [media] V4L: mt9m032: fix two dead-locks
        [media] rc-core: set mode for winbond-cir
        [media] drxk: Does not unlock mutex if sanity check failed in scu_command()
        [media] dvb_frontend: Fix a regression when switching back to DVB-S
      88981596
    • Linus Torvalds's avatar
      Merge tag 'mfd-for-linus-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 · 9f24ff6f
      Linus Torvalds authored
      Pull MFD fixes from Samuel Ortiz:
       "We have 3 build fixes, a OMAP USB host PHY reset fix and the twl6040
        conversion to an i2c driver.  The latter may not sound like a fix but
        the twl6040 MFD driver won't probe without it, triggering an OMAP4
        audio regression."
      
      * tag 'mfd-for-linus-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6:
        mfd: Fix modular builds of rc5t583 regulator support
        mfd: Fix asic3_gpio_to_irq
        ARM: OMAP3: USB: Fix the EHCI ULPI PHY reset issue
        mfd: Convert twl6040 to i2c driver, and separate it from twl core
        mfd : Fix dbx500 compilation error
      9f24ff6f
    • Wenqi Ma's avatar
      net/hyperv: Adding cancellation to ensure rndis filter is closed · 792df872
      Wenqi Ma authored
      Although the network interface is down, the RX packets number which
      could be observed by ifconfig may keep on increasing.
      
      This is because the WORK scheduled in netvsc_set_multicast_list()
      may be executed after netvsc_close(). That means the rndis filter
      may be re-enabled by do_set_multicast() even if it was closed by
      netvsc_close().
      
      By canceling possible WORK before close the rndis filter, the issue
      could be never happened.
      Signed-off-by: default avatarWenqi Ma <wenqi_ma@trendmicro.com.cn>
      Reviewed-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      792df872
    • Stephen Boyd's avatar
      ks8851: Fix mutex deadlock in ks8851_net_stop() · c5a99937
      Stephen Boyd authored
      There is a potential deadlock scenario when the ks8851 driver
      is removed. The interrupt handler schedules a workqueue which
      acquires a mutex that ks8851_net_stop() also acquires before
      flushing the workqueue. Previously lockdep wouldn't be able
      to find this problem but now that it has the support we can
      trigger this lockdep warning by rmmoding the driver after
      an ifconfig up.
      
      Fix the possible deadlock by disabling the interrupts in
      the chip and then release the lock across the workqueue
      flushing. The mutex is only there to proect the registers
      anyway so this should be ok.
      
      =======================================================
      [ INFO: possible circular locking dependency detected ]
      3.0.21-00021-g8b33780-dirty #2911
      -------------------------------------------------------
      rmmod/125 is trying to acquire lock:
       ((&ks->irq_work)){+.+...}, at: [<c019e0b8>] flush_work+0x0/0xac
      
      but task is already holding lock:
       (&ks->lock){+.+...}, at: [<bf00b850>] ks8851_net_stop+0x64/0x138 [ks8851]
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (&ks->lock){+.+...}:
             [<c01b89c8>] __lock_acquire+0x940/0x9f8
             [<c01b9058>] lock_acquire+0x10c/0x130
             [<c083dbec>] mutex_lock_nested+0x68/0x3dc
             [<bf00bd48>] ks8851_irq_work+0x24/0x46c [ks8851]
             [<c019c580>] process_one_work+0x2d8/0x518
             [<c019cb98>] worker_thread+0x220/0x3a0
             [<c01a2ad4>] kthread+0x88/0x94
             [<c0107008>] kernel_thread_exit+0x0/0x8
      
      -> #0 ((&ks->irq_work)){+.+...}:
             [<c01b7984>] validate_chain+0x914/0x1018
             [<c01b89c8>] __lock_acquire+0x940/0x9f8
             [<c01b9058>] lock_acquire+0x10c/0x130
             [<c019e104>] flush_work+0x4c/0xac
             [<bf00b858>] ks8851_net_stop+0x6c/0x138 [ks8851]
             [<c06b209c>] __dev_close_many+0x98/0xcc
             [<c06b2174>] dev_close_many+0x68/0xd0
             [<c06b22ec>] rollback_registered_many+0xcc/0x2b8
             [<c06b2554>] rollback_registered+0x28/0x34
             [<c06b25b8>] unregister_netdevice_queue+0x58/0x7c
             [<c06b25f4>] unregister_netdev+0x18/0x20
             [<bf00c1f4>] ks8851_remove+0x64/0xb4 [ks8851]
             [<c049ddf0>] spi_drv_remove+0x18/0x1c
             [<c0468e98>] __device_release_driver+0x7c/0xbc
             [<c0468f64>] driver_detach+0x8c/0xb4
             [<c0467f00>] bus_remove_driver+0xb8/0xe8
             [<c01c1d20>] sys_delete_module+0x1e8/0x27c
             [<c0105ec0>] ret_fast_syscall+0x0/0x3c
      
      other info that might help us debug this:
      
       Possible unsafe locking scenario:
      
             CPU0                    CPU1
             ----                    ----
        lock(&ks->lock);
                                     lock((&ks->irq_work));
                                     lock(&ks->lock);
        lock((&ks->irq_work));
      
       *** DEADLOCK ***
      
      4 locks held by rmmod/125:
       #0:  (&__lockdep_no_validate__){+.+.+.}, at: [<c0468f44>] driver_detach+0x6c/0xb4
       #1:  (&__lockdep_no_validate__){+.+.+.}, at: [<c0468f50>] driver_detach+0x78/0xb4
       #2:  (rtnl_mutex){+.+.+.}, at: [<c06b25e8>] unregister_netdev+0xc/0x20
       #3:  (&ks->lock){+.+...}, at: [<bf00b850>] ks8851_net_stop+0x64/0x138 [ks8851]
      
      Cc: Ben Dooks <ben-linux@fluff.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c5a99937
    • Al Viro's avatar
      kill mm argument of vm_munmap() · bfce281c
      Al Viro authored
      it's always current->mm
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      bfce281c
    • Al Viro's avatar
      perfmon: kill some helpers and arguments · 9f3a4afb
      Al Viro authored
      pfm_vm_munmap() is simply vm_munmap() and pfm_remove_smpl_mapping()
      always get current as the first argument.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      9f3a4afb
    • Al Viro's avatar
      aio: don't bother with unmapping when aio_free_ring() is coming from exit_aio() · 936af157
      Al Viro authored
      ... since exit_mmap() is coming and it will munmap() everything anyway.
      In all other cases aio_free_ring() has ctx->mm == current->mm; moreover,
      all other callers of vm_munmap() have mm == current->mm, so this will
      allow us to get rid of mm argument of vm_munmap().
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      936af157
    • Ulf Hansson's avatar
      mmc: core: Do not pre-claim host in suspend · 7c570919
      Ulf Hansson authored
      Since SDIO drivers may want to do some SDIO operations in their suspend
      callback functions, we must not keep the host claimed when calling them.
      
      Daniel Drake reported that libertas_sdio encountered a deadlock in its
      suspend function.
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@stericsson.com>
      Tested-by: default avatarDaniel Drake <dsd@laptop.org>
      [stable@: please apply to 3.2-stable and 3.3-stable]
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarChris Ball <cjb@laptop.org>
      7c570919
    • Jaehoon Chung's avatar
      mmc: dw_mmc: prevent NULL dereference for dma_ops · e1631f98
      Jaehoon Chung authored
      Now, dma_ops is assumed that use the IDMAC.  But if dma_ops is assigned
      the pdata->dma_ops, we didn't ensure that callback function is defined.
      
      If the callback isn't defined, then we should run in PIO mode.
      Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Acked-by: default avatarWill Newton <will.newton@imgtec.com>
      Signed-off-by: default avatarChris Ball <cjb@laptop.org>
      e1631f98
    • Eric Bénard's avatar
      mmc: unbreak sdhci-esdhc-imx on i.MX25 · b8915282
      Eric Bénard authored
      This was broken by me in 37865fe9
      ("mmc: sdhci-esdhc-imx: fix timeout on i.MX's sdhci") where more
      extensive tests would have shown that read or write of data to the
      card were failing (even if the partition table was correctly read).
      Signed-off-by: default avatarEric Bénard <eric@eukrea.com>
      Acked-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarChris Ball <cjb@laptop.org>
      b8915282
    • H Hartley Sweeten's avatar
      mmc: cd-gpio: Include header to pickup exported symbol prototypes · 5ca65188
      H Hartley Sweeten authored
      Include the linux/mmc/cd-gpio.h header to pickup the prototypes
      for the two exported symbols.
      
      This quiets the sparse warnings:
      
      warning: symbol 'mmc_cd_gpio_request' was not declared. Should it be static?
      warning: symbol 'mmc_cd_gpio_free' was not declared. Should it be static?
      Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Acked-by: default avatarVenkatraman S <svenkatr@ti.com>
      Signed-off-by: default avatarChris Ball <cjb@laptop.org>
      5ca65188
    • Daniel Drake's avatar
      mmc: sdhci: refine non-removable card checking for card detection · 87b87a3f
      Daniel Drake authored
      Commit c79396c1 ("mmc: sdhci: prevent card detection activity
      for non-removable cards") disables card detection where the cards
      are marked as non-removable.
      
      This makes sense, but the implementation detail of calling
      mmc_card_is_removable() causes some problems, because
      mmc_card_is_removable() is overloaded with CONFIG_MMC_UNSAFE_RESUME
      semantics.
      
      In the OLPC XO case, we need CONFIG_MMC_UNSAFE_RESUME because our root
      filesystem is stored on SD, but we also have external SD card slots
      where we want automatic card detection.
      
      Refine the check to only apply to hosts marked as MMC_CAP_NONREMOVABLE,
      which is defined to mean that the card is *really* nonremovable. This
      could be revisited in future if we find a way to improve
      CONFIG_MMC_UNSAFE_RESUME semantics.
      Signed-off-by: default avatarDaniel Drake <dsd@laptop.org>
      Acked-by: default avatarChuanxiao Dong <chuanxiao.dong@intel.com>
      [stable@: please apply to 3.3-stable]
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarChris Ball <cjb@laptop.org>
      87b87a3f