From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tero Kristo Subject: Re: [RFC PATCH] ARM: OMAP2+: Fix updating of sysconfig register Date: Wed, 2 Mar 2016 09:38:43 +0200 Message-ID: <56D69883.6070603@ti.com> References: <1456832887-5312-1-git-send-email-lokeshvutla@ti.com> <56D65FD4.4090206@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <56D65FD4.4090206@ti.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Lokesh Vutla , Paul Walmsley , Lokesh Vutla , jonathanh@nvidia.com Cc: tony@atomide.com, linux-omap@vger.kernel.org, Sekhar Nori , linux-arm-kernel@lists.infradead.org List-Id: linux-omap@vger.kernel.org On 03/02/2016 05:36 AM, Lokesh Vutla wrote: > > > On Tuesday 01 March 2016 10:33 PM, Paul Walmsley wrote: >> + Jon Hunter >> >> On Tue, 1 Mar 2016, Lokesh Vutla wrote: >> >>> commit 127500ccb766f ("ARM: OMAP2+: Only write the sysconfig on idle >>> when necessary") talks about verification of sysconfig cache value before >>> updating it, only during idle path. But the patch is adding the >>> verification in the enable path. So, adding the check in a proper place >>> as per the commit description. >>> >>> Not keeping this check during enable path as there is a chance of losing >>> context and it is safe to do on idle as the context of the register will >>> never be lost while the device is active. > > When the patch was originally posted[1], this check was in proper place > itself. Not sure what happened after that. Looks like a merge conflict to me. The patch from Lokesh fixes it, so: Acked-by: Tero Kristo > > [1] https://www.mail-archive.com/linux-omap%40vger.kernel.org/msg78032.html > > Thanks and regards, > Lokesh > >>> >>> Signed-off-by: Lokesh Vutla >>> --- >>> arch/arm/mach-omap2/omap_hwmod.c | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c >>> index e9f65fe..71b3747 100644 >>> --- a/arch/arm/mach-omap2/omap_hwmod.c >>> +++ b/arch/arm/mach-omap2/omap_hwmod.c >>> @@ -1416,9 +1416,7 @@ static void _enable_sysc(struct omap_hwmod *oh) >>> (sf & SYSC_HAS_CLOCKACTIVITY)) >>> _set_clockactivity(oh, oh->class->sysc->clockact, &v); >>> >>> - /* If the cached value is the same as the new value, skip the write */ >>> - if (oh->_sysc_cache != v) >>> - _write_sysconfig(v, oh); >>> + _write_sysconfig(v, oh); >>> >>> /* >>> * Set the autoidle bit only after setting the smartidle bit >>> @@ -1481,7 +1479,9 @@ static void _idle_sysc(struct omap_hwmod *oh) >>> _set_master_standbymode(oh, idlemode, &v); >>> } >>> >>> - _write_sysconfig(v, oh); >>> + /* If the cached value is the same as the new value, skip the write */ >>> + if (oh->_sysc_cache != v) >>> + _write_sysconfig(v, oh); >>> } >>> >>> /** >>> -- >>> 2.1.4 >>> >> >> >> - Paul >> From mboxrd@z Thu Jan 1 00:00:00 1970 From: t-kristo@ti.com (Tero Kristo) Date: Wed, 2 Mar 2016 09:38:43 +0200 Subject: [RFC PATCH] ARM: OMAP2+: Fix updating of sysconfig register In-Reply-To: <56D65FD4.4090206@ti.com> References: <1456832887-5312-1-git-send-email-lokeshvutla@ti.com> <56D65FD4.4090206@ti.com> Message-ID: <56D69883.6070603@ti.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 03/02/2016 05:36 AM, Lokesh Vutla wrote: > > > On Tuesday 01 March 2016 10:33 PM, Paul Walmsley wrote: >> + Jon Hunter >> >> On Tue, 1 Mar 2016, Lokesh Vutla wrote: >> >>> commit 127500ccb766f ("ARM: OMAP2+: Only write the sysconfig on idle >>> when necessary") talks about verification of sysconfig cache value before >>> updating it, only during idle path. But the patch is adding the >>> verification in the enable path. So, adding the check in a proper place >>> as per the commit description. >>> >>> Not keeping this check during enable path as there is a chance of losing >>> context and it is safe to do on idle as the context of the register will >>> never be lost while the device is active. > > When the patch was originally posted[1], this check was in proper place > itself. Not sure what happened after that. Looks like a merge conflict to me. The patch from Lokesh fixes it, so: Acked-by: Tero Kristo > > [1] https://www.mail-archive.com/linux-omap%40vger.kernel.org/msg78032.html > > Thanks and regards, > Lokesh > >>> >>> Signed-off-by: Lokesh Vutla >>> --- >>> arch/arm/mach-omap2/omap_hwmod.c | 8 ++++---- >>> 1 file changed, 4 insertions(+), 4 deletions(-) >>> >>> diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c >>> index e9f65fe..71b3747 100644 >>> --- a/arch/arm/mach-omap2/omap_hwmod.c >>> +++ b/arch/arm/mach-omap2/omap_hwmod.c >>> @@ -1416,9 +1416,7 @@ static void _enable_sysc(struct omap_hwmod *oh) >>> (sf & SYSC_HAS_CLOCKACTIVITY)) >>> _set_clockactivity(oh, oh->class->sysc->clockact, &v); >>> >>> - /* If the cached value is the same as the new value, skip the write */ >>> - if (oh->_sysc_cache != v) >>> - _write_sysconfig(v, oh); >>> + _write_sysconfig(v, oh); >>> >>> /* >>> * Set the autoidle bit only after setting the smartidle bit >>> @@ -1481,7 +1479,9 @@ static void _idle_sysc(struct omap_hwmod *oh) >>> _set_master_standbymode(oh, idlemode, &v); >>> } >>> >>> - _write_sysconfig(v, oh); >>> + /* If the cached value is the same as the new value, skip the write */ >>> + if (oh->_sysc_cache != v) >>> + _write_sysconfig(v, oh); >>> } >>> >>> /** >>> -- >>> 2.1.4 >>> >> >> >> - Paul >>