public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: "Mukunda,Vijendar" <vijendar.mukunda@amd.com>, vkoul@kernel.org
Cc: amadeuszx.slawinski@linux.intel.com, Mario.Limonciello@amd.com,
	Sunil-kumar.Dommati@amd.com, Basavaraj.Hiregoudar@amd.com,
	Mastan.Katragadda@amd.com, Arungopal.kondaveeti@amd.com,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Sanyog Kale <sanyog.r.kale@intel.com>,
	"moderated list:SOUNDWIRE SUBSYSTEM"
	<alsa-devel@alsa-project.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V2 5/8] soundwire: amd: add soundwire manager interrupt handling
Date: Tue, 14 Feb 2023 07:28:15 -0600	[thread overview]
Message-ID: <b632ba86-767f-2813-ad2d-4a3424e6b02e@linux.intel.com> (raw)
In-Reply-To: <f739053c-d19b-f773-cead-77abad53feec@amd.com>


>>>> +update_status:
>>>> +	sdw_handle_slave_status(&amd_manager->bus, amd_manager->status);
>>>> +	if (amd_manager->status[0] == SDW_SLAVE_ATTACHED) {
>>>> +		if (retry_count++ < SDW_MAX_DEVICES) {
>>>> +			acp_reg_writel(AMD_SDW_IRQ_MASK_0TO7, amd_manager->mmio +
>>>> +				       ACP_SW_STATE_CHANGE_STATUS_MASK_0TO7);
>>>> +			acp_reg_writel(AMD_SDW_IRQ_MASK_8TO11,
>>>> +				       amd_manager->mmio + ACP_SW_STATE_CHANGE_STATUS_MASK_8TO11);
>>>> +			amd_sdw_read_and_process_ping_status(amd_manager);
>>>> +			goto update_status;
>>>> +		} else {
>>>> +			dev_err_ratelimited(amd_manager->dev,
>>>> +					    "Device0 detected after %d iterations\n",
>>>> +					    retry_count);
>>>> +		}
>>>> +	}
>>> this seems rather inspired by the Cadence code, but is there really a
>>> case where you need to re-check for devices? In the Cadence case, this
>>> was added because we have a logical OR and new devices would not be handled.
>> As mentioned in V1 set, we have corner cases during enumeration sequence.
>> We observed device alerts are missing during peripheral enumeration sequence
>> when multiple peripheral devices are connected over the same link.
>> This is not inspired by Intel code.
>>
>> As per V1 version review comment, we have included retry_count logic to address
>> faulty case.
>>
>> We forgot to include comment. we will fix it.
> Slight correction in the explanation.
> 
> During the peripheral enumeration sequence, the soundwire peripheral interrupts
> are masked.
> If soundwire interrupts are not masked, it will cause side effects when multiple
> peripheral devices connected over the same link.
> As interrupts are masked, during device slot programming for each peripheral,
> soundwire manager driver won't receive any interrupts.
> 
> Once the device number programming is done for all peripherals, the soundwire
> interrupts will be unmasked. Read the peripheral device status from ping command
> and process the response, which will invoke the peripheral device initialization sequence.
> This sequence will ensure all peripheral devices enumerated and initialized
> properly.

Humm, the explanation is difficult to follow, it's not clear on which
side the interrupts are masked. Are you talking about the peripheral
being prevented from generating interrupts, or about the manager not
detecting peripheral state changes with an interrupt-based mechanism?

I am not sure what 'side effects' can happen, during enumeration all
devices show up as device0 and the SoundWire bus provides a mechanism to
enumerate without conflicts.

  reply	other threads:[~2023-02-14 19:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230213094031.2231058-1-Vijendar.Mukunda@amd.com>
2023-02-13  9:40 ` [PATCH V2 1/8] soundwire: export sdw_compute_slave_ports() function Vijendar Mukunda
2023-02-13  9:40 ` [PATCH V2 2/8] soundwire: amd: Add support for AMD Manager driver Vijendar Mukunda
2023-02-13 18:05   ` Pierre-Louis Bossart
2023-02-14  5:28     ` Mukunda,Vijendar
2023-02-14 13:21       ` Pierre-Louis Bossart
2023-02-14 22:29         ` Mukunda,Vijendar
2023-02-13  9:40 ` [PATCH V2 3/8] soundwire: amd: register soundwire manager dai ops Vijendar Mukunda
2023-02-13 18:09   ` Pierre-Louis Bossart
2023-02-14  5:49     ` Mukunda,Vijendar
2023-02-13  9:40 ` [PATCH V2 4/8] soundwire: amd: enable build for AMD soundwire manager driver Vijendar Mukunda
2023-02-13  9:40 ` [PATCH V2 5/8] soundwire: amd: add soundwire manager interrupt handling Vijendar Mukunda
2023-02-13 18:15   ` Pierre-Louis Bossart
2023-02-14  5:56     ` Mukunda,Vijendar
2023-02-14  7:54       ` Mukunda,Vijendar
2023-02-14 13:28         ` Pierre-Louis Bossart [this message]
2023-02-14 22:18           ` Mukunda,Vijendar
2023-02-13  9:40 ` [PATCH V2 6/8] soundwire: amd: add runtime pm ops for AMD soundwire manager driver Vijendar Mukunda
2023-02-13 18:20   ` Pierre-Louis Bossart
2023-02-14  6:13     ` Mukunda,Vijendar
2023-02-14 13:33       ` Pierre-Louis Bossart
2023-02-14 21:44         ` Mukunda,Vijendar
2023-02-13  9:40 ` [PATCH V2 7/8] soundwire: amd: handle soundwire wake enable interrupt Vijendar Mukunda
2023-02-13 18:24   ` Pierre-Louis Bossart
2023-02-14  6:15     ` Mukunda,Vijendar
2023-02-14 13:35       ` Pierre-Louis Bossart
2023-02-14 21:24         ` Mukunda,Vijendar
2023-02-13  9:40 ` [PATCH V2 8/8] soundwire: amd: add pm_prepare callback and pm ops support Vijendar Mukunda

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=b632ba86-767f-2813-ad2d-4a3424e6b02e@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=Arungopal.kondaveeti@amd.com \
    --cc=Basavaraj.Hiregoudar@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Mastan.Katragadda@amd.com \
    --cc=Sunil-kumar.Dommati@amd.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=amadeuszx.slawinski@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sanyog.r.kale@intel.com \
    --cc=vijendar.mukunda@amd.com \
    --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