Skip to content

Commit 8efe3a6

Browse files
tmlindgregkh
authored andcommitted
bus: ti-sysc: Fix gpt12 system timer issue with reserved status
[ Upstream commit 3ff340e ] Jarkko Nikula <jarkko.nikula@bitmer.com> reported that Beagleboard revision c2 stopped booting. Jarkko bisected the issue down to commit 6cfcd55 ("clocksource/drivers/timer-ti-dm: Fix suspend and resume for am3 and am4"). Let's fix the issue by tagging system timers as reserved rather than ignoring them. And let's not probe any interconnect target module child devices for reserved modules. This allows PM runtime to keep track of clocks and clockdomains for the interconnect target module, and prevent the system timer from idling as we already have SYSC_QUIRK_NO_IDLE and SYSC_QUIRK_NO_IDLE_ON_INIT flags set for system timers. Fixes: 6cfcd55 ("clocksource/drivers/timer-ti-dm: Fix suspend and resume for am3 and am4") Reported-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent e32a291 commit 8efe3a6

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

‎drivers/bus/ti-sysc.c‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = {
100100
* @cookie: data used by legacy platform callbacks
101101
* @name: name if available
102102
* @revision: interconnect target module revision
103+
* @reserved: target module is reserved and already in use
103104
* @enabled: sysc runtime enabled status
104105
* @needs_resume: runtime resume needed on resume from suspend
105106
* @child_needs_resume: runtime resume needed for child on resume from suspend
@@ -130,6 +131,7 @@ struct sysc {
130131
struct ti_sysc_cookie cookie;
131132
const char *name;
132133
u32 revision;
134+
unsigned int reserved:1;
133135
unsigned int enabled:1;
134136
unsigned int needs_resume:1;
135137
unsigned int child_needs_resume:1;
@@ -3057,8 +3059,8 @@ static int sysc_probe(struct platform_device *pdev)
30573059
return error;
30583060

30593061
error = sysc_check_active_timer(ddata);
3060-
if (error)
3061-
return error;
3062+
if (error == -EBUSY)
3063+
ddata->reserved = true;
30623064

30633065
error = sysc_get_clocks(ddata);
30643066
if (error)
@@ -3094,11 +3096,15 @@ static int sysc_probe(struct platform_device *pdev)
30943096
sysc_show_registers(ddata);
30953097

30963098
ddata->dev->type = &sysc_device_type;
3097-
error = of_platform_populate(ddata->dev->of_node, sysc_match_table,
3098-
pdata ? pdata->auxdata : NULL,
3099-
ddata->dev);
3100-
if (error)
3101-
goto err;
3099+
3100+
if (!ddata->reserved) {
3101+
error = of_platform_populate(ddata->dev->of_node,
3102+
sysc_match_table,
3103+
pdata ? pdata->auxdata : NULL,
3104+
ddata->dev);
3105+
if (error)
3106+
goto err;
3107+
}
31023108

31033109
INIT_DELAYED_WORK(&ddata->idle_work, ti_sysc_idle);
31043110

0 commit comments

Comments
 (0)