linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: BOUGH CHEN <haibo.chen@nxp.com>
Cc: "ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
	"adrian.hunter@intel.com" <adrian.hunter@intel.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH v2 10/14] mmc: sdhci-esdhc-imx: handle 'sdhci,auto-cmd23-broken' from devicetree
Date: Wed, 11 Dec 2019 00:38:38 +0100	[thread overview]
Message-ID: <CACRpkdbm75KX3bBH0gaGhiPTd=zD996qgu7vSHr1H3u_uSRo=g@mail.gmail.com> (raw)
In-Reply-To: <20191203130120.11511-11-haibo.chen@nxp.com>

On Tue, Dec 3, 2019 at 1:54 PM BOUGH CHEN <haibo.chen@nxp.com> wrote:

> Since L4.15, community involve the commit 105819c8a545 ("mmc: core: use mrq->sbc
> when sending CMD23 for RPMB"), let the usdhc to decide whether to use ACMD23 for
> RPMB. This CMD23 for RPMB need to set the bit 31 to its argument, if not, the
> RPMB write operation will return general fail.
>
> According to the sdhci logic, SDMA mode will disable the ACMD23, and only in
> ADMA mode, it will chose to use ACMD23 if the host support. But according to
> debug, and confirm with IC, the imx6qpdl/imx6sx/imx6sl/imx7d do not support
> the ACMD23 feature completely. These SoCs only use the 16 bit block count of
> the register 0x4 (BLOCK_ATT) as the CMD23's argument in ACMD23 mode, which
> means it will ignore the upper 16 bit of the CMD23's argument. This will block
> the reliable write operation in RPMB, because RPMB reliable write need to set
> the bit31 of the CMD23's argument. This is the hardware limitation. Due to
> imx6sl use SDMA, so for imx6qpdl/imx6sx/imx7d, it need to broke the ACMD23 for
> eMMC, SD card do not has this limitation, because SD card do not support reliable
> write.
>
> For imx6ul/imx6ull/imx6sll/imx7ulp/imx8, it support the ACMD23 completely, it
> change to use the 0x0 register (DS_ADDR) to put the CMD23's argument in ADMA mode.
>
> This patch handle 'sdhci,auto-cmd23-broken' from devicetree.
>
> Signed-off-by: Haibo Chen <haibo.chen@nxp.com>

So it does seem like this is a problem with the host controller, not
with the card?

> -       if (of_find_property(np, "no-1-8-v", NULL))
> -               host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;

Why are you deleting this? Seems unrelated.

> +       /* call to generic sdhci_get_property to support additional capabilities */
> +       sdhci_get_property(pdev);

Or does it get set by this call?
(Then explain that change in the commit message.)

> +       if (device_property_present(dev, "sdhci,auto-cmd23-broken"))
> +               host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN;

Even if this is a problem with the host controller I am not convinced.

Can't you just use the compatible-string of the host controller to
switch this flag?

They should be different compatibles because if this bug is present
in one version of the host controller and not another version then
by definition they are not compatible, right?

The idea with very specific compatible strings is to handle
exactly things like this.

Yours,
Linus Walleij

  reply	other threads:[~2019-12-10 23:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 12:54 [PATCH v2 00/14] few fix for sdhci-esdhc-imx BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 01/14] mmc: sdhci: do not enable card detect interrupt for gpio cd type BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 02/14] mmc: sdhci-esdhc-imx: no fail when no pinctrl available BOUGH CHEN
2019-12-10 23:25   ` Linus Walleij
2019-12-03 12:54 ` [PATCH v2 03/14] mmc: sdhci-esdhci-imx: retune needed for Mega/Mix enabled SoCs BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 04/14] mmc: sdhci-esdhc-imx: restore the per_clk rate in PM_RUNTIME BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 05/14] doc: dt: fsl-imx-esdhc: add strobe-dll-delay-target binding BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 06/14] mmc: sdhci-esdhc-imx: add strobe-dll-delay-target support BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 07/14] mmc: sdhci-esdhc-imx: optimize the clock setting BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 08/14] mmc: sdhci-esdhc-imx: optimize the strobe dll setting BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 09/14] doc: dt: fsl-imx-esdhc: add auto-cmd23-broken binding BOUGH CHEN
2019-12-10 23:32   ` Linus Walleij
2019-12-10 23:39     ` Linus Walleij
2020-02-10  3:08       ` BOUGH CHEN
2020-02-10 13:30         ` Linus Walleij
2019-12-03 12:54 ` [PATCH v2 10/14] mmc: sdhci-esdhc-imx: handle 'sdhci,auto-cmd23-broken' from devicetree BOUGH CHEN
2019-12-10 23:38   ` Linus Walleij [this message]
2019-12-03 12:54 ` [PATCH v2 11/14] mmc: sdhci-esdhc-imx: clear pending interrupt and halt cqhci BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 12/14] mmc: sdhci-esdhc-imx: restore pin state when resume back BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 13/14] mmc: sdhci-esdhc-imx: clear DMA_SEL when disable DMA mode BOUGH CHEN
2019-12-03 12:54 ` [PATCH v2 14/14] mmc: queue: create dev->dma_parms before call dma_set_max_seg_size() BOUGH CHEN

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='CACRpkdbm75KX3bBH0gaGhiPTd=zD996qgu7vSHr1H3u_uSRo=g@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=adrian.hunter@intel.com \
    --cc=haibo.chen@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shawnguo@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).