]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
soundwire: only handle alert events when the peripheral is attached
authorBard Liao <yung-chuan.liao@linux.intel.com>
Wed, 20 May 2026 02:57:20 +0000 (10:57 +0800)
committerVinod Koul <vkoul@kernel.org>
Fri, 29 May 2026 06:32:05 +0000 (12:02 +0530)
It doesn't make sense to handle an alert event when the peripheral is
not attached. The slave->status could be SDW_SLAVE_ATTACHED or
SDW_SLAVE_ALERT when it is attached on the bus.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>
Link: https://patch.msgid.link/20260520025720.1999367-1-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/bus.c

index fe5316d93fefe7f2b49d788352f7bdd41b878fd0..0490777fa40671e1cc4bf3000e2197afa989b879 100644 (file)
@@ -1958,6 +1958,10 @@ int sdw_handle_slave_status(struct sdw_bus *bus,
                        break;
 
                case SDW_SLAVE_ALERT:
+                       if (slave->status != SDW_SLAVE_ATTACHED &&
+                           slave->status != SDW_SLAVE_ALERT)
+                               continue;
+
                        ret = sdw_handle_slave_alerts(slave);
                        if (ret < 0)
                                dev_err(&slave->dev,