Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
mmc: sdhci: Check mrq != NULL in sdhci_tasklet_finish
mmc: sdhci: Check mrq->cmd in sdhci_tasklet_finish
mmc: tmio: fix .set_ios(MMC_POWER_UP) handling
mmc: fix a race between card-detect rescan and clock-gate work instances
mmc: omap: Fix possible NULL pointer deref
mmc: core: mmc_add_card(): fix missing break in switch statement
mmc: sdhci-pci: Fix error case in sdhci_pci_probe_slot()

+20 -13
+1
drivers/mmc/core/bus.c
··· 284 284 type = "SD-combo"; 285 285 if (mmc_card_blockaddr(card)) 286 286 type = "SDHC-combo"; 287 + break; 287 288 default: 288 289 type = "?"; 289 290 break;
+4 -5
drivers/mmc/core/host.c
··· 94 94 spin_unlock_irqrestore(&host->clk_lock, flags); 95 95 return; 96 96 } 97 - mutex_lock(&host->clk_gate_mutex); 97 + mmc_claim_host(host); 98 98 spin_lock_irqsave(&host->clk_lock, flags); 99 99 if (!host->clk_requests) { 100 100 spin_unlock_irqrestore(&host->clk_lock, flags); ··· 104 104 pr_debug("%s: gated MCI clock\n", mmc_hostname(host)); 105 105 } 106 106 spin_unlock_irqrestore(&host->clk_lock, flags); 107 - mutex_unlock(&host->clk_gate_mutex); 107 + mmc_release_host(host); 108 108 } 109 109 110 110 /* ··· 130 130 { 131 131 unsigned long flags; 132 132 133 - mutex_lock(&host->clk_gate_mutex); 133 + mmc_claim_host(host); 134 134 spin_lock_irqsave(&host->clk_lock, flags); 135 135 if (host->clk_gated) { 136 136 spin_unlock_irqrestore(&host->clk_lock, flags); ··· 140 140 } 141 141 host->clk_requests++; 142 142 spin_unlock_irqrestore(&host->clk_lock, flags); 143 - mutex_unlock(&host->clk_gate_mutex); 143 + mmc_release_host(host); 144 144 } 145 145 146 146 /** ··· 215 215 host->clk_gated = false; 216 216 INIT_WORK(&host->clk_gate_work, mmc_host_clk_gate_work); 217 217 spin_lock_init(&host->clk_lock); 218 - mutex_init(&host->clk_gate_mutex); 219 218 } 220 219 221 220 /**
+1 -1
drivers/mmc/host/omap.c
··· 832 832 return IRQ_HANDLED; 833 833 } 834 834 835 - if (end_command) 835 + if (end_command && host->cmd) 836 836 mmc_omap_cmd_done(host, host->cmd); 837 837 if (host->data != NULL) { 838 838 if (transfer_error)
+1
drivers/mmc/host/sdhci-pci.c
··· 957 957 host->ioaddr = pci_ioremap_bar(pdev, bar); 958 958 if (!host->ioaddr) { 959 959 dev_err(&pdev->dev, "failed to remap registers\n"); 960 + ret = -ENOMEM; 960 961 goto release; 961 962 } 962 963
+8 -1
drivers/mmc/host/sdhci.c
··· 1334 1334 1335 1335 host = (struct sdhci_host*)param; 1336 1336 1337 + /* 1338 + * If this tasklet gets rescheduled while running, it will 1339 + * be run again afterwards but without any active request. 1340 + */ 1341 + if (!host->mrq) 1342 + return; 1343 + 1337 1344 spin_lock_irqsave(&host->lock, flags); 1338 1345 1339 1346 del_timer(&host->timer); ··· 1352 1345 * upon error conditions. 1353 1346 */ 1354 1347 if (!(host->flags & SDHCI_DEVICE_DEAD) && 1355 - (mrq->cmd->error || 1348 + ((mrq->cmd && mrq->cmd->error) || 1356 1349 (mrq->data && (mrq->data->error || 1357 1350 (mrq->data->stop && mrq->data->stop->error))) || 1358 1351 (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) {
+5 -5
drivers/mmc/host/tmio_mmc_pio.c
··· 728 728 tmio_mmc_set_clock(host, ios->clock); 729 729 730 730 /* Power sequence - OFF -> UP -> ON */ 731 - if (ios->power_mode == MMC_POWER_OFF || !ios->clock) { 731 + if (ios->power_mode == MMC_POWER_UP) { 732 + /* power up SD bus */ 733 + if (host->set_pwr) 734 + host->set_pwr(host->pdev, 1); 735 + } else if (ios->power_mode == MMC_POWER_OFF || !ios->clock) { 732 736 /* power down SD bus */ 733 737 if (ios->power_mode == MMC_POWER_OFF && host->set_pwr) 734 738 host->set_pwr(host->pdev, 0); 735 739 tmio_mmc_clk_stop(host); 736 - } else if (ios->power_mode == MMC_POWER_UP) { 737 - /* power up SD bus */ 738 - if (host->set_pwr) 739 - host->set_pwr(host->pdev, 1); 740 740 } else { 741 741 /* start bus clock */ 742 742 tmio_mmc_clk_start(host);
-1
include/linux/mmc/host.h
··· 183 183 struct work_struct clk_gate_work; /* delayed clock gate */ 184 184 unsigned int clk_old; /* old clock value cache */ 185 185 spinlock_t clk_lock; /* lock for clk fields */ 186 - struct mutex clk_gate_mutex; /* mutex for clock gating */ 187 186 #endif 188 187 189 188 /* host specific block data */