All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND] mmc: core: add error message when switching fails in mmc_select_hs()
@ 2016-08-23  9:50 Jungseung Lee
  2016-08-24  9:31 ` Ulf Hansson
       [not found] ` <CGME20160824093151epcas1p264895d3724996afc9855663b41ff3466@epcas1p2.samsung.com>
  0 siblings, 2 replies; 3+ messages in thread
From: Jungseung Lee @ 2016-08-23  9:50 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc; +Cc: Jungseung Lee

The switch failure message in mmc_select_timing had been removed
since that is invalid: commit 0400ed0a083a ("mmc: core: remove the
invalid message in mmc_select_timing")

Now, in the case when mmc_select_hs return error in mmc_select_timing,
there is nothing to print failure message.
Let's make for mmc_select_hs() print message itself in the failure case.

Signed-off-by: Jungseung Lee <js07.lee@samsung.com>
---
 drivers/mmc/core/mmc.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index f2d185c..e07fcce 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1018,6 +1018,7 @@ static int mmc_switch_status(struct mmc_card *card)
  */
 static int mmc_select_hs(struct mmc_card *card)
 {
+	struct mmc_host *host = card->host;
 	int err;
 
 	err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
@@ -1029,6 +1030,10 @@ static int mmc_select_hs(struct mmc_card *card)
 		err = mmc_switch_status(card);
 	}
 
+	if (err)
+		pr_err("%s: switch to high-speed failed, err:%d\n",
+			mmc_hostname(host), err);
+
 	return err;
 }
 
@@ -1265,11 +1270,8 @@ static int mmc_select_hs400es(struct mmc_card *card)
 
 	/* Switch card to HS mode */
 	err = mmc_select_hs(card);
-	if (err) {
-		pr_err("%s: switch to high-speed failed, err:%d\n",
-			mmc_hostname(host), err);
+	if (err)
 		goto out_err;
-	}
 
 	err = mmc_switch_status(card);
 	if (err)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] mmc: core: add error message when switching fails in mmc_select_hs()
  2016-08-23  9:50 [PATCH RESEND] mmc: core: add error message when switching fails in mmc_select_hs() Jungseung Lee
@ 2016-08-24  9:31 ` Ulf Hansson
       [not found] ` <CGME20160824093151epcas1p264895d3724996afc9855663b41ff3466@epcas1p2.samsung.com>
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2016-08-24  9:31 UTC (permalink / raw)
  To: Jungseung Lee; +Cc: linux-mmc

On 23 August 2016 at 11:50, Jungseung Lee <js07.lee@samsung.com> wrote:
> The switch failure message in mmc_select_timing had been removed
> since that is invalid: commit 0400ed0a083a ("mmc: core: remove the
> invalid message in mmc_select_timing")
>
> Now, in the case when mmc_select_hs return error in mmc_select_timing,
> there is nothing to print failure message.
> Let's make for mmc_select_hs() print message itself in the failure case.
>
> Signed-off-by: Jungseung Lee <js07.lee@samsung.com>
> ---
>  drivers/mmc/core/mmc.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index f2d185c..e07fcce 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1018,6 +1018,7 @@ static int mmc_switch_status(struct mmc_card *card)
>   */
>  static int mmc_select_hs(struct mmc_card *card)
>  {
> +       struct mmc_host *host = card->host;

No need for local variable here, just use card->host below instead.

>         int err;
>
>         err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
> @@ -1029,6 +1030,10 @@ static int mmc_select_hs(struct mmc_card *card)
>                 err = mmc_switch_status(card);
>         }
>
> +       if (err)
> +               pr_err("%s: switch to high-speed failed, err:%d\n",
> +                       mmc_hostname(host), err);

I think a pr_warn() would be better as mmc_select_timing() uses the
legacy speed mode when err == -EBADMSG.

> +
>         return err;
>  }
>
> @@ -1265,11 +1270,8 @@ static int mmc_select_hs400es(struct mmc_card *card)
>
>         /* Switch card to HS mode */
>         err = mmc_select_hs(card);
> -       if (err) {
> -               pr_err("%s: switch to high-speed failed, err:%d\n",
> -                       mmc_hostname(host), err);
> +       if (err)
>                 goto out_err;
> -       }
>
>         err = mmc_switch_status(card);
>         if (err)
> --
> 1.7.9.5
>

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re: [PATCH RESEND] mmc: core: add error message when switching fails in mmc_select_hs()
       [not found] ` <CGME20160824093151epcas1p264895d3724996afc9855663b41ff3466@epcas1p2.samsung.com>
@ 2016-08-24 10:21   ` 이정승
  0 siblings, 0 replies; 3+ messages in thread
From: 이정승 @ 2016-08-24 10:21 UTC (permalink / raw)
  To: Ulf Hansson, 이정승, linux-mmc

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

Hi,

>> @@ -1018,6 +1018,7 @@ static int mmc_switch_status(struct mmc_card *card)
>>   */
>>  static int mmc_select_hs(struct mmc_card *card)
>>  {
>> +       struct mmc_host *host = card->host;
> 
>No need for local variable here, just use card->host below instead.

Yes, it should be.
 
>>         int err;
>>
>>         err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
>> @@ -1029,6 +1030,10 @@ static int mmc_select_hs(struct mmc_card *card)
>>                 err = mmc_switch_status(card);
>>         }
>>
>> +       if (err)
>> +               pr_err("%s: switch to high-speed failed, err:%d\n",
>> +                       mmc_hostname(host), err);
> 
>I think a pr_warn() would be better as mmc_select_timing() uses the
>legacy speed mode when err == -EBADMSG.

I agree. A modified patch will be sent right after. 
Thanks for your comment.

>> +
>>         return err;
>>  }
>>
> 
>Kind regards
>Uffe
 
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-24 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-23  9:50 [PATCH RESEND] mmc: core: add error message when switching fails in mmc_select_hs() Jungseung Lee
2016-08-24  9:31 ` Ulf Hansson
     [not found] ` <CGME20160824093151epcas1p264895d3724996afc9855663b41ff3466@epcas1p2.samsung.com>
2016-08-24 10:21   ` 이정승

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.