Commit fe63a7d
Fixup: soundwire: bus: add CLOCK_STOP_MODE1 support back
sdw_get_clk_stop_mode() converts slave->dev.driver with
drv_to_sdw_driver() and dereferences the result unconditionally. A
Peripheral can be attached and enumerated on the bus while it has no
driver bound to it, for example after its codec driver module has been
removed, and in that case slave->dev.driver is NULL.
sdw_bus_prep_clk_stop() walks every Peripheral which has a device
number and is in ATTACHED or ALERT state, so the Manager's runtime
suspend reaches such an unbound Peripheral and the container_of()
arithmetic turns the NULL pointer into a small negative offset:
BUG: unable to handle page fault for address: fffffffffffffff8
RIP: 0010:sdw_bus_prep_clk_stop+0x93/0x1d0 [soundwire_bus]
Call Trace:
sdw_cdns_clock_stop+0xbe/0x1d0 [soundwire_cadence]
intel_stop_bus+0xc1/0x100 [soundwire_intel]
intel_suspend_runtime+0x7b/0x160 [soundwire_intel]
__rpm_callback+0x57/0x210
rpm_suspend+0xfc/0x660
pm_runtime_work+0xa4/0xb0
Take sdw_dev_lock and check slave->probed before looking at the driver,
the same way sdw_slave_clk_stop_callback() and the other clock stop
helpers do, and fall back to the mode advertised by the Peripheral
property when no driver is bound.
Fixes: 922ebc4 ("soundwire: bus: add CLOCK_STOP_MODE1 support back")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>1 parent 60efcc4 commit fe63a7d
1 file changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
957 | 957 | | |
958 | 958 | | |
959 | 959 | | |
960 | | - | |
961 | | - | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
962 | 965 | | |
963 | 966 | | |
964 | 967 | | |
965 | 968 | | |
966 | 969 | | |
967 | | - | |
968 | | - | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
969 | 978 | | |
970 | | - | |
| 979 | + | |
971 | 980 | | |
972 | 981 | | |
973 | 982 | | |
| |||
0 commit comments