From patchwork Wed May 12 14:44:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 435659 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp5124550jao; Wed, 12 May 2021 12:35:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJD/86EYZZgQqM/sQlBm7cLFctajBJJW3J3ZFmdWdlEk4o9uUxQj/cmhK7PIwHAiKnXnGx X-Received: by 2002:a05:6e02:118f:: with SMTP id y15mr6729792ili.52.1620848107359; Wed, 12 May 2021 12:35:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620848107; cv=none; d=google.com; s=arc-20160816; b=Ag+F95fg988VtX9ZJMo/N30nIpUBcv0IniWuqr/5B6/QR0ghKBx7L1bJzvddMXrzKY +9G1D1Vks8fmKW95MAVorR9chBNbhihVNdOByck2OAS9AsvKnZOKYBD8RiwOVBYQzv5X 6EI/gv8mMt4ocoO6033sd4HYYXo4v1KSvw2rvfiZv2m4L6NtUMazlF0cvMax8yyogNZD nk9t4viAxopMec2C8xyyOggPSGLXBy34C7F9oz/MUhD6FuQdd7JDsWVocp27GzerOhsR 17aQjiCLI0Nx0LyJlJtmrAen9bCow6E9XIa9yS9ycbQVJ7PhPzcJ+u5gRyQegwgIARx5 4S9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MKYMsTwm2HZpe6hinA/WE9lNlombFBEgeFRzYo3vinQ=; b=W+sMT0HnuagAOWDVIMKwI4NCGN43/2zI/Xd8X76aLabWvbVuckpNXRxfUeEPuDYojE D99NxMkB1Plw1f8ReP1V3SfxnsT6B1/e4mMB9gAEl/ADAhOGC5yA2E9f2k8IEHF5l8Mp 6PWJNTZ8g/Li1taAkH4Ob1Wmw9M9uaX1i6z6PwuvFlOXiHnCfWkbZ8/9XWc6BXdxAKNu JvCWDg4dsTD6rU6mK/W5I9gclS0fpREcnQP/7us1yPORdJqmTlZHY8tgiNTFkCrDNH3k qlcnUqOiPctClbR5WNNRsctp6fuA7zaNF1s9swY9By8m9nT7wBIIKok020cQZVh8YpDj tOMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1LdAG/i6"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q8si330223ior.12.2021.05.12.12.35.07; Wed, 12 May 2021 12:35:07 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="1LdAG/i6"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238230AbhELQou (ORCPT + 12 others); Wed, 12 May 2021 12:44:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:55246 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242333AbhELQeW (ORCPT ); Wed, 12 May 2021 12:34:22 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 728AD61E1D; Wed, 12 May 2021 15:59:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620835171; bh=aH3V/EMZogkLClF40LYGgxMG8md/Xzv6pjXUHDDoMHU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1LdAG/i6EmKw/9wD1qFCJ+Rlh2u5vdJFjtY2ZmvOxuTu7xQ70pbZsWQAqJagRnXKf RC8+LEoV8HEDgKfqNiD4HUJ4Lb0l+3EAVQuG5tpzWvqN2pYyGBd6N2EAQfUA64UHGf FoUB5/VwlhoQdUFiTUbF8Q7l1w3PmpUkjyMe4k9o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Pierre-Louis Bossart , Vinod Koul , Sasha Levin Subject: [PATCH 5.12 237/677] soundwire: bus: Fix device found flag correctly Date: Wed, 12 May 2021 16:44:43 +0200 Message-Id: <20210512144845.115217688@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144837.204217980@linuxfoundation.org> References: <20210512144837.204217980@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Srinivas Kandagatla [ Upstream commit f03690f4f6992225d05dbd1171212e5be5a370dd ] 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 Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210309104816.20350-1-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/soundwire/bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c index 46885429928a..4ec29338ce9a 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -705,7 +705,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; @@ -737,6 +737,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) {