Skip to content

Commit

Permalink
dmaengine: Revert "dmaengine: qcom: bam_dma: Avoid writing unavailabl…
Browse files Browse the repository at this point in the history
…e 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 <caleb.connolly@linaro.org>
Fixes: 57a7138 ("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>
  • Loading branch information
Caleb Connolly authored and Vinod Koul committed Feb 27, 2025
1 parent 76ed9b7 commit e521f51
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions drivers/dma/qcom/bam_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -401,7 +398,6 @@ struct bam_device {

/* dma start transaction tasklet */
struct tasklet_struct task;
u32 bam_revision;
};

/**
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e521f51

Please sign in to comment.