]> git.baikalelectronics.ru Git - kernel.git/commit
soundwire: intel: fix potential race condition during power down
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Wed, 18 Aug 2021 02:49:52 +0000 (10:49 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 23 Aug 2021 12:10:33 +0000 (17:40 +0530)
commit347902c61c5967618c7168b1f975b17a7bbc9121
treef6c41ea740884ada64ea62aaf39c4ab9562e3094
parentc774cd21d1b7a68ce9b35578c957609b78177b15
soundwire: intel: fix potential race condition during power down

The power down sequence sets the link_up flag as false outside of the
mutex_lock. This is potentially unsafe.

In additional the flow in that sequence can be improved by first
testing if the link was powered, setting the link_up flag as false and
proceeding with the power down. In case the CPA bits cannot be
cleared, we only flag an error since we cannot deal with interrupts
any longer.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20210818024954.16873-2-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/intel.c