All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chun-Hung Wu <chun-hung.wu@mediatek.com>
To: Alan Cooper <alcooperx@gmail.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
Subject: Re: [PATCH 2/5] [2/5] mmc: host: Remove redundant host CQE bindings
Date: Tue, 14 Apr 2020 08:22:18 +0800	[thread overview]
Message-ID: <1586823738.16047.7.camel@mtkswgap22> (raw)
In-Reply-To: <CAOGqxeUjx+OWRhwWznk-uHZ9op7WTZaAGq6xd4Z4QdL+Hja2yA@mail.gmail.com>

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. 
> 
> > -       }
> >         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


WARNING: multiple messages have this Message-ID (diff)
From: Chun-Hung Wu <chun-hung.wu@mediatek.com>
To: Alan Cooper <alcooperx@gmail.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: Tue, 14 Apr 2020 08:22:18 +0800	[thread overview]
Message-ID: <1586823738.16047.7.camel@mtkswgap22> (raw)
In-Reply-To: <CAOGqxeUjx+OWRhwWznk-uHZ9op7WTZaAGq6xd4Z4QdL+Hja2yA@mail.gmail.com>

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. 
> 
> > -       }
> >         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


WARNING: multiple messages have this Message-ID (diff)
From: Chun-Hung Wu <chun-hung.wu@mediatek.com>
To: Alan Cooper <alcooperx@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	wsd_upstream@mediatek.com, linux-mmc <linux-mmc@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	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>,
	Chaotian Jing <chaotian.jing@mediatek.com>,
	kernel-team@android.com, Pan Bian <bianpan2016@163.com>,
	DTML <devicetree@vger.kernel.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org, mirq-linux@rere.qmqm.pl,
	Rob Herring <robh+dt@kernel.org>,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Allison Randal <allison@lohutok.net>,
	"moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE"
	<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>,
	": Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] [2/5] mmc: host: Remove redundant host CQE bindings
Date: Tue, 14 Apr 2020 08:22:18 +0800	[thread overview]
Message-ID: <1586823738.16047.7.camel@mtkswgap22> (raw)
In-Reply-To: <CAOGqxeUjx+OWRhwWznk-uHZ9op7WTZaAGq6xd4Z4QdL+Hja2yA@mail.gmail.com>

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. 
> 
> > -       }
> >         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

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

WARNING: multiple messages have this Message-ID (diff)
From: Chun-Hung Wu <chun-hung.wu@mediatek.com>
To: Alan Cooper <alcooperx@gmail.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Kate Stewart <kstewart@linuxfoundation.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	wsd_upstream@mediatek.com, linux-mmc <linux-mmc@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	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>,
	Chaotian Jing <chaotian.jing@mediatek.com>,
	kernel-team@android.com, Pan Bian <bianpan2016@163.com>,
	DTML <devicetree@vger.kernel.org>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-arm-msm@vger.kernel.org, mirq-linux@rere.qmqm.pl,
	Rob Herring <robh+dt@kernel.org>,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Allison Randal <allison@lohutok.net>,
	"moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE"
	<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>,
	": Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] [2/5] mmc: host: Remove redundant host CQE bindings
Date: Tue, 14 Apr 2020 08:22:18 +0800	[thread overview]
Message-ID: <1586823738.16047.7.camel@mtkswgap22> (raw)
In-Reply-To: <CAOGqxeUjx+OWRhwWznk-uHZ9op7WTZaAGq6xd4Z4QdL+Hja2yA@mail.gmail.com>

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. 
> 
> > -       }
> >         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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-04-14  0:22 UTC|newest]

Thread overview: 41+ 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 ` Chun-Hung Wu
2020-04-06  9:27 ` Chun-Hung Wu
2020-04-06  9:27 ` 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   ` Chun-Hung Wu
2020-04-06  9:27   ` Chun-Hung Wu
2020-04-06  9:27   ` Chun-Hung Wu
2020-04-06  9:27 ` [PATCH 2/5] [2/5] mmc: host: Remove redundant host " Chun-Hung Wu
2020-04-06  9:27   ` Chun-Hung Wu
2020-04-06  9:27   ` Chun-Hung Wu
2020-04-06  9:27   ` Chun-Hung Wu
     [not found]   ` <1586165281-11888-3-git-send-email-chun-hung.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2020-04-06 13:59     ` Alan Cooper
2020-04-06 13:59       ` Alan Cooper
2020-04-06 13:59       ` Alan Cooper
2020-04-06 13:59       ` Alan Cooper
2020-04-14  0:22       ` Chun-Hung Wu [this message]
2020-04-14  0:22         ` Chun-Hung Wu
2020-04-14  0:22         ` Chun-Hung Wu
2020-04-14  0:22         ` Chun-Hung Wu
2020-04-16 18:25         ` Alan Cooper
2020-04-16 18:25           ` Alan Cooper
2020-04-16 18:25           ` Alan Cooper
2020-04-16 18:25           ` Alan Cooper
     [not found] ` <1586165281-11888-1-git-send-email-chun-hung.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2020-04-06  9:27   ` [PATCH 3/5] [3/5] mmc: mediatek: refine msdc timeout api Chun-Hung Wu
2020-04-06  9:27     ` Chun-Hung Wu
2020-04-06  9:27     ` Chun-Hung Wu
2020-04-06  9:27     ` 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   ` Chun-Hung Wu
2020-04-06  9:28   ` Chun-Hung Wu
2020-04-06  9:28   ` 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-06  9:28   ` Chun-Hung Wu
2020-04-06  9:28   ` Chun-Hung Wu
2020-04-06  9:28   ` Chun-Hung Wu
     [not found]   ` <1586165281-11888-6-git-send-email-chun-hung.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2020-04-14 13:55     ` Rob Herring
2020-04-14 13:55       ` Rob Herring
2020-04-14 13:55       ` Rob Herring
2020-04-14 13:55       ` Rob Herring
2020-04-15  9:44 ` [PATCH v4 0/5] mmc: mediatek: add mmc cqhci support Ulf Hansson

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=1586823738.16047.7.camel@mtkswgap22 \
    --to=chun-hung.wu@mediatek.com \
    --cc=adrian.hunter@intel.com \
    --cc=agross@kernel.org \
    --cc=alcooperx@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=chaotian.jing@mediatek.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=kstewart@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=mark.rutland@arm.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=thierry.reding@gmail.com \
    --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 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.