lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTimSt5a998m1oqdppsWjGCVid0-Ub81pKgsPR36f@mail.gmail.com>
Date:	Tue, 21 Dec 2010 05:59:06 -0500
From:	zhangfei gao <zhangfei.gao@...il.com>
To:	Takashi Iwai <tiwai@...e.de>
Cc:	Chris Ball <cjb@...top.org>, Philip Rakity <prakity@...vell.com>,
	Aries Lee <arieslee@...cron.com>, Qiming Wu <wuqm@...vell.com>,
	"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc: Test bus-width for old MMC devices (v2)

On Fri, Dec 17, 2010 at 3:11 AM, Takashi Iwai <tiwai@...e.de> wrote:
> At Fri, 17 Dec 2010 03:43:42 +0000,
> Chris Ball wrote:
>>
>> Hi Philip,
>>
>> On Thu, Dec 16, 2010 at 06:33:49PM -0800, Philip Rakity wrote:
>> > It is not possible for bus_width to be not initialized.  This would imply ARRAY_SIZE(bus_widths) is 1.  Certainly not true.
>>
>> Right, I agree.  We should fix the warning anyway.
>
> Well, this is always a gray-zone question.  One prefers fixing it
> either via uninitialized_var() or by setting a bogus value.  But, this
> would cover any possible real bug in future.  Thus another prefers
> ignoring it, because it's just a compiler bug (mostly of old gcc).
>
> After all, it's up to maintainer, so take as you like :)
>
>
> thanks,
>
> Takashi
>
>
>> > We could just initialize by changing
>> > +           unsigned idx, bus_width;
>> > to
>> > +           unsigned idx, bus_width = 0;
>>
>> Okay, I've pushed to mmc-next with that change.
>>
>> > I wonder what compiler are you using so we can avoid this issue in future.
>>
>> Ah, good point -- I was building with a gcc 4.1.2 ARM cross-compiler,
>> and using a gcc 4.5.1 cross-build instead avoids the warning.
>>
>> Thanks,
>>
>> --
>> Chris Ball   <cjb@...top.org>   <http://printf.net/>
>> One Laptop Per Child
>>
>

Could you help adding this modification?
We found error happen since bus_width is not set at these condition:
1. ddr=0
2. not set MMC_CAP_BUS_WIDTH_TEST

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 1d8409f..86cac0d 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -586,7 +586,11 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 		} else if (ddr) {
 			mmc_card_set_ddr_mode(card);
 			mmc_set_bus_width_ddr(card->host, bus_width, ddr);
-		}
+
+		} else
+			mmc_set_bus_width(card->host,
+					bus_widths[idx]);
+
 	}

 	if (!oldcard)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