All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: "Ulf Hansson" <ulf.hansson@linaro.org>,
	"Jérôme Pouiller" <jerome.pouiller@silabs.com>,
	"Avri Altman" <avri.altman@wdc.com>,
	"Shawn Lin" <shawn.lin@rock-chips.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Tony Lindgren" <tony@atomide.com>,
	"Bean Huo" <beanhuo@micron.com>,
	"H. Nikolaus Schaller" <hns@goldelico.com>,
	"Kiwoong Kim" <kwmad.kim@samsung.com>,
	"Tian Tao" <tiantao6@hisilicon.com>,
	"Andreas Kemnade" <andreas@kemnade.info>,
	"Yang Li" <abaci-bugfix@linux.alibaba.com>
Cc: notasas@gmail.com, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org,
	kernel@pyra-handheld.com, linux-omap@vger.kernel.org
Subject: [PATCH v2 4/6] mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO
Date: Wed, 10 Nov 2021 18:17:09 +0100	[thread overview]
Message-ID: <e7936cff7fc24d187ef2680d3b4edb0ade58f293.1636564631.git.hns@goldelico.com> (raw)
In-Reply-To: <cover.1636564631.git.hns@goldelico.com>

From: Ulf Hansson <ulf.hansson@linaro.org>

The mmc core takes a specific path to support initializing of a
non-standard SDIO card. This is triggered by looking for the card-quirk,
MMC_QUIRK_NONSTD_SDIO.

In mmc_sdio_init_card() this gets rather messy, as it causes the code to
bail out earlier, compared to the usual path. This leads to that the OCR
doesn't get saved properly in card->ocr. Fortunately, only omap_hsmmc has
been using the MMC_QUIRK_NONSTD_SDIO and is dealing with the issue, by
assigning a hardcoded value (0x80) to card->ocr from an ->init_card() ops.

To make the behaviour consistent, let's instead rely on the core to save
the OCR in card->ocr during initialization.

Reported-by: H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
---
 drivers/mmc/core/sdio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index cf8ee66990508..41164748723d2 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -709,6 +709,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
 		host->ops->init_card(host, card);
 	mmc_fixup_device(card, sdio_card_init_methods);
 
+	card->ocr = ocr_card;
+
 	/*
 	 * If the host and card support UHS-I mode request the card
 	 * to switch to 1.8V signaling level.  No 1.8v signalling if
@@ -821,7 +823,7 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
 			goto mismatch;
 		}
 	}
-	card->ocr = ocr_card;
+
 	mmc_fixup_device(card, sdio_fixup_methods);
 
 	if (card->type == MMC_TYPE_SD_COMBO) {
-- 
2.33.0


  parent reply	other threads:[~2021-11-10 17:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-10 17:17 [PATCH v2 0/6] mmc: core: extend mmc_fixup_device and transplant ti,wl1251 quirks from to be retired omap_hsmmc H. Nikolaus Schaller
2021-11-10 17:17 ` [PATCH v2 1/6] mmc: core: rewrite mmc_fixup_device() H. Nikolaus Schaller
2021-11-10 17:17 ` [PATCH v2 2/6] mmc: core: allow to match the device tree to apply quirks H. Nikolaus Schaller
2021-11-10 17:17 ` [PATCH v2 3/6] mmc: core: provide macro and table " H. Nikolaus Schaller
2021-11-10 17:17 ` H. Nikolaus Schaller [this message]
2021-11-10 17:20   ` [PATCH v2 4/6] mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO H. Nikolaus Schaller
2021-11-11  9:21     ` Ulf Hansson
2021-11-10 17:17 ` [PATCH v2 5/6] mmc: core: transplant ti,wl1251 quirks from to be retired omap_hsmmc H. Nikolaus Schaller
2021-11-10 17:17 ` [PATCH v2 6/6] mmc: host: omap_hsmmc: revert special init for wl1251 H. Nikolaus Schaller
2021-11-11 12:10 ` [PATCH v2 0/6] mmc: core: extend mmc_fixup_device and transplant ti,wl1251 quirks from to be retired omap_hsmmc Ulf Hansson
2021-11-11 13:50   ` H. Nikolaus Schaller
2021-11-11 14:11     ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7936cff7fc24d187ef2680d3b4edb0ade58f293.1636564631.git.hns@goldelico.com \
    --to=hns@goldelico.com \
    --cc=abaci-bugfix@linux.alibaba.com \
    --cc=andreas@kemnade.info \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=jerome.pouiller@silabs.com \
    --cc=kernel@pyra-handheld.com \
    --cc=kwmad.kim@samsung.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=notasas@gmail.com \
    --cc=shawn.lin@rock-chips.com \
    --cc=tiantao6@hisilicon.com \
    --cc=tony@atomide.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.