Subject: [PATCHv2 02/12] ARM: OMAP2+: hwmod code/data: fix 32K sync timer

From: [email-masked] (Benoit Cousson)
Date: Wed, 4 Jul 2012 18:57:10 +0200

Hi Paul,

On 07/04/2012 02:53 PM, Paul Walmsley wrote:
> On Wed, 4 Jul 2012, Paul Walmsley wrote:
> 
>> So the updated patch below uses a clockdomain data flag for this 
>> instead.
> 
> Here's a version that's a little cleaner.  No functional changes.

[...]

> @@ -1141,8 +1144,16 @@ static void _enable_sysc(struct omap_hwmod *oh)
>  	sf = oh->class->sysc->sysc_flags;
>  
>  	if (sf & SYSC_HAS_SIDLEMODE) {
> -		idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ?
> -			HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART;
> +		clkdm_act = ((oh->clkdm &&
> +			      oh->clkdm->flags & CLKDM_ACTIVE_WITH_MPU) ||
> +			     (oh->_clk->clkdm &&

This is crashing on OMAP4 due to a NULL oh->_clk that can happen on some
hwmod.

+			     (oh->_clk && oh->_clk->clkdm &&

Is fixing the issue.

Regards,
Benoit

> +			      oh->_clk->clkdm->flags & CLKDM_ACTIVE_WITH_MPU));
> +		if (clkdm_act && !(oh->class->sysc->idlemodes &
> +				   (SIDLE_SMART | SIDLE_SMART_WKUP)))
> +			idlemode = HWMOD_IDLEMODE_FORCE;
> +		else
> +			idlemode = (oh->flags & HWMOD_SWSUP_SIDLE) ?
> +				HWMOD_IDLEMODE_NO : HWMOD_IDLEMODE_SMART;
>  		_set_slave_idlemode(oh, idlemode, &v);
>  	}
>