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]
Message-ID: <CAMuHMdVkbMbKdY76XGDGxGwCsY_oHZfF=v9XMLZSjLMN+jKe_Q@mail.gmail.com>
Date:   Tue, 24 Nov 2020 16:42:52 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>
Cc:     Krzysztof Kozlowski <krzk@...nel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Jiri Kosina <trivial@...nel.org>,
        Mark Brown <broonie@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
        Biju Das <biju.das.jz@...renesas.com>,
        Prabhakar <prabhakar.csengg@...il.com>,
        Sergei Shtylyov <sergei.shtylyov@...il.com>
Subject: Re: [PATCH 2/5] memory: renesas-rpc-if: Make rpcif_enable/disable_rpm()
 as static inline

Hi Prabhakar,

On Tue, Nov 24, 2020 at 12:27 PM Lad Prabhakar
<prabhakar.mahadev-lad.rj@...renesas.com> wrote:
> Define rpcif_enable_rpm() and rpcif_disable_rpm() as static
> inline in the header instead of exporting it.
>
> Suggested-by: Pavel Machek <pavel@...x.de>
> Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>

Thanks for your patch, which is an improvement.

> --- a/include/memory/renesas-rpc-if.h
> +++ b/include/memory/renesas-rpc-if.h
> @@ -10,6 +10,7 @@
>  #ifndef __RENESAS_RPC_IF_H
>  #define __RENESAS_RPC_IF_H
>
> +#include <linux/pm_runtime.h>
>  #include <linux/types.h>
>
>  enum rpcif_data_dir {
> @@ -77,11 +78,19 @@ struct      rpcif {
>
>  int  rpcif_sw_init(struct rpcif *rpc, struct device *dev);
>  void rpcif_hw_init(struct rpcif *rpc, bool hyperflash);
> -void rpcif_enable_rpm(struct rpcif *rpc);
> -void rpcif_disable_rpm(struct rpcif *rpc);
>  void rpcif_prepare(struct rpcif *rpc, const struct rpcif_op *op, u64 *offs,
>                    size_t *len);
>  int rpcif_manual_xfer(struct rpcif *rpc);
>  ssize_t rpcif_dirmap_read(struct rpcif *rpc, u64 offs, size_t len, void *buf);
>
> +static inline void rpcif_enable_rpm(struct rpcif *rpc)
> +{
> +       pm_runtime_enable(rpc->dev);
> +}
> +
> +static inline void rpcif_disable_rpm(struct rpcif *rpc)
> +{
> +       pm_runtime_put_sync(rpc->dev);

Looking at how this is used, this should call pm_runtime_disable()
instead.

And probably this should be moved inside the core RPC-IF driver:
  1. pm_runtime_enable() could be called from rpcif_sw_init(),
  2. pm_runtime_put_sync() can be called from a new rpc_sw_deinit()
     function, to be called by the SPI and MTD drivers on probe failure
     and on remove.

> +}

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