Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756373AbbHZHUk (ORCPT ); Wed, 26 Aug 2015 03:20:40 -0400 Received: from lucky1.263xmail.com ([211.157.147.130]:60315 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751951AbbHZHUT (ORCPT ); Wed, 26 Aug 2015 03:20:19 -0400 X-263anti-spam: bpcheck:1; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-ADDR-CHECKED: 0 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: linux-kernel@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <323b224df6a66cb3f9bdb2ff12ac1394> 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 , Ulf Hansson References: <1439537446-7713-1-git-send-email-sdliyong@gmail.com> Cc: shawn.lin@rock-chips.com, Chris Ball , linux-mmc , "linux-kernel@vger.kernel.org" From: Shawn Lin Message-ID: <55DD68AB.30006@rock-chips.com> Date: Wed, 26 Aug 2015 15:20:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2844 Lines: 90 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, wrote: >>> 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); >> >> 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 -- 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/