All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Peng Fan <peng.fan@nxp.com>,
	"riteshh@codeaurora.org" <riteshh@codeaurora.org>,
	"asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
	"ulf.hansson@linaro.org" <ulf.hansson@linaro.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	BOUGH CHEN <haibo.chen@nxp.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"van.freenix@gmail.com" <van.freenix@gmail.com>
Subject: Re: [RFC] mmc: cqhci: clear pending interrupt and halt
Date: Tue, 16 Apr 2019 11:32:03 +0300	[thread overview]
Message-ID: <83ba5bb2-2d59-1f67-b1a1-cb5e20985a1f@intel.com> (raw)
In-Reply-To: <DB7PR04MB44904965E8F1BF09A5C150B288240@DB7PR04MB4490.eurprd04.prod.outlook.com>

On 16/04/19 10:27 AM, Peng Fan wrote:
> Hi Adrian,
> 
>>
>> On 16/04/19 9:48 AM, Peng Fan wrote:
>>> On i.MX8MM, we are running Dual Linux OS, with 1st Linux using SD Card
>>> as rootfs storage, 2nd Linux using eMMC as rootfs storage. We let the
>>> the 1st linux configure power/clock for the 2nd Linux.
>>>
>>> When the 2nd Linux is booting into rootfs stage, we let the 1st Linux
>>> to destroy the 2nd linux, then restart the 1st linux, we met SDHCI
>>> dump as following, after we clear the pending interrupt and halt
>>> CQCTL, issue gone.
>>
>> I think it is better if the vendor driver does any necessary resets before
>> initialization.
> 
> In drivers/mmc/host/sdhci-esdhc-imx.c, there is a call to cqhci_init
> " 1525                 err = cqhci_init(cq_host, host->mmc, false);"
> 
> You mean I put the following piece code into sdhci-esdhc-imx.c?
> 
> "
>      status = cqhci_readl(cq_host, CQHCI_IS);
>      cqhci_writel(cq_host, status, CQHCI_IS);
>      cqhci_writel(cq_host, CQHCI_HALT, CQHCI_CTL);
> "
> 
> How about the following patch?
> 
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index b8e11a77e274..f2e46ddf9695 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -1435,6 +1435,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>         struct cqhci_host *cq_host;
>         int err;
>         struct pltfm_imx_data *imx_data;
> +       u32 status;
> 
>         host = sdhci_pltfm_init(pdev, &sdhci_esdhc_imx_pdata,
>                                 sizeof(*imx_data));
> @@ -1542,6 +1543,11 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
>                 err = cqhci_init(cq_host, host->mmc, false);
>                 if (err)
>                         goto disable_ahb_clk;
> +
> +               status = cqhci_readl(cq_host, CQHCI_IS);
> +               cqhci_writel(cq_host, status, CQHCI_IS);
> +               cqhci_writel(cq_host, CQHCI_HALT, CQHCI_CTL);
> +
>         }
> 

It would be nicer to:
1. Define how CQHCI gets reset.  For example, with our controllers
SDHCI_RESET_ALL also resets CQHCI.
2. Define when CQHCI should be reset. e.g. using the ->reset() host op for
example.
3. Implement a patch that meets those requirements.

  reply	other threads:[~2019-04-16  8:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  7:27 [RFC] mmc: cqhci: clear pending interrupt and halt Peng Fan
2019-04-16  8:32 ` Adrian Hunter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-04-16  6:48 Peng Fan
2019-04-16  7:19 ` Adrian Hunter

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=83ba5bb2-2d59-1f67-b1a1-cb5e20985a1f@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=asutoshd@codeaurora.org \
    --cc=haibo.chen@nxp.com \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=riteshh@codeaurora.org \
    --cc=ulf.hansson@linaro.org \
    --cc=van.freenix@gmail.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 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.