From patchwork Wed Dec 18 11:09: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: 22624 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B95D423FC6 for ; Wed, 18 Dec 2013 11:09:30 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id i17sf13099115qcy.2 for ; Wed, 18 Dec 2013 03:09:30 -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=IPm9FUzUxuwaiqxCO0LjNUilnXuekXmbXy5iSkqSyAk=; b=KlijEoorJuX/61TdV9YFhRFWb2S6BilR7KZGsJeYa58HpaWSPkPapiFak2+Cebl/Lb vy/BDOfGkan3QekAheenJUq5s8SZKH4jOFpwiTCRlI+yTcDQG532PoqSMY2AchzMmU0A 0Wq6ZuQTVE3ahkXlEnBJRhsr1rztM6czOA9b+GR40yr71+N/SRc5DnZMCdazTx5ZeW9n 4m//Huevn7ecM+mEaUPLkgX8tqkx/RPoY9NJgUFZCfQAilVdU+mT8TTO4c9NMHhZo8NB qOXzZm5Cl1leSLUKzHKwTxvi51urgTxkQcSfrZwcXnDcf56dh6FjLb4jbsjclJPqSeGB hOfQ== X-Gm-Message-State: ALoCoQm/3LcZCAqZwqXmz5XdVE1KaYnABVpE13EAz+j9Gu5eYqNO/77sLCYP2F9FAF1IfKEU0kpJ X-Received: by 10.236.93.243 with SMTP id l79mr7208450yhf.33.1387364970267; Wed, 18 Dec 2013 03:09:30 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.36.161 with SMTP id r1ls19015qej.71.gmail; Wed, 18 Dec 2013 03:09:30 -0800 (PST) X-Received: by 10.52.120.11 with SMTP id ky11mr7071650vdb.28.1387364970140; Wed, 18 Dec 2013 03:09:30 -0800 (PST) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id gq10si5589785vdc.43.2013.12.18.03.09.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 03:09:30 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id jw12so5212560veb.3 for ; Wed, 18 Dec 2013 03:09:30 -0800 (PST) X-Received: by 10.58.181.165 with SMTP id dx5mr9390vec.52.1387364970068; Wed, 18 Dec 2013 03:09:30 -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 ey3csp233304ved; Wed, 18 Dec 2013 03:09:29 -0800 (PST) X-Received: by 10.152.23.39 with SMTP id j7mr11112631laf.28.1387364968761; Wed, 18 Dec 2013 03:09:28 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by mx.google.com with ESMTPS id jb7si2679453lbc.113.2013.12.18.03.09.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 03:09:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.215.45 is neither permitted nor denied by best guess record for domain of ulf.hansson@linaro.org) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id eh20so3802677lab.18 for ; Wed, 18 Dec 2013 03:09:28 -0800 (PST) X-Received: by 10.112.143.163 with SMTP id sf3mr1322161lbb.20.1387364968027; Wed, 18 Dec 2013 03:09:28 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id ld10sm27868575lab.8.2013.12.18.03.09.26 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 03:09:26 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Chris Ball Cc: Ulf Hansson Subject: [PATCH 2/2] mmc: core: Enable MMC_CAP2_CACHE_CTRL as default Date: Wed, 18 Dec 2013 12:09:21 +0100 Message-Id: <1387364961-15464-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1387364961-15464-1-git-send-email-ulf.hansson@linaro.org> References: <1387364961-15464-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.172 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 --- drivers/mmc/core/core.c | 3 --- drivers/mmc/core/mmc.c | 3 +-- include/linux/mmc/host.h | 1 - 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index df591a9..66ec347 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2585,9 +2585,6 @@ 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 */