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 C8DA014E2C2; Mon, 16 Sep 2024 12:12:06 +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=1726488726; cv=none; b=IJbyQWPyHXzprp6B4fWoVsr7SZFTVlWSngPw4kRvqMf0MVjUS5PXV5i5/TsK6ns2puHoF5FyOKswwfAvhpQ+7LMRIMrik1RLkNfmULBOhQRLQEPGvMXxNeer5pTOocvi2GVmiRGJk8e16+IPebRRXOqdQZYrQoNjQeY45pSPFXo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726488726; c=relaxed/simple; bh=0sl0dKd27sZwn343PbER+UJpabdQHQ6/6a+tIaZXjag=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uHBq3Loi8/iU5QkD/fZjGZPy7JgYVEob67IRUCmt2uuP0uYfKFPKpXkMB+ohmNGMG3/zCd9DTsK+ZbnZHPdVPjWZc3wmK4VSlyH2/iBvV/7wu7CIqZ6IitpTRXjt+K8viD6zM/mFWb365O3SNbl9CX1NEIhMFVdHl38HdA6F6gk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rxGxvh1/; 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="rxGxvh1/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 517E9C4CEC4; Mon, 16 Sep 2024 12:12:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1726488726; bh=0sl0dKd27sZwn343PbER+UJpabdQHQ6/6a+tIaZXjag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rxGxvh1/vrZxHHq3F+DU8eWrg1dL50SDRJ2cCHWEgFp7m9yAhX1HlbPda4tZNju7L nJtBXxVJe0G9QTCRib/y5jUiGlhaeXosb72KBwoU6RMMKEYpFtiCVxat7CMGsayMc5 +mkWG6wsSJbidckU/wZppDpzKSpjGyLyXg0lV0No= 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.6 78/91] soundwire: stream: Revert "soundwire: stream: fix programming slave ports for non-continous port maps" Date: Mon, 16 Sep 2024 13:44:54 +0200 Message-ID: <20240916114227.035875884@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240916114224.509743970@linuxfoundation.org> References: <20240916114224.509743970@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-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]; }