All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix stm32-rng for default state and suspend
@ 2018-04-23 15:04 ` Lionel Debieve
  0 siblings, 0 replies; 8+ messages in thread
From: Lionel Debieve @ 2018-04-23 15:04 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Alexandre Torgue, Rob Herring, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Ludovic Barre

This series are fixing the default build state for stm32-rng that
activate the driver with arm multi_v7_defconfig.
Second patch is fixing the power suspend/resume behavior which was
not working.

Lionel Debieve (2):
  hwrng: stm32 - define default state for rng driver
  hwrng: stm32-rng: Fix pm_suspend issue

 drivers/char/hw_random/Kconfig     | 1 +
 drivers/char/hw_random/stm32-rng.c | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.15.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Fix stm32-rng for default state and suspend
@ 2018-04-23 15:04 ` Lionel Debieve
  0 siblings, 0 replies; 8+ messages in thread
From: Lionel Debieve @ 2018-04-23 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

This series are fixing the default build state for stm32-rng that
activate the driver with arm multi_v7_defconfig.
Second patch is fixing the power suspend/resume behavior which was
not working.

Lionel Debieve (2):
  hwrng: stm32 - define default state for rng driver
  hwrng: stm32-rng: Fix pm_suspend issue

 drivers/char/hw_random/Kconfig     | 1 +
 drivers/char/hw_random/stm32-rng.c | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.15.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] hwrng: stm32 - define default state for rng driver
  2018-04-23 15:04 ` Lionel Debieve
@ 2018-04-23 15:04   ` Lionel Debieve
  -1 siblings, 0 replies; 8+ messages in thread
From: Lionel Debieve @ 2018-04-23 15:04 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Alexandre Torgue, Rob Herring, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Ludovic Barre

Define default state for stm32_rng driver. It will
be default selected with multi_v7_defconfig

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index d53541e96bee..c34b257d852d 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -347,6 +347,7 @@ config HW_RANDOM_STM32
 	tristate "STMicroelectronics STM32 random number generator"
 	depends on HW_RANDOM && (ARCH_STM32 || COMPILE_TEST)
 	depends on HAS_IOMEM
+	default HW_RANDOM
 	help
 	  This driver provides kernel-side support for the Random Number
 	  Generator hardware found on STM32 microcontrollers.
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/2] hwrng: stm32 - define default state for rng driver
@ 2018-04-23 15:04   ` Lionel Debieve
  0 siblings, 0 replies; 8+ messages in thread
From: Lionel Debieve @ 2018-04-23 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

Define default state for stm32_rng driver. It will
be default selected with multi_v7_defconfig

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig
index d53541e96bee..c34b257d852d 100644
--- a/drivers/char/hw_random/Kconfig
+++ b/drivers/char/hw_random/Kconfig
@@ -347,6 +347,7 @@ config HW_RANDOM_STM32
 	tristate "STMicroelectronics STM32 random number generator"
 	depends on HW_RANDOM && (ARCH_STM32 || COMPILE_TEST)
 	depends on HAS_IOMEM
+	default HW_RANDOM
 	help
 	  This driver provides kernel-side support for the Random Number
 	  Generator hardware found on STM32 microcontrollers.
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] hwrng: stm32-rng - fix pm_suspend issue
  2018-04-23 15:04 ` Lionel Debieve
@ 2018-04-23 15:04   ` Lionel Debieve
  -1 siblings, 0 replies; 8+ messages in thread
From: Lionel Debieve @ 2018-04-23 15:04 UTC (permalink / raw)
  To: Matt Mackall, Herbert Xu, Arnd Bergmann, Greg Kroah-Hartman,
	Maxime Coquelin, Alexandre Torgue, Rob Herring, linux-crypto,
	linux-arm-kernel, linux-kernel
  Cc: Benjamin Gaignard, Ludovic Barre

When suspend is called after pm_runtime_suspend,
same callback is used and access to rng register is
freezing system. By calling the pm_runtime_force_suspend,
it first checks that runtime has been already done.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/stm32-rng.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 0d2328da3b76..042860d97b15 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -187,8 +187,13 @@ static int stm32_rng_runtime_resume(struct device *dev)
 }
 #endif
 
-static UNIVERSAL_DEV_PM_OPS(stm32_rng_pm_ops, stm32_rng_runtime_suspend,
-			    stm32_rng_runtime_resume, NULL);
+static const struct dev_pm_ops stm32_rng_pm_ops = {
+	SET_RUNTIME_PM_OPS(stm32_rng_runtime_suspend,
+			   stm32_rng_runtime_resume, NULL)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
+};
+
 
 static const struct of_device_id stm32_rng_match[] = {
 	{
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] hwrng: stm32-rng - fix pm_suspend issue
@ 2018-04-23 15:04   ` Lionel Debieve
  0 siblings, 0 replies; 8+ messages in thread
