Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7280b51a authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by John W. Linville
Browse files

ssb: extif: add check for max value before setting watchdog register



Prevent the watchdog register on the extif core to be set to a too
high value.

Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7ffbffe3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -112,9 +112,10 @@ void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
	*m = extif_read32(extif, SSB_EXTIF_CLOCK_SB);
}

void ssb_extif_watchdog_timer_set(struct ssb_extif *extif,
				  u32 ticks)
void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks)
{
	if (ticks > SSB_EXTIF_WATCHDOG_MAX_TIMER)
		ticks = SSB_EXTIF_WATCHDOG_MAX_TIMER;
	extif_write32(extif, SSB_EXTIF_WATCHDOG, ticks);
}

+1 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@
/* watchdog */
#define SSB_EXTIF_WATCHDOG_CLK		48000000	/* Hz */

#define SSB_EXTIF_WATCHDOG_MAX_TIMER	((1 << 28) - 1)


#ifdef CONFIG_SSB_DRIVER_EXTIF