From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6ADA1E0E13; Wed, 6 Nov 2024 12:56:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730897761; cv=none; b=F5dWLrhhYgyGfVQ5JfFDtDq53fkf5LTz5/hq+PrrsRmEc93yiCbz2M+Qsu27v8sOxikuWWX8sqz6rxBNO1wxDBHFMTqR4GigNGqviyiEHJcoj+R+mLNmrmcIvAIjtcGLPFd5g1iSLfULiIk2W5b/3bqSZ5ycYU+D4T2UnxZD4Zk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730897761; c=relaxed/simple; bh=oGhOpdctQJefevFBvMNuahbf2DA1VINJPdaU+/PfbNs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fp4TCqvsllKj9UinASRX5o+DB3SvoAEsnCjfC6KWSxI7XyoEJBCcu1pYMXRC09F+R1+VxhOVqRcsmKL226KPQTks5M7LeXtDCTTK5d6csbXnApQXlVtbOC7EkO/zShLk9kz0KEkD8/pZVh3OMxoJ7ozFDfMzRNVw/B0OTfWEvEQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=a03VWx/K; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="a03VWx/K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49130C4CECD; Wed, 6 Nov 2024 12:56:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1730897761; bh=oGhOpdctQJefevFBvMNuahbf2DA1VINJPdaU+/PfbNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a03VWx/K10iZozGthEOIZ7MaCZkvJbZYN8724n27m8gMUslvyF/dX9kKMFl5xVy1a Jn4TvqC+ytYfyaKMR4LPTR/3O1R9YuKvJIWZ2ELKdY4VhpewJZhiCBSnkl+hf5D+2r eqGmLRscMWdRGthx7/HdR54ifYvRm4W/ScVKQGVQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bard Liao , Charles Keepax , Krzysztof Kozlowski , Peter Ujfalusi , Vinod Koul Subject: [PATCH 5.4 011/462] soundwire: stream: Revert "soundwire: stream: fix programming slave ports for non-continous port maps" Date: Wed, 6 Nov 2024 12:58:24 +0100 Message-ID: <20241106120331.786214445@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241106120331.497003148@linuxfoundation.org> References: <20241106120331.497003148@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Krzysztof Kozlowski commit 233a95fd574fde1c375c486540a90304a2d2d49f upstream. This reverts commit ab8d66d132bc8f1992d3eb6cab8d32dda6733c84 because it breaks codecs using non-continuous masks in source and sink ports. The commit missed the point that port numbers are not used as indices for iterating over prop.sink_ports or prop.source_ports. Soundwire core and existing codecs expect that the array passed as prop.sink_ports and prop.source_ports is continuous. The port mask still might be non-continuous, but that's unrelated. Reported-by: Bard Liao Closes: https://lore.kernel.org/all/b6c75eee-761d-44c8-8413-2a5b34ee2f98@linux.intel.com/ Fixes: ab8d66d132bc ("soundwire: stream: fix programming slave ports for non-continous port maps") Acked-by: Bard Liao Reviewed-by: Charles Keepax Cc: stable@vger.kernel.org Signed-off-by: Krzysztof Kozlowski Tested-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20240909164746.136629-1-krzysztof.kozlowski@linaro.org Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/soundwire/stream.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -1407,18 +1407,18 @@ struct sdw_dpn_prop *sdw_get_slave_dpn_p unsigned int port_num) { struct sdw_dpn_prop *dpn_prop; - unsigned long mask; + u8 num_ports; int i; if (direction == SDW_DATA_DIR_TX) { - mask = slave->prop.source_ports; + num_ports = hweight32(slave->prop.source_ports); dpn_prop = slave->prop.src_dpn_prop; } else { - mask = slave->prop.sink_ports; + num_ports = hweight32(slave->prop.sink_ports); dpn_prop = slave->prop.sink_dpn_prop; } - for_each_set_bit(i, &mask, 32) { + for (i = 0; i < num_ports; i++) { if (dpn_prop[i].num == port_num) return &dpn_prop[i]; }