From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C047ECE564 for ; Tue, 10 Sep 2024 13:50:34 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1DC36EC1; Tue, 10 Sep 2024 15:50:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1DC36EC1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1725976232; bh=sB67UM2Zr/q7FoL8u4RtQFupw/SD6hgP282y93A+VVc=; h=Date:Subject:From:To:Cc:References:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=g6YmF4jRk0OXPilCIJvKLhp0drEqfarWgdC1L+6CBKIpoJ+pt7uVfxQuhO3dN6Xf2 5PwAC8c29J4B6yFE4Vv1EktTXkTa7TBzFlbTAIN4LLklMJs5eML8IVArYhBjmS1O++ ztXcMBsi+SpZkT78TmZOI9EO8+wk8Ia05ciWF9iQ= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 92EB9F805AE; Tue, 10 Sep 2024 15:50:01 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id CDA81F805AE; Tue, 10 Sep 2024 15:50:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B7763F801F5; Tue, 10 Sep 2024 15:49:55 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 39781F80027 for ; Tue, 10 Sep 2024 15:49:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 39781F80027 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=lKqFcj0N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1725976194; x=1757512194; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=sB67UM2Zr/q7FoL8u4RtQFupw/SD6hgP282y93A+VVc=; b=lKqFcj0Nfl2R8Ef3X4LEnc6cklkSfqgR6wWbE/SIPhkG0em8Sp4FajIu I5Zlz6UOHqItDWu34uV5a63kXHVGRmpSqbZzBMFmZkeWHUNBPoheT9NQO 8/1qX4oQlRToCRyuWY83GlsHhO5JygYMAlXSkwBs2jAXiTwBQ/jOfGKhM fJMRNoFfFXzAp07Vaoyn/Z0nc3EArMktcOF2X0b+aEvek9mXR4ZnhXh2B G38wGauu9kwdoBtcr4KA1BYoTLFdkY5jK1mdjYhHpd5I+zGIKrdcMM2pl rm0np0pmnU6lfSzYII0wmbk/AvOdL1gzCpDp5dOTrqxiId5nobbvuRleH A==; X-CSE-ConnectionGUID: ZbBWKvueROCS1uNxciTOAA== X-CSE-MsgGUID: FTW/AFZ9QlaF38cpuCnkvg== X-IronPort-AV: E=McAfee;i="6700,10204,11191"; a="42240469" X-IronPort-AV: E=Sophos;i="6.10,217,1719903600"; d="scan'208";a="42240469" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2024 06:49:48 -0700 X-CSE-ConnectionGUID: re10FFAzQcigLzN/JNyLIQ== X-CSE-MsgGUID: eGchYnd+QDWW4DIT/4hATQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.10,217,1719903600"; d="scan'208";a="66652238" Received: from maurocar-mobl2.ger.corp.intel.com (HELO [10.245.245.155]) ([10.245.245.155]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2024 06:49:46 -0700 Message-ID: Date: Tue, 10 Sep 2024 16:49:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RESEND] soundwire: stream: Revert "soundwire: stream: fix programming slave ports for non-continous port maps" From: =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= To: Krzysztof Kozlowski , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Charles Keepax , stable@vger.kernel.org References: <20240909164746.136629-1-krzysztof.kozlowski@linaro.org> <568137f5-4e4f-4df7-8054-011977077098@linux.intel.com> Content-Language: en-US In-Reply-To: <568137f5-4e4f-4df7-8054-011977077098@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID-Hash: EIJPIJ5MDNTLD34ZU56O4HEEL5TNIVPK X-Message-ID-Hash: EIJPIJ5MDNTLD34ZU56O4HEEL5TNIVPK X-MailFrom: peter.ujfalusi@linux.intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 10/09/2024 16:05, Péter Ujfalusi wrote: > > > On 09/09/2024 19:47, Krzysztof Kozlowski wrote: >> 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: >> Signed-off-by: Krzysztof Kozlowski > > Tested-by: Peter Ujfalusi Vinod: can you pick this patch for 6.11 if there is still time since upstream is also broken since 6.11-rc6 > >> >> --- >> >> Resending with Ack/Rb tags and missing Cc-stable. >> --- >> drivers/soundwire/stream.c | 8 ++++---- >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c >> index f275143d7b18..7aa4900dcf31 100644 >> --- a/drivers/soundwire/stream.c >> +++ b/drivers/soundwire/stream.c >> @@ -1291,18 +1291,18 @@ struct sdw_dpn_prop *sdw_get_slave_dpn_prop(struct sdw_slave *slave, >> 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]; >> } > -- Péter