Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751391AbbHQGsM (ORCPT ); Mon, 17 Aug 2015 02:48:12 -0400 Received: from regular1.263xmail.com ([211.150.99.135]:51236 "EHLO regular1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750754AbbHQGsK (ORCPT ); Mon, 17 Aug 2015 02:48:10 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: shawn.lin@rock-chips.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <1bdc331f60336784b4e49bceec0b3ea3> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH] mmc: block: disable the reliable write If the card does not support CMD23 To: LIYONG , "chris@printf.net" , "ulf.hansson@linaro.org" , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1439537446-7713-1-git-send-email-sdliyong@gmail.com> <55CDA30E.7030208@rock-chips.com> Cc: shawn.lin@rock-chips.com From: Shawn Lin Message-ID: <55D183A3.5010601@rock-chips.com> Date: Mon, 17 Aug 2015 14:48:03 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2841 Lines: 82 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 >>> >>> Signed-off-by: Yong Li >>> --- >>> 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���h����&���G���h�(�階�ݢj"���m�����z�ޖ���f���h���~�mml== > -- Shawn Lin -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/