linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
@ 2015-08-14  7:30 sdliyong
  2015-08-14  8:13 ` Shawn Lin
  2015-08-25 12:06 ` Ulf Hansson
  0 siblings, 2 replies; 10+ messages in thread
From: sdliyong @ 2015-08-14  7:30 UTC (permalink / raw)
  To: chris, ulf.hansson, sdliyong, linux-mmc, linux-kernel

From: Yong Li <sdliyong@gmail.com>

Signed-off-by: Yong Li <sdliyong@gmail.com>
---
 drivers/mmc/card/block.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 452782b..d9e3c45 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
 	bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
 			  (req->cmd_flags & REQ_META)) &&
 		(rq_data_dir(req) == WRITE) &&
-		(md->flags & MMC_BLK_REL_WR);
+		(md->flags & MMC_BLK_REL_WR) &&
+		!(card->quirks & MMC_QUIRK_BLK_NO_CMD23);
 
 	memset(brq, 0, sizeof(struct mmc_blk_request));
 	brq->mrq.cmd = &brq->cmd;
-- 
2.1.0


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

* Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
  2015-08-14  7:30 [PATCH] mmc: block: disable the reliable write If the card does not support CMD23 sdliyong
@ 2015-08-14  8:13 ` Shawn Lin
  2015-08-15 12:14   ` LIYONG
  2015-08-25 12:06 ` Ulf Hansson
  1 sibling, 1 reply; 10+ messages in thread
From: Shawn Lin @ 2015-08-14  8:13 UTC (permalink / raw)
  To: sdliyong, chris, ulf.hansson, linux-mmc, linux-kernel; +Cc: shawn.lin

在 2015/8/14 15:30, sdliyong@gmail.com 写道:
> From: Yong Li <sdliyong@gmail.com>
>
> Signed-off-by: Yong Li <sdliyong@gmail.com>
> ---
>   drivers/mmc/card/block.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 452782b..d9e3c45 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>   	bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
>   			  (req->cmd_flags & REQ_META)) &&
>   		(rq_data_dir(req) == WRITE) &&
> -		(md->flags & MMC_BLK_REL_WR);
> +		(md->flags & MMC_BLK_REL_WR) &&
> +		!(card->quirks & MMC_QUIRK_BLK_NO_CMD23);

Hi Yong,

pls check that code below.

MMC_BLK_REL_WR will not be enabled if we know this card CANNOT support 
CMD23 form SCR. AND, "card->quirks & MMC_QUIRK_BLK_NO_CMD23" would be 
checked here as well. So I think your code is unnecessary.

if ((md->flags & MMC_BLK_CMD23) && mmc_op_multi(brq->cmd.opcode) &&
	    (do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23) ||
	     do_data_tag)) {
		brq->sbc.opcode = MMC_SET_BLOCK_COUNT;
		brq->sbc.arg = brq->data.blocks |
			(do_rel_wr ? (1 << 31) : 0) |
			(do_data_tag ? (1 << 29) : 0);
		brq->sbc.flags = MMC_RSP_R1 | MMC_CMD_AC;
		brq->mrq.sbc = &brq->sbc;
	}

Thanks.
Shawn

>
>   	memset(brq, 0, sizeof(struct mmc_blk_request));
>   	brq->mrq.cmd = &brq->cmd;
>


-- 
Shawn Lin


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

* RE: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
  2015-08-14  8:13 ` Shawn Lin
@ 2015-08-15 12:14   ` LIYONG
  2015-08-17  6:48     ` Shawn Lin
  0 siblings, 1 reply; 10+ messages in thread
From: LIYONG @ 2015-08-15 12:14 UTC (permalink / raw)
  To: Shawn Lin, chris, ulf.hansson, linux-mmc, linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2362 bytes --]

Thanks Shawn. Please help to check the below in the mmc_blk_rw_rq_prep:
	if (do_rel_wr)
		mmc_apply_rel_rw(brq, card, req);

I think we need to set the do_rel_wr to false( at the beginning of this function) if the card does not support the CMD23. The above code is executed before the "if ((md->flags & MMC_BLK_CMD23)" code.

