Commit ed0abc8
ASoC: rsnd: adg: make rsnd_adg_clk_control() idempotent
rsnd_adg_clk_control() is asymmetric on the disable path: the clkin
clocks are guarded by clkin_rate[], but the "adg" clock is disabled
unconditionally. If an enable attempt fails (for example a clkin
failing to turn on during resume), the error path correctly rolls
everything back, but rsnd_resume() ignores the return value, so the
following system suspend calls rsnd_adg_clk_disable() again and
underflows the "adg" clock enable count:
adg_0_clks1 already disabled
WARNING: drivers/clk/clk.c:1188 clk_core_disable+0xa4/0xac
Call trace:
clk_core_disable+0xa4/0xac (P)
clk_disable+0x30/0x4c
rsnd_adg_clk_control+0x9c/0x2cc
rsnd_suspend+0x20/0x74
device_suspend+0x140/0x3ec
dpm_suspend+0x168/0x270
Track the enable state explicitly and bail out of redundant
enable/disable calls, mirroring what is already done for the per-SSI
clock prepare state. A failed enable leaves the state as disabled, so
the next suspend becomes a no-op and the next resume retries cleanly.
Fixes: 47899d5 ("ASoC: rsnd: adg: Add per-SSI ADG and SSIF supply clock management")
Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20260610164704.2211321-1-john.madieu.xa@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 95edf2d commit ed0abc8
1 file changed
Lines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
463 | 464 | | |
464 | 465 | | |
465 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
466 | 483 | | |
467 | 484 | | |
468 | 485 | | |
| |||
520 | 537 | | |
521 | 538 | | |
522 | 539 | | |
523 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
524 | 547 | | |
| 548 | + | |
| 549 | + | |
525 | 550 | | |
526 | 551 | | |
527 | 552 | | |
528 | 553 | | |
| 554 | + | |
| 555 | + | |
529 | 556 | | |
530 | 557 | | |
531 | 558 | | |
| |||
0 commit comments