From patchwork Mon Dec 10 16:52:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 153298 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3772553ljp; Mon, 10 Dec 2018 08:52:46 -0800 (PST) X-Received: by 2002:a2e:7317:: with SMTP id o23-v6mr8531197ljc.67.1544460766393; Mon, 10 Dec 2018 08:52:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544460766; cv=none; d=google.com; s=arc-20160816; b=UUhTzkI+H3oxDXKe0QAuBpHJitw1htXEpQCPpiIuBO1FejgyCVgTJqFRB0nWfCM8Wu f92cGVGmqdsLcjPjA13UDzNqdfrB3qRNo7+JBEG02AFxMunb84/HaQReof2qaoMti7dp sCm+492dtJjbryWSRnVERui7WQmCgP0bciphkp0tBPiLt2WPrR3OVvzRQOxGkfwePXtN IYT5FOpeJJuembtesBxBIVbrG3Krj8z4s5QfI1JNolJ6gVsUyIiP1fvtE1hUuGHOraJ0 3AkomfR0uPM4ykobSo/77dlgU66D+5A1efSqEtexCYjXKRgUr+QcIi0XC1WxNt5RC44A t4SQ== 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; bh=hztVpdSncV6eOao2PFKFcbGFH4Z0tMgd8EvT/1T5ytY=; b=F8bEYJNjUmTDgyAI0As4zp4vqFe7Sty5iyRJ69UbO6MyhlNx+TJNvVrROtWvnFoCvo GFgwzkUq1N815FZb2yBoYLe/VLRoNLirZVpTNcHOSF8S07MMOreWh53gOAsJSE9UVkvO 9iJ/2B0/7gILjAHjHiz7LKBY/58ngfPfwCmutwq+Ka4CiWZMFK5RgUK8NySQhQBBms5O SYjUt2qsgEnEfBdPq3HkdeI+a2u3gPsa58BuhDZai9r2o9luGN3o16ol022MgQlOma9X CWVqZrQL1vpKWqHwpxx8KemoVTUDYMLnTsn4wKZRLXgN6m7wk7AIf5eKWANWEIUz5ayS 7LFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F5GpOquj; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 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-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id x82sor2952830lff.40.2018.12.10.08.52.46 for (Google Transport Security); Mon, 10 Dec 2018 08:52:46 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F5GpOquj; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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=hztVpdSncV6eOao2PFKFcbGFH4Z0tMgd8EvT/1T5ytY=; b=F5GpOqujUCtlG5aJbuYpiAjHJzPJKUwLVe1sxJJe1bUs6qEqc87rwDvEtmhO5hbZGm MTur0yJs6VPyFdKHA6CKB+STdSLafvhwLXrb5S81l6SKtnEr1NCwcUv7z43HVG/9dUXv I1+Pvp6vsppxu8siTV2F+XR/OEERHLlmFhTkk= 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=hztVpdSncV6eOao2PFKFcbGFH4Z0tMgd8EvT/1T5ytY=; b=IiEflHh9Z12ip3gYB4C59TbyB3hBAho74pk4vYxoAJUQDqnzhUlNIDlkvbLyO9weDy JQFIngITcGtfks5XVBFDV58OXoE9SZxhYYKOdOvBIcb/EF/pSKu20impz9pIyguAJ+zb XSRlWSrH77YV/ovGQqyr52lWdwZyh9uX98EtxQ9YxXXolPz7Jdtv/Ks2t7+n0Nw2qydY MxOnrDPgnfeCqQfjKTNxdprDiNphWflpRwatE1oSRYLl/kRFU5V+HPzvbTaGYrYX2eeV HrF8NSbtMbkTNCIVNBKuK48faKt7oQAeN1Bw8sDPIpzT0fnYRiEO7Ff5V9YTQt/tX8+T l3VA== X-Gm-Message-State: AA+aEWadmD4OOYK6qlhonlnp8tHHgVMlWfmeOPKsKvH+rgz2l9LavqJ6 Jec9Th6KDPPDaOsqqq8vQUjmchIn X-Google-Smtp-Source: AFSGD/WYWAxFU0zEJfJz+2tQphkiejIV99WgzX0xfkvHBpUoYFUmOXOw+id8w34juF84CG64afyiLA== X-Received: by 2002:a19:5a05:: with SMTP id o5mr7849623lfb.140.1544460766011; Mon, 10 Dec 2018 08:52:46 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id w9sm2194574lfc.66.2018.12.10.08.52.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:52:45 -0800 (PST) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Wolfram Sang , Adrian Hunter , Sjoerd Simons , Faiz Abbas , Jaehoon Chung , Shawn Lin , Pratibhasagar V Subject: [PATCH 2/5] mmc: core: Allow BKOPS and CACHE ctrl even if no HPI support Date: Mon, 10 Dec 2018 17:52:37 +0100 Message-Id: <20181210165240.23101-3-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181210165240.23101-1-ulf.hansson@linaro.org> References: <20181210165240.23101-1-ulf.hansson@linaro.org> In commit 5320226a0512 ("mmc: core: Disable HPI for certain Hynix eMMC cards"), then intent was to prevent HPI from being used for some eMMC cards, which didn't properly support it. However, that went too far, as even BKOPS and CACHE ctrl became prevented. Let's restore those parts and allow BKOPS and CACHE ctrl even if HPI isn't supported. Fixes: 5320226a0512 ("mmc: core: Disable HPI for certain Hynix eMMC cards") Cc: Pratibhasagar V Signed-off-by: Ulf Hansson --- drivers/mmc/core/mmc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 1b8d38f54f65..cb98d30df409 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -526,8 +526,7 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) card->cid.year += 16; /* check whether the eMMC card supports BKOPS */ - if (!mmc_card_broken_hpi(card) && - ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1) { + if (ext_csd[EXT_CSD_BKOPS_SUPPORT] & 0x1) { card->ext_csd.bkops = 1; card->ext_csd.man_bkops_en = (ext_csd[EXT_CSD_BKOPS_EN] & @@ -1796,8 +1795,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 (!mmc_card_broken_hpi(card) && - 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);