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: 153297 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3772519ljp; Mon, 10 Dec 2018 08:52:44 -0800 (PST) X-Received: by 2002:a19:2c92:: with SMTP id s140mr6954124lfs.42.1544460764879; Mon, 10 Dec 2018 08:52:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544460764; cv=none; d=google.com; s=arc-20160816; b=loYKx9nkurkrC8Frg0fDNxWobnDLgAYYTQBVVW4fs8OcWYbl2G636T2vV43EY4X95e 1TdQVdmSyB10yPCP8q/XJmVKvk3/rFk1OHM75xKUu97fQnNFdXqCymB2TOPtB53rzGj/ sN/njqiQiLQVG29wDaRnJh2rQx380ArPb4aYI/FYtQDAu/Wy03maiwMMhciBOfhzwGP2 Bw7TAzVm/SxhsapxzC97Ni3zs71YNRWPsWZQq2oQ45Hwjz0d11d1tHS/0OXVyPR4LPZ5 8XG7swoRvpDBm50NYq/VvSpROM6iYnKWZ1hsa5tdVIk/mQMGM0aym+fsiWM3pWDlHa4j TSNA== 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=hqcZCX2GWMpTtbs35jhyR+WR9qxRRzYUjJ3v61z7O8g=; b=f/GH+fc0MuOQigwtOsbLuoOnzTBYkTjTnPUmwyiHDaUDdATAr6rYfOcDXKv3xqiEA/ eeIATGVSlVf99NaS16W07cwX0DLdWEZ9b3Dyat+f6Qp88YMLOZIZfev2WDRG4MkF8UU2 aR1PJ53ezGXHOhGG/TjCqGHmF/kvhHk0ftZw++Sqdy5i0oazlhtjcQq8mUXHwVlnIKHP NaJy24umK3YaHlqZuPXNf2Ogf6uy+7OI94nD7O1aTyngwqWU+qSCzSY+UjKKRHq6GOl4 +RN4pKtJ3cNbeTTpskrfGukUswebQdbRE8IIXiUfm5jtPsf9kh8L0VGhJ2q3Lxmy/76M bRpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SzZgiMwI; 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 n10sor2952536lfe.49.2018.12.10.08.52.44 for (Google Transport Security); Mon, 10 Dec 2018 08:52:44 -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=SzZgiMwI; 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=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=DnBI4JqfamzeSeA1Y1gsBK7oGEXQMN7odOZYKe6pO9CPvpTAGdtRi+cD5rdX0QT9Tl XMDUq83mHYHxr44uWB/I7S+cmx/Sm4GNKJ61Nu4s2/WFt78bq9LQ5rVK/4BjycPv2mRs BlDLTLBPp59nIuvUt3My9ao3BmMKjBHLo1ouvrlWpYY69xYhjRhqAlQ4bCdaWH0tRkJG SWep5O+PLabgJoV19idOB/9ft2YA85zeDIMiYCXiSq/M3oqGDy64QJQJrXLeTaxTZrKx m+wEzPumfGqHBG/Xwl+85ocIOSR7TGryCCjWGMEF+18hGuWmbUcKV6UP4wgWzMkykh1i 5Zaw== X-Gm-Message-State: AA+aEWZGzHspCWQ/0abb6TEz2rPqT/IMW6mb2qedmIlMTuqVIBUjJUNJ 3hbjLUoZ5y6/uYb5OXjU0JXRwLZP 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) 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.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> 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(-) -- 2.17.1 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; + } } /*