From patchwork Thu May 20 09:19:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 443188 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp2129719jac; Thu, 20 May 2021 02:54:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyp4Dzo0iwyTQt6Obg5S3FIR5w1kKEoUY2FtvR4GpzMOKRF+wP+ol9KKPgPZBNRN6ljlI/j X-Received: by 2002:a05:6602:21ca:: with SMTP id c10mr4712814ioc.10.1621504482985; Thu, 20 May 2021 02:54:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621504482; cv=none; d=google.com; s=arc-20160816; b=IJIi2CTeugeWwzFreMLPHDr2m1w7ueWU5tYAhIDlV/jR3ksKPpuzJ5rkGeZ8PNSZPS ChWeUvfBnBZ5ixjdx7ZwLaU7fqxxKGPT6CDFiQ55Y8XtrBIKHSUMwxuQGmbbChzwxOE/ S7XW2+XDGQx6YX2vr5lNeMEAd57N9zZh4t12Y3SjYvNXNMFQuz58IJ/iAKQ5hpF/QMQz GQYcZKG6rEm7k2+9vVpV0rq9KFV9HJZBqMf4/yUdv77PyUp7FUguSvdej4s+qbNqHhTL sSL1prKr7Gidx6gCCSwoav9v50abcR3y3q22iNLJO70y55Nc62sQ5HDvXLhTa2w6p6Uc +fww== 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=kX4kcNHcvDtBVY2Gq2RoIZl9xtvO+zz1EX4G2ebDn6A=; b=FPZHZ2SSbhZeA5xkvKEszeLDyxEji5ED55dCTUmXFCrm+iJWGqevSPF1Ma6gG7qZxq D4rrGIi7TkDs8zebq3dLVag5VuTlz3Ku9adI6YxuKOR0uP/ijkQk6vtmR7MByZ+aH5UP zaE5+zvZaQB7QuNeRei7hae6Q+4ELxTS7XqvHOsSyriX7aPOKfGH3/xZx4CGFAz1Wsgb 839Wwlaf9gy90E7GXA8LyKAItkO7FePI5E6A1NGskEijf9foC2g5z4orGCDDwEz9el0Y 2T3NM3TPUwHnaAQeO6Yn2Ado/IEFGyfqwC9aMnfZUVt0+mNPb9yZ9G+YERb3c2bb9HF2 Zglg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kSCDROR3; 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 w36si1802867jal.44.2021.05.20.02.54.42; Thu, 20 May 2021 02:54:42 -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=kSCDROR3; 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 S233311AbhETJz4 (ORCPT + 12 others); Thu, 20 May 2021 05:55:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:53920 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234029AbhETJwS (ORCPT ); Thu, 20 May 2021 05:52:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4617C61581; Thu, 20 May 2021 09:36:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503369; bh=2WHjvr9GkzDO1uT93ZbgQkhvdlHzfiDVYleSFNs5XR0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kSCDROR3JaVyaEALw0NuY99dALM2ctBGjsc2ThRHr0t8FsNqmcpyHLAoTVKBvAmmF tj24XtjCPSFiCWfKP4q1uk3mSS9BNhGpWB4kXI0RUEhRxlkvkbUKONVy9Y035d3cHI kW/brbo/35UovWm2SNz3DzNSsFOC0PjEOSFrdITU= 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 4.19 191/425] soundwire: bus: Fix device found flag correctly Date: Thu, 20 May 2021 11:19:20 +0200 Message-Id: <20210520092137.702096702@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 df172bf3925f..0089b606b70d 100644 --- a/drivers/soundwire/bus.c +++ b/drivers/soundwire/bus.c @@ -514,7 +514,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; @@ -545,6 +545,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) {