Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp287520ybe; Wed, 4 Sep 2019 20:10:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGHzDN2t/zlVCp/J7C6lbRYBQoK4vvh1se5UfEzWwe9E0AQaVu7LkvhlnCPTR/K3nibQxH X-Received: by 2002:a62:cec4:: with SMTP id y187mr1148553pfg.84.1567653039303; Wed, 04 Sep 2019 20:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567653039; cv=none; d=google.com; s=arc-20160816; b=sAt2ZC0663VKlchsWXO9qGSk0fD0e9lD4r1N6Y3AHwZIf+KOE+AJ4QL+SxCd8/bk1Z eo65V+KEahxhfNs3PXK7uSUEGTMLMKDoLaDx9lFlqwQGwygqqdT7t6KgcqMQ2Wf29clo 5S6AJSIYXeD6gCxNsvtLcH9znpkJf5LxFisa9a+0D7O6+yQ8ScvMYa7VLWTnkXpdGsPx S5iPpu+tMVBNqvfHgLlyIFFDBGQ4RBcb5q22QQQYjK4Mpq50IIkM1IYXje62nn74KvxJ iWTrrwD7vjPt8XdF+uUqJMA/dz6pdIFITNPRqpb4rBaI5QSthSan+E3ZCZyvuPUqJjAB JaMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=WIZdwMtuPbciv2moLLt5dlnw47oIzx3Tn31uXs4fM+0=; b=iDouY4LiWqAWQ1wI/ass0sjS/7os1SMifoFfy7X/1UhuwIA8jkbzgtoJ8iJMMieYRE 7+6FFyKYtwzBHopHUBb4SMR5HcmnFaCsSxZMVgnLIm5ERDX1h7fMiwGNbwiP8ELg3qow xxxLGqtWIozt4Xn3SZHZnW3vUHgy44dZwvzcz8kdyQ9+EwIkQN6PRRocBvy9VLcF40jH TjPRHqRWTeUsekVhX9vwGsXaDLlcQpF7mLaM4JUzc4wk80ebDqJoYh8c+6xaOE+4UkFW GefOIxI+4bm8ZC6CWvW7OlMjpBGPxINBOQseht9XXbxkJ3wlpEoLDfFIqhBACcC1MSrW bVTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s128si607819pfb.207.2019.09.04.20.10.23; Wed, 04 Sep 2019 20:10:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730944AbfIECzr (ORCPT + 99 others); Wed, 4 Sep 2019 22:55:47 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:41955 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727156AbfIECzr (ORCPT ); Wed, 4 Sep 2019 22:55:47 -0400 X-UUID: d9901c0c1e464b65a24bbe661a4e278f-20190905 X-UUID: d9901c0c1e464b65a24bbe661a4e278f-20190905 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1309410172; Thu, 05 Sep 2019 10:55:40 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 5 Sep 2019 10:55:36 +0800 Received: from [10.17.3.153] (172.27.4.253) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 5 Sep 2019 10:55:34 +0800 Message-ID: <1567652136.11483.1.camel@mhfsdcap03> Subject: Re: [PATCH 2/2] mmc: block: add CMD13 polling for ioctl() cmd with R1B response From: Chaotian Jing To: Avri Altman CC: Ulf Hansson , Matthias Brugger , Jens Axboe , Hannes Reinecke , YueHaibing , Wolfram Sang , Ming Lei , "Chris Boot" , Zachary Hays , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , "srv_heupstream@mediatek.com" Date: Thu, 5 Sep 2019 10:55:36 +0800 In-Reply-To: References: <20190904075444.2163-1-chaotian.jing@mediatek.com> <20190904075444.2163-3-chaotian.jing@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-09-04 at 14:11 +0000, Avri Altman wrote: > > static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct > > mmc_blk_data *md, > > struct mmc_blk_ioc_data *idata) > > { > > @@ -623,6 +675,9 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card > > *card, struct mmc_blk_data *md, > > __func__, status, err); > > } > > > > + if (!err && (cmd.flags & MMC_RSP_R1B)) > > + err = card_busy_detect(card, MMC_BLK_TIMEOUT_MS, NULL); > > + > > return err; > > } > You have both the R1B flag check, and status poll (for rpmb) few line above. > Maybe you could re-use it. > It will both simplify this patch, and save the tad optimization of your first patch. > > Thanks, > Avri So that we can drop the ioctl_rpmb_card_status_poll() as it do almost the same thing with card_busy_detect().