Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sound/soc/codecs/max98363.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ static int max98363_io_init(struct sdw_slave *slave)
/* make sure the device does not suspend immediately */
pm_runtime_mark_last_busy(dev);

pm_runtime_enable(dev);
if (!pm_runtime_enabled(dev))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yongzhi1 this looks a bit fishy with the runtime PM enable sequence and first_hw_init usage here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree, if pm_runtime_enable() is called by the codec driver, should there be a matching pm_runtime_disable() called in the same driver?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yongzhi1 it's not an issue with pm_runtime_disable() but rather the fact that this entire block is gated by the test on first_hw_init. I don't see how it's possible to execute this block twice.

@yongzhi1 yongzhi1 Jun 28, 2023 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, the above line is called once, and I can repro only once upon reboot with S0ix test "suspend_stress_test -c1"

[   79.258335] max98363 sdw:2:019f:8363:00:1: Bus clash detected before INT mask is enabled
[   79.258589] max98363 sdw:2:019f:8363:00:1: Unbalanced pm_runtime_enable!
[   79.258840] max98363 sdw:2:019f:8363:00:0: Bus clash detected before INT mask is enabled
[   79.259113] max98363 sdw:2:019f:8363:00:0: Unbalanced pm_runtime_enable!
[   90.705383] OOM killer enabled.
[   90.708888] Restarting tasks ..

Will re-test with #4345 and close this one.

pm_runtime_enable(dev);
}

pm_runtime_get_noresume(dev);
Expand Down