From: Vinod Koul <vkoul@kernel.org>
To: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: alsa-devel@alsa-project.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org,
pierre-louis.bossart@linux.intel.com,
srinivas.kandagatla@linaro.org, sanyog.r.kale@intel.com,
bard.liao@intel.com
Subject: Re: [PATCH] soundwire: cadence: recheck device0 attachment after status change
Date: Mon, 9 May 2022 12:00:32 +0530 [thread overview]
Message-ID: <Yni1CKb20D99kAce@matsya> (raw)
In-Reply-To: <20220420023039.14144-1-yung-chuan.liao@linux.intel.com>
On 20-04-22, 10:30, Bard Liao wrote:
> From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>
> This patch adds a status check after device0 attachment to solve race
> conditions observed during attachment with multiple devices per link
>
> The sequence is the following
>
> 1) deviceA attaches as device0
>
> 2) the hardware detects a device0 status change and throws an
> interrupt.
>
> 3) the interrupt handler schedules the work function
>
> 4) the workqueue starts, we read the status
> slave0 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT0);
> slave1 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT1);
>
> we deal with the status change and program deviceA device number to a
> non-zero value.
>
> 5) deviceB attaches as device0, the device0 status seen by the
> hardware does not change.
>
> 6) we clear the CDNS_MCP_SLAVE_INTSTAT0/1 registers -> we will never detect
> deviceB!
>
> This patch suggest re-checking in a loop the device0 status with a
> PING frame, i.e. using the real device0 status instead of information
> on status changes.
Applied, thanks
--
~Vinod
WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Bard Liao <yung-chuan.liao@linux.intel.com>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
gregkh@linuxfoundation.org, srinivas.kandagatla@linaro.org,
pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com,
bard.liao@intel.com
Subject: Re: [PATCH] soundwire: cadence: recheck device0 attachment after status change
Date: Mon, 9 May 2022 12:00:32 +0530 [thread overview]
Message-ID: <Yni1CKb20D99kAce@matsya> (raw)
In-Reply-To: <20220420023039.14144-1-yung-chuan.liao@linux.intel.com>
On 20-04-22, 10:30, Bard Liao wrote:
> From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>
> This patch adds a status check after device0 attachment to solve race
> conditions observed during attachment with multiple devices per link
>
> The sequence is the following
>
> 1) deviceA attaches as device0
>
> 2) the hardware detects a device0 status change and throws an
> interrupt.
>
> 3) the interrupt handler schedules the work function
>
> 4) the workqueue starts, we read the status
> slave0 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT0);
> slave1 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT1);
>
> we deal with the status change and program deviceA device number to a
> non-zero value.
>
> 5) deviceB attaches as device0, the device0 status seen by the
> hardware does not change.
>
> 6) we clear the CDNS_MCP_SLAVE_INTSTAT0/1 registers -> we will never detect
> deviceB!
>
> This patch suggest re-checking in a loop the device0 status with a
> PING frame, i.e. using the real device0 status instead of information
> on status changes.
Applied, thanks
--
~Vinod
next prev parent reply other threads:[~2022-05-09 6:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 2:30 [PATCH] soundwire: cadence: recheck device0 attachment after status change Bard Liao
2022-04-20 2:30 ` Bard Liao
2022-05-09 6:30 ` Vinod Koul [this message]
2022-05-09 6:30 ` Vinod Koul
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=Yni1CKb20D99kAce@matsya \
--to=vkoul@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=bard.liao@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=sanyog.r.kale@intel.com \
--cc=srinivas.kandagatla@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.