[Gta04-owner] omap3_pm_suspend --- was: dbus crashing with SIGBUS after suspend/resume

Dr. H. Nikolaus Schaller hns at goldelico.com
Sat Aug 3 19:49:56 CEST 2013


Am 03.08.2013 um 18:39 schrieb EdorFaus:

> Hi,
> 
> On 07/01/2013 03:35 PM, Radek Polak wrote:
>> i have quite tracked it down to the patch that enabled omap_off_mode.
> 
> I've been running with the v56 kernel for a little while (which disabled off_mode), and dbus no longer crashes for me, so this does indeed appear to be the cause (thank you for figuring it out).
> 
>> and it dbus crashed after like 2 calls
> 
>> Attached is diff between these two branches. Maybe it helps?
> 
> I noticed something suspicious in the diff that seems to align with the 2 calls part.
> 
> It may just be that I'm too unfamiliar with this code to see something obvious, but in the arch/arm/mach-omap2/pm34xx.c file there's this part:
> 
> +		if (strcmp(pwrst->pwrdm->name, "core_pwrdm") == 0) {
> +			static int times = 0;
> +			times++;
> +			if (times == 1)
> +				pwrst->next_state = PWRDM_POWER_RET;
> +			if (times == 2)
> +				pwrst->next_state = PWRDM_POWER_OFF;
> +		}
> 
> which adds a static int, and increments it on every call - but never resets it, and only does anything the first two times (which aligns with only 2 calls working properly).
> 
> I don't know if this is actually called during suspend/resume, or whether it's actually relevant even so, but I figured I should mention it in any case, just in case I was onto something.

I also have no idea what we need this for (it is not in the official 3.11 mainline, but introduced by our fixes).

> 
> By the way, if it isn't supposed to do anything after the second time, but is still called repeatedly, there's actually a tiny bug in it (which is admittedly very unlikely to be triggered): since the int is incremented always, it will eventually overflow and become 1 again...

Well, if I understand the function (omap3_pm_suspend) it is called only once each suspend. I.e. we need 2^32 suspend cycles for the variable to overflow :)

Maybe Neil can comment on it.

BR,
Nikolaus



More information about the Gta04-owner mailing list