From patchwork Thu Dec 19 20:04:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 22652 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9E75C23FE5 for ; Thu, 19 Dec 2013 20:04:59 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id e14sf6440452iej.4 for ; Thu, 19 Dec 2013 12:04:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=5zliz1to3vc024xsXcH/Xp/xD4IAK4rqtUjU6Losirw=; b=Xe+NZ5gRdXXhmgCsEpkymsjHwYtRdic6Xoc9tvOZshszcp0gv24STW64h08cKtmTYm 6uVLHEo6kA9BpOekQUTkpFeKltPzXUYdrTMzpfQI18wr2JYeNyQTCTg8Kb3mvHhpbSUm 6BQ0cxr/lAwlPl1VSwwpEWjOfHpMUrO387vBmezRpBf0Ub6CWwB8mmTOflVfrAimc8aN SAMQNvvB9o5Hcf46NOab+0mbANMviXxhJPQer9TVv3ZakiDyoyDVUgaCShf22HZlt2x5 AmoBim3/3/ui/jrj2P6RIpnZjYwKoQV5nUSo4J6gOJ7MQhALxlS4pQeQl6+47e/IpJD2 ET/g== X-Gm-Message-State: ALoCoQmkqc4S9dxqfJ4niJ7Xh3YIJ4HlMw/PnBBwH+86YsDJP/If3YGqzy0/VFZwQRUe1YIEg+I0 X-Received: by 10.42.65.138 with SMTP id l10mr1320008ici.31.1387483498681; Thu, 19 Dec 2013 12:04:58 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.86.232 with SMTP id s8ls471581qez.67.gmail; Thu, 19 Dec 2013 12:04:58 -0800 (PST) X-Received: by 10.52.171.79 with SMTP id as15mr1834144vdc.1.1387483498520; Thu, 19 Dec 2013 12:04:58 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id im16si911873vec.92.2013.12.19.12.04.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 12:04:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so996282veb.11 for ; Thu, 19 Dec 2013 12:04:58 -0800 (PST) X-Received: by 10.52.103.35 with SMTP id ft3mr1870599vdb.5.1387483498437; Thu, 19 Dec 2013 12:04:58 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp10871ved; Thu, 19 Dec 2013 12:04:57 -0800 (PST) X-Received: by 10.112.135.165 with SMTP id pt5mr1605956lbb.33.1387483497161; Thu, 19 Dec 2013 12:04:57 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by mx.google.com with ESMTPS id du3si2281638lbc.106.2013.12.19.12.04.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 12:04:57 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.47 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id ep20so696239lab.34 for ; Thu, 19 Dec 2013 12:04:56 -0800 (PST) X-Received: by 10.112.181.232 with SMTP id dz8mr1685136lbc.8.1387483496380; Thu, 19 Dec 2013 12:04:56 -0800 (PST) Received: from linaro-ulf.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id tc8sm3091113lbb.9.2013.12.19.12.04.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 19 Dec 2013 12:04:55 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Ulf Hansson Subject: [PATCH V2 2/2] mmc: core: Enable MMC_CAP2_CACHE_CTRL as default Date: Thu, 19 Dec 2013 21:04:21 +0100 Message-Id: <1387483461-6317-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1387483461-6317-1-git-send-email-ulf.hansson@linaro.org> References: <1387483461-6317-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , There are no reason to why the use of a non-volatile internal eMMC cache should be controlled by a host cap. Instead let's just enable it if the eMMC card supports it. Signed-off-by: Ulf Hansson Acked-by: Seungwon Jeon --- drivers/mmc/core/core.c | 4 ---- drivers/mmc/core/mmc.c | 3 +-- include/linux/mmc/host.h | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index df591a9..1228a59 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2582,12 +2582,8 @@ EXPORT_SYMBOL(mmc_power_restore_host); */ int mmc_flush_cache(struct mmc_card *card) { - struct mmc_host *host = card->host; int err = 0; - if (!(host->caps2 & MMC_CAP2_CACHE_CTRL)) - return err; - if (mmc_card_mmc(card) && (card->ext_csd.cache_size > 0) && (card->ext_csd.cache_ctrl & 1)) { diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index ef1cc73..7ab3e9c 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1287,8 +1287,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, * If cache size is higher than 0, this indicates * the existence of cache and it can be turned on. */ - if ((host->caps2 & MMC_CAP2_CACHE_CTRL) && - card->ext_csd.cache_size > 0) { + if (card->ext_csd.cache_size > 0) { err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_CACHE_CTRL, 1, card->ext_csd.generic_cmd6_time); diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index f539bc7..8383e3f 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -264,7 +264,6 @@ struct mmc_host { u32 caps2; /* More host capabilities */ #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ -#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ #define MMC_CAP2_FULL_PWR_CYCLE (1 << 2) /* Can do full power cycle */ #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ #define MMC_CAP2_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */