1. 19 1月, 2015 2 次提交
    • 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
  2. 26 11月, 2014 3 次提交
  3. 10 11月, 2014 3 次提交
  4. 23 9月, 2014 1 次提交
  5. 19 9月, 2014 1 次提交
  6. 09 9月, 2014 4 次提交
  7. 11 8月, 2014 2 次提交
  8. 22 5月, 2014 1 次提交
  9. 13 5月, 2014 7 次提交
  10. 21 4月, 2014 1 次提交
  11. 29 3月, 2014 1 次提交
  12. 26 2月, 2014 1 次提交
  13. 17 1月, 2014 1 次提交
  14. 14 1月, 2014 1 次提交
  15. 31 10月, 2013 1 次提交
  16. 26 9月, 2013 10 次提交