Skip to content

Commit b91872c

Browse files
committed
Merge tag 'dmaengine-fix-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine fixes from Vinod Koul: - tegra210 div_u64 divison and max page fixes - revert Qualcomm unavailable register workaround which is causing regression, fixes have been proposed but still gaps are present so revert this for now * tag 'dmaengine-fix-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dmaengine: Revert "dmaengine: qcom: bam_dma: Avoid writing unavailable register" dmaengine: tegra210-adma: check for adma max page dmaengine: tegra210-adma: Use div_u64 for 64 bit division
2 parents a760b10 + e521f51 commit b91872c

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

drivers/dma/qcom/bam_dma.c

+8-16
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)

drivers/dma/tegra210-adma.c

+5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ struct tegra_adma;
8383
* @nr_channels: Number of DMA channels available.
8484
* @ch_fifo_size_mask: Mask for FIFO size field.
8585
* @sreq_index_offset: Slave channel index offset.
86+
* @max_page: Maximum ADMA Channel Page.
8687
* @has_outstanding_reqs: If DMA channel can have outstanding requests.
88+
* @set_global_pg_config: Global page programming.
8789
*/
8890
struct tegra_adma_chip_data {
8991
unsigned int (*adma_get_burst_config)(unsigned int burst_size);
@@ -99,6 +101,7 @@ struct tegra_adma_chip_data {
99101
unsigned int nr_channels;
100102
unsigned int ch_fifo_size_mask;
101103
unsigned int sreq_index_offset;
104+
unsigned int max_page;
102105
bool has_outstanding_reqs;
103106
void (*set_global_pg_config)(struct tegra_adma *tdma);
104107
};
@@ -854,6 +857,7 @@ static const struct tegra_adma_chip_data tegra210_chip_data = {
854857
.nr_channels = 22,
855858
.ch_fifo_size_mask = 0xf,
856859
.sreq_index_offset = 2,
860+
.max_page = 0,
857861
.has_outstanding_reqs = false,
858862
.set_global_pg_config = NULL,
859863
};
@@ -871,6 +875,7 @@ static const struct tegra_adma_chip_data tegra186_chip_data = {
871875
.nr_channels = 32,
872876
.ch_fifo_size_mask = 0x1f,
873877
.sreq_index_offset = 4,
878+
.max_page = 4,
874879
.has_outstanding_reqs = true,
875880
.set_global_pg_config = tegra186_adma_global_page_config,
876881
};

0 commit comments

Comments
 (0)