1. 19 1月, 2015 8 次提交
    • N
      mmc: omap_hsmmc: remove prepare/complete system suspend support. · 61bd8a04
      NeilBrown 提交于
      The only function of these 'prepare' and 'complete' is to
      disable the 'card detect' irq during suspend.
      
      The commit which added this,
      commit a48ce884
          mmc: omap_hsmmc: Introduce omap_hsmmc_prepare/complete
      
      justified it by the need to avoid the registration of new devices
      during suspend.
      However mmc_pm_notify will set ->rescan_disable in the 'prepare'
      stage and clear it in the 'complete' stage, so no card detection
      will actually happen.
      Also the interrupt will be disabled before final suspend as part
      of common suspend processing.
      
      So this disabling of the interrupt is unnecessary, and interferes
      with a transition to using common code for card-detect management.
      
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Venkatraman S <svenkatr@ti.com>
      Cc: Chris Ball <cjb@laptop.org>
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      61bd8a04
    • A
      mmc: toshsd: Fix unbalanced locking · 8a66fdae
      Axel Lin 提交于
      Fix returning IRQ_HANDLED with spin_lock held.
      Signed-off-by: NAxel Lin <axel.lin@ingics.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      8a66fdae
    • W
      mmc: toshsd: use module_pci_driver to simplify the code · 1818681c
      Wei Yongjun 提交于
      Use the module_pci_driver() macro to make the code simpler
      by eliminating module_init and module_exit calls.
      Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      1818681c
    • A
      mmc: sdhci: Fix FSL ESDHC reset handling quirk · 304f0a98
      Alessio Igor Bogani 提交于
      The commit 0718e59a ("mmc: sdhci: move FSL ESDHC reset handling quirk into
      esdhc code") states that Freescale esdhc is the only controller which needs
      the interrupt registers restored after a reset. So it moves
      SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET quirk handling code into the
      esdhc-imx driver only. Unfortunately the same controller is used in
      other boards which use the of-esdhc driver instead (like powerpc P2020).
      
      Restore interrupts after reset in the sdhci-of-esdhc driver also.
      Signed-off-by: NAlessio Igor Bogani <alessio.bogani@elettra.eu>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      304f0a98
    • M
      mmc: sdhci-sirf: add sirf tuning function (cmd 19) · fc0b638a
      Minda Chen 提交于
      Add manual tuning function in CSR atlas7 SoC. It is mainly used
      for the UHS-I SD card working SDR50 SDR104 mode.
      
      The tuning principle can be seen in SD spec part1 v3.01 4.2.4.5
      (tuning command).
      
      SD host send the cmd19 and set the delay value(0-127).
      and the sdcard return 64 bytes data. If the data is same with
      the tuning data. The delay value is valid. Execute this commmand
      128 times. And calculate the longest window of the valid values.
      The value in the middle of this window is the best value.
      Signed-off-by: NMinda Chen <Minda.Chen@csr.com>
      Signed-off-by: NBarry Song <Baohua.Song@csr.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      fc0b638a
    • D
      mmc: dw_mmc: Protect read-modify-write of INTMASK with a lock · f8c58c11
      Doug Anderson 提交于
      We're running into cases where our enabling of the SDIO interrupt in
      dw_mmc doesn't actually take effect.  Specifically, adding patch like
      this:
      
       +++ b/drivers/mmc/host/dw_mmc.c
       @@ -1076,6 +1076,9 @@ static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb)
      
            mci_writel(host, INTMASK,
                 (int_mask | SDMMC_INT_SDIO(slot->id)));
       +    int_mask = mci_readl(host, INTMASK);
       +    if (!(int_mask & SDMMC_INT_SDIO(slot->id)))
       +      dev_err(&mmc->class_dev, "failed to enable sdio irq\n");
          } else {
      
      ...actually triggers the error message.  That's because the
      dw_mci_enable_sdio_irq() unsafely does a read-modify-write of the
      INTMASK register.
      
      We can't just use the standard host->lock since that lock is not irq
      safe and mmc_signal_sdio_irq() (called from interrupt context) calls
      dw_mci_enable_sdio_irq().  Add a new irq-safe lock to protect INTMASK.
      
      An alternate solution to this is to punt mmc_signal_sdio_irq() to the
      tasklet and then protect INTMASK modifications by the standard host
      lock.  This seemed like a bit more of a high-latency change.
      Reported-by: NBing Zhao <bzhao@marvell.com>
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Reviewed-by: NJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      f8c58c11
    • D
      mmc: dw_mmc: Cleanup disable of low power mode w/ SDIO interrupts · b24c8b26
      Doug Anderson 提交于
      In the patch (9623b5b9 mmc: dw_mmc: Disable low power mode if SDIO
      interrupts are used) I added code that disabled the low power mode of
      dw_mmc when SDIO interrupts are used.  That code worked but always
      felt a little hacky because we ended up disabling low power as a side
      effect of the first enable_sdio_irq() call.  That wouldn't be so bad
      except that disabling low power involves a complicated process of
      writing to the CMD/CMDARG registers and that extra process makes it
      difficult to cleanly the read-modify-write race in
      dw_mci_enable_sdio_irq() (see future patch in the series).
      
      Change the code to take advantage of the init_card() callback of the
      mmc core to do this right at bootup.
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      b24c8b26
    • D
      mmc: core: Support the optional init_card() callback for MMC and SD · eac86321
      Doug Anderson 提交于
      In (3fcb027d ARM: MXC: mxcmmc: work around a bug in the SDHC busy line
      handling) the optional init_card() callback was added.  According to
      the original change it was "for now only called from
      mmc_sdio_init_card()".
      
      This callback really ought to be called from the SD and MMC init
      functions as well.  One current user of this callback
      (mxcmci_init_card) will not work as expected if you insert an SDIO
      card, then eject it and put a normal SD card in.  Specifically the
      normal SD card will not get to run with 4-bit data.
      
      I'd like to use the init_card() callback to handle a similar quirk on
      dw_mmc when using SDIO Interrupts (the "low power" feature of the card
      needs to be disabled), so that will add a second user of the function.
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Reviewed-by: NGrant Grundler <grundler@chromium.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      eac86321
  2. 14 1月, 2015 1 次提交
  3. 12 1月, 2015 8 次提交
    • A
      mmc: sdhci-pci: Add support for Intel SPT · 1f7f2652
      Adrian Hunter 提交于
      Add PCI IDs for SPT eMMC, SDIO and SD card.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      1f7f2652
    • A
      mmc: sdhci-acpi: Add ACPI HID INT344D · d0ed8e6b
      Adrian Hunter 提交于
      Add ACPI HID INT344D for an Intel SDIO host controller.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      d0ed8e6b
    • K
      mmc: sdhci: Fix sleep in atomic after inserting SD card · 2836766a
      Krzysztof Kozlowski 提交于
      Sleep in atomic context happened on Trats2 board after inserting or
      removing SD card because mmc_gpio_get_cd() was called under spin lock.
      
      Fix this by moving card detection earlier, before acquiring spin lock.
      The mmc_gpio_get_cd() call does not have to be protected by spin lock
      because it does not access any sdhci internal data.
      The sdhci_do_get_cd() call access host flags (SDHCI_DEVICE_DEAD). After
      moving it out side of spin lock it could theoretically race with driver
      removal but still there is no actual protection against manual card
      eject.
      
      Dmesg after inserting SD card:
      [   41.663414] BUG: sleeping function called from invalid context at drivers/gpio/gpiolib.c:1511
      [   41.670469] in_atomic(): 1, irqs_disabled(): 128, pid: 30, name: kworker/u8:1
      [   41.677580] INFO: lockdep is turned off.
      [   41.681486] irq event stamp: 61972
      [   41.684872] hardirqs last  enabled at (61971): [<c0490ee0>] _raw_spin_unlock_irq+0x24/0x5c
      [   41.693118] hardirqs last disabled at (61972): [<c04907ac>] _raw_spin_lock_irq+0x18/0x54
      [   41.701190] softirqs last  enabled at (61648): [<c0026fd4>] __do_softirq+0x234/0x2c8
      [   41.708914] softirqs last disabled at (61631): [<c00273a0>] irq_exit+0xd0/0x114
      [   41.716206] Preemption disabled at:[<  (null)>]   (null)
      [   41.721500]
      [   41.722985] CPU: 3 PID: 30 Comm: kworker/u8:1 Tainted: G        W      3.18.0-rc5-next-20141121 #883
      [   41.732111] Workqueue: kmmcd mmc_rescan
      [   41.735945] [<c0014d2c>] (unwind_backtrace) from [<c0011c80>] (show_stack+0x10/0x14)
      [   41.743661] [<c0011c80>] (show_stack) from [<c0489d14>] (dump_stack+0x70/0xbc)
      [   41.750867] [<c0489d14>] (dump_stack) from [<c0228b74>] (gpiod_get_raw_value_cansleep+0x18/0x30)
      [   41.759628] [<c0228b74>] (gpiod_get_raw_value_cansleep) from [<c03646e8>] (mmc_gpio_get_cd+0x38/0x58)
      [   41.768821] [<c03646e8>] (mmc_gpio_get_cd) from [<c036d378>] (sdhci_request+0x50/0x1a4)
      [   41.776808] [<c036d378>] (sdhci_request) from [<c0357934>] (mmc_start_request+0x138/0x268)
      [   41.785051] [<c0357934>] (mmc_start_request) from [<c0357cc8>] (mmc_wait_for_req+0x58/0x1a0)
      [   41.793469] [<c0357cc8>] (mmc_wait_for_req) from [<c0357e68>] (mmc_wait_for_cmd+0x58/0x78)
      [   41.801714] [<c0357e68>] (mmc_wait_for_cmd) from [<c0361c00>] (mmc_io_rw_direct_host+0x98/0x124)
      [   41.810480] [<c0361c00>] (mmc_io_rw_direct_host) from [<c03620f8>] (sdio_reset+0x2c/0x64)
      [   41.818641] [<c03620f8>] (sdio_reset) from [<c035a3d8>] (mmc_rescan+0x254/0x2e4)
      [   41.826028] [<c035a3d8>] (mmc_rescan) from [<c003a0e0>] (process_one_work+0x180/0x3f4)
      [   41.833920] [<c003a0e0>] (process_one_work) from [<c003a3bc>] (worker_thread+0x34/0x4b0)
      [   41.841991] [<c003a3bc>] (worker_thread) from [<c003fed8>] (kthread+0xe4/0x104)
      [   41.849285] [<c003fed8>] (kthread) from [<c000f268>] (ret_from_fork+0x14/0x2c)
      [   42.038276] mmc0: new high speed SDHC card at address 1234
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Fixes: 94144a46 ("mmc: sdhci: add get_cd() implementation")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      2836766a
    • T
      mmc: sdhci-pxav3: do the mbus window configuration after enabling clocks · aa8165f9
      Thomas Petazzoni 提交于
      In commit 5491ce3f ("mmc: sdhci-pxav3: add support for the Armada
      38x SDHCI controller"), the sdhci-pxav3 driver was extended to include
      support for the SDHCI controller found in the Armada 38x
      processor. This mainly involved adding some MBus window related
      configuration.
      
      However, this configuration is currently done too early in ->probe():
      it is done before clocks are enabled, while this configuration
      involves touching the registers of the controller, which will hang the
      SoC if the clock is disabled. It wasn't noticed until now because the
      bootloader typically leaves gatable clocks enabled, but in situations
      where we have a deferred probe (due to a CD GPIO that cannot be taken,
      for example), then the probe will be re-tried later, after a clock
      disable has been done in the exit path of the failed probe attempt of
      the device. This second probe() will hang the system due to the clock
      being disabled.
      
      This can for example be produced on Armada 385 GP, which has a CD GPIO
      connected to an I2C PCA9555. If the driver for the PCA9555 is not
      compiled into the kernel, then we will have the following sequence of
      events:
      
        1. The SDHCI probes
        2. It does the MBus configuration (which works, because the clock is
           left enabled by the bootloader)
        3. It enables the clock
        4. It tries to get the CD GPIO, which fails due to the driver being
           missing, so -EPROBE_DEFER is returned.
        5. Before returning -EPROBE_DEFER, the driver cleans up what was
           done, which includes disabling the clock.
        6. Later on, the SDHCI probe is tried again.
        7. It does the MBus configuration, which hangs because the clock is
           no longer enabled.
      
      This commit does the obvious fix of doing the MBus configuration after
      the clock has been enabled by the driver.
      
      Fixes: 5491ce3f ("mmc: sdhci-pxav3: add support for the Armada 38x SDHCI controller")
      Cc: <stable@vger.kernel.org> # v3.15+
      Signed-off-by: NThomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      aa8165f9
    • A
      mmc: sdhci: Disable re-tuning for HS400 · b5540ce1
      Adrian Hunter 提交于
      Re-tuning for HS400 mode must be done in HS200
      mode. Currently there is no support for that.
      That needs to be reflected in the code.
      Specifically, if tuning is executed in HS400 mode
      then return an error, and do not start the
      tuning timer if HS200 tuning is being done prior
      to switching to HS400.
      
      Note that periodic re-tuning is not expected
      to be needed for HS400 but re-tuning is still
      needed after the host controller has lost power.
      In the case of suspend/resume that is not necessary
      because the card is fully re-initialised. That
      just leaves runtime suspend/resume with no support
      for HS400 re-tuning.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      b5540ce1
    • A
      mmc: sdhci: Simplify use of tuning timer · 38e40bf5
      Adrian Hunter 提交于
      The tuning timer is always used if the tuning mode
      is 1 and there is a tuning count, irrespective of
      whether this is the first call, or any subsequent
      call. Consequently the logic to start the timer
      can be simplified.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Reviewed-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      38e40bf5
    • A
      mmc: sdhci: Add out_unlock to sdhci_execute_tuning · d519c863
      Adrian Hunter 提交于
      A 'goto' can be used to save duplicating unlocking
      and returning.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Reviewed-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      d519c863
    • A
      mmc: sdhci: Tuning should not change max_blk_count · ac00531d
      Adrian Hunter 提交于
      Re-tuning requires that the maximum data length
      is limited to 4MiB. The code currently changes
      max_blk_count in an attempt to achieve that.
      This is wrong because max_blk_count is a different
      limit, but it is also un-necessary because
      max_req_size is 512KiB anyway. Consequently, the
      changes to max_blk_count are removed and the
      comment for max_req_size adjusted accordingly.
      The comment is also tweaked to show that the 512KiB
      limit is a SDMA limit not an ADMA limit.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Reviewed-by: NAaron Lu <aaron.lu@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      ac00531d
  4. 29 12月, 2014 1 次提交
  5. 13 12月, 2014 1 次提交
  6. 08 12月, 2014 3 次提交
  7. 05 12月, 2014 2 次提交
  8. 04 12月, 2014 1 次提交
  9. 02 12月, 2014 8 次提交
  10. 26 11月, 2014 7 次提交