From patchwork Thu Jun 8 13:27:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 103388 Delivered-To: patches@linaro.org Received: by 10.140.91.77 with SMTP id y71csp2439525qgd; Thu, 8 Jun 2017 06:27:56 -0700 (PDT) X-Received: by 10.25.18.154 with SMTP id 26mr10022466lfs.176.1496928476382; Thu, 08 Jun 2017 06:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496928476; cv=none; d=google.com; s=arc-20160816; b=Wg1eRyAp0j94aPoeaxcM+XTp/usjsxilaF7jdHnQhMlGPLiQmuQ36BOopBI2TdF7Fi LGO+kpVWHwFO9p+V9s41DjoPCsyegeT2Y5izUHxiNGdaAzeaWgqr/QGqfIAv2QKrwjKk svK5M9yy0pilrfCJFB3Kqw1omRr4Qdda6d2Gfrp220Wfk5bHYYCAf3Yf82rQxIg31mix jHMKROKCiAx7VbKIFzYHdL7AdflmwmHXDJ49Eyzl/EgNdVEVpoZMv3xagA4WT4arhU3r 91jwJJw+6gyKo9Lr2+6KrZ/nyD2/FZzYFLkkklLwscVXhEEzzzU3xpfpvPsopZbTVXoM T+lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=oGnESwVEVw9CBhkEzwv4OisHXcw7Gcl+TzSvzqRXWX0=; b=YE1jsEo/V0moUWGFYqiTs+tLWliChgb1nMYPluZcWmIc0jjmMse92E1TNESt+k4TOu V3bF0SvboftldcnoJfrnXGq/svHcwo1ikT9z8S6a2exrl21TDRabhkP5x74uzWj2BK+r iv6On8yqVfszvj0669aYn/W5Ifs5jE5Dg2XAq7xUYnOdGHCfJdZ/I8pn2/7+M7AN7NAu hQ2zZg6u7I5zC/a/DRhdm+GZU4Ub9K5WHk10IcbAIhU7sG7kMzNzRr1952zyWdh2ADeN EcFgB7kSfx/E6eqGJ/zdqCou3NZjWxkKUpc2XRquwUHaXW+2vMSZosMd5KuX2RAF3n6h 0ewg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::235 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com. [2a00:1450:4010:c07::235]) by mx.google.com with ESMTPS id f22si2518571lfa.275.2017.06.08.06.27.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 06:27:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::235 as permitted sender) client-ip=2a00:1450:4010:c07::235; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::235 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x235.google.com with SMTP id o83so18027681lff.3 for ; Thu, 08 Jun 2017 06:27:56 -0700 (PDT) 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=oGnESwVEVw9CBhkEzwv4OisHXcw7Gcl+TzSvzqRXWX0=; b=FQ3ZWQfHnS8rfnkBEY1OfI8QDjp3/yHgp38lTAOlDN7RtvsjdcxwbmMpgz/LOGRZ4x yAQlwc47DErb4eMKCV2DqxJmVGe3goLFdFiY07bi3YFt0TBAv3tS8CgS1YZo6Vcmn+q2 FON75YzaPpuVFLi5BWJzfr2xYuD6orS4/tNXE= 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=oGnESwVEVw9CBhkEzwv4OisHXcw7Gcl+TzSvzqRXWX0=; b=DL8jsbfd9dZ5obibYaDnyTEmCpwQ1+SLoIXzyqy6/n/RiDNUCfEJXQ7eRbRgaOE04l 5UV6PD5Wl2S/yo+qx0GHX3jtTD2FSseNbX0q6J2ub2Fma+CPLJ6EPDNXdGFjNYFpK25F eKdznlV9BGWvJVlNfEA3gW55C5zIw3fr7hvqKVTsF90qh/zVgyxJTrbGzHVFIDgp+mSK ij4Xl4s+AXkltA/ssFSYI7t9/4BU12bP5zh01gnZK9mQ9sdcTeCGEa/B9I6/7gzY8qBq WvEfbz2YyTb85bQzbNIYH8/O3GKR+Xv/2OKAdZicYZDngGxlqOATobyHMtrOyI1xNKKf WGqA== X-Gm-Message-State: AODbwcBolERNoAyFDy+GFl7tiWNuPdI28XuAaL0LqbtD1ic0eo+f7JSc /BWpXif13/gdD6FlE0k= X-Received: by 10.25.29.20 with SMTP id d20mr11715451lfd.77.1496928476032; Thu, 08 Jun 2017 06:27:56 -0700 (PDT) Return-Path: Received: from uffe-XPS-13-9360.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id i8sm1025178ljb.55.2017.06.08.06.27.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Jun 2017 06:27:55 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Jaehoon Chung , Adrian Hunter , Linus Walleij Subject: [PATCH 4/9] mmc: core: Move mmc_flush_cache() from core.c to mmc_ops.c Date: Thu, 8 Jun 2017 15:27:40 +0200 Message-Id: <1496928465-25004-5-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496928465-25004-1-git-send-email-ulf.hansson@linaro.org> References: <1496928465-25004-1-git-send-email-ulf.hansson@linaro.org> The mmc_flush_cache() is a eMMC specific function, let's move it to mmc_ops.c to make that clear. Signed-off-by: Ulf Hansson --- drivers/mmc/core/core.c | 21 --------------------- drivers/mmc/core/mmc_ops.c | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 21 deletions(-) -- 2.7.4 Reviewed-by: Linus Walleij diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index de31f30..d40697f 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2729,27 +2729,6 @@ int mmc_power_restore_host(struct mmc_host *host) } EXPORT_SYMBOL(mmc_power_restore_host); -/* - * Flush the cache to the non-volatile storage. - */ -int mmc_flush_cache(struct mmc_card *card) -{ - int err = 0; - - if (mmc_card_mmc(card) && - (card->ext_csd.cache_size > 0) && - (card->ext_csd.cache_ctrl & 1)) { - err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, - EXT_CSD_FLUSH_CACHE, 1, 0); - if (err) - pr_err("%s: cache flush error %d\n", - mmc_hostname(card->host), err); - } - - return err; -} -EXPORT_SYMBOL(mmc_flush_cache); - #ifdef CONFIG_PM_SLEEP /* Do the card removal on suspend if card is assumed removeable * Do that in pm notifier while userspace isn't yet frozen, so we will be able diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index 53e4da48..f79d680 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -1022,6 +1022,27 @@ void mmc_start_bkops(struct mmc_card *card, bool from_exception) mmc_release_host(card->host); } +/* + * Flush the cache to the non-volatile storage. + */ +int mmc_flush_cache(struct mmc_card *card) +{ + int err = 0; + + if (mmc_card_mmc(card) && + (card->ext_csd.cache_size > 0) && + (card->ext_csd.cache_ctrl & 1)) { + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, + EXT_CSD_FLUSH_CACHE, 1, 0); + if (err) + pr_err("%s: cache flush error %d\n", + mmc_hostname(card->host), err); + } + + return err; +} +EXPORT_SYMBOL(mmc_flush_cache); + static int mmc_cmdq_switch(struct mmc_card *card, bool enable) { u8 val = enable ? EXT_CSD_CMDQ_MODE_ENABLED : 0;