Thanks,
Yong Li
----------------------------------------
> Subject: Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
> To: sdliyong@gmail.com; chris@printf.net; ulf.hansson@linaro.org; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> CC: shawn.lin@rock-chips.com
> From: shawn.lin@rock-chips.com
> Date: Fri, 14 Aug 2015 16:13:02 +0800
>
> 在 2015/8/14 15:30, sdliyong@gmail.com 写道:
>> From: Yong Li <sdliyong@gmail.com>
>>
>> Signed-off-by: Yong Li <sdliyong@gmail.com>
>> ---
>> drivers/mmc/card/block.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> index 452782b..d9e3c45 100644
>> --- a/drivers/mmc/card/block.c
>> +++ b/drivers/mmc/card/block.c
>> @@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>> bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
>> (req->cmd_flags & REQ_META)) &&
>> (rq_data_dir(req) == WRITE) &&
>> - (md->flags & MMC_BLK_REL_WR);
>> + (md->flags & MMC_BLK_REL_WR) &&
>> + !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);
>
> Hi Yong,
>
> pls check that code below.
>
> MMC_BLK_REL_WR will not be enabled if we know this card CANNOT support
> CMD23 form SCR. AND, "card->quirks & MMC_QUIRK_BLK_NO_CMD23" would be
> checked here as well. So I think your code is unnecessary.
>
> if ((md->flags & MMC_BLK_CMD23) && mmc_op_multi(brq->cmd.opcode) &&
> (do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23) ||
> do_data_tag)) {
> brq->sbc.opcode = MMC_SET_BLOCK_COUNT;
> brq->sbc.arg = brq->data.blocks |
> (do_rel_wr ? (1 << 31) : 0) |
> (do_data_tag ? (1 << 29) : 0);
> brq->sbc.flags = MMC_RSP_R1 | MMC_CMD_AC;
> brq->mrq.sbc = &brq->sbc;
> }
>
> Thanks.
> Shawn
>
>>
>> memset(brq, 0, sizeof(struct mmc_blk_request));
>> brq->mrq.cmd = &brq->cmd;
>>
>
>
> --
> Shawn Lin
>
 		 	   		  ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
  2015-08-15 12:14   ` LIYONG
@ 2015-08-17  6:48     ` Shawn Lin
  0 siblings, 0 replies; 10+ messages in thread
From: Shawn Lin @ 2015-08-17  6:48 UTC (permalink / raw)
  To: LIYONG, chris, ulf.hansson, linux-mmc, linux-kernel; +Cc: shawn.lin

On 2015/8/15 20:14, LIYONG wrote:
> Thanks Shawn. Please help to check the below in the mmc_blk_rw_rq_prep:
> 	if (do_rel_wr)
> 		mmc_apply_rel_rw(brq, card, req);
>
> I think we need to set the do_rel_wr to false( at the beginning of this function) if the card does not support the CMD23. The above code is executed before the "if ((md->flags & MMC_BLK_CMD23)" code.
>

ok, it makes sense.:)

