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 02485e3..9e923cd 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 712e08d..a0168e9 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 e30df9a..3080299 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;
        }