All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
@ 2015-07-23 13:25 ` Lokesh Vutla
  0 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-07-23 13:25 UTC (permalink / raw)
  To: paul, linux-omap; +Cc: t-kristo, lokeshvutla, nsekhar, linux-arm-kernel

This series implements lock and unlock functions for RTC and hooks
the same to DRA7 and AMx3xx hwmod.
This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
which is queued recently by Paul.

Changes since v2:
- Add kerneldoc for omap_hwmod_rtc_lock() function.

Lokesh Vutla (3):
  ARM: hwmod: RTC: Add lock and unlock functions
  ARM: DRA7: RTC: Add lock and unlock functions
  ARM: AMx3xx: RTC: Add lock and unlock functions

 arch/arm/mach-omap2/omap_hwmod.h                   |  2 +
 .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |  2 +
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c          |  2 +
 arch/arm/mach-omap2/omap_hwmod_reset.c             | 65 ++++++++++++++++++++++
 4 files changed, 71 insertions(+)

-- 
2.1.4

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

* [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
@ 2015-07-23 13:25 ` Lokesh Vutla
  0 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-07-23 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

This series implements lock and unlock functions for RTC and hooks
the same to DRA7 and AMx3xx hwmod.
This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
which is queued recently by Paul.

Changes since v2:
- Add kerneldoc for omap_hwmod_rtc_lock() function.

Lokesh Vutla (3):
  ARM: hwmod: RTC: Add lock and unlock functions
  ARM: DRA7: RTC: Add lock and unlock functions
  ARM: AMx3xx: RTC: Add lock and unlock functions

 arch/arm/mach-omap2/omap_hwmod.h                   |  2 +
 .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |  2 +
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c          |  2 +
 arch/arm/mach-omap2/omap_hwmod_reset.c             | 65 ++++++++++++++++++++++
 4 files changed, 71 insertions(+)

-- 
2.1.4

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

* [PATCH v3 1/3] ARM: hwmod: RTC: Add lock and unlock functions
  2015-07-23 13:25 ` Lokesh Vutla
@ 2015-07-23 13:25   ` Lokesh Vutla
  -1 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-07-23 13:25 UTC (permalink / raw)
  To: paul, linux-omap; +Cc: t-kristo, lokeshvutla, nsekhar, linux-arm-kernel

RTC IP have kicker feature which prevents spurious writes to its registers.
In order to write into any of the RTC registers, KICK values has to be
written to KICK registers.
Introduce omap_hwmod_rtc_unlock/lock functions, which  writes into these
KICK registers inorder to lock and unlock RTC registers.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.h       |  2 ++
 arch/arm/mach-omap2/omap_hwmod_reset.c | 65 ++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index c697b57..173a31e 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -748,6 +748,8 @@ const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
  */
 
 extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh);
