]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dmaengine: Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
authorCaleb Connolly <caleb.connolly@linaro.org>
Sat, 8 Feb 2025 22:30:54 +0000 (22:30 +0000)
committerVinod Koul <vkoul@kernel.org>
Thu, 27 Feb 2025 07:59:15 +0000 (13:29 +0530)
This commit causes a hard crash on sdm845 and likely other platforms.
Revert it until a proper fix is found.

This reverts commit 57a7138d0627: ("dmaengine: qcom: bam_dma: Avoid writing
unavailable register")

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Fixes: 57a7138d0627 ("dmaengine: qcom: bam_dma: Avoid writing unavailable register")
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on sdm845-DB845c
Tested-by: David Heidelberg <david@ixit.cz>
Link: https://lore.kernel.org/r/20250208223112.142567-1-caleb.connolly@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/qcom/bam_dma.c

index c14557efd577046adc74fa83fd45eb239977b5fa..bbc3276992bb012a1b79937bdbd069fc01f75331 100644 (file)
@@ -59,9 +59,6 @@ struct bam_desc_hw {
 #define DESC_FLAG_NWD BIT(12)
 #define DESC_FLAG_CMD BIT(11)
 
-#define BAM_NDP_REVISION_START 0x20
-#define BAM_NDP_REVISION_END   0x27
-
 struct bam_async_desc {
        struct virt_dma_desc vd;
 
@@ -401,7 +398,6 @@ struct bam_device {
 
        /* dma start transaction tasklet */
        struct tasklet_struct task;
-       u32 bam_revision;
 };
 
 /**
@@ -445,10 +441,8 @@ static void bam_reset(struct bam_device *bdev)
        writel_relaxed(val, bam_addr(bdev, 0, BAM_CTRL));
 
        /* set descriptor threshold, start with 4 bytes */
-       if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START,
-                    BAM_NDP_REVISION_END))
-               writel_relaxed(DEFAULT_CNT_THRSHLD,
-                              bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
+       writel_relaxed(DEFAULT_CNT_THRSHLD,
+                       bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
 
        /* Enable default set of h/w workarounds, ie all except BAM_FULL_PIPE */
        writel_relaxed(BAM_CNFG_BITS_DEFAULT, bam_addr(bdev, 0, BAM_CNFG_BITS));
@@ -1006,10 +1000,9 @@ static void bam_apply_new_config(struct bam_chan *bchan,
                        maxburst = bchan->slave.src_maxburst;
                else
                        maxburst = bchan->slave.dst_maxburst;
-               if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START,
-                            BAM_NDP_REVISION_END))
-                       writel_relaxed(maxburst,
-                                      bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
+
+               writel_relaxed(maxburst,
+                              bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
        }
 
        bchan->reconfigure = 0;
@@ -1199,11 +1192,10 @@ 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;
+       }
 
        /* check that configured EE is within range */
        if (bdev->ee >= bdev->num_ees)