From: Lionel Debieve @ 2018-04-23 15:04 UTC (permalink / raw)
  To: linux-arm-kernel

When suspend is called after pm_runtime_suspend,
same callback is used and access to rng register is
freezing system. By calling the pm_runtime_force_suspend,
it first checks that runtime has been already done.

Signed-off-by: Lionel Debieve <lionel.debieve@st.com>
---
 drivers/char/hw_random/stm32-rng.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index 0d2328da3b76..042860d97b15 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -187,8 +187,13 @@ static int stm32_rng_runtime_resume(struct device *dev)
 }
 #endif
 
-static UNIVERSAL_DEV_PM_OPS(stm32_rng_pm_ops, stm32_rng_runtime_suspend,
-			    stm32_rng_runtime_resume, NULL);
+static const struct dev_pm_ops stm32_rng_pm_ops = {
+	SET_RUNTIME_PM_OPS(stm32_rng_runtime_suspend,
+			   stm32_rng_runtime_resume, NULL)
+	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+				pm_runtime_force_resume)
+};
+
 
 static const struct of_device_id stm32_rng_match[] = {
 	{
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] Fix stm32-rng for default state and suspend
  2018-04-23 15:04 ` Lionel Debieve
@ 2018-05-05  7:16   ` Herbert Xu
  -1 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2018-05-05  7:16 UTC (permalink / raw)
  To: Lionel Debieve
  Cc: Matt Mackall, Arnd Bergmann, Greg Kroah-Hartman, Maxime Coquelin,
	Alexandre Torgue, Rob Herring, linux-crypto, linux-arm-kernel,
	linux-kernel, Benjamin Gaignard, Ludovic Barre

On Mon, Apr 23, 2018 at 05:04:24PM +0200, Lionel Debieve wrote:
> This series are fixing the default build state for stm32-rng that
> activate the driver with arm multi_v7_defconfig.
> Second patch is fixing the power suspend/resume behavior which was
> not working.
> 
> Lionel Debieve (2):
>   hwrng: stm32 - define default state for rng driver
>   hwrng: stm32-rng: Fix pm_suspend issue
> 
>  drivers/char/hw_random/Kconfig     | 1 +
>  drivers/char/hw_random/stm32-rng.c | 9 +++++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 0/2] Fix stm32-rng for default state and suspend
@ 2018-05-05  7:16   ` Herbert Xu
  0 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2018-05-05  7:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 23, 2018 at 05:04:24PM +0200, Lionel Debieve wrote:
> This series are fixing the default build state for stm32-rng that
> activate the driver with arm multi_v7_defconfig.
> Second patch is fixing the power suspend/resume behavior which was
> not working.
> 
> Lionel Debieve (2):
>   hwrng: stm32 - define default state for rng driver
>   hwrng: stm32-rng: Fix pm_suspend issue
> 
>  drivers/char/hw_random/Kconfig     | 1 +
>  drivers/char/hw_random/stm32-rng.c | 9 +++++++--
>  2 files changed, 8 insertions(+), 2 deletions(-)

All applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-05-05  7:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-23 15:04 [PATCH 0/2] Fix stm32-rng for default state and suspend Lionel Debieve
2018-04-23 15:04 ` Lionel Debieve
2018-04-23 15:04 ` [PATCH 1/2] hwrng: stm32 - define default state for rng driver Lionel Debieve
2018-04-23 15:04   ` Lionel Debieve
2018-04-23 15:04 ` [PATCH 2/2] hwrng: stm32-rng - fix pm_suspend issue Lionel Debieve
2018-04-23 15:04   ` Lionel Debieve
2018-05-05  7:16 ` [PATCH 0/2] Fix stm32-rng for default state and suspend Herbert Xu
2018-05-05  7:16   ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.