* [PATCH v2] dmaengine: qcom: bam_dma: Fix BAM_RIVISON register handling
@ 2025-01-17 11:13 Md Sadre Alam
2025-01-19 5:41 ` Manivannan Sadhasivam
0 siblings, 1 reply; 3+ messages in thread
From: Md Sadre Alam @ 2025-01-17 11:13 UTC (permalink / raw)
To: vkoul, robin.murphy, linux-arm-msm, dmaengine, linux-kernel
Cc: quic_mdalam, quic_varada, quic_srichara
This patch resolves a bug from the previous commit where the
BAM_DESC_CNT_TRSHLD register was conditionally written based on BAM-NDP
mode. It also fixes an issue where reading the BAM_REVISION register
would hang if num-ees was not zero, which occurs when the SoCs power on
BAM remotely. The BAM_REVISION register read has been moved to inside if
condition.
Cc: stable@vger.kernel.org
Fixes: 57a7138d0627 ("dmaengine: qcom: bam_dma: Avoid writing unavailable register")
Reported-by: Georgi Djakov <djakov@kernel.org>
Link: https://lore.kernel.org/lkml/9ef3daa8-cdb1-49f2-8d19-a72d6210ff3a@kernel.org/
Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
---
Change in [v2]
* Removed unnecessary if checks.
* Relocated the BAM_REVISION register read within the if condition.
Change in [v1]
* https://lore.kernel.org/lkml/1a5fc7e9-39fe-e527-efc3-1ea990bbb53b@quicinc.com/
* Posted initial fixup for BAM revision register read handling
drivers/dma/qcom/bam_dma.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index c14557efd577..d227b4f5b6b9 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -1199,11 +1199,11 @@ static int bam_init(struct bam_device *bdev)
u32 val;
/* read revision and configuration information */
- val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION));
- if (!bdev->num_ees)
+ if (!bdev->num_ees) {
+ val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION));
bdev->num_ees = (val >> NUM_EES_SHIFT) & NUM_EES_MASK;
-
- bdev->bam_revision = val & REVISION_MASK;
+ bdev->bam_revision = val & REVISION_MASK;
+ }
/* check that configured EE is within range */
if (bdev->ee >= bdev->num_ees)
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] dmaengine: qcom: bam_dma: Fix BAM_RIVISON register handling
2025-01-17 11:13 [PATCH v2] dmaengine: qcom: bam_dma: Fix BAM_RIVISON register handling Md Sadre Alam
@ 2025-01-19 5:41 ` Manivannan Sadhasivam
2025-01-20 6:25 ` Md Sadre Alam
0 siblings, 1 reply; 3+ messages in thread
From: Manivannan Sadhasivam @ 2025-01-19 5:41 UTC (permalink / raw)
To: Md Sadre Alam
Cc: vkoul, robin.murphy, linux-arm-msm, dmaengine, linux-kernel,
quic_varada, quic_srichara
On Fri, Jan 17, 2025 at 04:43:02PM +0530, Md Sadre Alam wrote:
> This patch resolves a bug from the previous commit where the
> BAM_DESC_CNT_TRSHLD register was conditionally written based on BAM-NDP
> mode. It also fixes an issue where reading the BAM_REVISION register
The 'also' sounds like the patch is fixing 2 issues, but it is just fixing one.
> would hang if num-ees was not zero, which occurs when the SoCs power on
> BAM remotely. The BAM_REVISION register read has been moved to inside if
> condition.
>
> Cc: stable@vger.kernel.org
The offending commit is just in the -next branch. So CCing stable is pointless.
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] dmaengine: qcom: bam_dma: Fix BAM_RIVISON register handling
2025-01-19 5:41 ` Manivannan Sadhasivam
@ 2025-01-20 6:25 ` Md Sadre Alam
0 siblings, 0 replies; 3+ messages in thread
From: Md Sadre Alam @ 2025-01-20 6:25 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: vkoul, robin.murphy, linux-arm-msm, dmaengine, linux-kernel,
quic_varada, quic_srichara
On 1/19/2025 11:11 AM, Manivannan Sadhasivam wrote:
> On Fri, Jan 17, 2025 at 04:43:02PM +0530, Md Sadre Alam wrote:
>> This patch resolves a bug from the previous commit where the
>> BAM_DESC_CNT_TRSHLD register was conditionally written based on BAM-NDP
>> mode. It also fixes an issue where reading the BAM_REVISION register
>
> The 'also' sounds like the patch is fixing 2 issues, but it is just fixing one.
Will update the commit message in next revision.
>
>> would hang if num-ees was not zero, which occurs when the SoCs power on
>> BAM remotely. The BAM_REVISION register read has been moved to inside if
>> condition.
>>
>> Cc: stable@vger.kernel.org
>
> The offending commit is just in the -next branch. So CCing stable is pointless.
Ok, will remove in next revision.
>
> - Mani
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-20 6:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-17 11:13 [PATCH v2] dmaengine: qcom: bam_dma: Fix BAM_RIVISON register handling Md Sadre Alam
2025-01-19 5:41 ` Manivannan Sadhasivam
2025-01-20 6:25 ` Md Sadre Alam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox