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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mmc-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC host fixes from Ulf Hansson:

- alcor: Stabilize data write requests

- sdhci-omap: Fix command error path during tuning

* tag 'mmc-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
mmc: sdhci-omap: Don't finish_mrq() on a command error during tuning
mmc: alcor: don't write data before command has completed

+51 -21
+13 -21
drivers/mmc/host/alcor.c
··· 48 48 struct mmc_command *cmd; 49 49 struct mmc_data *data; 50 50 unsigned int dma_on:1; 51 - unsigned int early_data:1; 52 51 53 52 struct mutex cmd_mutex; 54 53 ··· 143 144 host->sg_count--; 144 145 } 145 146 146 - static void alcor_trigger_data_transfer(struct alcor_sdmmc_host *host, 147 - bool early) 147 + static void alcor_trigger_data_transfer(struct alcor_sdmmc_host *host) 148 148 { 149 149 struct alcor_pci_priv *priv = host->alcor_pci; 150 150 struct mmc_data *data = host->data; ··· 153 155 ctrl |= AU6601_DATA_WRITE; 154 156 155 157 if (data->host_cookie == COOKIE_MAPPED) { 156 - if (host->early_data) { 157 - host->early_data = false; 158 - return; 159 - } 160 - 161 - host->early_data = early; 162 - 163 158 alcor_data_set_dma(host); 164 159 ctrl |= AU6601_DATA_DMA_MODE; 165 160 host->dma_on = 1; ··· 222 231 static void alcor_prepare_data(struct alcor_sdmmc_host *host, 223 232 struct mmc_command *cmd) 224 233 { 234 + struct alcor_pci_priv *priv = host->alcor_pci; 225 235 struct mmc_data *data = cmd->data; 226 236 227 237 if (!data) ··· 240 248 if (data->host_cookie != COOKIE_MAPPED) 241 249 alcor_prepare_sg_miter(host); 242 250 243 - alcor_trigger_data_transfer(host, true); 251 + alcor_write8(priv, 0, AU6601_DATA_XFER_CTRL); 244 252 } 245 253 246 254 static void alcor_send_cmd(struct alcor_sdmmc_host *host, ··· 427 435 if (!host->data) 428 436 return false; 429 437 430 - alcor_trigger_data_transfer(host, false); 438 + alcor_trigger_data_transfer(host); 431 439 host->cmd = NULL; 432 440 return true; 433 441 } ··· 448 456 if (!host->data) 449 457 alcor_request_complete(host, 1); 450 458 else 451 - alcor_trigger_data_transfer(host, false); 459 + alcor_trigger_data_transfer(host); 452 460 host->cmd = NULL; 453 461 } 454 462 ··· 479 487 break; 480 488 case AU6601_INT_READ_BUF_RDY: 481 489 alcor_trf_block_pio(host, true); 482 - if (!host->blocks) 483 - break; 484 - alcor_trigger_data_transfer(host, false); 485 490 return 1; 486 491 case AU6601_INT_WRITE_BUF_RDY: 487 492 alcor_trf_block_pio(host, false); 488 - if (!host->blocks) 489 - break; 490 - alcor_trigger_data_transfer(host, false); 491 493 return 1; 492 494 case AU6601_INT_DMA_END: 493 495 if (!host->sg_count) ··· 494 508 break; 495 509 } 496 510 497 - if (intmask & AU6601_INT_DATA_END) 498 - return 0; 511 + if (intmask & AU6601_INT_DATA_END) { 512 + if (!host->dma_on && host->blocks) { 513 + alcor_trigger_data_transfer(host); 514 + return 1; 515 + } else { 516 + return 0; 517 + } 518 + } 499 519 500 520 return 1; 501 521 }
+38
drivers/mmc/host/sdhci-omap.c
··· 797 797 sdhci_reset(host, mask); 798 798 } 799 799 800 + #define CMD_ERR_MASK (SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX |\ 801 + SDHCI_INT_TIMEOUT) 802 + #define CMD_MASK (CMD_ERR_MASK | SDHCI_INT_RESPONSE) 803 + 804 + static u32 sdhci_omap_irq(struct sdhci_host *host, u32 intmask) 805 + { 806 + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); 807 + struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host); 808 + 809 + if (omap_host->is_tuning && host->cmd && !host->data_early && 810 + (intmask & CMD_ERR_MASK)) { 811 + 812 + /* 813 + * Since we are not resetting data lines during tuning 814 + * operation, data error or data complete interrupts 815 + * might still arrive. Mark this request as a failure 816 + * but still wait for the data interrupt 817 + */ 818 + if (intmask & SDHCI_INT_TIMEOUT) 819 + host->cmd->error = -ETIMEDOUT; 820 + else 821 + host->cmd->error = -EILSEQ; 822 + 823 + host->cmd = NULL; 824 + 825 + /* 826 + * Sometimes command error interrupts and command complete 827 + * interrupt will arrive together. Clear all command related 828 + * interrupts here. 829 + */ 830 + sdhci_writel(host, intmask & CMD_MASK, SDHCI_INT_STATUS); 831 + intmask &= ~CMD_MASK; 832 + } 833 + 834 + return intmask; 835 + } 836 + 800 837 static struct sdhci_ops sdhci_omap_ops = { 801 838 .set_clock = sdhci_omap_set_clock, 802 839 .set_power = sdhci_omap_set_power, ··· 844 807 .platform_send_init_74_clocks = sdhci_omap_init_74_clocks, 845 808 .reset = sdhci_omap_reset, 846 809 .set_uhs_signaling = sdhci_omap_set_uhs_signaling, 810 + .irq = sdhci_omap_irq, 847 811 }; 848 812 849 813 static int sdhci_omap_set_capabilities(struct sdhci_omap_host *omap_host)