* [PATCH/RFC] spi: sh-msiof: Add runtime PM lock in initializing
@ 2014-12-15 14:01 Yoshihiro Kaneko
[not found] ` <1418652071-6396-1-git-send-email-ykaneko0929-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Yoshihiro Kaneko @ 2014-12-15 14:01 UTC (permalink / raw)
To: linux-spi-u79uwXL29TY76Z2rM5mHXA
Cc: Mark Brown, Simon Horman, Magnus Damm, Geert Uytterhoeven,
linux-sh-u79uwXL29TY76Z2rM5mHXA
From: Hisashi Nakamura <hisashi.nakamura.ak-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
SH-MSIOF driver is enabled autosuspend API of spi framework.
But autosuspend framework doesn't work during initializing.
So runtime PM lock is added in SH-MSIOF driver initializing.
Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
This patch is based on the for-next branch of Mark Brown's spi tree.
drivers/spi/spi-sh-msiof.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index 3f36540..1405293 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -480,6 +480,8 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
struct device_node *np = spi->master->dev.of_node;
struct sh_msiof_spi_priv *p = spi_master_get_devdata(spi->master);
+ pm_runtime_get_sync(&p->pdev->dev);
+
if (!np) {
/*
* Use spi->controller_data for CS (same strategy as spi_gpio),
@@ -498,6 +500,9 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
if (spi->cs_gpio >= 0)
gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
+
+ pm_runtime_put_sync(&p->pdev->dev);
+
return 0;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH/RFC] spi: sh-msiof: Add runtime PM lock in initializing
[not found] ` <1418652071-6396-1-git-send-email-ykaneko0929-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2014-12-15 17:39 ` Mark Brown
2014-12-15 18:19 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2014-12-15 17:39 UTC (permalink / raw)
To: Yoshihiro Kaneko
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA, Simon Horman, Magnus Damm,
Geert Uytterhoeven, linux-sh-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 370 bytes --]
On Mon, Dec 15, 2014 at 11:01:11PM +0900, Yoshihiro Kaneko wrote:
> From: Hisashi Nakamura <hisashi.nakamura.ak-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
>
> SH-MSIOF driver is enabled autosuspend API of spi framework.
> But autosuspend framework doesn't work during initializing.
> So runtime PM lock is added in SH-MSIOF driver initializing.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH/RFC] spi: sh-msiof: Add runtime PM lock in initializing
[not found] ` <1418652071-6396-1-git-send-email-ykaneko0929-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-12-15 17:39 ` Mark Brown
@ 2014-12-15 18:19 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2014-12-15 18:19 UTC (permalink / raw)
To: Yoshihiro Kaneko, linux-spi-u79uwXL29TY76Z2rM5mHXA
Cc: Mark Brown, Simon Horman, Magnus Damm, Geert Uytterhoeven,
linux-sh-u79uwXL29TY76Z2rM5mHXA
Hello.
On 12/15/2014 05:01 PM, Yoshihiro Kaneko wrote:
> From: Hisashi Nakamura <hisashi.nakamura.ak-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
> SH-MSIOF driver is enabled autosuspend API of spi framework.
> But autosuspend framework doesn't work during initializing.
> So runtime PM lock is added in SH-MSIOF driver initializing.
> Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak-zM6kxYcvzFBBDgjK7y7TUQ@public.gmane.org>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> This patch is based on the for-next branch of Mark Brown's spi tree.
> drivers/spi/spi-sh-msiof.c | 5 +++++
> 1 file changed, 5 insertions(+)
> diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
> index 3f36540..1405293 100644
> --- a/drivers/spi/spi-sh-msiof.c
> +++ b/drivers/spi/spi-sh-msiof.c
[...]
> @@ -498,6 +500,9 @@ static int sh_msiof_spi_setup(struct spi_device *spi)
> if (spi->cs_gpio >= 0)
> gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH));
>
> +
> + pm_runtime_put_sync(&p->pdev->dev);
> +
Do you really need the sync version here?
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-15 18:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-15 14:01 [PATCH/RFC] spi: sh-msiof: Add runtime PM lock in initializing Yoshihiro Kaneko
[not found] ` <1418652071-6396-1-git-send-email-ykaneko0929-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-12-15 17:39 ` Mark Brown
2014-12-15 18:19 ` Sergei Shtylyov
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).