Skip to content

Commit e521f51

Browse files
kcxtvinodkoul
authored andcommitted
dmaengine: Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register"
This commit causes a hard crash on sdm845 and likely other platforms. Revert it until a proper fix is found. This reverts commit 57a7138: ("dmaengine: qcom: bam_dma: Avoid writing unavailable register") Signed-off-by: Caleb Connolly <[email protected]> Fixes: 57a7138 ("dmaengine: qcom: bam_dma: Avoid writing unavailable register") Tested-by: Neil Armstrong <[email protected]> # on sdm845-DB845c Tested-by: David Heidelberg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 76ed9b7 commit e521f51

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

drivers/dma/qcom/bam_dma.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ struct bam_desc_hw {
5959
#define DESC_FLAG_NWD BIT(12)
6060
#define DESC_FLAG_CMD BIT(11)
6161

62-
#define BAM_NDP_REVISION_START 0x20
63-
#define BAM_NDP_REVISION_END 0x27
64-
6562
struct bam_async_desc {
6663
struct virt_dma_desc vd;
6764

@@ -401,7 +398,6 @@ struct bam_device {
401398

402399
/* dma start transaction tasklet */
403400
struct tasklet_struct task;
404-
u32 bam_revision;
405401
};
406402

407403
/**
@@ -445,10 +441,8 @@ static void bam_reset(struct bam_device *bdev)
445441
writel_relaxed(val, bam_addr(bdev, 0, BAM_CTRL));
446442

447443
/* set descriptor threshold, start with 4 bytes */
448-
if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START,
449-
BAM_NDP_REVISION_END))
450-
writel_relaxed(DEFAULT_CNT_THRSHLD,
451-
bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
444+
writel_relaxed(DEFAULT_CNT_THRSHLD,
445+
bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
452446

453447
/* Enable default set of h/w workarounds, ie all except BAM_FULL_PIPE */
454448
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,
10061000
maxburst = bchan->slave.src_maxburst;
10071001
else
10081002
maxburst = bchan->slave.dst_maxburst;
1009-
if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START,
1010-
BAM_NDP_REVISION_END))
1011-
writel_relaxed(maxburst,
1012-
bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
1003+
1004+
writel_relaxed(maxburst,
1005+
bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
10131006
}
10141007

10151008
bchan->reconfigure = 0;
@@ -1199,11 +1192,10 @@ static int bam_init(struct bam_device *bdev)
11991192
u32 val;
12001193

12011194
/* read revision and configuration information */
1202-
val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION));
1203-
if (!bdev->num_ees)
1195+
if (!bdev->num_ees) {
1196+
val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION));
12041197
bdev->num_ees = (val >> NUM_EES_SHIFT) & NUM_EES_MASK;
1205-
1206-
bdev->bam_revision = val & REVISION_MASK;
1198+
}
12071199

12081200
/* check that configured EE is within range */
12091201
if (bdev->ee >= bdev->num_ees)

0 commit comments

Comments
 (0)