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-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:
"MMC core:
- Fix mmc card initialization for hosts not supporting HW busy
detection
- Fix mmc_test for sending commands during non-blocking write

MMC host:
- mxs: Avoid using an uninitialized
- sdhci: Restore enhanced strobe setting during runtime resume
- sdhci: Fix a couple of reset related issues
- dw_mmc: Fix a reset controller issue"

* tag 'mmc-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
mmc: mxs: Initialize the spinlock prior to using it
mmc: mmc: Use 500ms as the default generic CMD6 timeout
mmc: mmc_test: Fix "Commands during non-blocking write" tests
mmc: sdhci: Fix missing enhanced strobe setting during runtime resume
mmc: sdhci: Reset cmd and data circuits after tuning failure
mmc: sdhci: Fix unexpected data interrupt handling
mmc: sdhci: Fix CMD line reset interfering with ongoing data transfer
mmc: dw_mmc: add the "reset" as name of reset controller
Documentation: synopsys-dw-mshc: add binding for reset-names

+41 -17
+5
Documentation/devicetree/bindings/mmc/synopsys-dw-mshc.txt
··· 43 43 reset signal present internally in some host controller IC designs. 44 44 See Documentation/devicetree/bindings/reset/reset.txt for details. 45 45 46 + * reset-names: request name for using "resets" property. Must be "reset". 47 + (It will be used together with "resets" property.) 48 + 46 49 * clocks: from common clock binding: handle to biu and ciu clocks for the 47 50 bus interface unit clock and the card interface unit clock. 48 51 ··· 106 103 interrupts = <0 75 0>; 107 104 #address-cells = <1>; 108 105 #size-cells = <0>; 106 + resets = <&rst 20>; 107 + reset-names = "reset"; 109 108 }; 110 109 111 110 [board specific internal DMA resources]
+4 -4
drivers/mmc/card/mmc_test.c
··· 2347 2347 struct mmc_test_req *rq = mmc_test_req_alloc(); 2348 2348 struct mmc_host *host = test->card->host; 2349 2349 struct mmc_test_area *t = &test->area; 2350 - struct mmc_async_req areq; 2350 + struct mmc_test_async_req test_areq = { .test = test }; 2351 2351 struct mmc_request *mrq; 2352 2352 unsigned long timeout; 2353 2353 bool expired = false; ··· 2363 2363 mrq->sbc = &rq->sbc; 2364 2364 mrq->cap_cmd_during_tfr = true; 2365 2365 2366 - areq.mrq = mrq; 2367 - areq.err_check = mmc_test_check_result_async; 2366 + test_areq.areq.mrq = mrq; 2367 + test_areq.areq.err_check = mmc_test_check_result_async; 2368 2368 2369 2369 mmc_test_prepare_mrq(test, mrq, t->sg, t->sg_len, dev_addr, t->blocks, 2370 2370 512, write); ··· 2378 2378 2379 2379 /* Start ongoing data request */ 2380 2380 if (use_areq) { 2381 - mmc_start_req(host, &areq, &ret); 2381 + mmc_start_req(host, &test_areq.areq, &ret); 2382 2382 if (ret) 2383 2383 goto out_free; 2384 2384 } else {
+3
drivers/mmc/core/mmc.c
··· 26 26 #include "mmc_ops.h" 27 27 #include "sd_ops.h" 28 28 29 + #define DEFAULT_CMD6_TIMEOUT_MS 500 30 + 29 31 static const unsigned int tran_exp[] = { 30 32 10000, 100000, 1000000, 10000000, 31 33 0, 0, 0, 0 ··· 573 571 card->erased_byte = 0x0; 574 572 575 573 /* eMMC v4.5 or later */ 574 + card->ext_csd.generic_cmd6_time = DEFAULT_CMD6_TIMEOUT_MS; 576 575 if (card->ext_csd.rev >= 6) { 577 576 card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; 578 577
+1 -1
drivers/mmc/host/dw_mmc.c
··· 2940 2940 return ERR_PTR(-ENOMEM); 2941 2941 2942 2942 /* find reset controller when exist */ 2943 - pdata->rstc = devm_reset_control_get_optional(dev, NULL); 2943 + pdata->rstc = devm_reset_control_get_optional(dev, "reset"); 2944 2944 if (IS_ERR(pdata->rstc)) { 2945 2945 if (PTR_ERR(pdata->rstc) == -EPROBE_DEFER) 2946 2946 return ERR_PTR(-EPROBE_DEFER);
+2 -2
drivers/mmc/host/mxs-mmc.c
··· 661 661 662 662 platform_set_drvdata(pdev, mmc); 663 663 664 + spin_lock_init(&host->lock); 665 + 664 666 ret = devm_request_irq(&pdev->dev, irq_err, mxs_mmc_irq_handler, 0, 665 667 dev_name(&pdev->dev), host); 666 668 if (ret) 667 669 goto out_free_dma; 668 - 669 - spin_lock_init(&host->lock); 670 670 671 671 ret = mmc_add_host(mmc); 672 672 if (ret)
+26 -10
drivers/mmc/host/sdhci.c
··· 2086 2086 2087 2087 if (!host->tuning_done) { 2088 2088 pr_info(DRIVER_NAME ": Timeout waiting for Buffer Read Ready interrupt during tuning procedure, falling back to fixed sampling clock\n"); 2089 + 2090 + sdhci_do_reset(host, SDHCI_RESET_CMD); 2091 + sdhci_do_reset(host, SDHCI_RESET_DATA); 2092 + 2089 2093 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); 2090 2094 ctrl &= ~SDHCI_CTRL_TUNED_CLK; 2091 2095 ctrl &= ~SDHCI_CTRL_EXEC_TUNING; ··· 2290 2286 2291 2287 for (i = 0; i < SDHCI_MAX_MRQS; i++) { 2292 2288 mrq = host->mrqs_done[i]; 2293 - if (mrq) { 2294 - host->mrqs_done[i] = NULL; 2289 + if (mrq) 2295 2290 break; 2296 - } 2297 2291 } 2298 2292 2299 2293 if (!mrq) { ··· 2322 2320 * upon error conditions. 2323 2321 */ 2324 2322 if (sdhci_needs_reset(host, mrq)) { 2323 + /* 2324 + * Do not finish until command and data lines are available for 2325 + * reset. Note there can only be one other mrq, so it cannot 2326 + * also be in mrqs_done, otherwise host->cmd and host->data_cmd 2327 + * would both be null. 2328 + */ 2329 + if (host->cmd || host->data_cmd) { 2330 + spin_unlock_irqrestore(&host->lock, flags); 2331 + return true; 2332 + } 2333 + 2325 2334 /* Some controllers need this kick or reset won't work here */ 2326 2335 if (host->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET) 2327 2336 /* This is to force an update */ ··· 2340 2327 2341 2328 /* Spec says we should do both at the same time, but Ricoh 2342 2329 controllers do not like that. */ 2343 - if (!host->cmd) 2344 - sdhci_do_reset(host, SDHCI_RESET_CMD); 2345 - if (!host->data_cmd) 2346 - sdhci_do_reset(host, SDHCI_RESET_DATA); 2330 + sdhci_do_reset(host, SDHCI_RESET_CMD); 2331 + sdhci_do_reset(host, SDHCI_RESET_DATA); 2347 2332 2348 2333 host->pending_reset = false; 2349 2334 } 2350 2335 2351 2336 if (!sdhci_has_requests(host)) 2352 2337 sdhci_led_deactivate(host); 2338 + 2339 + host->mrqs_done[i] = NULL; 2353 2340 2354 2341 mmiowb(); 2355 2342 spin_unlock_irqrestore(&host->lock, flags); ··· 2525 2512 if (!host->data) { 2526 2513 struct mmc_command *data_cmd = host->data_cmd; 2527 2514 2528 - if (data_cmd) 2529 - host->data_cmd = NULL; 2530 - 2531 2515 /* 2532 2516 * The "data complete" interrupt is also used to 2533 2517 * indicate that a busy state has ended. See comment ··· 2532 2522 */ 2533 2523 if (data_cmd && (data_cmd->flags & MMC_RSP_BUSY)) { 2534 2524 if (intmask & SDHCI_INT_DATA_TIMEOUT) { 2525 + host->data_cmd = NULL; 2535 2526 data_cmd->error = -ETIMEDOUT; 2536 2527 sdhci_finish_mrq(host, data_cmd->mrq); 2537 2528 return; 2538 2529 } 2539 2530 if (intmask & SDHCI_INT_DATA_END) { 2531 + host->data_cmd = NULL; 2540 2532 /* 2541 2533 * Some cards handle busy-end interrupt 2542 2534 * before the command completed, so make ··· 2923 2911 sdhci_enable_preset_value(host, true); 2924 2912 spin_unlock_irqrestore(&host->lock, flags); 2925 2913 } 2914 + 2915 + if ((mmc->caps2 & MMC_CAP2_HS400_ES) && 2916 + mmc->ops->hs400_enhanced_strobe) 2917 + mmc->ops->hs400_enhanced_strobe(mmc, &mmc->ios); 2926 2918 2927 2919 spin_lock_irqsave(&host->lock, flags); 2928 2920