linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Gareth Williams <gareth.williams.jx@renesas.com>
Cc: Mark Brown <broonie@kernel.org>,
	Phil Edworthy <phil.edworthy@renesas.com>,
	linux-spi <linux-spi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] spi: dw: Add basic runtime PM support
Date: Mon, 16 Sep 2019 16:36:03 +0200	[thread overview]
Message-ID: <CAMuHMdUnzmYEcp0B5MG7itB1JHtNL7Stj9S2EFB0U0y_naQVBQ@mail.gmail.com> (raw)
In-Reply-To: <1568376720-7402-3-git-send-email-gareth.williams.jx@renesas.com>

Hi Gareth,

On Fri, Sep 13, 2019 at 2:13 PM Gareth Williams
<gareth.williams.jx@renesas.com> wrote:
> From: Phil Edworthy <phil.edworthy@renesas.com>
>
> Enable runtime PM so that the clock used to access the registers in the
> peripheral is turned on using a clock domain.
>
> Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
> Signed-off-by: Gareth Williams <gareth.williams.jx@renesas.com>

Thanks for your patch!

> --- a/drivers/spi/spi-dw.c
> +++ b/drivers/spi/spi-dw.c
> @@ -10,6 +10,7 @@
>  #include <linux/module.h>
>  #include <linux/highmem.h>
>  #include <linux/delay.h>
> +#include <linux/pm_runtime.h>
>  #include <linux/slab.h>
>  #include <linux/spi/spi.h>
>
> @@ -497,6 +498,9 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
>         if (dws->set_cs)
>                 master->set_cs = dws->set_cs;
>
> +       pm_runtime_enable(dev);
> +       pm_runtime_get_sync(dev);

The second line keeps the device powered all the time.
What about setting spi_controller.auto_runtime_pm = true, so the SPI
code can manage its Runtime PM status?

> +
>         /* Basic HW init */
>         spi_hw_init(dev, dws);
>

What about the error path?
Don't you need to disable Runtime PM again in dw_spi_remove_host()?

I assume this will be called from drivers/spi/spi-dw-mmio.c, which already
enables the clock explicitly all the timer?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-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

  reply	other threads:[~2019-09-16 14:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 12:11 [PATCH 0/3] spi: dw: Add basic runtime PM support Gareth Williams
2019-09-13 12:11 ` [PATCH 1/3] dt: spi: Add Renesas RZ/N1 binding documentation Gareth Williams
2019-09-13 12:11 ` [PATCH 2/3] spi: dw: Add basic runtime PM support Gareth Williams
2019-09-16 14:36   ` Geert Uytterhoeven [this message]
2019-09-16 16:14     ` Gareth Williams
2019-09-17  6:36       ` Geert Uytterhoeven
2019-09-17  9:34         ` Gareth Williams
2019-09-13 12:12 ` [PATCH 3/3] spi: dw: Add compatible string for Renesas RZ/N1 SPI Controller Gareth Williams
2019-09-15 11:00   ` Andy Shevchenko
2019-09-15 11:22     ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdUnzmYEcp0B5MG7itB1JHtNL7Stj9S2EFB0U0y_naQVBQ@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=broonie@kernel.org \
    --cc=gareth.williams.jx@renesas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=phil.edworthy@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).