linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chun-Hung Wu <chun-hung.wu@mediatek.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: "Mark Rutland" <mark.rutland@arm.com>,
	"Kate Stewart" <kstewart@linuxfoundation.org>,
	wsd_upstream <wsd_upstream@mediatek.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Al Cooper" <alcooperx@gmail.com>,
	"Bjorn Andersson" <bjorn.andersson@linaro.org>,
	linux-tegra <linux-tegra@vger.kernel.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Pavel Machek" <pavel@ucw.cz>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Andy Gross" <agross@kernel.org>,
	"BCM Kernel Feedback" <bcm-kernel-feedback-list@broadcom.com>,
	"Allison Randal" <allison@lohutok.net>,
	"Android Kernel Team" <kernel-team@android.com>,
	"Pan Bian" <bianpan2016@163.com>,
	"Veerabhadrarao Badiganti" <vbadigan@codeaurora.org>,
	DTML <devicetree@vger.kernel.org>,
	"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
	"Rob Herring" <robh+dt@kernel.org>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Stanley Chu (朱原陞)" <stanley.chu@mediatek.com>,
	"Chaotian Jing (井朝天)" <Chaotian.Jing@mediatek.com>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Mathieu Malaterre" <malat@debian.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Kuohong Wang (王國鴻)" <kuohong.wang@mediatek.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Yong Mao (毛勇)" <yong.mao@mediatek.com>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 1/5] mmc: core: Extend mmc_of_parse() to parse CQE bindings
Date: Tue, 12 May 2020 09:16:38 +0800	[thread overview]
Message-ID: <1589246198.612.1.camel@mtkswgap22> (raw)
In-Reply-To: <CAPDyKFoAa3=Rg77Af7nNQOZN13m9NQYERosrqiK_kuL3s-YECA@mail.gmail.com>

On Fri, 2020-05-08 at 13:05 +0800, Ulf Hansson wrote:
> On Thu, 7 May 2020 at 18:33, Veerabhadrarao Badiganti
> <vbadigan@codeaurora.org> wrote:
> >
> >
> > On 5/6/2020 10:06 PM, Ulf Hansson wrote:
> > > On Wed, 6 May 2020 at 15:01, Veerabhadrarao Badiganti
> > > <vbadigan@codeaurora.org> wrote:
> > >>
> > >> On 4/28/2020 5:26 AM, Chun-Hung Wu wrote:
> > >>> Parse CQE bindings "supports-cqe" and "disable-cqe-dcmd"
> > >>> in mmc_of_parse().
> > >>>
> > >>> Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
> > >>> ---
> > >>>    drivers/mmc/core/host.c | 5 +++++
> > >>>    1 file changed, 5 insertions(+)
> > >>>
> > >>> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> > >>> index c876872..47521c6 100644
> > >>> --- a/drivers/mmc/core/host.c
> > >>> +++ b/drivers/mmc/core/host.c
> > >>> @@ -302,6 +302,11 @@ int mmc_of_parse(struct mmc_host *host)
> > >>>                host->caps2 |= MMC_CAP2_NO_SD;
> > >>>        if (device_property_read_bool(dev, "no-mmc"))
> > >>>                host->caps2 |= MMC_CAP2_NO_MMC;
> > >>> +     if (device_property_read_bool(dev, "supports-cqe"))
> > >>> +             host->caps2 |= MMC_CAP2_CQE;
> > >> This change is breaking emmc driver on qcom platforms where this dt
> > >> property is defined.
> > >>
> > >> [    1.543453]  cqhci_deactivate+0xc/0x38
> > >> [    1.545627]  sdhci_msm_reset+0x40/0x58
> > >> [    1.549447]  sdhci_do_reset+0x48/0x7c
> > >> [    1.553180]  __sdhci_read_caps+0x7c/0x214
> > >> [    1.556913]  sdhci_setup_host+0x58/0xce8
> > >> [    1.560905]  sdhci_msm_probe+0x588/0x8a4
> > >> [    1.564900]  platform_drv_probe+0x4c/0xb0
> > >>
> > >> So, we cant have this flag defined before sdhci_setup_host().
> > >>
> > >> I will have to clear this cap and re-enable it in our initialization.
> > > Thanks for reporting! I have dropped all the four patches from
> > > Chun-Hung, so we can figure out how to fix this.
> > >
> > > Please help to review the next version of the series.
> >
> > Thanks Ulf.
> >
> > Hi Chun-Hung,
> >
> > On qcom controller CQE also gets reset when SDHC is reset. So we have to
> > explicitly disable CQE
> > by invoking  cqhci_deactivate() during sdhc reset
> >
> > SDHC gets reset in sdhci_setup_host() even before cqe is initialized.
> > With MMC_CAP2_CQE_DCMD cap set even before sdhci_set_host(), we are
> > getting null pointer access with cqhci_deactivate().
> >
> > If CQE getting reset with SDHC reset is generic (applicable to other
> > controllers) then you have revisit your logic.
> > If its not the case then only qcom driver would get affected.
> 
> Thanks for clarifying the problem, much appreciated.
> 
> To me, it looks like the DT parsing of the CQE properties are better
> suited to be managed by each sdhci variant, to continue to leave some
> room for flexibility.
> 
> Chun-Hung, can you please drop patch 1 and patch2 from the series and
> adapt to this change in the mediatek variant?
Ok, I will rollback patch1 and patch2 from series and keep DT parsing
of the CQE properties by each sdhci/msdc variant.
CQE properties will move to mediatek variant.
> 
> [...]
> 
> Kind regards
> Uffe

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

  reply	other threads:[~2020-05-12  1:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27 23:56 [PATCH v5 0/5] mmc: mediatek: add mmc cqhci support Chun-Hung Wu
2020-04-27 23:56 ` [PATCH v5 1/5] mmc: core: Extend mmc_of_parse() to parse CQE bindings Chun-Hung Wu
2020-05-06 13:00   ` Veerabhadrarao Badiganti
2020-05-06 16:36     ` Ulf Hansson
2020-05-07 16:33       ` Veerabhadrarao Badiganti
2020-05-08  5:05         ` Ulf Hansson
2020-05-12  1:16           ` Chun-Hung Wu [this message]
2020-04-27 23:56 ` [PATCH v5 2/5] mmc: host: Remove redundant " Chun-Hung Wu
2020-04-27 23:56 ` [PATCH v5 3/5] mmc: mediatek: refine msdc timeout api Chun-Hung Wu
2020-04-28 12:28   ` yong.mao
2020-04-27 23:56 ` [PATCH v5 4/5] mmc: mediatek: command queue support Chun-Hung Wu
2020-04-28 13:02   ` yong.mao
2020-04-27 23:56 ` [PATCH v5 5/5] dt-bindings: mmc: mediatek: Add document for mt6779 Chun-Hung Wu

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=1589246198.612.1.camel@mtkswgap22 \
    --to=chun-hung.wu@mediatek.com \
    --cc=Chaotian.Jing@mediatek.com \
    --cc=adrian.hunter@intel.com \
    --cc=agross@kernel.org \
    --cc=alcooperx@gmail.com \
    --cc=allison@lohutok.net \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bianpan2016@163.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=kernel-team@android.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=kuohong.wang@mediatek.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=malat@debian.org \
    --cc=mark.rutland@arm.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=michal.simek@xilinx.com \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=pavel@ucw.cz \
    --cc=robh+dt@kernel.org \
    --cc=stanley.chu@mediatek.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=vbadigan@codeaurora.org \
    --cc=wsd_upstream@mediatek.com \
    --cc=yong.mao@mediatek.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).