mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gopi Chandra Sekhar Reddy Kanala <gopi.kanala@oss.qualcomm.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
	Vinod Koul <vkoul@kernel.org>,
	Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: linux-sound@vger.kernel.org, ckeepax@opensource.cirrus.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soundwire: bus: detect SDCA cascade on peripherals reporting class_id 0
Date: Mon, 30 Nov 2026 19:02:59 +0530	[thread overview]
Message-ID: <b3df1500-176e-41ec-a986-1a7487855f52@oss.qualcomm.com> (raw)
In-Reply-To: <9c26a64e-6176-4fc5-ae21-c3f3a519adba@linux.dev>



On 29-11-2026 18:30, Pierre-Louis Bossart wrote:
> 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.

The challenge is determining what we'd use as the condition. DP0_INT 
feeds both the nested-IRQ path and sdca_cascade handling, and SDCA 
peripherals don't all appear to consume interrupt information in the 
same way. I'm not sure we have a reliable existing indicator that would 
let us safely determine when a DP0_INT read can be skipped for all SDCA 
devices. Did you have something specific in mind?


  reply	other threads:[~2026-11-30 13:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28  8:03 Gopi Chandra Sekhar Reddy Kanala
2026-11-28 19:11 ` Pierre-Louis Bossart
2026-11-29  8:57   ` Gopi Chandra Sekhar Reddy Kanala
2026-11-29 13:00     ` Pierre-Louis Bossart
2026-11-30 13:32       ` Gopi Chandra Sekhar Reddy Kanala [this message]
2026-11-30 14:29         ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b3df1500-176e-41ec-a986-1a7487855f52@oss.qualcomm.com \
    --to=gopi.kanala@oss.qualcomm.com \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®