Merge tag 'mmc-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Apr 2018 17:59:03 +0000 (10:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Apr 2018 17:59:03 +0000 (10:59 -0700)
Pull MMC fixes from Ulf Hansson:
 "MMC core:
   - Prevent bus reference leak in mmc_blk_init()

  MMC host:
   - tmio: Fix error handling when issuing CMD23
   - jz4740: Fix race condition in IRQ mask update"

* tag 'mmc-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: tmio: Fix error handling when issuing CMD23
  mmc: core: Prevent bus reference leak in mmc_blk_init()
  mmc: jz4740: Fix race condition in IRQ mask update

drivers/mmc/core/block.c
drivers/mmc/host/jz4740_mmc.c
drivers/mmc/host/tmio_mmc_core.c

index 02485e310c81f364368a24728664493cb315ed9b..9e923cd1d80ebee9c96d70aceabb87b2a0935581 100644 (file)
@@ -3080,6 +3080,7 @@ static void __exit mmc_blk_exit(void)
        mmc_unregister_driver(&mmc_driver);
        unregister_blkdev(MMC_BLOCK_MAJOR, "mmc");
        unregister_chrdev_region(mmc_rpmb_devt, MAX_DEVICES);
+       bus_unregister(&mmc_rpmb_bus_type);
 }
 
 module_init(mmc_blk_init);
index 712e08d9a45e452100d42a76fb5eed916f42bc93..a0168e9e4fce74cdb8ed6fb2e30477e809999f35 100644 (file)
@@ -362,9 +362,9 @@ static void jz4740_mmc_set_irq_enabled(struct jz4740_mmc_host *host,
                host->irq_mask &= ~irq;
        else
                host->irq_mask |= irq;
-       spin_unlock_irqrestore(&host->lock, flags);
 
        writew(host->irq_mask, host->base + JZ_REG_MMC_IMASK);
+       spin_unlock_irqrestore(&host->lock, flags);
 }
 
 static void jz4740_mmc_clock_enable(struct jz4740_mmc_host *host,
index e30df9ad8197c4b59b1ed0b40c8037d2ef2b7322..3080299303045adc5908683b5509e4420ead2063 100644 (file)
@@ -913,7 +913,7 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
                host->check_scc_error(host);
 
        /* If SET_BLOCK_COUNT, continue with main command */
-       if (host->mrq) {
+       if (host->mrq && !mrq->cmd->error) {
                tmio_process_mrq(host, mrq);
                return;
        }