+void omap_hwmod_rtc_unlock(struct omap_hwmod *oh);
+void omap_hwmod_rtc_lock(struct omap_hwmod *oh);
 
 /*
  * Chip variant-specific hwmod init routines - XXX should be converted
diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c
index 65e186c..2c51584 100644
--- a/arch/arm/mach-omap2/omap_hwmod_reset.c
+++ b/arch/arm/mach-omap2/omap_hwmod_reset.c
@@ -29,6 +29,16 @@
 #include <sound/aess.h>
 
 #include "omap_hwmod.h"
+#include "common.h"
+
+#define OMAP_RTC_STATUS_REG	0x44
+#define OMAP_RTC_KICK0_REG	0x6c
+#define OMAP_RTC_KICK1_REG	0x70
+
+#define OMAP_RTC_KICK0_VALUE	0x83E70B13
+#define OMAP_RTC_KICK1_VALUE	0x95A4F1E0
+#define OMAP_RTC_STATUS_BUSY	BIT(0)
+#define OMAP_RTC_MAX_READY_TIME	50
 
 /**
  * omap_hwmod_aess_preprogram - enable AESS internal autogating
@@ -51,3 +61,58 @@ int omap_hwmod_aess_preprogram(struct omap_hwmod *oh)
 
 	return 0;
 }
+
+/**
+ * omap_rtc_wait_not_busy - Wait for the RTC BUSY flag
+ * @oh: struct omap_hwmod *
+ *
+ * For updating certain RTC registers, the MPU must wait
+ * for the BUSY status in OMAP_RTC_STATUS_REG to become zero.
+ * Once the BUSY status is zero, there is a 15-μs access
+ * period in which the MPU can program.
+ */
+static void omap_rtc_wait_not_busy(struct omap_hwmod *oh)
+{
+	int i;
+
+	/* BUSY may stay active for 1/32768 second (~30 usec) */
+	omap_test_timeout(omap_hwmod_read(oh, OMAP_RTC_STATUS_REG)
+			  & OMAP_RTC_STATUS_REG, OMAP_RTC_MAX_READY_TIME, i);
+	/* now we have ~15 usec to read/write various registers */
+}
+
+/**
+ * omap_hwmod_rtc_unlock - Unlock the Kicker mechanism.
+ * @oh: struct omap_hwmod *
+ *
+ * RTC IP have kicker feature. This prevents spurious writes to its registers.
+ * In order to write into any of the RTC registers, KICK values has te be
+ * written in respective KICK registers. This is needed for hwmod to write into
+ * sysconfig register.
+ */
+void omap_hwmod_rtc_unlock(struct omap_hwmod *oh)
+{
+	local_irq_disable();
+	omap_rtc_wait_not_busy(oh);
+	omap_hwmod_write(OMAP_RTC_KICK0_VALUE, oh, OMAP_RTC_KICK0_REG);
+	omap_hwmod_write(OMAP_RTC_KICK1_VALUE, oh, OMAP_RTC_KICK1_REG);
+	local_irq_enable();
+}
+
+/**
+ * omap_hwmod_rtc_lock - Lock the Kicker mechanism.
+ * @oh: struct omap_hwmod *
+ *
+ * RTC IP have kicker feature. This prevents spurious writes to its registers.
+ * Once the RTC registers are written, KICK mechanism needs to be locked,
+ * in order to prevent any spurious writes. This function locks back the RTC
+ * registers once hwmod completes its write into sysconfig register.
+ */
+void omap_hwmod_rtc_lock(struct omap_hwmod *oh)
+{
+	local_irq_disable();
+	omap_rtc_wait_not_busy(oh);
+	omap_hwmod_write(0x0, oh, OMAP_RTC_KICK0_REG);
+	omap_hwmod_write(0x0, oh, OMAP_RTC_KICK1_REG);
+	local_irq_enable();
+}
-- 
2.1.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 1/3] ARM: hwmod: RTC: Add lock and unlock functions
@ 2015-07-23 13:25   ` Lokesh Vutla
  0 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-07-23 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

RTC IP have kicker feature which prevents spurious writes to its registers.
In order to write into any of the RTC registers, KICK values has to be
written to KICK registers.
Introduce omap_hwmod_rtc_unlock/lock functions, which  writes into these
KICK registers inorder to lock and unlock RTC registers.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.h       |  2 ++
 arch/arm/mach-omap2/omap_hwmod_reset.c | 65 ++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h
index c697b57..173a31e 100644
--- a/arch/arm/mach-omap2/omap_hwmod.h
+++ b/arch/arm/mach-omap2/omap_hwmod.h
@@ -748,6 +748,8 @@ const char *omap_hwmod_get_main_clk(struct omap_hwmod *oh);
  */
 
 extern int omap_hwmod_aess_preprogram(struct omap_hwmod *oh);
+void omap_hwmod_rtc_unlock(struct omap_hwmod *oh);
+void omap_hwmod_rtc_lock(struct omap_hwmod *oh);
 
 /*
  * Chip variant-specific hwmod init routines - XXX should be converted
diff --git a/arch/arm/mach-omap2/omap_hwmod_reset.c b/arch/arm/mach-omap2/omap_hwmod_reset.c
index 65e186c..2c51584 100644
--- a/arch/arm/mach-omap2/omap_hwmod_reset.c
+++ b/arch/arm/mach-omap2/omap_hwmod_reset.c
@@ -29,6 +29,16 @@
 #include <sound/aess.h>
 
 #include "omap_hwmod.h"
+#include "common.h"
+
+#define OMAP_RTC_STATUS_REG	0x44
+#define OMAP_RTC_KICK0_REG	0x6c
+#define OMAP_RTC_KICK1_REG	0x70
+
+#define OMAP_RTC_KICK0_VALUE	0x83E70B13
+#define OMAP_RTC_KICK1_VALUE	0x95A4F1E0
+#define OMAP_RTC_STATUS_BUSY	BIT(0)
+#define OMAP_RTC_MAX_READY_TIME	50
 
 /**
  * omap_hwmod_aess_preprogram - enable AESS internal autogating
@@ -51,3 +61,58 @@ int omap_hwmod_aess_preprogram(struct omap_hwmod *oh)
 
 	return 0;
 }
+
+/**
+ * omap_rtc_wait_not_busy - Wait for the RTC BUSY flag
+ * @oh: struct omap_hwmod *
+ *
+ * For updating certain RTC registers, the MPU must wait
+ * for the BUSY status in OMAP_RTC_STATUS_REG to become zero.
+ * Once the BUSY status is zero, there is a 15-?s access
+ * period in which the MPU can program.
+ */
+static void omap_rtc_wait_not_busy(struct omap_hwmod *oh)
+{
+	int i;
+
+	/* BUSY may stay active for 1/32768 second (~30 usec) */
+	omap_test_timeout(omap_hwmod_read(oh, OMAP_RTC_STATUS_REG)
+			  & OMAP_RTC_STATUS_REG, OMAP_RTC_MAX_READY_TIME, i);
+	/* now we have ~15 usec to read/write various registers */
+}
+
+/**
+ * omap_hwmod_rtc_unlock - Unlock the Kicker mechanism.
+ * @oh: struct omap_hwmod *
+ *
+ * RTC IP have kicker feature. This prevents spurious writes to its registers.
+ * In order to write into any of the RTC registers, KICK values has te be
+ * written in respective KICK registers. This is needed for hwmod to write into
+ * sysconfig register.
+ */
+void omap_hwmod_rtc_unlock(struct omap_hwmod *oh)
+{
+	local_irq_disable();
+	omap_rtc_wait_not_busy(oh);
+	omap_hwmod_write(OMAP_RTC_KICK0_VALUE, oh, OMAP_RTC_KICK0_REG);
+	omap_hwmod_write(OMAP_RTC_KICK1_VALUE, oh, OMAP_RTC_KICK1_REG);
+	local_irq_enable();
+}
+
+/**
+ * omap_hwmod_rtc_lock - Lock the Kicker mechanism.
+ * @oh: struct omap_hwmod *
+ *
+ * RTC IP have kicker feature. This prevents spurious writes to its registers.
+ * Once the RTC registers are written, KICK mechanism needs to be locked,
+ * in order to prevent any spurious writes. This function locks back the RTC
+ * registers once hwmod completes its write into sysconfig register.
+ */
+void omap_hwmod_rtc_lock(struct omap_hwmod *oh)
+{
+	local_irq_disable();
+	omap_rtc_wait_not_busy(oh);
+	omap_hwmod_write(0x0, oh, OMAP_RTC_KICK0_REG);
+	omap_hwmod_write(0x0, oh, OMAP_RTC_KICK1_REG);
+	local_irq_enable();
+}
-- 
2.1.4

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

* [PATCH v3 2/3] ARM: DRA7: RTC: Add lock and unlock functions
  2015-07-23 13:25 ` Lokesh Vutla
