Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp381323ybe; Wed, 4 Sep 2019 00:56:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyy6bbaBESFU+b4vZSbLuSkoW8eVym1/niazVJJH+e26oQ/YvQ+w/xPyq9hvzFnYOnWDaW4 X-Received: by 2002:a63:ed50:: with SMTP id m16mr33629313pgk.209.1567583768569; Wed, 04 Sep 2019 00:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567583768; cv=none; d=google.com; s=arc-20160816; b=wUgHnZdvEkc6qHmnBwDu2rej83q+pHqncqP5E/GFfruPIqil4ThaqdpKNTAxz2tsQk LsEKLHQoniD4sqaElAVVvi2qc7c7m9W1kOpUrj0iNq2wYU1PkRcq8RjhakFD4ldH++vY wq2AyNBNKf5we4/EBz3Maa6VZrMh9T4AX1LkESpaUrNFb1MibG0GdbO+3XVCN+NcoPcQ s1idg4t4EIcw6KsDvLqyhB9CEMkDoChhcslgtJ+TugwEyGRwXklUB5G9SdjDxyKv2ajJ 7BIK42PUGg3UvGUYCkrJCZ5oxsqyPFdIPOoy1jd2e4Mzt7RCxo0VgfoZwA0mN1IEJsTq lKDA== 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=XEfj/A1N++02bOyOuwAGVb/jdFc8IqMSgtfNUwHZ+Q8WmrU81/owgKHiubS2lXvcpP dhYsYT5h+u4Gmns5Zcb78GtIFi4ty0H/uBSX9Qi3ZT/x4qNWVY8mm9B/03cYiTAo8MjQ lmqChQGnSmFjX3VxtIDfsSlsqS6O7Em8SjhHftjyhE7ez7TEFjefNcDcxpW3qg8z0Ikc O6ZriarffNcguNlOLEEMfOdTlkVUaBwbRhig//fOVHXU3tHsNeTlGZrJPxnngAMeYnvK n9f31hyf6xm2VPQHtT/Lv0lbt74ko9XDEtDjelJ4FYyKoRloMiK/nLUA8vTPJnm0m+6H hlng== 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 w12si16252366pgs.364.2019.09.04.00.55.53; Wed, 04 Sep 2019 00:56:08 -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 S1729324AbfIDHy7 (ORCPT + 99 others); Wed, 4 Sep 2019 03:54:59 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:62607 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729125AbfIDHy6 (ORCPT ); Wed, 4 Sep 2019 03:54:58 -0400 X-UUID: 3c934b3f09dd4918a237f385a8221a68-20190904 X-UUID: 3c934b3f09dd4918a237f385a8221a68-20190904 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 155241615; Wed, 04 Sep 2019 15:54:51 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 4 Sep 2019 15:54:49 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 4 Sep 2019 15:54:48 +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 1/2] mmc: block: make the card_busy_detect() more generic Date: Wed, 4 Sep 2019 15:54:43 +0800 Message-ID: <20190904075444.2163-2-chaotian.jing@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190904075444.2163-1-chaotian.jing@mediatek.com> References: <20190904075444.2163-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