From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795942683; b=M6FGPOd2oHPgZ4kDWYQ2CipzRYG9o23Ismoh3Ukxr87S4/idRGHFohwLtSVgNpTieNBr vnNe5nEjxDlZwzfKTm/wEWaeY/nzMJ20UqQUc1EEkYC8PYvFkSE98ayc7BqI12bGJASj0 T3bNqZmu1qlKaQT/+n+ffobq19ER4boSZF8Zc5QAkmBJsMG6kV36g7OH9HevKjeb0K5Oi suacUnb/tQUBx6Wl2BMmcV2f4VOZfzeLxzA++6uDYd+NasToRNc2nCtv4vjAdtOnC0vDv lOIS01fr9Q9uGT4+cLhiXFl+YWnmYz6uAp3SbK+23uVaIWbugwmuodja/eAET0EeHjQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795942683; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Proofpoint-Spam-Info: X-Proofpoint-ORIG-GUID:X-Authority-Analysis: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=dNvcZFtxiaX3ni35op0Q5lL7thMLJmWR1C34+l0SkQI=; b=Zq68i+Y18oaxYc4NcKkIkh5jLk37VnP8V9+yDKaA211gYuPlPqjIKS8HHyHnHNmrYSSI l6GA182h6PLyGDeRDgxNxF3HcrkkXp4fwxZVcTa9fD70XBI0GAucElW6zuizJ8Mwx2n2Y PJshr+Oht6U6cPWck2Iy2AEuefiedcWvcmYJVYLz2CbhdIvQ/G6XKth6UjpfIjfbF8Qtq Ea8Shme64ym+YXQFt4P2Fi3kSdtyhJCkOFbTNjPy1D60uAtpIld/ci3luUYGkLZq4l9Jc mkAgrtBysydrIqVTY226EIdpXmmAcGLsMMhxkQxz31S/awAm8kyKQZkwzDyKPYSRcqg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=LHTeZab4; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=CjvS5Y0M; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 66C88606A323 for ; Sun, 29 Nov 2026 08:58:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 66C88606A323 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=LHTeZab4; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=CjvS5Y0M Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AT4IEEl3585560 for ; Sun, 29 Nov 2026 08:58:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= dNvcZFtxiaX3ni35op0Q5lL7thMLJmWR1C34+l0SkQI=; b=LHTeZab4bm8Agehs G6ljoF/5zNpX+PdERsyRfYADBaw//VMeQFGvPxTmALOdBBbRDhw+8Oz6FfAI1Qbs WBhcfNY0To19JJ109r1kfssvN/ZyCVMK8IudKy8rlJkEDaVMw2k7mPv78oak5oip filO9IpkqFUZFj6RlQ35xlHrdl5ljJwec4rbSKnxyRQ/tOzUMTdpsEYR9ps85cZh nQ7ZgVS0qiGczGYOXiaLzf0Gup3/qQHZPzN78ZGKFsb/36p4wrfrniD5U/TLLHzF liqyTEiShlpizxt8Zev3lfolfLKce/jRgwN4Ch5GgENcr9uti8gmmiCrwdygU5k8 bk25Og== Received: from mail-dy1-f199.google.com (mail-dy1-f199.google.com [74.125.82.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j7ny6aqeu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 29 Nov 2026 08:58:00 +0000 (GMT) Received: by mail-dy1-f199.google.com with SMTP id 5a478bee46e88-3425098ae4bso9536702eec.0 for ; Sun, 29 Nov 2026 00:58:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1795942680; x=1796547480; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dNvcZFtxiaX3ni35op0Q5lL7thMLJmWR1C34+l0SkQI=; b=CjvS5Y0MfU88ipnOLZjNlWQn7TiKA2NV8aS8V7iMT69oLYBJr88MXXpAZiaB40+dmY 4NsETSmjwrj2hhO6NCZdnRqiZk+JGUMvMVBhKoP5sZKPFBy2zj3ddyV3f1upHj2jkHqU wgEGGvpPj2ZsbwsD9M6gfSSvp4xrG3kYGb2HYbVqt/5mDCbHZ7b8tFMrssXGUhTIaMhf iK0jiS848/O8U2qEqD0PoMzJO9sjCjpCqL9dSOUFxWYui+fi89kk8aEdNeLC16UFNQ2j XV+AW/NE63k1ft9d+yykF83aXHCIbWlnJJKFpOvTGAOQgVayBP2r8keYbBgWev601Kax H3oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795942680; x=1796547480; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=dNvcZFtxiaX3ni35op0Q5lL7thMLJmWR1C34+l0SkQI=; b=VVyX1zR2WEpWb/sTNUEaSiCBKt9ecQggxG60h0swfF5sd0ln4yl6DrSS7z7Uml/jlZ 4MQ+Xpf9baqGzLTX+i7FyNBgd7tzdQjXNkDxmQ5c2LhnXunsHPTafCNNXt6gCB4i+WMW SmDmdAafLLro/rqIEoPauFmbm7FRYTd+k2YQeIHjmllF3xXTnI1qzZe3W3MRNc3JBRR4 W/G4AFLpNCCYMj0TPu/MuZhY+z+AsIwRIlC7g5+TTYpMWcELkkkS9TzwfCEP5oV2FPxS mK/DD81xnUSJ9eAgQ1fJiH2Sv8XywryHdOnBz0qhILyO5hFctVncmBsCwSSCspNXd+Oe cEKw== X-Forwarded-Encrypted: i=1; AL+hErEQ28GKzBcJ7gjVgY4aQMLEeQRIQaRhpQjp2HUlWMr70GC0Kji6tM8NxiOvJM/prG/SdDSGfVvuyNczxfw=@vger.kernel.org X-Gm-Message-State: APuU4Z+Fn3orgvY/MbIVju56KqHdqISxF9LH+ok+pxxBsyr1cy1rWHwE YGNCMr7VxM6+iKKtYDeReCwuxqAaCXh9iiVPkmzRDLHgNCtfjwOk9GIihR0KJW86Qq+dm0/lOU1 2LDedOxMiQ7ToYSuUWATsLwDIPKPXqH91Td95n5D/+ZQdVOab1XHUyAdzw6AzQEjVDmc= X-Gm-Gg: AZFdTZd6sDMxQuiKHf8pGJREjq37uM/U/+3K56myNcd1+6KkZ27b81okWV07TbGqjQw Wa/hgyQ02cAm92ZkbtUOzf983JSZDIVjqZd5IOGwvPcO5UUCM++KxN5B5NDqD1Kk39Z7Z3L07m9 BqRiZpFFkOOMKHjRZxvRTPFTw9Upet+BX2vTPuytiKLlWrY8BA0puQFkBfv1JV0KnrK4DgPS6/Y nZ8rdTPcwKL9/05WwC4DxOenjcGtJklrVj5VD51Os1ImDEuRfCVjy2yK6sSHkwXEHrQHXB8hsEb MOphi7WgLcd1x7pO4hiOtXKTngh1J/u/E2IlwZHG2uq6SSS/d52JvBwq1Ula9un55j5cUeshN5I S0mB0Qfr33eIVggRCoYpLsoIlHjMb1F7Lno7H6nIjIanSsRFA+3VQJsR/lFTOvt/WayhVIvg5sc lMH4ho X-Received: by 2002:a05:7022:3f0d:b0:1b5:32d6:6784 with SMTP id a92af1059eb24-1b5525f1012mr29791434c88.20.1795942679834; Sun, 29 Nov 2026 00:57:59 -0800 (PST) X-Received: by 2002:a05:7022:3f0d:b0:1b5:32d6:6784 with SMTP id a92af1059eb24-1b5525f1012mr29791413c88.20.1795942679270; Sun, 29 Nov 2026 00:57:59 -0800 (PST) Received: from [192.168.1.166] ([106.222.231.237]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5566c1142sm67679406c88.2.2026.11.29.00.57.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Nov 2026 00:57:58 -0800 (PST) Message-ID: <614f25fb-ad21-4c2b-80e1-7c5f83b4ebbb@oss.qualcomm.com> Date: Sun, 29 Nov 2026 14:27:54 +0530 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] soundwire: bus: detect SDCA cascade on peripherals reporting class_id 0 To: Pierre-Louis Bossart , Vinod Koul , Bard Liao Cc: linux-sound@vger.kernel.org, ckeepax@opensource.cirrus.com, linux-kernel@vger.kernel.org References: <20261128-sdw-sdca-cascade-v1-1-a97540779103@oss.qualcomm.com> Content-Language: en-US From: Gopi Chandra Sekhar Reddy Kanala In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYxMTI5MDAzNSBTYWx0ZWRfXwbaMIYx1fcRj WO39j/lvJY0VgJhUeHbEzOJK0jLvEwrhMPn1HRhzXn3wU/Q9xQEdpcswh6y3isF3GVPdmKLyZSW aedyHH/DSM8+DLlGLq7D9eZ4GcQNK2w= X-Proofpoint-ORIG-GUID: 8g770mFq-_QIaqiYqwGAUT8T4sU_uSK3 X-Authority-Analysis: v=2.4 cv=TMfQ2Fla c=1 sm=1 tr=0 ts=6b0be919 cx=c_pps a=cFYjgdjTJScbgFmBucgdfQ==:117 a=ZoHCIs2Qhxpyy06sOc1+0g==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=GRXm4R3AjzU_WkPqAgAA:9 a=QEXdDO2ut3YA:10 a=scEy_gLbYbu1JhEsrz4S:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTI5MDAzNSBTYWx0ZWRfXyq2r9eaX12OT WMI68B2vRdx1Xcv4ktfyrK2LCf7LyJYYSlUnUK+Vt5Y1YJrWnnDDEahVroM/V9uExrGKazmC9xu fGChsib4Cnt/tTF1Z15R1t44tKtvkS+18WGMOIZeASRXdUCl5a9sb3qkm3yUOBU6S7w3LmsoeYH oHlHi4+75vOsBvKD76SLCNGho9KEZTRXqBemQobQibJl8pC3EhikCO7ahYxPeKYqSHek5x3agK5 nIqgS2UZ2Ia0uGH07FWj+yHBgbPhHrj8ULW7wjlrsjJPdSPc7PZn1/r0sr0pK4Bbvtf+1hjSMto FoGBmSOJYfWF/hbT50ENVHuqpjoayL3L2Tp0riy007CRRjJiTr7ZRqQQKwgjKzci9hVAOHfwazk u690BrHomKBiJKYUZlMSVycHiy3+8Gl8lkmuACkoSaaW1C+5uWmztECuNjcYzmSDfwT3tWcpI3U Jk3QX+beyF3EiyzTDlA== X-Proofpoint-GUID: 8g770mFq-_QIaqiYqwGAUT8T4sU_uSK3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-29_02,2026-11-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 priorityscore=1501 phishscore=0 impostorscore=0 spamscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611290035 On 29-11-2026 00:41, Pierre-Louis Bossart wrote: > On 11/28/26 09:03, Gopi Chandra Sekhar Reddy Kanala wrote: >> sdw_handle_slave_alerts() only reads DP0_INT, and so can only ever see >> SDCA_CASCADE, when the peripheral enumerates with a non-zero class_id. >> That is what the SDCA amendment requires, and it holds for most SDCA >> peripherals. >> >> A peripheral that enumerates with DevId_5 == 0 has its SDCA interrupts >> left invisible to the bus driver: SDCA_CASCADE is never read, so >> slave_notify is never set from it, and if the peripheral also masks >> SCP_INT1.IMPL_DEF there is no other path to it either. Neither >> handle_nested_irq() nor .interrupt_callback() is ever reached and the >> SDCA regmap-irq handlers for its Functions never run, so interrupt >> driven features such as jack detection silently do nothing. WCD9378 is >> one such peripheral. >> >> Fall back to sdca_data.num_functions when class_id is zero. It is >> already maintained for every SDCA peripheral: the ACPI path fills it in >> from the DisCo tables, and a peripheral with no DisCo enumeration seeds >> it from its own .probe, in both cases long before an SDCA interrupt can >> be unmasked. No new property or quirk is needed, and nothing changes >> for a peripheral that reports its class_id correctly. > > This would work to cover this very odd corner case. > > Just wondering if it could be improved to only deal with SDCA cascade > *if* there are actually interrupts reported. the num_functions > 0 > criterion is rather broad, a device such as a simple amplifier could be > built in such a way that no interrupts are reported, ever. With the > suggested solution one would read a register for no good reason. It's > not that bad, but it's not great either. I don't think the additional check broadens things much in practice. Devices with a valid SDCA class_id already read DP0_INT on every alert today, regardless of whether any SDCA interrupts are ultimately reported. The added num_functions check only affects class_id == 0 devices, so the corner case you're describing would need to both enumerate with class_id == 0 and have no SDCA interrupt sources. -Gopi >> Signed-off-by: Gopi Chandra Sekhar Reddy Kanala >> --- >> A follow-up ASoC series enabling jack detection on the WCD9378 SDCA >> codec depends on this at runtime; there is no build dependency and it >> will be posted separately once this is applied. >> --- >> drivers/soundwire/bus.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/soundwire/bus.c b/drivers/soundwire/bus.c >> index aeaae5a57c89..4a88b2af7447 100644 >> --- a/drivers/soundwire/bus.c >> +++ b/drivers/soundwire/bus.c >> @@ -1693,7 +1693,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) >> goto io_err; >> } >> >> - if (slave->id.class_id) { >> + if (slave->id.class_id || slave->sdca_data.num_functions) { >> ret = sdw_read_no_pm(slave, SDW_DP0_INT); >> if (ret < 0) { >> dev_err(&slave->dev, >> @@ -1833,7 +1833,7 @@ static int sdw_handle_slave_alerts(struct sdw_slave *slave) >> goto io_err; >> } >> >> - if (slave->id.class_id) { >> + if (slave->id.class_id || slave->sdca_data.num_functions) { >> ret = sdw_read_no_pm(slave, SDW_DP0_INT); >> if (ret < 0) { >> dev_err(&slave->dev, >> >> --- >> base-commit: 909ef7a9a30fa139e69e555e3606680f5cca7726 >> change-id: 20261128-sdw-sdca-cascade-8c6ab0089ffb >> >> Best regards, >> -- >> Gopi Chandra Sekhar Reddy Kanala >> >