[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdauCe-zAcsO5q_79+Ux_a2=bktA5UqKjWs4XdBJZ3wWeg@mail.gmail.com>
Date: Fri, 21 Feb 2020 15:33:58 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Chun-Hung Wu <chun-hung.wu@...iatek.com>
Cc: Chaotian Jing <chaotian.jing@...iatek.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Matthias Brugger <matthias.bgg@...il.com>,
Pavel Machek <pavel@....cz>,
Kate Stewart <kstewart@...uxfoundation.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Pan Bian <bianpan2016@....com>,
Thomas Gleixner <tglx@...utronix.de>,
Allison Randal <allison@...utok.net>,
Mathieu Malaterre <malat@...ian.org>,
Stanley Chu <stanley.chu@...iatek.com>,
Kuohong Wang <kuohong.wang@...iatek.com>,
kernel-team@...roid.com,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-mmc <linux-mmc@...r.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>, wsd_upstream@...iatek.com,
Linux ARM <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH 1/4] [1/4] mmc: core: expose MMC_CAP2_CQE* to dt
On Mon, Feb 17, 2020 at 7:32 AM Chun-Hung Wu <chun-hung.wu@...iatek.com> wrote:
> Expose MMC_CAP2_CQE and MMC_CAP2_CQE_DCMD
> to host->caps2 if
> 1. "supports-cqe" is defined in dt and
> 2. "disable-cqe-dcmd" is not defined in dt.
>
> ---
> drivers/mmc/core/host.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 105b7a7..efb0dbe 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -319,6 +319,14 @@ 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;
I don't understand why this is even a DT property as it should
be clear from the hosts compatible whether it supports CQE or
not. But it's too late to do anything about that I suppose, and
I just assume there is something I don't understand here.
> + /* Must be after "supports-cqe" check */
> + if (!device_property_read_bool(dev, "disable-cqe-dcmd")) {
> + if (host->caps2 & MMC_CAP2_CQE)
> + host->caps2 |= MMC_CAP2_CQE_DCMD;
> + }
This is the right place to do this I suppose. Disabling CQE
selectively is something you might wanna do for debugging.
Acked-by: Linus Walleij <linus.walleij@...aro.org>
I see that some drivers are already parsing this DT property
on their own, should we follow up with patches so that these:
$ git grep 'supports-cqe'
drivers/mmc/host/sdhci-brcmstb.c: if
(device_property_read_bool(&pdev->dev, "supports-cqe")) {
drivers/mmc/host/sdhci-msm.c: if (of_property_read_bool(node, "supports-cqe"))
drivers/mmc/host/sdhci-tegra.c: if
(device_property_read_bool(host->mmc->parent, "supports-cqe"))
Make use of the central parsing instead?
Yours,
Linus Walleij
Powered by blists - more mailing lists