Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp527627ybe; Thu, 5 Sep 2019 01:36:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwvqQgfVwP9KErWWXuPf5UJHAw3DNkSClOA28Go0Ntk51patSlE+baZtvO/f72amHL/c/i X-Received: by 2002:a17:902:d717:: with SMTP id w23mr2116327ply.321.1567672592568; Thu, 05 Sep 2019 01:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567672592; cv=none; d=google.com; s=arc-20160816; b=jvjAvx2LqCqgP75U7Ukb+ExwjIPyBIz3tnUYplTgvnYADhTFuAQPmsaB0JQnDMDeKd Nbot/nRNLxLCz3qVQewhqsjOBm0q5AZfVYslSnpTB6kUbha158yb9hO103/+DiECJF8t vxeu1bH7Bu7CZrsueLyK3Lz+ILcIIcmB2hM9Iq/v1jWXa3MnM58xAVe33jeyBA+sh/xT tvu+JYlfO7V0LZa59XE1k6V+SkWg83AEDxElW4+iMKuItv9/Hn4R6woUE+UdDTdKKR+q b9/ly0NGLMHPszw5N4bSK+H+VUTagAH+0iyxNBSKEgpR/0cb+2oI48ljhPMMH0B9oL+a rHGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=bhq3pczNYGmJxQkSD7if/xX+4txb0IGGXqGBgfCRLTo=; b=n8JoaELHD44xSUY03j3Aekm7qMachURfw0+YtdFF0UWbzrf4Uo603oFphvugf5EYns /JkI3bUh5vDgDvLOl02ah9yKNF+Gm/cgpXjnnzc7cyZw/8WorQnMr1oDfD69Uu29rqNQ 0viVoKKy51IyFtojCW+NoOmBnl+1ItIeAPSurJsii0Kyu0MJIM9Z2S6RVvNklFNu9Rx5 RF/LHKhDAiX4tXNdVpbKJdAq5YpywVh3l9I4/DYhwLYgdPuCob69nx+qHvOMl4rJOVWl J65mwRhAvYsIaGQ9UFW1QmGBovyg+QbnRvvn+QTbfJn31h4vNIw166eh2KykayA7hQxW RUug== 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 s76si36847pfs.170.2019.09.05.01.36.16; Thu, 05 Sep 2019 01:36:32 -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 S1732358AbfIEHxc (ORCPT + 99 others); Thu, 5 Sep 2019 03:53:32 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:35367 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1732323AbfIEHxb (ORCPT ); Thu, 5 Sep 2019 03:53:31 -0400 X-UUID: 172f208976b7425b951fede0050e782e-20190905 X-UUID: 172f208976b7425b951fede0050e782e-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 1929595209; Thu, 05 Sep 2019 15:53:25 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 5 Sep 2019 15:53:23 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 5 Sep 2019 15:53:21 +0800 From: Chaotian Jing To: Ulf Hansson CC: Matthias Brugger , Jens Axboe , Hannes Reinecke , Chaotian Jing , Avri Altman , YueHaibing , Wolfram Sang , Ming Lei , Chris Boot , Zachary Hays , , , , , Subject: [PATCH v2 1/2] mmc: block: make the card_busy_detect() more generic Date: Thu, 5 Sep 2019 15:53:17 +0800 Message-ID: <20190905075318.15554-2-chaotian.jing@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190905075318.15554-1-chaotian.jing@mediatek.com> References: <20190905075318.15554-1-chaotian.jing@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org to use the card_busy_detect() to wait card levae the programming state, there may be do not have the "struct request *" argument. Signed-off-by: Chaotian Jing --- drivers/mmc/core/block.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 2c71a434c915..aa7c19f7e298 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -981,7 +981,7 @@ static inline bool mmc_blk_in_tran_state(u32 status) } static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms, - struct request *req, u32 *resp_errs) + u32 *resp_errs) { unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms); int err = 0; @@ -992,8 +992,8 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms, err = __mmc_send_status(card, &status, 5); if (err) { - pr_err("%s: error %d requesting status\n", - req->rq_disk->disk_name, err); + dev_err(mmc_dev(card->host), + "error %d requesting status\n", err); return err; } @@ -1006,9 +1006,9 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms, * leaves the program state. */ if (done) { - pr_err("%s: Card stuck in wrong state! %s %s status: %#x\n", - mmc_hostname(card->host), - req->rq_disk->disk_name, __func__, status); + dev_err(mmc_dev(card->host), + "Card stuck in wrong state! %s status: %#x\n", + __func__, status); return -ETIMEDOUT; } @@ -1671,7 +1671,7 @@ static int mmc_blk_fix_state(struct mmc_card *card, struct request *req) mmc_blk_send_stop(card, timeout); - err = card_busy_detect(card, timeout, req, NULL); + err = card_busy_detect(card, timeout, NULL); mmc_retune_release(card->host); @@ -1895,7 +1895,7 @@ static int mmc_blk_card_busy(struct mmc_card *card, struct request *req) if (mmc_host_is_spi(card->host) || rq_data_dir(req) == READ) return 0; - err = card_busy_detect(card, MMC_BLK_TIMEOUT_MS, req, &status); + err = card_busy_detect(card, MMC_BLK_TIMEOUT_MS, &status); /* * Do not assume data transferred correctly if there are any error bits -- 2.18.0