From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.196 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795893146; b=D1dfH/ra+T0GEa/QKNNyFfcv7+i7v5kdkTgKpkGStEpxp0paZT5hmoz3PRgLwCCzZutz RxoT/gRuxoWdAx26DDHnRo460N33uXYRNK9EUl/YWmkbobypTO61ezq7VSGD+IGvpbEso s/HMmMuKqHdHlWhAiY8O3DbDVFW5je1hbFyoQRxrRs3Xn73+3Xf/jeDUL7Kr79W/iND7i l+a1cho3PqJH1pEYawQ01AKPKb8Wg5gG6fvy0GNIafG+SJjaslQ6EpI1YMsun9CDXGNTm HqAMDtDIkIB3uxYgeU63vXUKUZ1wVMzaa/5HHsXqBJITYdmeay8JQhy+sF92C92WadA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795893146; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=YXq08i5VhOlOyOnUfeOXATU1bCtCL1/4ucjI9N9pX24=; b=MvPh2/dBSfV80phy4qvQlhZtBhBL8u4c8rlOSrvliJAmby3SKIKEHtMtSYY7JbKg3oag gUsivXSCFRyyNyTOjMeO3eKLOvrlPyNNsuVdAiqJmDRSeYWu7KJ4j9jm2BN5x+I/JiGWy Dq21/usZaAI49uhRiZFINr6w6ZUwE7IKIumKujNkVGZlDI0q6dNd77FY+HDFc3Qp6PYxJ yFY6ro4tvy/hcLylQwATgtdbMLQb5D5lwdlmRUQpMITfTTZHSGdjSwzR6BRSuFgx2Xt4Y pyApzcKIsxpbDprmVYD1KZrRAckOt5H50HcpnWrCMvV2op0bIbe9v1fQr28K+kx6bWg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=LmkOnsCa; arc=none smtp.remote-ip=91.218.175.196 Received: from mta0.migadu.com (out-196.mta0.migadu.com [91.218.175.196]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 816D5606A321 for ; Sat, 28 Nov 2026 19:12:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 816D5606A321 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=LmkOnsCa X-Envelope-To: linux-kernel@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=CfVgOrH0XXa4YazJWm4LTuCtO5/eZT7AW6TbcTaSJ5A=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795893142; v=1; x=1796497942; b=LmkOnsCaFQ2OpcTFZAmU++n8TyHyJz98T2F8LFXHrw9rZq+2KvYOze6juJ4W8Zw2EkdOknTi mewsv4QGaJbmJV6A4PDUSSJPYTF/f+/VwapU7BMcVZRET3X4XZDMXI1CCV5RS9tkQcMWd5rldr0 JUz+edZ2TeyWHtGPgIVmt4tU= X-Envelope-To: linux-kernel@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 07b7a0be2df1316c; Sat, 28 Nov 2026 19:12:22 +0000 X-Mizu-Trace-ID: 07b7a0be2df1316c X-Migadu-Flow: FLOW_OUT Message-ID: Date: Sat, 28 Nov 2026 20:11:46 +0100 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: Gopi Chandra Sekhar Reddy Kanala , 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: Pierre-Louis Bossart In-Reply-To: <20261128-sdw-sdca-cascade-v1-1-a97540779103@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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. > 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 >