From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.128 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795957260; b=vZvrZ2F9w2bdbD1wh/GAAiydy1Csk9OhQpps4UQ3lHZ0yN69RuOjV+8icto71gtzGR9w IT8KJYPAoLYExCmBvfqBGpmXynZSjR+QKVpodWTRp6PJ5WIPuMyOv1LbTnJsjxP0NuV6K g9DvWN4xUMI6lLn7t604rBTU+3vx7HfWKiZZZ+G9Aa1kCJ0F8kDETXL8BAAApwDxQa63O Jic3MIJ/0lvSObEtLIuusFODzfSR5G+JJRmUzXN45UdmafbQUdmZVLzhm8rNeV9ABxBtA nF3V5hV3Gvk3hQ6jguSdMwrrt+JSwzwSq0EpjXvi1wTuRrnIuXXZ7n9nN2O+jkl2pSg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795957260; 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=Q++KJbvJXh1EaUkP0EnVx/q/VkG8gmSI3z8aNmlsdY8=; b=YAQDGEwl3ERqIYaSnrb9yQXmlo+WBzftbHm6zVL+K24NkqYT+kLSBaj9IV+2etBsCA18 JMEs9EG4QLDtfgps9B3y8ThT1meUKbGr3OX0m990AUfc+ZUYNBQ6rvED4p9XTCByRBiu4 1jtK11WhST6ljCF3YTmoWvwXFcwEwzFXWxpRZ2rCVHwk8fKhpQ1vwGNomW13Xl+S6tqB7 D3ZvCLEYONES5F+pgUCfL776Enw17pyvoTFDyWH2XNB8MU17XMY/zweud6n5AyvwD7jyA pviqcl5eLE0Bw2cqTXF/8W5gRYTVKAzkjwnuHkykzlQD8heWZA3kSSFVfp+RfTHI4hQ== 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=w1Gkl0PT; arc=none smtp.remote-ip=91.218.175.128 Received: from mta0.migadu.com (out-128.mta0.migadu.com [91.218.175.128]) (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 599FB606A323 for ; Sun, 29 Nov 2026 13:00:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 599FB606A323 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=w1Gkl0PT X-Envelope-To: linux-sound@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=GOu81qpcwIBdEGbvrENBo17E6Z/Q8BBFX5uh+6hsQy0=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795957252; v=1; x=1796562052; b=w1Gkl0PTDc0iYK0hjb/MAa39lH+ygOGtRz2cByz7E2KPixkrI/7X0fXskQnLtrgsilV9geCi M8JT6YrSBxDJpITeKZLsUfOXMZmZBSPdzry5LxGuhlEAXoKi50WFNxUKsQc4mp+yG0ePCtdqUNS B5yBlxRLIYZaP9U7890WoGS0= X-Envelope-To: linux-sound@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id f942e174dbcab86a; Sun, 29 Nov 2026 13:00:52 +0000 X-Mizu-Trace-ID: f942e174dbcab86a X-Migadu-Flow: FLOW_OUT Message-ID: <9c26a64e-6176-4fc5-ae21-c3f3a519adba@linux.dev> Date: Sun, 29 Nov 2026 14:00:05 +0100 X-Mailing-List: linux-sound@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> <614f25fb-ad21-4c2b-80e1-7c5f83b4ebbb@oss.qualcomm.com> Content-Language: en-US From: Pierre-Louis Bossart In-Reply-To: <614f25fb-ad21-4c2b-80e1-7c5f83b4ebbb@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/29/26 09:57, Gopi Chandra Sekhar Reddy Kanala wrote: > > > 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. well, we could also change the behavior for 'normal' devices with a valid class_id... That way no need to special case this problematic device, and everyone benefits by only reading DP0 if there is actually an interrupt to handle.