lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAPDyKFpbK72utA0O1gTR30NzKzmtGCFbAKL6BJA+rUVdDhOstQ@mail.gmail.com>
Date:   Wed, 2 Sep 2020 09:59:49 +0200
From:   Ulf Hansson <ulf.hansson@...aro.org>
To:     Chris Packham <chris.packham@...iedtelesis.co.nz>
Cc:     Adrian Hunter <adrian.hunter@...el.com>,
        "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "yinbo.zhu" <yinbo.zhu@....com>
Subject: Re: [PATCH] mmc: sdhci-of-esdhc: Don't walk device-tree on every interrupt

+ Yinbo Zhu

On Wed, 2 Sep 2020 at 06:06, Chris Packham
<chris.packham@...iedtelesis.co.nz> wrote:
>
> Commit b214fe592ab7 ("mmc: sdhci-of-esdhc: add erratum eSDHC7 support")
> added code to check for a specific compatible string in the device-tree
> on every esdhc interrupt. We know that if it's present the compatible
> string will be found on the sdhc host. Instead of walking the
> device-tree, go directly to the sdhc host's device and use
> of_device_is_compatible().
>
> Signed-off-by: Chris Packham <chris.packham@...iedtelesis.co.nz>

Thanks for the patch. Indeed, this isn't the way we should implement quirks.

However, could you perhaps do the OF parsing in esdhc_init() and
assign a quirk flag that you check in esdhc_irq() instead?

Along the lines of how we do it for "quirk_delay_before_data_reset".

Kind regards
Uffe

> ---
>
> I found this in passing while trying to track down another issue using ftrace.
> I found it odd that I was seeing a lot of calls to __of_device_is_compatible()
> coming from esdhc_irq() (the fact that this interrupt is going off on my board
> is also odd, but that's a different story).
>
>  drivers/mmc/host/sdhci-of-esdhc.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
> index 7c73d243dc6c..11c8c522d623 100644
> --- a/drivers/mmc/host/sdhci-of-esdhc.c
> +++ b/drivers/mmc/host/sdhci-of-esdhc.c
> @@ -1177,10 +1177,11 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host,
>
>  static u32 esdhc_irq(struct sdhci_host *host, u32 intmask)
>  {
> +       struct device *dev = mmc_dev(host->mmc);
> +       struct device_node *np = dev->of_node;
>         u32 command;
>
> -       if (of_find_compatible_node(NULL, NULL,
> -                               "fsl,p2020-esdhc")) {
> +       if (of_device_is_compatible(np, "fsl,p2020-esdhc")) {
>                 command = SDHCI_GET_CMD(sdhci_readw(host,
>                                         SDHCI_COMMAND));
>                 if (command == MMC_WRITE_MULTIPLE_BLOCK &&
> --
> 2.28.0
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