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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0CLA33CTerXJ=bK+myhyHp_utoLnTX-NzMgjeb7icAGg@mail.gmail.com>
Date:   Tue, 29 Mar 2022 17:10:03 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Tony Huang <tonyhuang.sunplus@...il.com>
Cc:     Ulf Hansson <ulf.hansson@...aro.org>,
        Rob Herring <robh+dt@...nel.org>, lhjeff911@...il.com,
        linux-mmc <linux-mmc@...r.kernel.org>,
        DTML <devicetree@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Wells Lu 呂芳騰 <wells.lu@...plus.com>,
        Tony Huang <tony.huang@...plus.com>, lh.kuo@...plus.com
Subject: Re: [PATCH v5 2/2] mmc: Add mmc driver for Sunplus SP7021

On Tue, Mar 29, 2022 at 4:42 PM Tony Huang <tonyhuang.sunplus@...il.com> wrote:
>
> Add mmc driver for Sunplus SP7021
>
> Signed-off-by: Tony Huang <tonyhuang.sunplus@...il.com>

There should be a description of the device in the changelog, not just the same
text as the subject.

> +static void spmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
> +{
> +       struct spmmc_host *host = mmc_priv(mmc);
> +       struct mmc_data *data;
> +       struct mmc_command *cmd;
> +       int ret;
> +
> +       ret = mutex_lock_interruptible(&host->mrq_lock);
> +       if (ret)
> +               return;

I don't think it's valid to just return here when you get a signal. If
nothing can
handle the signal, doesn't it just hang?

It also appears that you don't release the mutex until the tasklet runs,
but it is not valid to release a mutex from a different context.

You should get a warning about this when running a kernel with lockdep
enabled at compile time. Please rework the locking to make this work.

> +#endif /* ifdef CONFIG_PM_RUNTIME */
> +
> +static const struct dev_pm_ops spmmc_pm_ops = {
> +       SET_SYSTEM_SLEEP_PM_OPS(spmmc_pm_suspend, spmmc_pm_resume)
> +#ifdef CONFIG_PM_RUNTIME
> +       SET_RUNTIME_PM_OPS(spmmc_pm_runtime_suspend, spmmc_pm_runtime_resume, NULL)
> +#endif
> +};
> +#endif /* ifdef CONFIG_PM */

It's better to use SYSTEM_SLEEP_PM_OPS/RUNTIME_PM_OPS instead
of the SET_ version, then you can remove all the #ifdef checks.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