From: Alan Cooper <alcooperx@gmail.com>
To: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Cc: mirq-linux@rere.qmqm.pl, Jonathan Hunter <jonathanh@nvidia.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Florian Fainelli <f.fainelli@gmail.com>,
BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Michal Simek <michal.simek@xilinx.com>,
Thierry Reding <thierry.reding@gmail.com>,
Chaotian Jing <chaotian.jing@mediatek.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Linus Walleij <linus.walleij@linaro.org>,
Pavel Machek <pavel@ucw.cz>,
Kate Stewart <kstewart@linuxfoundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Pan Bian <bianpan2016@163.com>,
Thomas Gleixner <tglx@linutronix.de>,
Allison Randal <allison@lohutok.net>,
Mathieu Malaterre <malat@debian.org>,
Stanley Chu <stanley.chu@mediatek.com>,
Kuohong Wang <kuohong.wang@mediatek.com>,
kernel-team@android.com,
": Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
linux-mmc <linux-mmc@vger.kernel.org>,
linux-mediatek@lists.infradead.org,
DTML <devicetree@vger.kernel.org>,
wsd_upstream@mediatek.com,
"moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH 2/5] [2/5] mmc: host: Remove redundant host CQE bindings
Date: Thu, 16 Apr 2020 14:25:52 -0400 [thread overview]
Message-ID: <CAOGqxeWvo0Dd6DaSEnosFV8xWngUq9By-hdtu4yJZwh6R=PgLw@mail.gmail.com> (raw)
In-Reply-To: <1586823738.16047.7.camel@mtkswgap22>
On Mon, Apr 13, 2020 at 8:22 PM Chun-Hung Wu <chun-hung.wu@mediatek.com> wrote:
>
> On Mon, 2020-04-06 at 09:59 -0400, Alan Cooper wrote:
> > On Mon, Apr 6, 2020 at 5:28 AM Chun-Hung Wu <chun-hung.wu@mediatek.com> wrote:
> > >
> > > CQE bindings "supports-cqe" and "disable-cqe-dcmd" is parsed
> > > in mmc_of_parse(). Remove vendor code which parses CQE bindings,
> > > and use mmc_host->caps2 to decide support CQE or not.
> > >
> > > Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
> > > ---
> > > drivers/mmc/host/sdhci-brcmstb.c | 11 ++++++-----
> > > drivers/mmc/host/sdhci-msm.c | 3 +--
> > > drivers/mmc/host/sdhci-of-arasan.c | 3 ---
> > > drivers/mmc/host/sdhci-tegra.c | 2 +-
> > > 4 files changed, 8 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
> > > index ad01f64..07c90c6 100644
> > > --- a/drivers/mmc/host/sdhci-brcmstb.c
> > > +++ b/drivers/mmc/host/sdhci-brcmstb.c
> > > @@ -247,10 +247,6 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
> > > return res;
> > >
> > > memset(&brcmstb_pdata, 0, sizeof(brcmstb_pdata));
> > > - if (device_property_read_bool(&pdev->dev, "supports-cqe")) {
> > > - has_cqe = true;
> > > - match_priv->ops->irq = sdhci_brcmstb_cqhci_irq;
> >
> > The above line that sets the irq was moved to later in the function,
> > but needs to come before sdhci_pltfm_init()
> >
> > Al
> After check the code in sdhci_pltfm_init(), I don't see where
> match_priv->ops->irq being used in code section.
> Only "host->ops = pdata->ops;" is assigned, may I know why should
> we put match_priv->ops->irq = sdhci_brcmstb_cqhci_irq; before
> sdhci_pltfm_init()?
> By the way, host only added to kernel after sdhci_brcmstb_add_host(),
> So, I suppose isr assignment is ok before anywhere of it.
I thought I remembered having to move the "set irq" to before
sdhci_pltfm_init() when I first added the functionality, but it looks
like it isn't necessary
I tested your changes and they worked correctly.
Acked-by: Al Cooper <alcooperx@gmail.com>
> >
> > > - }
> > > brcmstb_pdata.ops = match_priv->ops;
> > > host = sdhci_pltfm_init(pdev, &brcmstb_pdata,
> > > sizeof(struct sdhci_brcmstb_priv));
> > > @@ -261,7 +257,6 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
> > >
> > > pltfm_host = sdhci_priv(host);
> > > priv = sdhci_pltfm_priv(pltfm_host);
> > > - priv->has_cqe = has_cqe;
> > >
> > > /* Map in the non-standard CFG registers */
> > > iomem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> > > @@ -276,6 +271,12 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
> > > if (res)
> > > goto err;
> > >
> > > + if (host->mmc->caps2 & MMC_CAP2_CQE) {
> > > + has_cqe = true;
> > > + match_priv->ops->irq = sdhci_brcmstb_cqhci_irq;
> > > + }
> > > + priv->has_cqe = has_cqe;
> > > +
> > > /*
> > > * If the chip has enhanced strobe and it's enabled, add
> > > * callback
> > > diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
> > > index c3a160c..fbb2f57 100644
> > > --- a/drivers/mmc/host/sdhci-msm.c
> > > +++ b/drivers/mmc/host/sdhci-msm.c
> > > @@ -1880,7 +1880,6 @@ static int sdhci_msm_probe(struct platform_device *pdev)
> > > u8 core_major;
> > > const struct sdhci_msm_offset *msm_offset;
> > > const struct sdhci_msm_variant_info *var_info;
> > > - struct device_node *node = pdev->dev.of_node;
> > >
> > > host = sdhci_pltfm_init(pdev, &sdhci_msm_pdata, sizeof(*msm_host));
> > > if (IS_ERR(host))
> > > @@ -2076,7 +2075,7 @@ static int sdhci_msm_probe(struct platform_device *pdev)
> > > pm_runtime_use_autosuspend(&pdev->dev);
> > >
> > > host->mmc_host_ops.execute_tuning = sdhci_msm_execute_tuning;
> > > - if (of_property_read_bool(node, "supports-cqe"))
> > > + if (host->mmc->caps2 & MMC_CAP2_CQE)
> > > ret = sdhci_msm_cqe_add_host(host, pdev);
> > > else
> > > ret = sdhci_add_host(host);
> > > diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
> > > index e49b44b..359eff6 100644
> > > --- a/drivers/mmc/host/sdhci-of-arasan.c
> > > +++ b/drivers/mmc/host/sdhci-of-arasan.c
> > > @@ -1281,9 +1281,6 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
> > > sdhci_arasan_voltage_switch;
> > > sdhci_arasan->has_cqe = true;
> > > host->mmc->caps2 |= MMC_CAP2_CQE;
> > > -
> > > - if (!of_property_read_bool(np, "disable-cqe-dcmd"))
> > > - host->mmc->caps2 |= MMC_CAP2_CQE_DCMD;
> > > }
> > >
> > > ret = sdhci_arasan_add_host(sdhci_arasan);
> > > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> > > index 403ac44..d09abdd 100644
> > > --- a/drivers/mmc/host/sdhci-tegra.c
> > > +++ b/drivers/mmc/host/sdhci-tegra.c
> > > @@ -715,7 +715,7 @@ static void tegra_sdhci_parse_dt(struct sdhci_host *host)
> > > struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> > > struct sdhci_tegra *tegra_host = sdhci_pltfm_priv(pltfm_host);
> > >
> > > - if (device_property_read_bool(host->mmc->parent, "supports-cqe"))
> > > + if (host->mmc->caps2 & MMC_CAP2_CQE)
> > > tegra_host->enable_hwcq = true;
> > > else
> > > tegra_host->enable_hwcq = false;
> > > --
> > > 1.9.1
>
next prev parent reply other threads:[~2020-04-16 18:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-06 9:27 [PATCH v4 0/5] mmc: mediatek: add mmc cqhci support Chun-Hung Wu
2020-04-06 9:27 ` [PATCH 1/5] [1/5] mmc: core: Extend mmc_of_parse() to parse CQE bindings Chun-Hung Wu
2020-04-06 9:27 ` [PATCH 2/5] [2/5] mmc: host: Remove redundant host " Chun-Hung Wu
2020-04-06 13:59 ` Alan Cooper
2020-04-14 0:22 ` Chun-Hung Wu
2020-04-16 18:25 ` Alan Cooper [this message]
2020-04-06 9:27 ` [PATCH 3/5] [3/5] mmc: mediatek: refine msdc timeout api Chun-Hung Wu
2020-04-06 9:28 ` [PATCH 4/5] [4/5] mmc: mediatek: command queue support Chun-Hung Wu
2020-04-06 9:28 ` [PATCH 5/5] [5/5] dt-bindings: mmc: mediatek: Add document for mt6779 Chun-Hung Wu
2020-04-14 13:55 ` Rob Herring
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='CAOGqxeWvo0Dd6DaSEnosFV8xWngUq9By-hdtu4yJZwh6R=PgLw@mail.gmail.com' \
--to=alcooperx@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=agross@kernel.org \
--cc=allison@lohutok.net \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bianpan2016@163.com \
--cc=bjorn.andersson@linaro.org \
--cc=chaotian.jing@mediatek.com \
--cc=chun-hung.wu@mediatek.com \
--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=wsd_upstream@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).