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: 10721769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B7A8E15A6 for ; Mon, 10 Dec 2018 16:52:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A68482A816 for ; Mon, 10 Dec 2018 16:52:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A5CE2A82F; Mon, 10 Dec 2018 16:52:49 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham 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 29D992A816 for ; Mon, 10 Dec 2018 16:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727224AbeLJQws (ORCPT ); Mon, 10 Dec 2018 11:52:48 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:35858 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727501AbeLJQws (ORCPT ); Mon, 10 Dec 2018 11:52:48 -0500 Received: by mail-lf1-f66.google.com with SMTP id a16so8530421lfg.3 for ; Mon, 10 Dec 2018 08:52:47 -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=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=LFYRF1MeSWC8VbrXVlEcvYYTjJimHTMWhHOaQUQOunMJohw1D7uV5l0FXBDDK+42/V Vb+9eUg16ga63Vab1UfiCt9fcKYH0VluRVDD6seoNBvVf0dtdZXaRZmm0fakDVlY9Dhq rx9gAKgwWjPPUcFFVRNrEpY4vQ/jUAdMV0M4OHNAbpkVjXq5G6J6zTLHssswy2zpAR9j aKu5XkkiGyelfmrL/eZ3YTEvdrm0ygShM9sedwF5/zP+pjsJvScj4GPj9k8y0iUncGgL OsVhQOPvFelJkB5x8x+YnCZV+wcWOWKif1vB8qI+stX/4Xu9wVa8Ej3by3d7iZLMPwmT Re5Q== X-Gm-Message-State: AA+aEWZtc2CnXs9l1XEPD9CeY2kwdFgDMZsBOr+mLzvFkj92NnbkoXrX mEdzBQmLK+maqK1csAGPwTm8QCZYkKusKQ== 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) 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> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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);