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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 30 Nov 2022 19:38:30 +0200
From:   Tomer Maimon <tmaimon77@...il.com>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     ulf.hansson@...aro.org, avifishman70@...il.com,
        tali.perry1@...il.com, joel@....id.au, venture@...gle.com,
        yuenn@...gle.com, benjaminfair@...gle.com, adrian.hunter@...el.com,
        skhan@...uxfoundation.org, davidgow@...gle.com,
        pbrobinson@...il.com, gsomlo@...il.com, briannorris@...omium.org,
        arnd@...db.de, krakoczy@...micro.com, openbmc@...ts.ozlabs.org,
        linux-mmc@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/2] mmc: sdhci-npcm: Add NPCM SDHCI driver

Hi Andy,

Thanks for your comments.

On Wed, 30 Nov 2022 at 17:50, Andy Shevchenko <andy.shevchenko@...il.com> wrote:
>
> On Wed, Nov 30, 2022 at 5:09 PM Tomer Maimon <tmaimon77@...il.com> wrote:
> >
> > Add Nuvoton NPCM BMC sdhci-pltfm controller driver.
>
> ...
>
> >  obj-$(CONFIG_MMC_S3C)          += s3cmci.o
> >  obj-$(CONFIG_MMC_SDRICOH_CS)   += sdricoh_cs.o
> >  obj-$(CONFIG_MMC_TMIO)         += tmio_mmc.o
>
> > +obj-$(CONFIG_MMC_SDHCI_NPCM)   += sdhci-npcm.o
>
> Keep it ordered by module name.
>
> >  obj-$(CONFIG_MMC_TMIO_CORE)    += tmio_mmc_core.o
> >  obj-$(CONFIG_MMC_SDHI)         += renesas_sdhi_core.o
> >  obj-$(CONFIG_MMC_SDHI_SYS_DMAC)                += renesas_sdhi_sys_dmac.o
>
> ...
>
> > +/*
> > + * NPCM SDHC MMC host controller driver.
> > + *
> > + */
>
> Too many lines for seems to be oneliner comment.
>
> ...
>
> > +#include <linux/of.h>
>
> I don't see how it's being used.
> But it seems the mod_devicetable.h is missing.
>
> ...
>
> > +static const struct sdhci_pltfm_data npcm_sdhci_pdata = {
> > +       .quirks  = SDHCI_QUIRK_DELAY_AFTER_POWER,
> > +       .quirks2 = SDHCI_QUIRK2_STOP_WITH_TC |
> > +                  SDHCI_QUIRK2_NO_1_8_V,
> > +};
>
> Why? Can't you use the sdhci as a library?
Can you explain what you mean by using sdhci as a library?
is it not to use the pltfm_data structure and only to set the quirks
directly through the host?
> ...
>
> > +static int npcm_sdhci_probe(struct platform_device *pdev)
> > +{
> > +       struct sdhci_pltfm_host *pltfm_host;
> > +       struct sdhci_host *host;
> > +       u32 caps;
> > +       int ret;
> > +
> > +       host = sdhci_pltfm_init(pdev, &npcm_sdhci_pdata, 0);
> > +       if (IS_ERR(host))
> > +               return PTR_ERR(host);
> > +
> > +       pltfm_host = sdhci_priv(host);
>
> > +       pltfm_host->clk = devm_clk_get(&pdev->dev, NULL);
> > +
>
> Blank line in a wrong position, should be before devm_clk_get().
>
> > +       if (!IS_ERR(pltfm_host->clk))
> > +               clk_prepare_enable(pltfm_host->clk);
>
> Why not use a specific helper that gets the clock enabled?
which specific helper? can you give me more specific details?
>
> > +       caps = sdhci_readl(host, SDHCI_CAPABILITIES);
> > +       if (caps & SDHCI_CAN_DO_8BIT)
> > +               host->mmc->caps |= MMC_CAP_8_BIT_DATA;
> > +
> > +       ret = mmc_of_parse(host->mmc);
> > +       if (ret)
> > +               goto err_sdhci_add;
> > +
> > +       ret = sdhci_add_host(host);
> > +       if (ret)
> > +               goto err_sdhci_add;
> > +
> > +       return 0;
> > +
> > +err_sdhci_add:
> > +       clk_disable_unprepare(pltfm_host->clk);
> > +       sdhci_pltfm_free(pdev);
> > +       return ret;
> > +}
>
> ...
>
> > +
>
> Redundant blank line.
>
> > +module_platform_driver(npcm_sdhci_driver);
>
> --
> With Best Regards,
> Andy Shevchenko

Best regards,

Tomer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