Repository navigation
Commit 40aebd1
committed
NVIDIA: SAUCE: watchdog: sbsa_gwdt: stop the watchdog across the whole system-sleep transition
The driver stops a running watchdog in its own device suspend callback
and restarts it in its resume callback. That leaves the watchdog armed,
with nobody refreshing it, for the entire early part of suspend entry:
userspace freeze, kernel thread freeze, and every device suspend
callback that runs before this device's own. The same window exists at
the tail end of resume.
When the watchdog is running from boot (early_enable=1, previously
force_enable=1 downstream; 10 s default timeout) and any device stalls
its suspend callback past the timeout, the watchdog resets the system
in the middle of suspend entry. On N1x (Yukon) this fired on about 7%
of suspend attempts in a randomized stress run (9 resets in 124
suspends; the serial console shows the board dropping into the boot
ROM mid-entry with the watchdog reset status set in NONRST_REG2). Two
elimination runs confirm the mechanism: the identical stress matrix
with the parameter off produced zero resets in 118 suspends, and with
the first version of this change (notifier plus the original device
callbacks) applied and the watchdog force-enabled, zero resets in 198
suspends across four runs (the baseline rate predicts about 14). The
version here keeps that mechanism, removes the device resume callback
and adds the locking described below; it is compile tested.
Stop the watchdog from a PM notifier at the *_PREPARE events, before
tasks are frozen and device callbacks run, and restart it at the
PM_POST_* events, after everything has resumed. The driver state (armed,
stopped for sleep) lives under a lock shared with the watchdog ops, so a
userspace stop or magic close after thaw cannot race the restart, and a
start requested while the transition is in progress is deferred until
PM_POST_* instead of arming hardware nobody can refresh. The notifier is
registered before anything can arm the watchdog and its failure fails
the probe. A suspend-only device callback remains as the final guard for
a device whose probe overlapped the *_PREPARE event; it has no resume
counterpart, so nothing re-arms the watchdog during device resume,
before PM_POST_SUSPEND.
This is also upstream-relevant as a companion to the early_enable
parameter: the armed-during-entry window exists for any system running
the SBSA watchdog from boot.
Fixes: 57d2caa ("Watchdog: introduce ARM SBSA watchdog driver")
Signed-off-by: David Cemin <dcemin@nvidia.com>1 parent f8c1047 commit 40aebd1
1 file changed
Lines changed: 142 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
91 | 100 | | |
92 | 101 | | |
93 | 102 | | |
| |||
96 | 105 | | |
97 | 106 | | |
98 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
| |||
250 | 263 | | |
251 | 264 | | |
252 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
253 | 278 | | |
254 | 279 | | |
255 | 280 | | |
| 281 | + | |
256 | 282 | | |
257 | | - | |
258 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
259 | 293 | | |
260 | 294 | | |
261 | 295 | | |
262 | 296 | | |
263 | 297 | | |
264 | 298 | | |
265 | 299 | | |
| 300 | + | |
266 | 301 | | |
267 | | - | |
268 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
269 | 308 | | |
270 | 309 | | |
271 | 310 | | |
| |||
294 | 333 | | |
295 | 334 | | |
296 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
297 | 416 | | |
298 | 417 | | |
299 | 418 | | |
| |||
325 | 444 | | |
326 | 445 | | |
327 | 446 | | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
328 | 462 | | |
329 | 463 | | |
330 | 464 | | |
| |||
354 | 488 | | |
355 | 489 | | |
356 | 490 | | |
357 | | - | |
| 491 | + | |
358 | 492 | | |
| 493 | + | |
| 494 | + | |
359 | 495 | | |
360 | 496 | | |
361 | 497 | | |
| |||
414 | 550 | | |
415 | 551 | | |
416 | 552 | | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | 553 | | |
444 | 554 | | |
445 | 555 | | |
| |||
455 | 565 | | |
456 | 566 | | |
457 | 567 | | |
458 | | - | |
| 568 | + | |
459 | 569 | | |
460 | 570 | | |
461 | 571 | | |
| |||
0 commit comments