[PATCH v2 1/4] soundwire: qcom: update status correctly with mask

Srinivas Kandagatla posted 4 patches 2 years, 3 months ago
[PATCH v2 1/4] soundwire: qcom: update status correctly with mask
Posted by Srinivas Kandagatla 2 years, 3 months ago
SoundWire device status can be incorrectly updated without
proper mask, fix this by adding a mask before updating the status.

Fixes: c7d49c76d1d5 ("soundwire: qcom: add support to new interrupts")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/soundwire/qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index aad5942e5980..9440787e924b 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -515,7 +515,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl)
 		status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ));
 
 		if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) {
-			ctrl->status[dev_num] = status;
+			ctrl->status[dev_num] = status & SWRM_MCP_SLV_STATUS_MASK;
 			return dev_num;
 		}
 	}
-- 
2.21.0
Re: [PATCH v2 1/4] soundwire: qcom: update status correctly with mask
Posted by Johan Hovold 2 years, 2 months ago
On Thu, May 25, 2023 at 02:38:09PM +0100, Srinivas Kandagatla wrote:
> SoundWire device status can be incorrectly updated without
> proper mask, fix this by adding a mask before updating the status.
> 
> Fixes: c7d49c76d1d5 ("soundwire: qcom: add support to new interrupts")
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---

When rebasing on 6.5-rc1, I noticed that this one was apparently never
merged along with the rest of the series.

Any idea how this could have happened?

And can we get this one into 6.5 as well?

>  drivers/soundwire/qcom.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index aad5942e5980..9440787e924b 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -515,7 +515,7 @@ static int qcom_swrm_get_alert_slave_dev_num(struct qcom_swrm_ctrl *ctrl)
>  		status = (val >> (dev_num * SWRM_MCP_SLV_STATUS_SZ));
>  
>  		if ((status & SWRM_MCP_SLV_STATUS_MASK) == SDW_SLAVE_ALERT) {
> -			ctrl->status[dev_num] = status;
> +			ctrl->status[dev_num] = status & SWRM_MCP_SLV_STATUS_MASK;
>  			return dev_num;
>  		}
>  	}

Johan