linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: core: add the warning message when card didn't support HPI
@ 2012-03-09  8:24 Jaehoon Chung
  2012-03-09 13:12 ` Chris Ball
  0 siblings, 1 reply; 3+ messages in thread
From: Jaehoon Chung @ 2012-03-09  8:24 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, Kyungmin Park

Though card didn't support HPI,someone could use the send_hpi_cmd().
Then maybe didn't work fine.
Because card->ext_csd.hpi_cmd didn't set.
So if card didn't support hpi, return the waring message.

And CMD12's flags is MMC_RSP_R1B.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/mmc/core/mmc_ops.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
index 4d41fa9..395f944 100644
--- a/drivers/mmc/core/mmc_ops.c
+++ b/drivers/mmc/core/mmc_ops.c
@@ -556,9 +556,15 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
 	unsigned int flags;
 	int err;
 
+	if (!card->ext_csd.hpi) {
+		pr_waring("%s: Card didn't support HPI command\n",
+				mmc_hostname(card->host));
+		return -EINVAL;
+	}
+
 	opcode = card->ext_csd.hpi_cmd;
 	if (opcode == MMC_STOP_TRANSMISSION)
-		flags = MMC_RSP_R1 | MMC_CMD_AC;
+		flags = MMC_RSP_R1B | MMC_CMD_AC;
 	else if (opcode == MMC_SEND_STATUS)
 		flags = MMC_RSP_R1 | MMC_CMD_AC;
 

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

* Re: [PATCH] mmc: core: add the warning message when card didn't support HPI
  2012-03-09  8:24 [PATCH] mmc: core: add the warning message when card didn't support HPI Jaehoon Chung
@ 2012-03-09 13:12 ` Chris Ball
  2012-03-09 16:33   ` Jae hoon Chung
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Ball @ 2012-03-09 13:12 UTC (permalink / raw)
  To: Jaehoon Chung; +Cc: linux-mmc, Kyungmin Park

Hi,

On Fri, Mar 09 2012, Jaehoon Chung wrote:
> Though card didn't support HPI,someone could use the send_hpi_cmd().
> Then maybe didn't work fine.
> Because card->ext_csd.hpi_cmd didn't set.
> So if card didn't support hpi, return the waring message.
>
> And CMD12's flags is MMC_RSP_R1B.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/mmc/core/mmc_ops.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
> index 4d41fa9..395f944 100644
> --- a/drivers/mmc/core/mmc_ops.c
> +++ b/drivers/mmc/core/mmc_ops.c
> @@ -556,9 +556,15 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
>  	unsigned int flags;
>  	int err;
>  
> +	if (!card->ext_csd.hpi) {
> +		pr_waring("%s: Card didn't support HPI command\n",

This isn't going to compile.  Please compile test patches before sending
them.

> +				mmc_hostname(card->host));
> +		return -EINVAL;
> +	}
> +
>  	opcode = card->ext_csd.hpi_cmd;
>  	if (opcode == MMC_STOP_TRANSMISSION)
> -		flags = MMC_RSP_R1 | MMC_CMD_AC;
> +		flags = MMC_RSP_R1B | MMC_CMD_AC;
>  	else if (opcode == MMC_SEND_STATUS)
>  		flags = MMC_RSP_R1 | MMC_CMD_AC;

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH] mmc: core: add the warning message when card didn't support HPI
  2012-03-09 13:12 ` Chris Ball
@ 2012-03-09 16:33   ` Jae hoon Chung
  0 siblings, 0 replies; 3+ messages in thread
From: Jae hoon Chung @ 2012-03-09 16:33 UTC (permalink / raw)
  To: Chris Ball; +Cc: Jaehoon Chung, linux-mmc, Kyungmin Park

Hi Chris.

Sorry..i will resend the patch after fixed.

Best Regards,
Jaehoon Chung

2012/3/9 Chris Ball <cjb@laptop.org>:
> Hi,
>
> On Fri, Mar 09 2012, Jaehoon Chung wrote:
>> Though card didn't support HPI,someone could use the send_hpi_cmd().
>> Then maybe didn't work fine.
>> Because card->ext_csd.hpi_cmd didn't set.
>> So if card didn't support hpi, return the waring message.
>>
>> And CMD12's flags is MMC_RSP_R1B.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>>  drivers/mmc/core/mmc_ops.c |    8 +++++++-
>>  1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c
>> index 4d41fa9..395f944 100644
>> --- a/drivers/mmc/core/mmc_ops.c
>> +++ b/drivers/mmc/core/mmc_ops.c
>> @@ -556,9 +556,15 @@ int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
>>       unsigned int flags;
>>       int err;
>>
>> +     if (!card->ext_csd.hpi) {
>> +             pr_waring("%s: Card didn't support HPI command\n",
>
> This isn't going to compile.  Please compile test patches before sending
> them.
>
>> +                             mmc_hostname(card->host));
>> +             return -EINVAL;
>> +     }
>> +
>>       opcode = card->ext_csd.hpi_cmd;
>>       if (opcode == MMC_STOP_TRANSMISSION)
>> -             flags = MMC_RSP_R1 | MMC_CMD_AC;
>> +             flags = MMC_RSP_R1B | MMC_CMD_AC;
>>       else if (opcode == MMC_SEND_STATUS)
>>               flags = MMC_RSP_R1 | MMC_CMD_AC;
>
> Thanks,
>
> - Chris.
> --
> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> One Laptop Per Child
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" 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] 3+ messages in thread

end of thread, other threads:[~2012-03-09 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-09  8:24 [PATCH] mmc: core: add the warning message when card didn't support HPI Jaehoon Chung
2012-03-09 13:12 ` Chris Ball
2012-03-09 16:33   ` Jae hoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).