linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>, <linux-mmc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-rockchip@lists.infradead.org>, <kernel@collabora.com>,
	Yifeng Zhao <yifeng.zhao@rock-chips.com>
Subject: Re: [PATCH 1/2] mmc: sdhci-of-dwcmshc: Add command queue support for rockchip SOCs
Date: Thu, 23 Oct 2025 13:13:07 +0300	[thread overview]
Message-ID: <8eec7ae4-c02f-4099-b5ec-065c8ea06f90@intel.com> (raw)
In-Reply-To: <7bxs6nw5fnjq22p7gxrmjqjtw3g5nt6cacwpfjihxv5jk765si@ho3odkyxpi7m>

On 16/10/2025 20:09, Sebastian Reichel wrote:
> Hi,
> 
> I will fix the typo in the commit message in PATCHv2.
> 
> On Thu, Oct 16, 2025 at 10:42:29AM +0300, Adrian Hunter wrote:
>>> +static void rk35xx_sdhci_cqe_enable(struct mmc_host *mmc)
>>> +{
>>> +	struct sdhci_host *host = mmc_priv(mmc);
>>> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
>>> +	struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
>>> +	u32 reg;
>>> +
>>> +	reg = sdhci_readl(host, dwc_priv->vendor_specific_area2 + CQHCI_CFG);
>>> +	reg |= CQHCI_ENABLE;
>>> +	sdhci_writel(host, reg, dwc_priv->vendor_specific_area2 + CQHCI_CFG);
>>> +
>>> +	reg = sdhci_readl(host, SDHCI_PRESENT_STATE);
>>> +	while (reg & SDHCI_DATA_AVAILABLE) {
>>> +		sdhci_readl(host, SDHCI_BUFFER);
>>> +		reg = sdhci_readl(host, SDHCI_PRESENT_STATE);
>>> +	}
>>> +
>>> +	sdhci_writew(host, DWCMSHC_SDHCI_CQE_TRNS_MODE, SDHCI_TRANSFER_MODE);
>>> +
>>> +	sdhci_cqe_enable(mmc);
>>> +
>>> +	sdhci_writew(host, DWCMSHC_SDHCI_CQE_TRNS_MODE, SDHCI_TRANSFER_MODE);
>>
>> Transfer mode was set already 2 lines up
> 
> Indeed. I was not sure if this is an intentional quirk from Yifeng
> Zhao and thus kept this dual write.
> 
>>> +}
>>> +
>>> +static void rk35xx_sdhci_cqe_disabled(struct mmc_host *mmc, bool recovery)
>>
>> As mentioned elsewhere "disabled" -> "disable"
> 
> Ack, will fix in PATCHv2.
> 
>>> +{
>>> +	struct sdhci_host *host = mmc_priv(mmc);
>>> +	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
>>> +	struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
>>> +	unsigned long flags;
>>> +	u32 ctrl;
>>> +
>>> +	mmc->cqe_ops->cqe_wait_for_idle(mmc);
>>
>> Is this necessary?  If so, it seems more like something that should be done by
>> cqhci itself.
> 
> The RK3588 TRM says that the software needs to verify that the eMMC
> controller is in idle state without any ongoing commands or data
> transfers before disabling the CQ_EN bit (CQHCI_ENABLE in the kernel).

Leave out cqe_wait_for_idle() but make use of ->pre_enable() and
->post_disable(), refer for example msdc_cqe_pre_enable() /
msdc_cqe_post_disable() or sdhci_tegra_cqe_pre_enable() /
sdhci_tegra_cqe_post_disable()


  reply	other threads:[~2025-10-23 10:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14 15:41 [PATCH 0/2] mmc: sdhci-of-dwcmshc: Add command queue support for Rockchip SOCs Sebastian Reichel
2025-10-14 15:41 ` [PATCH 1/2] mmc: sdhci-of-dwcmshc: Add command queue support for rockchip SOCs Sebastian Reichel
2025-10-14 21:47   ` Dragan Simic
2025-10-16  7:42   ` Adrian Hunter
2025-10-16 17:09     ` Sebastian Reichel
2025-10-23 10:13       ` Adrian Hunter [this message]
2025-10-14 15:41 ` [PATCH 2/2] arm64: dts: rockchip: add eMMC CQE support for rk3588 Sebastian Reichel

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=8eec7ae4-c02f-4099-b5ec-065c8ea06f90@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=kernel@collabora.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=robh@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=ulf.hansson@linaro.org \
    --cc=yifeng.zhao@rock-chips.com \
    /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).