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 C24F01553AB; Mon, 16 Sep 2024 12:07:52 +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=1726488472; cv=none; b=pA3y5D2itvElcq17tlCOxIBeM1ZD1Aj2DLNZcbBD0rC1Hm8ifF5HpD9vQxVlcjYd4sgtTHaB4snS5++DkEwhpBeMU3MUHQmKySxdw3b6N3kfqYDVKzOjeRo5NLBO6Fh3FQjsiGp13cFl3dqJQsrpyItDNZ7maDf5Bgd9ifEv7JQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726488472; c=relaxed/simple; bh=iqO1O4n2l43MwE4Xm572QGOA/IIcqVUrxItd07+Em4k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o4DZBJVPcnq4jfLt6+GnQE5yjCozPAWZLVJYJCuWZUf3017E6hnL2rt/Lu9v3hR5PHMRGIiYMKMsQmlpW5EV8UvuyIzwmR+TX32+Ht3zp9JwHHNgqrIwKnxzIS41br1LQIcA8IfzMkYItK80BtSFg4lZrSzDtlh5uCtxPdy2gco= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=W82syuY+; 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="W82syuY+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A5D2C4CEC4; Mon, 16 Sep 2024 12:07:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1726488472; bh=iqO1O4n2l43MwE4Xm572QGOA/IIcqVUrxItd07+Em4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W82syuY+puA4BBEzJbI7iylpuGz7YS/v8PKmQsnVc5YpFzD/ULsjp7trG1TkwZFwU JRXwWFud8hYQGnbaURfvA2xqsO4GjDVqy4EepoGQEGFzvmGcXH5oxKPI2OexFSRKAU XJHDFr+iGArGaCH5r1NPZKoRu/cZLwjMC8oyz1dw= 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 6.10 099/121] soundwire: stream: Revert "soundwire: stream: fix programming slave ports for non-continous port maps" Date: Mon, 16 Sep 2024 13:44:33 +0200 Message-ID: <20240916114232.395845533@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240916114228.914815055@linuxfoundation.org> References: <20240916114228.914815055@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 6.10-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 @@ -1286,18 +1286,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]; }