From patchwork Mon Dec 10 16:52:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 10721767 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 5EBA915A6 for ; Mon, 10 Dec 2018 16:52:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EDD12A810 for ; Mon, 10 Dec 2018 16:52:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4347F2A82F; Mon, 10 Dec 2018 16:52:48 +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 EA73D2A810 for ; Mon, 10 Dec 2018 16:52:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727572AbeLJQwr (ORCPT ); Mon, 10 Dec 2018 11:52:47 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:35325 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726729AbeLJQwr (ORCPT ); Mon, 10 Dec 2018 11:52:47 -0500 Received: by mail-lf1-f65.google.com with SMTP id e26so8521056lfc.2 for ; Mon, 10 Dec 2018 08:52:45 -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=hqcZCX2GWMpTtbs35jhyR+WR9qxRRzYUjJ3v61z7O8g=; b=SzZgiMwImXTYxmO6NLTH1JL6c1KYRqjgTjyNBKcECG7awagPaj9WbMYcmDhSPmjStX XTlGweHmkteY5mLcoUGMef+PR5k2wrO+KxSQJil6AN4KsLdoRgpGE1jsJw4WWzNOZWy5 /WS9RjIN/UEvcI9VhvAmE8qAfZ9y30gmanRug= 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=hqcZCX2GWMpTtbs35jhyR+WR9qxRRzYUjJ3v61z7O8g=; b=J/9UbmvWfHc2xlhRy7zFjB4E/1vZgnWA0GWD6/05xWyzOpuPwZe8+aQnnVBKiKo+pr LZcgVr1axg8/aM4uybECUpVtRJlbstpAWswCRcxiQKrxwGpTwJvo+05Nv6pHMSN6LZt0 RK4DOJJbrArSXr5c8tftkYbztDzztcpywl7acyI428ZA5kXbkXCVnTFyJSNyCnv5SGSp ydWK0WzZzNbbdz8S70BGq69/GBvPfNCPMXenFa6Y38j79lns/pPrbG3GJ4vxtirjtZJO CP6ylgIH+8TNc0FKBmq9il3RZv927k3EUs+A+gcGCmr4zHb51NdbJHd5BJ5PvHhz6fPU 0p9g== X-Gm-Message-State: AA+aEWYhPnK5/qnkt/xZkFyh5lSBKP+0bR5DkaRgiZngkj1VqKyY6v/+ nSQDcpVHTn521o6cVeFw45G+MZdihmV8sQ== X-Google-Smtp-Source: AFSGD/XuCSaqvn2tDyt/+bKKO4Zef+LXl3utQcH1+Sgb6hMW4S6pIkvKRArAigpg/59JmM19VBgt2A== X-Received: by 2002:a19:cc46:: with SMTP id c67mr7114526lfg.145.1544460764504; Mon, 10 Dec 2018 08:52:44 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Dec 2018 08:52:43 -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 Subject: [PATCH 1/5] mmc: core: Reset HPI enabled state during re-init and in case of errors Date: Mon, 10 Dec 2018 17:52:36 +0100 Message-Id: <20181210165240.23101-2-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 During a re-initialization of the eMMC card, we may fail to re-enable HPI. In these cases, that isn't properly reflected in the card->ext_csd.hpi_en bit, as it keeps being set. This may cause following attempts to use HPI, even if's not enabled. Let's fix this! Fixes: eb0d8f135b67 ("mmc: core: support HPI send command") Signed-off-by: Ulf Hansson --- drivers/mmc/core/mmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 4ff08ea930a6..1b8d38f54f65 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1785,9 +1785,11 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, if (err) { pr_warn("%s: Enabling HPI failed\n", mmc_hostname(card->host)); + card->ext_csd.hpi_en = 0; err = 0; - } else + } else { card->ext_csd.hpi_en = 1; + } } /*