@ 2015-07-23 13:25   ` Lokesh Vutla
  -1 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-07-23 13:25 UTC (permalink / raw)
  To: paul, linux-omap; +Cc: t-kristo, lokeshvutla, nsekhar, linux-arm-kernel

Hook omap_hwmod_rtc_unlock/lock functions into RTC hwmod,
so that SYSCONFIG register is updated properly

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index 2606c66..95d9bc5c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -1572,6 +1572,8 @@ static struct omap_hwmod_class_sysconfig dra7xx_rtcss_sysc = {
 static struct omap_hwmod_class dra7xx_rtcss_hwmod_class = {
 	.name	= "rtcss",
 	.sysc	= &dra7xx_rtcss_sysc,
+	.unlock	= &omap_hwmod_rtc_unlock,
+	.lock	= &omap_hwmod_rtc_lock,
 };
 
 /* rtcss */
-- 
2.1.4

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

* [PATCH v3 2/3] ARM: DRA7: RTC: Add lock and unlock functions
@ 2015-07-23 13:25   ` Lokesh Vutla
  0 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-07-23 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hook omap_hwmod_rtc_unlock/lock functions into RTC hwmod,
so that SYSCONFIG register is updated properly

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_7xx_data.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
index 2606c66..95d9bc5c 100644
--- a/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_7xx_data.c
@@ -1572,6 +1572,8 @@ static struct omap_hwmod_class_sysconfig dra7xx_rtcss_sysc = {
 static struct omap_hwmod_class dra7xx_rtcss_hwmod_class = {
 	.name	= "rtcss",
 	.sysc	= &dra7xx_rtcss_sysc,
+	.unlock	= &omap_hwmod_rtc_unlock,
+	.lock	= &omap_hwmod_rtc_lock,
 };
 
 /* rtcss */
-- 
2.1.4

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

* [PATCH v3 3/3] ARM: AMx3xx: RTC: Add lock and unlock functions
  2015-07-23 13:25 ` Lokesh Vutla
@ 2015-07-23 13:25   ` Lokesh Vutla
  -1 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-07-23 13:25 UTC (permalink / raw)
  To: paul, linux-omap; +Cc: t-kristo, lokeshvutla, nsekhar, linux-arm-kernel

Hook omap_hwmod_rtc_unlock/lock functions into RTC hwmod,
so that SYSCONFIG register is updated properly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index 907a452b..aed3362 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -918,6 +918,8 @@ static struct omap_hwmod_class_sysconfig am33xx_rtc_sysc = {
 static struct omap_hwmod_class am33xx_rtc_hwmod_class = {
 	.name		= "rtc",
 	.sysc		= &am33xx_rtc_sysc,
+	.unlock		= &omap_hwmod_rtc_unlock,
+	.lock		= &omap_hwmod_rtc_lock,
 };
 
 struct omap_hwmod am33xx_rtc_hwmod = {
-- 
2.1.4

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

* [PATCH v3 3/3] ARM: AMx3xx: RTC: Add lock and unlock functions
@ 2015-07-23 13:25   ` Lokesh Vutla
  0 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-07-23 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

Hook omap_hwmod_rtc_unlock/lock functions into RTC hwmod,
so that SYSCONFIG register is updated properly.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index 907a452b..aed3362 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -918,6 +918,8 @@ static struct omap_hwmod_class_sysconfig am33xx_rtc_sysc = {
 static struct omap_hwmod_class am33xx_rtc_hwmod_class = {
 	.name		= "rtc",
 	.sysc		= &am33xx_rtc_sysc,
+	.unlock		= &omap_hwmod_rtc_unlock,
+	.lock		= &omap_hwmod_rtc_lock,
 };
 
 struct omap_hwmod am33xx_rtc_hwmod = {
-- 
2.1.4

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

* Re: [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
  2015-07-23 13:25 ` Lokesh Vutla
@ 2015-08-27  4:21   ` Lokesh Vutla
  -1 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-08-27  4:21 UTC (permalink / raw)
  To: Lokesh Vutla, paul, linux-omap; +Cc: t-kristo, tony, nsekhar, linux-arm-kernel

Hi Paul,

On Thursday 23 July 2015 06:55 PM, Lokesh Vutla wrote:
> This series implements lock and unlock functions for RTC and hooks
> the same to DRA7 and AMx3xx hwmod.
> This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
> which is queued recently by Paul.
Gentle ping on this series.

Thanks and regards,
Lokesh
> 
> Changes since v2:
> - Add kerneldoc for omap_hwmod_rtc_lock() function.
> 
> Lokesh Vutla (3):
>   ARM: hwmod: RTC: Add lock and unlock functions
>   ARM: DRA7: RTC: Add lock and unlock functions
>   ARM: AMx3xx: RTC: Add lock and unlock functions
> 
>  arch/arm/mach-omap2/omap_hwmod.h                   |  2 +
>  .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |  2 +
>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c          |  2 +
>  arch/arm/mach-omap2/omap_hwmod_reset.c             | 65 ++++++++++++++++++++++
>  4 files changed, 71 insertions(+)
> 

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

* [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
@ 2015-08-27  4:21   ` Lokesh Vutla
  0 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-08-27  4:21 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On Thursday 23 July 2015 06:55 PM, Lokesh Vutla wrote:
> This series implements lock and unlock functions for RTC and hooks
> the same to DRA7 and AMx3xx hwmod.
> This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
> which is queued recently by Paul.
Gentle ping on this series.

Thanks and regards,
Lokesh
> 
> Changes since v2:
> - Add kerneldoc for omap_hwmod_rtc_lock() function.
> 
> Lokesh Vutla (3):
>   ARM: hwmod: RTC: Add lock and unlock functions
>   ARM: DRA7: RTC: Add lock and unlock functions
>   ARM: AMx3xx: RTC: Add lock and unlock functions
> 
>  arch/arm/mach-omap2/omap_hwmod.h                   |  2 +
>  .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |  2 +
>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c          |  2 +
>  arch/arm/mach-omap2/omap_hwmod_reset.c             | 65 ++++++++++++++++++++++
>  4 files changed, 71 insertions(+)
> 

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

* Re: [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
  2015-08-27  4:21   ` Lokesh Vutla
@ 2015-09-24  4:45     ` Lokesh Vutla
  -1 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-09-24  4:45 UTC (permalink / raw)
  To: Lokesh Vutla, paul, linux-omap; +Cc: t-kristo, tony, nsekhar, linux-arm-kernel

Hi Paul,

On Thursday 27 August 2015 09:51 AM, Lokesh Vutla wrote:
> Hi Paul,
> 
> On Thursday 23 July 2015 06:55 PM, Lokesh Vutla wrote:
>> This series implements lock and unlock functions for RTC and hooks
>> the same to DRA7 and AMx3xx hwmod.
>> This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
>> which is queued recently by Paul.
> Gentle ping on this series.
Do you have any comments on this series?

Thanks and regards,
Lokesh
> 
> Thanks and regards,
> Lokesh
>>
>> Changes since v2:
>> - Add kerneldoc for omap_hwmod_rtc_lock() function.
>>
>> Lokesh Vutla (3):
>>   ARM: hwmod: RTC: Add lock and unlock functions
>>   ARM: DRA7: RTC: Add lock and unlock functions
>>   ARM: AMx3xx: RTC: Add lock and unlock functions
>>
>>  arch/arm/mach-omap2/omap_hwmod.h                   |  2 +
>>  .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |  2 +
>>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c          |  2 +
>>  arch/arm/mach-omap2/omap_hwmod_reset.c             | 65 ++++++++++++++++++++++
>>  4 files changed, 71 insertions(+)
>>

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

* [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
@ 2015-09-24  4:45     ` Lokesh Vutla
  0 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-09-24  4:45 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On Thursday 27 August 2015 09:51 AM, Lokesh Vutla wrote:
> Hi Paul,
> 
> On Thursday 23 July 2015 06:55 PM, Lokesh Vutla wrote:
>> This series implements lock and unlock functions for RTC and hooks
>> the same to DRA7 and AMx3xx hwmod.
>> This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
>> which is queued recently by Paul.
> Gentle ping on this series.
Do you have any comments on this series?

Thanks and regards,
Lokesh
> 
> Thanks and regards,
> Lokesh
>>
>> Changes since v2:
>> - Add kerneldoc for omap_hwmod_rtc_lock() function.
>>
>> Lokesh Vutla (3):
>>   ARM: hwmod: RTC: Add lock and unlock functions
>>   ARM: DRA7: RTC: Add lock and unlock functions
>>   ARM: AMx3xx: RTC: Add lock and unlock functions
>>
>>  arch/arm/mach-omap2/omap_hwmod.h                   |  2 +
>>  .../mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c |  2 +
>>  arch/arm/mach-omap2/omap_hwmod_7xx_data.c          |  2 +
>>  arch/arm/mach-omap2/omap_hwmod_reset.c             | 65 ++++++++++++++++++++++
>>  4 files changed, 71 insertions(+)
>>

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

* Re: [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
  2015-09-24  4:45     ` Lokesh Vutla
@ 2015-09-28 16:35       ` Paul Walmsley
  -1 siblings, 0 replies; 16+ messages in thread
From: Paul Walmsley @ 2015-09-28 16:35 UTC (permalink / raw)
  To: Lokesh Vutla
  Cc: Lokesh Vutla, nsekhar, t-kristo, tony, linux-omap, linux-arm-kernel

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1314 bytes --]

On Thu, 24 Sep 2015, Lokesh Vutla wrote:

> On Thursday 27 August 2015 09:51 AM, Lokesh Vutla wrote:
> > On Thursday 23 July 2015 06:55 PM, Lokesh Vutla wrote:
> >> This series implements lock and unlock functions for RTC and hooks
> >> the same to DRA7 and AMx3xx hwmod.
> >> This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
> >> which is queued recently by Paul.
> > Gentle ping on this series.
> Do you have any comments on this series?

Looks pretty good.  I'm slightly concerned about the latency jitter impact 
on -rt kernels for that local_irq_disable() section.  Looks like it could 
hold off interrupts for ~(50 udelay µs) + 50*((RTC register read time) + 
1).  But I'm not sure if preempt_enable/disable() is a good alternative 
since a bunch of interrupt top halves could conceivably run after the RTC 
goes non-busy and result in the RTC not being locked/unlocked.  

Is there an RTC IP block register that the code can read, or a safe 
sequence that the code can execute, after the RTC lock/unlock operation to 
verify that the RTC has successfully been locked or unlocked?  If so then 
it's probably worth converting the local_irq_disable/enable() to 
preempt_disable/enable() and testing that, then retrying the lock/unlock 
if it fails.


- Paul

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
@ 2015-09-28 16:35       ` Paul Walmsley
  0 siblings, 0 replies; 16+ messages in thread
From: Paul Walmsley @ 2015-09-28 16:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 24 Sep 2015, Lokesh Vutla wrote:

> On Thursday 27 August 2015 09:51 AM, Lokesh Vutla wrote:
> > On Thursday 23 July 2015 06:55 PM, Lokesh Vutla wrote:
> >> This series implements lock and unlock functions for RTC and hooks
> >> the same to DRA7 and AMx3xx hwmod.
> >> This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
> >> which is queued recently by Paul.
> > Gentle ping on this series.
> Do you have any comments on this series?

Looks pretty good.  I'm slightly concerned about the latency jitter impact 
on -rt kernels for that local_irq_disable() section.  Looks like it could 
hold off interrupts for ~(50 udelay ?s) + 50*((RTC register read time) + 
1).  But I'm not sure if preempt_enable/disable() is a good alternative 
since a bunch of interrupt top halves could conceivably run after the RTC 
goes non-busy and result in the RTC not being locked/unlocked.  

Is there an RTC IP block register that the code can read, or a safe 
sequence that the code can execute, after the RTC lock/unlock operation to 
verify that the RTC has successfully been locked or unlocked?  If so then 
it's probably worth converting the local_irq_disable/enable() to 
preempt_disable/enable() and testing that, then retrying the lock/unlock 
if it fails.


- Paul

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

* Re: [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
  2015-09-28 16:35       ` Paul Walmsley
@ 2015-09-29  3:53         ` Lokesh Vutla
  -1 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-09-29  3:53 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Lokesh Vutla, nsekhar, t-kristo, tony, linux-omap, linux-arm-kernel

Hi Paul,

On Monday 28 September 2015 10:05 PM, Paul Walmsley wrote:
> On Thu, 24 Sep 2015, Lokesh Vutla wrote:
> 
>> On Thursday 27 August 2015 09:51 AM, Lokesh Vutla wrote:
>>> On Thursday 23 July 2015 06:55 PM, Lokesh Vutla wrote:
>>>> This series implements lock and unlock functions for RTC and hooks
>>>> the same to DRA7 and AMx3xx hwmod.
>>>> This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
>>>> which is queued recently by Paul.
>>> Gentle ping on this series.
>> Do you have any comments on this series?
> 
> Looks pretty good.  I'm slightly concerned about the latency jitter impact 
> on -rt kernels for that local_irq_disable() section.  Looks like it could 
> hold off interrupts for ~(50 udelay µs) + 50*((RTC register read time) + 
> 1).  But I'm not sure if preempt_enable/disable() is a good alternative 
> since a bunch of interrupt top halves could conceivably run after the RTC 
> goes non-busy and result in the RTC not being locked/unlocked. 
Agree.

> 
> Is there an RTC IP block register that the code can read, or a safe 
> sequence that the code can execute, after the RTC lock/unlock operation to 
> verify that the RTC has successfully been locked or unlocked?  If so then 
> it's probably worth converting the local_irq_disable/enable() to 
> preempt_disable/enable() and testing that, then retrying the lock/unlock 
> if it fails.
I am afraid there is no such register to verify lock or unlock. Also
these KICK registers are Write only registers so can't read back the
value. Even the driver implement the same api's for writing into registers.

One thing I can think of is that to write a known pattern to scratch pad
register and read back the value to confirm if it is locked/unlocked.
But don't think this is a good approach.

Thanks and regards,
Lokesh

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

* [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks
@ 2015-09-29  3:53         ` Lokesh Vutla
  0 siblings, 0 replies; 16+ messages in thread
From: Lokesh Vutla @ 2015-09-29  3:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On Monday 28 September 2015 10:05 PM, Paul Walmsley wrote:
> On Thu, 24 Sep 2015, Lokesh Vutla wrote:
> 
>> On Thursday 27 August 2015 09:51 AM, Lokesh Vutla wrote:
>>> On Thursday 23 July 2015 06:55 PM, Lokesh Vutla wrote:
>>>> This series implements lock and unlock functions for RTC and hooks
>>>> the same to DRA7 and AMx3xx hwmod.
>>>> This is dependent on the patch https://patchwork.kernel.org/patch/6578281/,
>>>> which is queued recently by Paul.
>>> Gentle ping on this series.
>> Do you have any comments on this series?
> 
> Looks pretty good.  I'm slightly concerned about the latency jitter impact 
> on -rt kernels for that local_irq_disable() section.  Looks like it could 
> hold off interrupts for ~(50 udelay ?s) + 50*((RTC register read time) + 
> 1).  But I'm not sure if preempt_enable/disable() is a good alternative 
> since a bunch of interrupt top halves could conceivably run after the RTC 
> goes non-busy and result in the RTC not being locked/unlocked. 
Agree.

> 
> Is there an RTC IP block register that the code can read, or a safe 
> sequence that the code can execute, after the RTC lock/unlock operation to 
> verify that the RTC has successfully been locked or unlocked?  If so then 
> it's probably worth converting the local_irq_disable/enable() to 
> preempt_disable/enable() and testing that, then retrying the lock/unlock 
> if it fails.
I am afraid there is no such register to verify lock or unlock. Also
these KICK registers are Write only registers so can't read back the
value. Even the driver implement the same api's for writing into registers.

One thing I can think of is that to write a known pattern to scratch pad
register and read back the value to confirm if it is locked/unlocked.
But don't think this is a good approach.

Thanks and regards,
Lokesh

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

end of thread, other threads:[~2015-09-29  3:53 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-23 13:25 [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks Lokesh Vutla
2015-07-23 13:25 ` Lokesh Vutla
2015-07-23 13:25 ` [PATCH v3 1/3] ARM: hwmod: RTC: Add lock and unlock functions Lokesh Vutla
2015-07-23 13:25   ` Lokesh Vutla
2015-07-23 13:25 ` [PATCH v3 2/3] ARM: DRA7: " Lokesh Vutla
2015-07-23 13:25   ` Lokesh Vutla
2015-07-23 13:25 ` [PATCH v3 3/3] ARM: AMx3xx: " Lokesh Vutla
2015-07-23 13:25   ` Lokesh Vutla
2015-08-27  4:21 ` [PATCH v3 0/3] ARM: OMAP2+: hwmod: RTC: Add lock and unlock hooks Lokesh Vutla
2015-08-27  4:21   ` Lokesh Vutla
2015-09-24  4:45   ` Lokesh Vutla
2015-09-24  4:45     ` Lokesh Vutla
2015-09-28 16:35     ` Paul Walmsley
2015-09-28 16:35       ` Paul Walmsley
2015-09-29  3:53       ` Lokesh Vutla
2015-09-29  3:53         ` Lokesh Vutla

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.