Skip to content
Snippets Groups Projects
Commit b91872c5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents a760b101 e521f516
No related branches found
No related tags found
No related merge requests found
...@@ -59,9 +59,6 @@ struct bam_desc_hw { ...@@ -59,9 +59,6 @@ struct bam_desc_hw {
#define DESC_FLAG_NWD BIT(12) #define DESC_FLAG_NWD BIT(12)
#define DESC_FLAG_CMD BIT(11) #define DESC_FLAG_CMD BIT(11)
#define BAM_NDP_REVISION_START 0x20
#define BAM_NDP_REVISION_END 0x27
struct bam_async_desc { struct bam_async_desc {
struct virt_dma_desc vd; struct virt_dma_desc vd;
...@@ -401,7 +398,6 @@ struct bam_device { ...@@ -401,7 +398,6 @@ struct bam_device {
/* dma start transaction tasklet */ /* dma start transaction tasklet */
struct tasklet_struct task; struct tasklet_struct task;
u32 bam_revision;
}; };
/** /**
...@@ -445,10 +441,8 @@ static void bam_reset(struct bam_device *bdev) ...@@ -445,10 +441,8 @@ static void bam_reset(struct bam_device *bdev)
writel_relaxed(val, bam_addr(bdev, 0, BAM_CTRL)); writel_relaxed(val, bam_addr(bdev, 0, BAM_CTRL));
/* set descriptor threshold, start with 4 bytes */ /* set descriptor threshold, start with 4 bytes */
if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START, writel_relaxed(DEFAULT_CNT_THRSHLD,
BAM_NDP_REVISION_END)) 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 */ /* 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)); 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, ...@@ -1006,10 +1000,9 @@ static void bam_apply_new_config(struct bam_chan *bchan,
maxburst = bchan->slave.src_maxburst; maxburst = bchan->slave.src_maxburst;
else else
maxburst = bchan->slave.dst_maxburst; maxburst = bchan->slave.dst_maxburst;
if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START,
BAM_NDP_REVISION_END)) writel_relaxed(maxburst,
writel_relaxed(maxburst, bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD));
} }
bchan->reconfigure = 0; bchan->reconfigure = 0;
...@@ -1199,11 +1192,10 @@ static int bam_init(struct bam_device *bdev) ...@@ -1199,11 +1192,10 @@ static int bam_init(struct bam_device *bdev)
u32 val; u32 val;
/* read revision and configuration information */ /* 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->num_ees = (val >> NUM_EES_SHIFT) & NUM_EES_MASK;
}
bdev->bam_revision = val & REVISION_MASK;
/* check that configured EE is within range */ /* check that configured EE is within range */
if (bdev->ee >= bdev->num_ees) if (bdev->ee >= bdev->num_ees)
......
...@@ -83,7 +83,9 @@ struct tegra_adma; ...@@ -83,7 +83,9 @@ struct tegra_adma;
* @nr_channels: Number of DMA channels available. * @nr_channels: Number of DMA channels available.
* @ch_fifo_size_mask: Mask for FIFO size field. * @ch_fifo_size_mask: Mask for FIFO size field.
* @sreq_index_offset: Slave channel index offset. * @sreq_index_offset: Slave channel index offset.
* @max_page: Maximum ADMA Channel Page.
* @has_outstanding_reqs: If DMA channel can have outstanding requests. * @has_outstanding_reqs: If DMA channel can have outstanding requests.
* @set_global_pg_config: Global page programming.
*/ */
struct tegra_adma_chip_data { struct tegra_adma_chip_data {
unsigned int (*adma_get_burst_config)(unsigned int burst_size); unsigned int (*adma_get_burst_config)(unsigned int burst_size);
...@@ -99,6 +101,7 @@ struct tegra_adma_chip_data { ...@@ -99,6 +101,7 @@ struct tegra_adma_chip_data {
unsigned int nr_channels; unsigned int nr_channels;
unsigned int ch_fifo_size_mask; unsigned int ch_fifo_size_mask;
unsigned int sreq_index_offset; unsigned int sreq_index_offset;
unsigned int max_page;
bool has_outstanding_reqs; bool has_outstanding_reqs;
void (*set_global_pg_config)(struct tegra_adma *tdma); void (*set_global_pg_config)(struct tegra_adma *tdma);
}; };
...@@ -854,6 +857,7 @@ static const struct tegra_adma_chip_data tegra210_chip_data = { ...@@ -854,6 +857,7 @@ static const struct tegra_adma_chip_data tegra210_chip_data = {
.nr_channels = 22, .nr_channels = 22,
.ch_fifo_size_mask = 0xf, .ch_fifo_size_mask = 0xf,
.sreq_index_offset = 2, .sreq_index_offset = 2,
.max_page = 0,
.has_outstanding_reqs = false, .has_outstanding_reqs = false,
.set_global_pg_config = NULL, .set_global_pg_config = NULL,
}; };
...@@ -871,6 +875,7 @@ static const struct tegra_adma_chip_data tegra186_chip_data = { ...@@ -871,6 +875,7 @@ static const struct tegra_adma_chip_data tegra186_chip_data = {
.nr_channels = 32, .nr_channels = 32,
.ch_fifo_size_mask = 0x1f, .ch_fifo_size_mask = 0x1f,
.sreq_index_offset = 4, .sreq_index_offset = 4,
.max_page = 4,
.has_outstanding_reqs = true, .has_outstanding_reqs = true,
.set_global_pg_config = tegra186_adma_global_page_config, .set_global_pg_config = tegra186_adma_global_page_config,
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment