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-v3.18-2' of git://git.linaro.org/people/ulf.hansson/mmc

Pull MMC fix from Ulf Hansson:
"Fix card detection regression in the MMC core.

The MMC_CAP2_CD_ACTIVE_HIGH and MMC_CAP2_RO_ACTIVE_HIGH could under
some circumstances be set incorrectly, causing the card detection to
fail"

* tag 'mmc-v3.18-2' of git://git.linaro.org/people/ulf.hansson/mmc:
mmc: core: fix card detection regression

+8 -13
+8 -13
drivers/mmc/core/host.c
··· 311 311 struct device_node *np; 312 312 u32 bus_width; 313 313 int len, ret; 314 - bool cap_invert, gpio_invert; 314 + bool cd_cap_invert, cd_gpio_invert = false; 315 + bool ro_cap_invert, ro_gpio_invert = false; 315 316 316 317 if (!host->parent || !host->parent->of_node) 317 318 return 0; ··· 360 359 if (of_find_property(np, "non-removable", &len)) { 361 360 host->caps |= MMC_CAP_NONREMOVABLE; 362 361 } else { 363 - if (of_property_read_bool(np, "cd-inverted")) 364 - cap_invert = true; 365 - else 366 - cap_invert = false; 362 + cd_cap_invert = of_property_read_bool(np, "cd-inverted"); 367 363 368 364 if (of_find_property(np, "broken-cd", &len)) 369 365 host->caps |= MMC_CAP_NEEDS_POLL; 370 366 371 367 ret = mmc_gpiod_request_cd(host, "cd", 0, true, 372 - 0, &gpio_invert); 368 + 0, &cd_gpio_invert); 373 369 if (ret) { 374 370 if (ret == -EPROBE_DEFER) 375 371 return ret; ··· 389 391 * both inverted, the end result is that the CD line is 390 392 * not inverted. 391 393 */ 392 - if (cap_invert ^ gpio_invert) 394 + if (cd_cap_invert ^ cd_gpio_invert) 393 395 host->caps2 |= MMC_CAP2_CD_ACTIVE_HIGH; 394 396 } 395 397 396 398 /* Parse Write Protection */ 397 - if (of_property_read_bool(np, "wp-inverted")) 398 - cap_invert = true; 399 - else 400 - cap_invert = false; 399 + ro_cap_invert = of_property_read_bool(np, "wp-inverted"); 401 400 402 - ret = mmc_gpiod_request_ro(host, "wp", 0, false, 0, &gpio_invert); 401 + ret = mmc_gpiod_request_ro(host, "wp", 0, false, 0, &ro_gpio_invert); 403 402 if (ret) { 404 403 if (ret == -EPROBE_DEFER) 405 404 goto out; ··· 409 414 dev_info(host->parent, "Got WP GPIO\n"); 410 415 411 416 /* See the comment on CD inversion above */ 412 - if (cap_invert ^ gpio_invert) 417 + if (ro_cap_invert ^ ro_gpio_invert) 413 418 host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH; 414 419 415 420 if (of_find_property(np, "cap-sd-highspeed", &len))