From patchwork Thu Feb 9 15:33:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9564925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3610060572 for ; Thu, 9 Feb 2017 15:36:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2504F2853A for ; Thu, 9 Feb 2017 15:36:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 19EE228535; Thu, 9 Feb 2017 15:36:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B69C32853E for ; Thu, 9 Feb 2017 15:36:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753922AbdBIPgR (ORCPT ); Thu, 9 Feb 2017 10:36:17 -0500 Received: from mail-lf0-f54.google.com ([209.85.215.54]:35010 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753918AbdBIPgI (ORCPT ); Thu, 9 Feb 2017 10:36:08 -0500 Received: by mail-lf0-f54.google.com with SMTP id n124so4531654lfd.2 for ; Thu, 09 Feb 2017 07:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=npCRU42dkx1AZadVlBLWrFeHcs+g7NhTe46w4kLrtjU=; b=IsA3EFpLPjz7hixrUrxiqFNXWgZnCT6lXaICdq/yPjiT4FJdu/rtH7v61HrzYCIKo8 O33ePVfA1ut//DAl7Tg3U3dom0dPdOyVdnpsME5lp0/OAWDUkY6bx8sbinsNBZYyxzIR DuUNvJ6dlVEsulJMnxtMvQo8CrKM/pZi2+P6M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=npCRU42dkx1AZadVlBLWrFeHcs+g7NhTe46w4kLrtjU=; b=XyGb0PV2XUe4v2HE/9tx0ODJg1mNWKzCTahsf29w1v1Fq0xwbHGoKlfqwvGMJajBqE pMoM61aSjH2irNv8tQBkKfDDK72TjxwgrZ0x1Xp80Y52aQQgyeL57Zi9kC1ZoGeXTGet 0WlyRc1itbPmDbanbO3JOAiU6ghv/P7Fcvjl8lY6+pzPc+Ro7KCy4515ftnI8ItooS91 KV54b13wsVzDLv3ck3HyaZ42y5G9FmuWe5t1L2Er+JRcOK8BxP9B0HWbQWJcBMXu9ycy KVhbzBIktiPMoIhJdfvLvN2R3jLxSs4ipBp9GCNkhSAuqobv9/aZBOsXy0Eln0TY+Ntv UzLg== X-Gm-Message-State: AMke39l+xiZ7dL/Y2OmedhJm7IuhGLpcnP/wH/EC4lO899mtMMoTIC/x5CsaM9kW4njR1lz4 X-Received: by 10.46.1.74 with SMTP id 71mr1419027ljb.74.1486654511705; Thu, 09 Feb 2017 07:35:11 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e86sm3670614lji.32.2017.02.09.07.35.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 07:35:10 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Paolo Valente Cc: Chunyan Zhang , Baolin Wang , linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Arnd Bergmann , Linus Walleij Subject: [PATCH 09/16] mmc: core: kill off the context info Date: Thu, 9 Feb 2017 16:33:56 +0100 Message-Id: <20170209153403.9730-10-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170209153403.9730-1-linus.walleij@linaro.org> References: <20170209153403.9730-1-linus.walleij@linaro.org> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The last member of the context info: is_waiting_last_req is just assigned values, never checked. Delete that and the whole context info as a result. Signed-off-by: Linus Walleij Reviewed-by: Bartlomiej Zolnierkiewicz --- drivers/mmc/core/bus.c | 1 - drivers/mmc/core/core.c | 13 ------------- drivers/mmc/core/core.h | 2 -- drivers/mmc/core/queue.c | 9 +-------- include/linux/mmc/host.h | 9 --------- 5 files changed, 1 insertion(+), 33 deletions(-) diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c index 301246513a37..22ed11ac961b 100644 --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c @@ -348,7 +348,6 @@ int mmc_add_card(struct mmc_card *card) #ifdef CONFIG_DEBUG_FS mmc_add_card_debugfs(card); #endif - mmc_init_context_info(card->host); card->dev.of_node = mmc_of_find_child_device(card->host, 0); diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 933a4d1f20d5..4b84f18518ac 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2975,19 +2975,6 @@ void mmc_unregister_pm_notifier(struct mmc_host *host) } #endif -/** - * mmc_init_context_info() - init synchronization context - * @host: mmc host - * - * Init struct context_info needed to implement asynchronous - * request mechanism, used by mmc core, host driver and mmc requests - * supplier. - */ -void mmc_init_context_info(struct mmc_host *host) -{ - host->context_info.is_waiting_last_req = false; -} - static int __init mmc_init(void) { int ret; diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 8a95c82554be..620bea373c3a 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -90,8 +90,6 @@ void mmc_remove_host_debugfs(struct mmc_host *host); void mmc_add_card_debugfs(struct mmc_card *card); void mmc_remove_card_debugfs(struct mmc_card *card); -void mmc_init_context_info(struct mmc_host *host); - int mmc_execute_tuning(struct mmc_card *card); int mmc_hs200_to_hs400(struct mmc_card *card); int mmc_hs400_to_hs200(struct mmc_card *card); diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index 63927ffd6825..a845fe8d4fd1 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -53,7 +53,6 @@ static int mmc_queue_thread(void *d) { struct mmc_queue *mq = d; struct request_queue *q = mq->queue; - struct mmc_context_info *cntx = &mq->card->host->context_info; current->flags |= PF_MEMALLOC; @@ -65,15 +64,12 @@ static int mmc_queue_thread(void *d) set_current_state(TASK_INTERRUPTIBLE); req = blk_fetch_request(q); mq->asleep = false; - cntx->is_waiting_last_req = false; if (!req) { /* * Dispatch queue is empty so set flags for * mmc_request_fn() to wake us up. */ - if (mq->mqrq_prev->req) - cntx->is_waiting_last_req = true; - else + if (!mq->mqrq_prev->req) mq->asleep = true; } mq->mqrq_cur->req = req; @@ -123,7 +119,6 @@ static void mmc_request_fn(struct request_queue *q) { struct mmc_queue *mq = q->queuedata; struct request *req; - struct mmc_context_info *cntx; if (!mq) { while ((req = blk_fetch_request(q)) != NULL) { @@ -133,8 +128,6 @@ static void mmc_request_fn(struct request_queue *q) return; } - cntx = &mq->card->host->context_info; - if (mq->asleep) wake_up_process(mq->thread); } diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 970d7f9b1eba..a7c0ed887391 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -192,14 +192,6 @@ struct mmc_slot { void *handler_priv; }; -/** - * mmc_context_info - synchronization details for mmc context - * @is_waiting_last_req mmc context waiting for single running request - */ -struct mmc_context_info { - bool is_waiting_last_req; -}; - struct regulator; struct mmc_pwrseq; @@ -373,7 +365,6 @@ struct mmc_host { struct dentry *debugfs_root; struct mmc_async_req *areq; /* active async req */ - struct mmc_context_info context_info; /* async synchronization info */ /* finalization work thread, handles finalizing requests */ struct kthread_worker req_done_worker;