linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH v2] soundwire: bus: Fix device found flag correctly
@ 2021-03-09 10:48 Srinivas Kandagatla
  2021-03-22 12:16 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Srinivas Kandagatla @ 2021-03-09 10:48 UTC (permalink / raw)
  To: vkoul
  Cc: yung-chuan.liao, pierre-louis.bossart, sanyog.r.kale,
	linux-kernel, alsa-devel, Srinivas Kandagatla

found flag is used to indicate SoundWire devices that are
both enumerated on the bus and available in the device list.
However this flag is not reset correctly after one iteration,
This could miss some of the devices that are enumerated on the
bus but not in device list. So reset this correctly to fix this issue!

Fixes: d52d7a1be02c ("soundwire: Add Slave status handling helpers")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
For some reason I ended up deleting Fixes tag so resending with it!

 drivers/soundwire/bus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c
index a9ab4a6264e0..188e391c5a83 100644
--- a/drivers/soundwire/bus.c
+++ b/drivers/soundwire/bus.c
@@ -712,7 +712,7 @@ static int sdw_program_device_num(struct sdw_bus *bus)
 	struct sdw_slave *slave, *_s;
 	struct sdw_slave_id id;
 	struct sdw_msg msg;
-	bool found = false;
+	bool found;
 	int count = 0, ret;
 	u64 addr;
 
@@ -744,6 +744,7 @@ static int sdw_program_device_num(struct sdw_bus *bus)
 
 		sdw_extract_slave_id(bus, addr, &id);
 
+		found = false;
 		/* Now compare with entries */
 		list_for_each_entry_safe(slave, _s, &bus->slaves, node) {
 			if (sdw_compare_devid(slave, id) == 0) {
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RESEND PATCH v2] soundwire: bus: Fix device found flag correctly
  2021-03-09 10:48 [RESEND PATCH v2] soundwire: bus: Fix device found flag correctly Srinivas Kandagatla
@ 2021-03-22 12:16 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2021-03-22 12:16 UTC (permalink / raw)
  To: Srinivas Kandagatla
  Cc: yung-chuan.liao, pierre-louis.bossart, sanyog.r.kale,
	linux-kernel, alsa-devel

On 09-03-21, 10:48, Srinivas Kandagatla wrote:
> found flag is used to indicate SoundWire devices that are
> both enumerated on the bus and available in the device list.
> However this flag is not reset correctly after one iteration,
> This could miss some of the devices that are enumerated on the
> bus but not in device list. So reset this correctly to fix this issue!

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-22 12:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 10:48 [RESEND PATCH v2] soundwire: bus: Fix device found flag correctly Srinivas Kandagatla
2021-03-22 12:16 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).