> Thanks,
> Yong Li
> ----------------------------------------
>> Subject: Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
>> To: sdliyong@gmail.com; chris@printf.net; ulf.hansson@linaro.org; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
>> CC: shawn.lin@rock-chips.com
>> From: shawn.lin@rock-chips.com
>> Date: Fri, 14 Aug 2015 16:13:02 +0800
>>
>> 在 2015/8/14 15:30, sdliyong@gmail.com 写道:
>>> From: Yong Li <sdliyong@gmail.com>
>>>
>>> Signed-off-by: Yong Li <sdliyong@gmail.com>
>>> ---
>>> drivers/mmc/card/block.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>> index 452782b..d9e3c45 100644
>>> --- a/drivers/mmc/card/block.c
>>> +++ b/drivers/mmc/card/block.c
>>> @@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>>> bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
>>> (req->cmd_flags & REQ_META)) &&
>>> (rq_data_dir(req) == WRITE) &&
>>> - (md->flags & MMC_BLK_REL_WR);
>>> + (md->flags & MMC_BLK_REL_WR) &&
>>> + !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);
>>
>> Hi Yong,
>>
>> pls check that code below.
>>
>> MMC_BLK_REL_WR will not be enabled if we know this card CANNOT support
>> CMD23 form SCR. AND, "card->quirks & MMC_QUIRK_BLK_NO_CMD23" would be
>> checked here as well. So I think your code is unnecessary.
>>
>> if ((md->flags & MMC_BLK_CMD23) && mmc_op_multi(brq->cmd.opcode) &&
>> (do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23) ||
>> do_data_tag)) {
>> brq->sbc.opcode = MMC_SET_BLOCK_COUNT;
>> brq->sbc.arg = brq->data.blocks |
>> (do_rel_wr ? (1 << 31) : 0) |
>> (do_data_tag ? (1 << 29) : 0);
>> brq->sbc.flags = MMC_RSP_R1 | MMC_CMD_AC;
>> brq->mrq.sbc = &brq->sbc;
>> }
>>
>> Thanks.
>> Shawn
>>
>>>
>>> memset(brq, 0, sizeof(struct mmc_blk_request));
>>> brq->mrq.cmd = &brq->cmd;
>>>
>>
>>
>> --
>> Shawn Lin
>>
>   		 	   		  N�����r��y���b�X��ǧv�^�)޺{.n�+����{��g"��^n�r���z�\x1a��h����&��\x1e�G���h�\x03(�階�ݢj"��\x1a�^[m�����z�ޖ���f���h���~�mml==
>


-- 
Shawn Lin


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

* Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
  2015-08-14  7:30 [PATCH] mmc: block: disable the reliable write If the card does not support CMD23 sdliyong
  2015-08-14  8:13 ` Shawn Lin
@ 2015-08-25 12:06 ` Ulf Hansson
  2015-08-26  6:15   ` LIYONG
  2015-08-27 13:22   ` Ulf Hansson
  1 sibling, 2 replies; 10+ messages in thread
From: Ulf Hansson @ 2015-08-25 12:06 UTC (permalink / raw)
  To: sdliyong; +Cc: Chris Ball, linux-mmc, linux-kernel

On 14 August 2015 at 09:30,  <sdliyong@gmail.com> wrote:
> From: Yong Li <sdliyong@gmail.com>
>
> Signed-off-by: Yong Li <sdliyong@gmail.com>
> ---
>  drivers/mmc/card/block.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 452782b..d9e3c45 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>         bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
>                           (req->cmd_flags & REQ_META)) &&
>                 (rq_data_dir(req) == WRITE) &&
> -               (md->flags & MMC_BLK_REL_WR);
> +               (md->flags & MMC_BLK_REL_WR) &&
> +               !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);

Further down in mmc_blk_rw_rq_prep() we check for
MMC_QUIRK_BLK_NO_CMD23. That check becomes redundant after this
change, please remove that check as a part of this patch as well.

>
>         memset(brq, 0, sizeof(struct mmc_blk_request));
>         brq->mrq.cmd = &brq->cmd;
> --
> 2.1.0
>

Kind regards
Uffe

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

* RE: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
  2015-08-25 12:06 ` Ulf Hansson
@ 2015-08-26  6:15   ` LIYONG
  2015-08-26  7:20     ` Shawn Lin
  2015-08-27 13:22   ` Ulf Hansson
  1 sibling, 1 reply; 10+ messages in thread
From: LIYONG @ 2015-08-26  6:15 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, linux-mmc, linux-kernel

Hi Uffe,

The bool variable do_rel_wr is used on line 1408 and line 1436:
if (brq->data.blocks> 1 || do_rel_wr) {
		/* SPI multiblock writes terminate using a special
		 * token, not a STOP_TRANSMISSION request.
		 */

	if (do_rel_wr)
		mmc_apply_rel_rw(brq, card, req);

If a card does not support CMD23, I think we need to set the do_rel_wr to false at the beginning of this mmc_blk_rw_rq_prep function

Thanks,
Yong Li
----------------------------------------
> Date: Tue, 25 Aug 2015 14:06:43 +0200
> Subject: Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
> From: ulf.hansson@linaro.org
> To: sdliyong@gmail.com
> CC: chris@printf.net; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
>
> On 14 August 2015 at 09:30, <sdliyong@gmail.com> wrote:
>> From: Yong Li <sdliyong@gmail.com>
>>
>> Signed-off-by: Yong Li <sdliyong@gmail.com>
>> ---
>> drivers/mmc/card/block.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> index 452782b..d9e3c45 100644
>> --- a/drivers/mmc/card/block.c
>> +++ b/drivers/mmc/card/block.c
>> @@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>> bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
>> (req->cmd_flags & REQ_META)) &&
>> (rq_data_dir(req) == WRITE) &&
>> - (md->flags & MMC_BLK_REL_WR);
>> + (md->flags & MMC_BLK_REL_WR) &&
>> + !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);
>
> Further down in mmc_blk_rw_rq_prep() we check for
> MMC_QUIRK_BLK_NO_CMD23. That check becomes redundant after this
> change, please remove that check as a part of this patch as well.
>
>>
>> memset(brq, 0, sizeof(struct mmc_blk_request));
>> brq->mrq.cmd = &brq->cmd;
>> --
>> 2.1.0
>>
>
> Kind regards
> Uffe
 		 	   		  

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

* Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
  2015-08-26  6:15   ` LIYONG
@ 2015-08-26  7:20     ` Shawn Lin
  2015-08-26 12:38       ` LIYONG
  0 siblings, 1 reply; 10+ messages in thread
From: Shawn Lin @ 2015-08-26  7:20 UTC (permalink / raw)
  To: LIYONG, Ulf Hansson; +Cc: shawn.lin, Chris Ball, linux-mmc, linux-kernel

On 2015/8/26 14:15, LIYONG wrote:
> Hi Uffe,
>
> The bool variable do_rel_wr is used on line 1408 and line 1436:
> if (brq->data.blocks> 1 || do_rel_wr) {
> 		/* SPI multiblock writes terminate using a special
> 		 * token, not a STOP_TRANSMISSION request.
> 		 */
>
> 	if (do_rel_wr)
> 		mmc_apply_rel_rw(brq, card, req);
>
> If a card does not support CMD23, I think we need to set the do_rel_wr to false at the beginning of this mmc_blk_rw_rq_prep function

Hi Yong,

You miss the point, Ulf means you should remove
"(do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23)" as well.

No need to check card->quirks & MMC_QUIRK_BLK_NO_CMD23 twice, you have 
did it while checking do_rel_wr, right?

bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
(req->cmd_flags & REQ_META)) &&
(rq_data_dir(req) == WRITE) &&
- (md->flags & MMC_BLK_REL_WR);
+ (md->flags & MMC_BLK_REL_WR) &&
+ !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);

>
> Thanks,
> Yong Li
> ----------------------------------------
>> Date: Tue, 25 Aug 2015 14:06:43 +0200
>> Subject: Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
>> From: ulf.hansson@linaro.org
>> To: sdliyong@gmail.com
>> CC: chris@printf.net; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
>>
>> On 14 August 2015 at 09:30, <sdliyong@gmail.com> wrote:
>>> From: Yong Li <sdliyong@gmail.com>
>>>
>>> Signed-off-by: Yong Li <sdliyong@gmail.com>
>>> ---
>>> drivers/mmc/card/block.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>> index 452782b..d9e3c45 100644
>>> --- a/drivers/mmc/card/block.c
>>> +++ b/drivers/mmc/card/block.c
>>> @@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>>> bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
>>> (req->cmd_flags & REQ_META)) &&
>>> (rq_data_dir(req) == WRITE) &&
>>> - (md->flags & MMC_BLK_REL_WR);
>>> + (md->flags & MMC_BLK_REL_WR) &&
>>> + !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);
>>
>> Further down in mmc_blk_rw_rq_prep() we check for
>> MMC_QUIRK_BLK_NO_CMD23. That check becomes redundant after this
>> change, please remove that check as a part of this patch as well.
>>
>>>
>>> memset(brq, 0, sizeof(struct mmc_blk_request));
>>> brq->mrq.cmd = &brq->cmd;
>>> --
>>> 2.1.0
>>>
>>
>> Kind regards
>> Uffe
>   		 	   		  --
> 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
>
>
>


-- 
Best Regards
Shawn Lin


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

* RE: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
  2015-08-26  7:20     ` Shawn Lin
