The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Richard Fitzgerald <rf@opensource.cirrus.com>,
	vkoul@kernel.org, yung-chuan.liao@linux.intel.com,
	sanyog.r.kale@intel.com
Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/5] soundwire: cadence: Fix lost ATTACHED interrupts when enumerating
Date: Wed, 14 Sep 2022 15:48:56 +0200	[thread overview]
Message-ID: <1b506127-f992-b554-e984-589dc46aa110@linux.intel.com> (raw)
In-Reply-To: <20220914120949.747951-5-rf@opensource.cirrus.com>


> diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
> index 245191d22ccd..2f131604d884 100644
> --- a/drivers/soundwire/cadence_master.c
> +++ b/drivers/soundwire/cadence_master.c
> @@ -954,9 +954,22 @@ static void cdns_update_slave_status_work(struct work_struct *work)
>  	u32 device0_status;
>  	int retry_count = 0;
>  
> +	/*
> +	 * Clear main interrupt first so we don't lose any assertions
> +	 * the happen during this function.

typo: that happen?

The flow looks good to me otherwise, so

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> +	 */
> +	cdns_writel(cdns, CDNS_MCP_INTSTAT, CDNS_MCP_INT_SLAVE_MASK);
> +
>  	slave0 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT0);
>  	slave1 = cdns_readl(cdns, CDNS_MCP_SLAVE_INTSTAT1);
>  
> +	/*
> +	 * Clear the bits before handling so we don't lose any
> +	 * bits that re-assert.
> +	 */
> +	cdns_writel(cdns, CDNS_MCP_SLAVE_INTSTAT0, slave0);
> +	cdns_writel(cdns, CDNS_MCP_SLAVE_INTSTAT1, slave1);
> +
>  	/* combine the two status */
>  	slave_intstat = ((u64)slave1 << 32) | slave0;
>  
> @@ -964,8 +977,6 @@ static void cdns_update_slave_status_work(struct work_struct *work)
>  
>  update_status:
>  	cdns_update_slave_status(cdns, slave_intstat);
> -	cdns_writel(cdns, CDNS_MCP_SLAVE_INTSTAT0, slave0);
> -	cdns_writel(cdns, CDNS_MCP_SLAVE_INTSTAT1, slave1);
>  
>  	/*
>  	 * When there is more than one peripheral per link, it's
> @@ -982,6 +993,11 @@ static void cdns_update_slave_status_work(struct work_struct *work)
>  	 * attention with PING commands. There is no need to check for
>  	 * ALERTS since they are not allowed until a non-zero
>  	 * device_number is assigned.
> +	 *
> +	 * Do not clear the INTSTAT0/1. While looping to enumerate devices on
> +	 * #0 there could be status changes on other devices - these must
> +	 * be kept in the INTSTAT so they can be handled when all #0 devices
> +	 * have been handled.
>  	 */
>  
>  	device0_status = cdns_readl(cdns, CDNS_MCP_SLAVE_STAT);
> @@ -1001,8 +1017,7 @@ static void cdns_update_slave_status_work(struct work_struct *work)
>  		}
>  	}
>  
> -	/* clear and unmask Slave interrupt now */
> -	cdns_writel(cdns, CDNS_MCP_INTSTAT, CDNS_MCP_INT_SLAVE_MASK);
> +	/* unmask Slave interrupt now */
>  	cdns_updatel(cdns, CDNS_MCP_INTMASK,
>  		     CDNS_MCP_INT_SLAVE_MASK, CDNS_MCP_INT_SLAVE_MASK);
>  

  reply	other threads:[~2022-09-14 14:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 12:09 [PATCH v3 0/5] soundwire: Fixes for spurious and missing UNATTACH Richard Fitzgerald
2022-09-14 12:09 ` [PATCH v3 1/5] soundwire: cadence: fix updating slave status when a bus has multiple peripherals Richard Fitzgerald
2022-09-14 12:09 ` [PATCH v3 2/5] soundwire: bus: Don't lose unattach notifications Richard Fitzgerald
2022-09-14 12:09 ` [PATCH v3 3/5] soundwire: bus: Don't re-enumerate before status is UNATTACHED Richard Fitzgerald
2022-09-14 12:09 ` [PATCH v3 4/5] soundwire: cadence: Fix lost ATTACHED interrupts when enumerating Richard Fitzgerald
2022-09-14 13:48   ` Pierre-Louis Bossart [this message]
2022-09-14 14:30     ` Richard Fitzgerald
2022-09-14 12:09 ` [PATCH v3 5/5] soundwire: bus: Don't exit early if no device IDs were programmed Richard Fitzgerald
2022-09-14 13:58   ` Pierre-Louis Bossart
2022-09-14 14:00 ` [PATCH v3 0/5] soundwire: Fixes for spurious and missing UNATTACH 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=1b506127-f992-b554-e984-589dc46aa110@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rf@opensource.cirrus.com \
    --cc=sanyog.r.kale@intel.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