bug in drivers/mmc/core/core.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, greetings,

I think below line has a bug in core.c.

According to SD specification, the maximum identification frequency is
400 KHz (physical_layer_2.0.pdf, page 123).
But the original code would set higher than 400 KHz if the f_min is
higher than 400 KHz. Conversely, if f_min is lower than 400 KHz, it is
always set as 400 KHz. This is wrong also.

========================================================

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 3168ebd..0cf7e5c 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -907,7 +907,7 @@ static void mmc_power_up(struct mmc_host *host)
 	 */
 	mmc_delay(10);

-	if (host->f_min > 400000) {
+	if (host->f_min < 400000) {
 		pr_warning("%s: Minimum clock frequency too high for "
 				"identification mode\n", mmc_hostname(host));
 		host->ios.clock = host->f_min;

===========================================================

Best regards,
Fred

Attachment: 0001-mmc-Maximum-frequency-of-identification-mode-is-400-.patch
Description: Binary data


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux