• Ye Li's avatar
    watchdog: imx7ulp_wdt: Handle wdog reconfigure failure · c32b53f9
    Ye Li authored
    Current driver may meet reconfigure failure caused by below reasons:
    
    1. The wdog on iMX7ULP has different behavior after RCS valid. It needs
       to wait more than 2.5 wdog clock for clock sync before next
       reconfiguration, while imx8ulp wdog does not need such delay.
    
    2. After unlock, there is 128 bus clock window opened for reconfiguration,
       but on iMX8ULP, the HW can't guarantee the latency. So it is possible
       the window is closed before the writing arrives to wdog.
    
    3. If the PRES is enabled, the RCS valid time becomes x256 to the time
       of PRES disabled. It is about 1715ms on iMX8ULP. So We have to increase
       the RCS timeout and can't wait it in IRQ disabled.
    
    The patch updates the driver to handle failures
    
    1. Using different wait for unlock and RCS. Unlock valid time is very short
       and only related to bus clock. It must be in IRQ disabled to avoid
       being interrupted in 128 clock window. But for RCS time, it is longer
       and ok for IRQ enabled.
    
    2. Add retry for any reconfigure failure with default 5 times.
    
    3. Add "fsl,imx8ulp-wdt" compatile string for iMX8ULP and afterwards
       platform which don't need more 2.5 wdog clock after RCS valid.
       For imx7ulp, add post delay of 2.5 clock after RCS valid.
    Signed-off-by: default avatarYe Li <ye.li@nxp.com>
    Signed-off-by: default avatarAlice Guo <alice.guo@nxp.com>
    Reviewed-by: default avatarJacky Bai <ping.bai@nxp.com>
    Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Link: https://lore.kernel.org/r/20220825083256.14565-6-alice.guo@oss.nxp.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
    c32b53f9
imx7ulp_wdt.c 9.55 KB