* [PATCH v3 1/1] mmc: core: skip card initialization if power class selection fails
@ 2012-04-12 14:06 Subhash Jadavani
2012-04-13 14:41 ` Namjae Jeon
0 siblings, 1 reply; 4+ messages in thread
From: Subhash Jadavani @ 2012-04-12 14:06 UTC (permalink / raw)
To: linux-mmc; +Cc: linux-arm-msm, Subhash Jadavani
With current implementation of power class selection,
mmc_select_powerclass() should never fail. So treat any error
returned by this function as serious enough to skip the card
initialization.
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
---
drivers/mmc/core/mmc.c | 18 +++++++-----------
1 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 54df5ad..bfc987f 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -736,6 +736,10 @@ static int mmc_select_powerclass(struct mmc_card *card,
card->ext_csd.generic_cmd6_time);
}
+ if (err)
+ pr_err("%s: power class selection for ext_csd_bus_width %d"
+ " failed\n", mmc_hostname(card->host), bus_width);
+
return err;
}
@@ -1117,9 +1121,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4;
err = mmc_select_powerclass(card, ext_csd_bits, ext_csd);
if (err)
- pr_warning("%s: power class selection to bus width %d"
- " failed\n", mmc_hostname(card->host),
- 1 << bus_width);
+ goto err;
}
/*
@@ -1151,10 +1153,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
err = mmc_select_powerclass(card, ext_csd_bits[idx][0],
ext_csd);
if (err)
- pr_warning("%s: power class selection to "
- "bus width %d failed\n",
- mmc_hostname(card->host),
- 1 << bus_width);
+ goto err;
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_BUS_WIDTH,
@@ -1182,10 +1181,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
err = mmc_select_powerclass(card, ext_csd_bits[idx][1],
ext_csd);
if (err)
- pr_warning("%s: power class selection to "
- "bus width %d ddr %d failed\n",
- mmc_hostname(card->host),
- 1 << bus_width, ddr);
+ goto err;
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_BUS_WIDTH,
--
1.7.1.1
--
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/1] mmc: core: skip card initialization if power class selection fails
2012-04-12 14:06 [PATCH v3 1/1] mmc: core: skip card initialization if power class selection fails Subhash Jadavani
@ 2012-04-13 14:41 ` Namjae Jeon
2012-04-25 12:55 ` Subhash Jadavani
2012-05-09 14:07 ` Chris Ball
0 siblings, 2 replies; 4+ messages in thread
From: Namjae Jeon @ 2012-04-13 14:41 UTC (permalink / raw)
To: Subhash Jadavani, Chris Ball; +Cc: linux-mmc, linux-arm-msm
2012/4/12 Subhash Jadavani <subhashj@codeaurora.org>:
> With current implementation of power class selection,
> mmc_select_powerclass() should never fail. So treat any error
> returned by this function as serious enough to skip the card
> initialization.
>
> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Looks good to me.
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
> ---
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH v3 1/1] mmc: core: skip card initialization if power class selection fails
2012-04-13 14:41 ` Namjae Jeon
@ 2012-04-25 12:55 ` Subhash Jadavani
2012-05-09 14:07 ` Chris Ball
1 sibling, 0 replies; 4+ messages in thread
From: Subhash Jadavani @ 2012-04-25 12:55 UTC (permalink / raw)
To: 'Namjae Jeon', 'Chris Ball'; +Cc: linux-mmc, linux-arm-msm
Hi Chris,
Is this patch looks ok?
Regards,
Subhash
> -----Original Message-----
> From: linux-arm-msm-owner@vger.kernel.org [mailto:linux-arm-msm-
> owner@vger.kernel.org] On Behalf Of Namjae Jeon
> Sent: Friday, April 13, 2012 8:12 PM
> To: Subhash Jadavani; Chris Ball
> Cc: linux-mmc@vger.kernel.org; linux-arm-msm@vger.kernel.org
> Subject: Re: [PATCH v3 1/1] mmc: core: skip card initialization if power class
> selection fails
>
> 2012/4/12 Subhash Jadavani <subhashj@codeaurora.org>:
> > With current implementation of power class selection,
> > mmc_select_powerclass() should never fail. So treat any error returned
> > by this function as serious enough to skip the card initialization.
> >
> > Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
> Looks good to me.
> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
> > ---
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the
> body of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3 1/1] mmc: core: skip card initialization if power class selection fails
2012-04-13 14:41 ` Namjae Jeon
2012-04-25 12:55 ` Subhash Jadavani
@ 2012-05-09 14:07 ` Chris Ball
1 sibling, 0 replies; 4+ messages in thread
From: Chris Ball @ 2012-05-09 14:07 UTC (permalink / raw)
To: Namjae Jeon; +Cc: Subhash Jadavani, linux-mmc, linux-arm-msm
Hi,
On Fri, Apr 13 2012, Namjae Jeon wrote:
> 2012/4/12 Subhash Jadavani <subhashj@codeaurora.org>:
>> With current implementation of power class selection,
>> mmc_select_powerclass() should never fail. So treat any error
>> returned by this function as serious enough to skip the card
>> initialization.
>>
>> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
> Looks good to me.
> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Thanks, pushed to mmc-next for 3.5.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-05-09 14:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 14:06 [PATCH v3 1/1] mmc: core: skip card initialization if power class selection fails Subhash Jadavani
2012-04-13 14:41 ` Namjae Jeon
2012-04-25 12:55 ` Subhash Jadavani
2012-05-09 14:07 ` Chris Ball
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.