[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b632ba86-767f-2813-ad2d-4a3424e6b02e@linux.intel.com>
Date: Tue, 14 Feb 2023 07:28:15 -0600
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: "Mukunda,Vijendar" <vijendar.mukunda@....com>, vkoul@...nel.org
Cc: amadeuszx.slawinski@...ux.intel.com, Mario.Limonciello@....com,
Sunil-kumar.Dommati@....com, Basavaraj.Hiregoudar@....com,
Mastan.Katragadda@....com, Arungopal.kondaveeti@....com,
Bard Liao <yung-chuan.liao@...ux.intel.com>,
Sanyog Kale <sanyog.r.kale@...el.com>,
"moderated list:SOUNDWIRE SUBSYSTEM" <alsa-devel@...a-project.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2 5/8] soundwire: amd: add soundwire manager interrupt
handling
>>>> +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.
Powered by blists - more mailing lists