soundwire: bus: improve error handling for clock stop prepare/deprepare
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Fri, 13 Oct 2023 01:08:12 +0000 (09:08 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 16 Oct 2023 11:17:36 +0000 (16:47 +0530)
commitff435da4cc8b6137be9f0b6b4a9af095590d4b8c
tree6858bd152e5bc115a95d7e5167ecd2f8fbfd4674
parent95b0f3aa71eb09d067d89395fdb7f2dd87feae18
soundwire: bus: improve error handling for clock stop prepare/deprepare

The same logic is used for clock stop prepare and deprepare, and
having different logs for the two steps helps identify problems.

In addition, when the "NotFinished" bit remains set, the error
handling is not quite right:

a) for the clock stop prepare, the error is handled at the caller
level, and the error is ignored: there's no good reason to prevent the
pm_runtime suspend from happening. Throwing an error that is later
ignored is confusing.

b) for the clock stop deprepare, the error is ignored in bus.c and a
dev_warn() log shown. Throwing an error is also alarming users for no
good reason.

For both cases, demoting the error to dev_dbg() makes more sense.

Link: https://github.com/thesofproject/linux/issues/4619
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20231013010812.114216-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c