@ 2015-08-26 12:38       ` LIYONG
  0 siblings, 0 replies; 10+ messages in thread
From: LIYONG @ 2015-08-26 12:38 UTC (permalink / raw)
  To: Shawn Lin, Ulf Hansson; +Cc: Chris Ball, linux-mmc, linux-kernel

Thanks Shawn. I got your point. You mean we can remove the || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23) at line 1468.

But considering this case: The do_rel_wr = false and the card does support CMD23.
do_rel_wr = false; 
!(card->quirks & MMC_QUIRK_BLK_NO_CMD23) = true;

At line 1468, do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23) should be true;

If re remove the || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23), it will be false

It seems that we cannot modify the line 1468?

Thanks,
Yong Li
----------------------------------------
> Subject: Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
> To: sdliyong@gmail.com; ulf.hansson@linaro.org
> CC: shawn.lin@rock-chips.com; chris@printf.net; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> From: shawn.lin@rock-chips.com
> Date: Wed, 26 Aug 2015 15:20:11 +0800
>
> On 2015/8/26 14:15, LIYONG wrote:
>> Hi Uffe,
>>
>> The bool variable do_rel_wr is used on line 1408 and line 1436:
>> if (brq->data.blocks> 1 || do_rel_wr) {
>> /* SPI multiblock writes terminate using a special
>> * token, not a STOP_TRANSMISSION request.
>> */
>>
>> if (do_rel_wr)
>> mmc_apply_rel_rw(brq, card, req);
>>
>> If a card does not support CMD23, I think we need to set the do_rel_wr to false at the beginning of this mmc_blk_rw_rq_prep function
>
> Hi Yong,
>
> You miss the point, Ulf means you should remove
> "(do_rel_wr || !(card->quirks & MMC_QUIRK_BLK_NO_CMD23)" as well.
>
> No need to check card->quirks & MMC_QUIRK_BLK_NO_CMD23 twice, you have
> did it while checking do_rel_wr, right?
>
> bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
> (req->cmd_flags & REQ_META)) &&
> (rq_data_dir(req) == WRITE) &&
> - (md->flags & MMC_BLK_REL_WR);
> + (md->flags & MMC_BLK_REL_WR) &&
> + !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);
>
>>
>> Thanks,
>> Yong Li
>> ----------------------------------------
>>> Date: Tue, 25 Aug 2015 14:06:43 +0200
>>> Subject: Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
>>> From: ulf.hansson@linaro.org
>>> To: sdliyong@gmail.com
>>> CC: chris@printf.net; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
>>>
>>> On 14 August 2015 at 09:30, <sdliyong@gmail.com> wrote:
>>>> From: Yong Li <sdliyong@gmail.com>
>>>>
>>>> Signed-off-by: Yong Li <sdliyong@gmail.com>
>>>> ---
>>>> drivers/mmc/card/block.c | 3 ++-
>>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>>> index 452782b..d9e3c45 100644
>>>> --- a/drivers/mmc/card/block.c
>>>> +++ b/drivers/mmc/card/block.c
>>>> @@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>>>> bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
>>>> (req->cmd_flags & REQ_META)) &&
>>>> (rq_data_dir(req) == WRITE) &&
>>>> - (md->flags & MMC_BLK_REL_WR);
>>>> + (md->flags & MMC_BLK_REL_WR) &&
>>>> + !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);
>>>
>>> Further down in mmc_blk_rw_rq_prep() we check for
>>> MMC_QUIRK_BLK_NO_CMD23. That check becomes redundant after this
>>> change, please remove that check as a part of this patch as well.
>>>
>>>>
>>>> memset(brq, 0, sizeof(struct mmc_blk_request));
>>>> brq->mrq.cmd = &brq->cmd;
>>>> --
>>>> 2.1.0
>>>>
>>>
>>> Kind regards
>>> Uffe
>> --
>> 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
>>
>>
>>
>
>
> --
> Best Regards
> Shawn Lin
>
 		 	   		  

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

* Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
  2015-08-25 12:06 ` Ulf Hansson
  2015-08-26  6:15   ` LIYONG
@ 2015-08-27 13:22   ` Ulf Hansson
  2015-08-28  0:38     ` LIYONG
  1 sibling, 1 reply; 10+ messages in thread
From: Ulf Hansson @ 2015-08-27 13:22 UTC (permalink / raw)
  To: Yong Li; +Cc: Chris Ball, linux-mmc, linux-kernel

On 25 August 2015 at 14:06, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> On 14 August 2015 at 09:30,  <sdliyong@gmail.com> wrote:
>> From: Yong Li <sdliyong@gmail.com>
>>
>> Signed-off-by: Yong Li <sdliyong@gmail.com>
>> ---
>>  drivers/mmc/card/block.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> index 452782b..d9e3c45 100644
>> --- a/drivers/mmc/card/block.c
>> +++ b/drivers/mmc/card/block.c
>> @@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>>         bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
>>                           (req->cmd_flags & REQ_META)) &&
>>                 (rq_data_dir(req) == WRITE) &&
>> -               (md->flags & MMC_BLK_REL_WR);
>> +               (md->flags & MMC_BLK_REL_WR) &&
>> +               !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);
>
> Further down in mmc_blk_rw_rq_prep() we check for
> MMC_QUIRK_BLK_NO_CMD23. That check becomes redundant after this
> change, please remove that check as a part of this patch as well.
>
>>
>>         memset(brq, 0, sizeof(struct mmc_blk_request));
>>         brq->mrq.cmd = &brq->cmd;
>> --
>> 2.1.0
>>
>

Please ignore my previous answer. MMC_QUIRK_BLK_NO_CMD23 is intended
to indicate to the mmc block layer whether using CMD23 for regular
block IO request could have a performance impact for some cards. If
that's the case we don't use it - except when using reliable write!

So this patch is just plain wrong.

Kind regards
Uffe

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

* RE: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
  2015-08-27 13:22   ` Ulf Hansson
