* [PATCH 0/2] Fixes in hwmod reset code @ 2012-03-13 13:55 Rajendra Nayak 2012-03-13 13:55 ` [PATCH 1/2] ARM: omap: hwmod: Restore sysc after a reset Rajendra Nayak 2012-03-13 13:55 ` [PATCH 2/2] ARM: omap: hwmod: Make omap_hwmod_softreset wait for reset status Rajendra Nayak 0 siblings, 2 replies; 6+ messages in thread From: Rajendra Nayak @ 2012-03-13 13:55 UTC (permalink / raw) To: linux-arm-kernel This fixes a couple of issues around hwmod reset APIs'. Patches are based on 3.3.-rc7. Rajendra Nayak (2): ARM: omap: hwmod: Restore sysc after a reset ARM: omap: hwmod: Make omap_hwmod_softreset wait for reset status arch/arm/mach-omap2/omap_hwmod.c | 18 +++++++----------- 1 files changed, 7 insertions(+), 11 deletions(-) ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: omap: hwmod: Restore sysc after a reset 2012-03-13 13:55 [PATCH 0/2] Fixes in hwmod reset code Rajendra Nayak @ 2012-03-13 13:55 ` Rajendra Nayak 2012-04-04 15:41 ` Paul Walmsley 2012-03-13 13:55 ` [PATCH 2/2] ARM: omap: hwmod: Make omap_hwmod_softreset wait for reset status Rajendra Nayak 1 sibling, 1 reply; 6+ messages in thread From: Rajendra Nayak @ 2012-03-13 13:55 UTC (permalink / raw) To: linux-arm-kernel After a softreset, make sure the sysc settings are correctly restored. Reported-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Rajendra Nayak <rnayak@ti.com> Cc: Benoit Cousson <b-cousson@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Shubhrajyoti D <shubhrajyoti@ti.com> --- arch/arm/mach-omap2/omap_hwmod.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index eba6cd3..ae56939 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -2270,6 +2270,10 @@ int omap_hwmod_reset(struct omap_hwmod *oh) spin_lock_irqsave(&oh->_lock, flags); r = _reset(oh); + if (oh->class->sysc) { + _update_sysc_cache(oh); + _enable_sysc(oh); + } spin_unlock_irqrestore(&oh->_lock, flags); return r; -- 1.7.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: omap: hwmod: Restore sysc after a reset 2012-03-13 13:55 ` [PATCH 1/2] ARM: omap: hwmod: Restore sysc after a reset Rajendra Nayak @ 2012-04-04 15:41 ` Paul Walmsley 2012-04-05 7:11 ` Rajendra Nayak 0 siblings, 1 reply; 6+ messages in thread From: Paul Walmsley @ 2012-04-04 15:41 UTC (permalink / raw) To: linux-arm-kernel On Tue, 13 Mar 2012, Rajendra Nayak wrote: > After a softreset, make sure the sysc settings are correctly > restored. > > Reported-by: Anand Gadiyar <gadiyar@ti.com> > Signed-off-by: Rajendra Nayak <rnayak@ti.com> > Cc: Benoit Cousson <b-cousson@ti.com> > Cc: Paul Walmsley <paul@pwsan.com> > Cc: Shubhrajyoti D <shubhrajyoti@ti.com> Thanks, this patch has been modified a bit to consolidate the SYSCONFIG reload after _reset() into the _reset() function itself. This should hopefully avoid future mistakes and avoid some code duplication. Modified patch follows, queued for 3.4-rc. - Paul From: Rajendra Nayak <rnayak@ti.com> Date: Tue, 13 Mar 2012 22:55:23 +0530 Subject: [PATCH] ARM: OMAP2+: hwmod: Restore sysc after a reset After a softreset, make sure the sysc settings are correctly restored. Reported-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Rajendra Nayak <rnayak@ti.com> Cc: Benoit Cousson <b-cousson@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Shubhrajyoti D <shubhrajyoti@ti.com> [paul at pwsan.com: combined post-reset SYSCONFIG reload code into the _reset() function to avoid duplication and future mistakes] Signed-off-by: Paul Walmsley <paul@pwsan.com> --- arch/arm/mach-omap2/omap_hwmod.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 5a68010..d32c1ce 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -1477,6 +1477,11 @@ static int _reset(struct omap_hwmod *oh) ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); + if (oh->class->sysc) { + _update_sysc_cache(oh); + _enable_sysc(oh); + } + return ret; } @@ -1786,20 +1791,9 @@ static int _setup(struct omap_hwmod *oh, void *data) return 0; } - if (!(oh->flags & HWMOD_INIT_NO_RESET)) { + if (!(oh->flags & HWMOD_INIT_NO_RESET)) _reset(oh); - /* - * OCP_SYSCONFIG bits need to be reprogrammed after a softreset. - * The _enable() function should be split to - * avoid the rewrite of the OCP_SYSCONFIG register. - */ - if (oh->class->sysc) { - _update_sysc_cache(oh); - _enable_sysc(oh); - } - } - postsetup_state = oh->_postsetup_state; if (postsetup_state == _HWMOD_STATE_UNKNOWN) postsetup_state = _HWMOD_STATE_ENABLED; -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: omap: hwmod: Restore sysc after a reset 2012-04-04 15:41 ` Paul Walmsley @ 2012-04-05 7:11 ` Rajendra Nayak 0 siblings, 0 replies; 6+ messages in thread From: Rajendra Nayak @ 2012-04-05 7:11 UTC (permalink / raw) To: linux-arm-kernel On Wednesday 04 April 2012 09:11 PM, Paul Walmsley wrote: > On Tue, 13 Mar 2012, Rajendra Nayak wrote: > >> After a softreset, make sure the sysc settings are correctly >> restored. >> >> Reported-by: Anand Gadiyar<gadiyar@ti.com> >> Signed-off-by: Rajendra Nayak<rnayak@ti.com> >> Cc: Benoit Cousson<b-cousson@ti.com> >> Cc: Paul Walmsley<paul@pwsan.com> >> Cc: Shubhrajyoti D<shubhrajyoti@ti.com> > > Thanks, this patch has been modified a bit to consolidate the SYSCONFIG > reload after _reset() into the _reset() function itself. This should > hopefully avoid future mistakes and avoid some code duplication. Modified > patch follows, queued for 3.4-rc. Thanks, changes look good. > > > - Paul > > > From: Rajendra Nayak<rnayak@ti.com> > Date: Tue, 13 Mar 2012 22:55:23 +0530 > Subject: [PATCH] ARM: OMAP2+: hwmod: Restore sysc after a reset > > After a softreset, make sure the sysc settings are correctly > restored. > > Reported-by: Anand Gadiyar<gadiyar@ti.com> > Signed-off-by: Rajendra Nayak<rnayak@ti.com> > Cc: Benoit Cousson<b-cousson@ti.com> > Cc: Paul Walmsley<paul@pwsan.com> > Cc: Shubhrajyoti D<shubhrajyoti@ti.com> > [paul at pwsan.com: combined post-reset SYSCONFIG reload code into the > _reset() function to avoid duplication and future mistakes] > Signed-off-by: Paul Walmsley<paul@pwsan.com> > --- > arch/arm/mach-omap2/omap_hwmod.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c > index 5a68010..d32c1ce 100644 > --- a/arch/arm/mach-omap2/omap_hwmod.c > +++ b/arch/arm/mach-omap2/omap_hwmod.c > @@ -1477,6 +1477,11 @@ static int _reset(struct omap_hwmod *oh) > > ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); > > + if (oh->class->sysc) { > + _update_sysc_cache(oh); > + _enable_sysc(oh); > + } > + > return ret; > } > > @@ -1786,20 +1791,9 @@ static int _setup(struct omap_hwmod *oh, void *data) > return 0; > } > > - if (!(oh->flags& HWMOD_INIT_NO_RESET)) { > + if (!(oh->flags& HWMOD_INIT_NO_RESET)) > _reset(oh); > > - /* > - * OCP_SYSCONFIG bits need to be reprogrammed after a softreset. > - * The _enable() function should be split to > - * avoid the rewrite of the OCP_SYSCONFIG register. > - */ > - if (oh->class->sysc) { > - _update_sysc_cache(oh); > - _enable_sysc(oh); > - } > - } > - > postsetup_state = oh->_postsetup_state; > if (postsetup_state == _HWMOD_STATE_UNKNOWN) > postsetup_state = _HWMOD_STATE_ENABLED; ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] ARM: omap: hwmod: Make omap_hwmod_softreset wait for reset status 2012-03-13 13:55 [PATCH 0/2] Fixes in hwmod reset code Rajendra Nayak 2012-03-13 13:55 ` [PATCH 1/2] ARM: omap: hwmod: Restore sysc after a reset Rajendra Nayak @ 2012-03-13 13:55 ` Rajendra Nayak 2012-03-13 13:59 ` Rajendra Nayak 1 sibling, 1 reply; 6+ messages in thread From: Rajendra Nayak @ 2012-03-13 13:55 UTC (permalink / raw) To: linux-arm-kernel omap_hwmod_softreset() does not seem to wait for reset status after doing a softreset. Make it use _ocp_softreset() instead which does this correctly. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Cc: Benoit Cousson <b-cousson@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Anand Gadiyar <gadiyar@ti.com> Cc: Shubhrajyoti D <shubhrajyoti@ti.com> --- arch/arm/mach-omap2/omap_hwmod.c | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index ae56939..9b49440 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -1907,20 +1907,12 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs) */ int omap_hwmod_softreset(struct omap_hwmod *oh) { - u32 v; - int ret; - - if (!oh || !(oh->_sysc_cache)) + if (!oh) return -EINVAL; - v = oh->_sysc_cache; - ret = _set_softreset(oh, &v); - if (ret) - goto error; - _write_sysconfig(v, oh); + _ocp_softreset(oh); -error: - return ret; + return 0; } /** -- 1.7.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ARM: omap: hwmod: Make omap_hwmod_softreset wait for reset status 2012-03-13 13:55 ` [PATCH 2/2] ARM: omap: hwmod: Make omap_hwmod_softreset wait for reset status Rajendra Nayak @ 2012-03-13 13:59 ` Rajendra Nayak 0 siblings, 0 replies; 6+ messages in thread From: Rajendra Nayak @ 2012-03-13 13:59 UTC (permalink / raw) To: linux-arm-kernel On Tuesday 13 March 2012 07:25 PM, Rajendra Nayak wrote: > omap_hwmod_softreset() does not seem to wait for reset status > after doing a softreset. Make it use _ocp_softreset() instead > which does this correctly. > > Signed-off-by: Rajendra Nayak<rnayak@ti.com> > Cc: Benoit Cousson<b-cousson@ti.com> > Cc: Paul Walmsley<paul@pwsan.com> > Cc: Anand Gadiyar<gadiyar@ti.com> > Cc: Shubhrajyoti D<shubhrajyoti@ti.com> > --- > arch/arm/mach-omap2/omap_hwmod.c | 14 +++----------- > 1 files changed, 3 insertions(+), 11 deletions(-) > > diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c > index ae56939..9b49440 100644 > --- a/arch/arm/mach-omap2/omap_hwmod.c > +++ b/arch/arm/mach-omap2/omap_hwmod.c > @@ -1907,20 +1907,12 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs) > */ > int omap_hwmod_softreset(struct omap_hwmod *oh) > { > - u32 v; > - int ret; > - > - if (!oh || !(oh->_sysc_cache)) > + if (!oh) > return -EINVAL; > > - v = oh->_sysc_cache; > - ret = _set_softreset(oh,&v); > - if (ret) > - goto error; > - _write_sysconfig(v, oh); > + _ocp_softreset(oh); > > -error: > - return ret; > + return 0; Just realized, this should be 'return _ocp_softreset(oh);' instead. will fix and repost. > } > > /** ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-04-05 7:11 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-03-13 13:55 [PATCH 0/2] Fixes in hwmod reset code Rajendra Nayak 2012-03-13 13:55 ` [PATCH 1/2] ARM: omap: hwmod: Restore sysc after a reset Rajendra Nayak 2012-04-04 15:41 ` Paul Walmsley 2012-04-05 7:11 ` Rajendra Nayak 2012-03-13 13:55 ` [PATCH 2/2] ARM: omap: hwmod: Make omap_hwmod_softreset wait for reset status Rajendra Nayak 2012-03-13 13:59 ` Rajendra Nayak
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).