mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhangfei gao <zhangfei.gao@gmail.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: Chris Ball <cjb@laptop.org>, Philip Rakity <prakity@marvell.com>,
	Aries Lee <arieslee@jmicron.com>, Qiming Wu <wuqm@marvell.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mmc: Test bus-width for old MMC devices (v2)
Date: Tue, 21 Dec 2010 05:59:06 -0500	[thread overview]
Message-ID: <AANLkTimSt5a998m1oqdppsWjGCVid0-Ub81pKgsPR36f@mail.gmail.com> (raw)
In-Reply-To: <s5hy67o95to.wl%tiwai@suse.de>

On Fri, Dec 17, 2010 at 3:11 AM, Takashi Iwai <tiwai@suse.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@laptop.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)

  reply	other threads:[~2010-12-21 10:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15  7:14 Takashi Iwai
2010-12-15 13:17 ` [PATCH] mmc: Enable bus-width tests on SDHCI host Takashi Iwai
2010-12-15 19:40   ` Takashi Iwai
2010-12-16 16:54     ` [PATCH] mmc/sdhci: Enable bus-width test for JMicron controllers Takashi Iwai
2010-12-17  3:58       ` Chris Ball
2010-12-16 23:40 ` [PATCH] mmc: Test bus-width for old MMC devices (v2) Chris Ball
2010-12-17  2:33   ` Philip Rakity
2010-12-17  3:43     ` Chris Ball
2010-12-17  8:11       ` Takashi Iwai
2010-12-21 10:59         ` zhangfei gao [this message]
2010-12-21 16:36           ` Philip Rakity
2010-12-21 19:35             ` Philip Rakity
2010-12-22  3:56             ` zhangfei gao
2010-12-22  8:59               ` Takashi Iwai
2010-12-28  8:27                 ` zhangfei gao
2011-01-02 19:52                 ` Chris Ball

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimSt5a998m1oqdppsWjGCVid0-Ub81pKgsPR36f@mail.gmail.com \
    --to=zhangfei.gao@gmail.com \
    --cc=arieslee@jmicron.com \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=prakity@marvell.com \
    --cc=tiwai@suse.de \
    --cc=wuqm@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®