Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Hauke Mehrtens and committed by
John W. Linville
7280b51a 7ffbffe3

+4 -2
+3 -2
drivers/ssb/driver_extif.c
··· 112 112 *m = extif_read32(extif, SSB_EXTIF_CLOCK_SB); 113 113 } 114 114 115 - void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, 116 - u32 ticks) 115 + void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks) 117 116 { 117 + if (ticks > SSB_EXTIF_WATCHDOG_MAX_TIMER) 118 + ticks = SSB_EXTIF_WATCHDOG_MAX_TIMER; 118 119 extif_write32(extif, SSB_EXTIF_WATCHDOG, ticks); 119 120 } 120 121
+1
include/linux/ssb/ssb_driver_extif.h
··· 152 152 /* watchdog */ 153 153 #define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */ 154 154 155 + #define SSB_EXTIF_WATCHDOG_MAX_TIMER ((1 << 28) - 1) 155 156 156 157 157 158 #ifdef CONFIG_SSB_DRIVER_EXTIF