@ 2015-08-28  0:38     ` LIYONG
  0 siblings, 0 replies; 10+ messages in thread
From: LIYONG @ 2015-08-28  0:38 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Chris Ball, linux-mmc, linux-kernel

Hi Uffe,

Since Reliable Write depends on the CMD23. I think we need to disable Reliable Write if the card does not support CMD23(due to performance impact issue), so I add this patch.

Do you think we still need to enable Reliable Write even if the card does not support CMD23?

Thanks,
Yong Li
----------------------------------------
> Date: Thu, 27 Aug 2015 15:22:44 +0200
> Subject: Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23
> From: ulf.hansson@linaro.org
> To: sdliyong@gmail.com
> CC: chris@printf.net; linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
>
> On 25 August 2015 at 14:06, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>> On 14 August 2015 at 09:30, <sdliyong@gmail.com> wrote:
>>> From: Yong Li <sdliyong@gmail.com>
>>>
>>> Signed-off-by: Yong Li <sdliyong@gmail.com>
>>> ---
>>> drivers/mmc/card/block.c | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>> index 452782b..d9e3c45 100644
>>> --- a/drivers/mmc/card/block.c
>>> +++ b/drivers/mmc/card/block.c
>>> @@ -1366,7 +1366,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
>>> bool do_rel_wr = ((req->cmd_flags & REQ_FUA) ||
>>> (req->cmd_flags & REQ_META)) &&
>>> (rq_data_dir(req) == WRITE) &&
>>> - (md->flags & MMC_BLK_REL_WR);
>>> + (md->flags & MMC_BLK_REL_WR) &&
>>> + !(card->quirks & MMC_QUIRK_BLK_NO_CMD23);
>>
>> Further down in mmc_blk_rw_rq_prep() we check for
>> MMC_QUIRK_BLK_NO_CMD23. That check becomes redundant after this
>> change, please remove that check as a part of this patch as well.
>>
>>>
>>> memset(brq, 0, sizeof(struct mmc_blk_request));
>>> brq->mrq.cmd = &brq->cmd;
>>> --
>>> 2.1.0
>>>
>>
>
> Please ignore my previous answer. MMC_QUIRK_BLK_NO_CMD23 is intended
> to indicate to the mmc block layer whether using CMD23 for regular
> block IO request could have a performance impact for some cards. If
> that's the case we don't use it - except when using reliable write!
>
> So this patch is just plain wrong.
>
> Kind regards
> Uffe
 		 	   		  

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

end of thread, other threads:[~2015-08-28  0:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-14  7:30 [PATCH] mmc: block: disable the reliable write If the card does not support CMD23 sdliyong
2015-08-14  8:13 ` Shawn Lin
2015-08-15 12:14   ` LIYONG
2015-08-17  6:48     ` Shawn Lin
2015-08-25 12:06 ` Ulf Hansson
2015-08-26  6:15   ` LIYONG
2015-08-26  7:20     ` Shawn Lin
2015-08-26 12:38       ` LIYONG
2015-08-27 13:22   ` Ulf Hansson
2015-08-28  0:38     ` LIYONG

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).