diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-03-11 16:07:14 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-03-11 16:07:14 -0400 |
| commit | abeb75218aeb5d64e501a9434b81ef833d88c907 (patch) | |
| tree | 6e2f571bce4e9bc120755a9e7ffd8ec9207b48b9 | |
| parent | d43be80a4ab0a7146d2251247e556f9da7bb14cc (diff) | |
| parent | 3cd2c313f1d618f92d1294addc6c685c17065761 (diff) | |
Merge tag 'dmaengine-fix-4.16-rc5' of git://git.infradead.org/users/vkoul/slave-dma
Pull dmaengine fixes from Vinod Koul:
"Two small fixes are for this cycle:
- fix max_chunk_size for rcar-dmac for R-Car Gen3
- fix clock resource of mv_xor_v2"
* tag 'dmaengine-fix-4.16-rc5' of git://git.infradead.org/users/vkoul/slave-dma:
dmaengine: mv_xor_v2: Fix clock resource by adding a register clock
dmaengine: rcar-dmac: fix max_chunk_size for R-Car Gen3
| -rw-r--r-- | Documentation/devicetree/bindings/dma/mv-xor-v2.txt | 6 | ||||
| -rw-r--r-- | drivers/dma/mv_xor_v2.c | 25 | ||||
| -rw-r--r-- | drivers/dma/sh/rcar-dmac.c | 2 |
3 files changed, 26 insertions, 7 deletions
diff --git a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt index 217a90eaabe7..9c38bbe7e6d7 100644 --- a/Documentation/devicetree/bindings/dma/mv-xor-v2.txt +++ b/Documentation/devicetree/bindings/dma/mv-xor-v2.txt | |||
| @@ -11,7 +11,11 @@ Required properties: | |||
| 11 | interrupts. | 11 | interrupts. |
| 12 | 12 | ||
| 13 | Optional properties: | 13 | Optional properties: |
| 14 | - clocks: Optional reference to the clock used by the XOR engine. | 14 | - clocks: Optional reference to the clocks used by the XOR engine. |
| 15 | - clock-names: mandatory if there is a second clock, in this case the | ||
| 16 | name must be "core" for the first clock and "reg" for the second | ||
| 17 | one | ||
| 18 | |||
| 15 | 19 | ||
| 16 | Example: | 20 | Example: |
| 17 | 21 | ||
diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c index f652a0e0f5a2..3548caa9e933 100644 --- a/drivers/dma/mv_xor_v2.c +++ b/drivers/dma/mv_xor_v2.c | |||
| @@ -163,6 +163,7 @@ struct mv_xor_v2_device { | |||
| 163 | void __iomem *dma_base; | 163 | void __iomem *dma_base; |
| 164 | void __iomem *glob_base; | 164 | void __iomem *glob_base; |
| 165 | struct clk *clk; | 165 | struct clk *clk; |
| 166 | struct clk *reg_clk; | ||
| 166 | struct tasklet_struct irq_tasklet; | 167 | struct tasklet_struct irq_tasklet; |
| 167 | struct list_head free_sw_desc; | 168 | struct list_head free_sw_desc; |
| 168 | struct dma_device dmadev; | 169 | struct dma_device dmadev; |
| @@ -749,13 +750,26 @@ static int mv_xor_v2_probe(struct platform_device *pdev) | |||
| 749 | if (ret) | 750 | if (ret) |
| 750 | return ret; | 751 | return ret; |
| 751 | 752 | ||
| 753 | xor_dev->reg_clk = devm_clk_get(&pdev->dev, "reg"); | ||
| 754 | if (PTR_ERR(xor_dev->reg_clk) != -ENOENT) { | ||
| 755 | if (!IS_ERR(xor_dev->reg_clk)) { | ||
| 756 | ret = clk_prepare_enable(xor_dev->reg_clk); | ||
| 757 | if (ret) | ||
| 758 | return ret; | ||
| 759 | } else { | ||
| 760 | return PTR_ERR(xor_dev->reg_clk); | ||
| 761 | } | ||
| 762 | } | ||
| 763 | |||
| 752 | xor_dev->clk = devm_clk_get(&pdev->dev, NULL); | 764 | xor_dev->clk = devm_clk_get(&pdev->dev, NULL); |
| 753 | if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER) | 765 | if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER) { |
| 754 | return -EPROBE_DEFER; | 766 | ret = EPROBE_DEFER; |
| 767 | goto disable_reg_clk; | ||
| 768 | } | ||
| 755 | if (!IS_ERR(xor_dev->clk)) { | 769 | if (!IS_ERR(xor_dev->clk)) { |
| 756 | ret = clk_prepare_enable(xor_dev->clk); | 770 | ret = clk_prepare_enable(xor_dev->clk); |
| 757 | if (ret) | 771 | if (ret) |
| 758 | return ret; | 772 | goto disable_reg_clk; |
| 759 | } | 773 | } |
| 760 | 774 | ||
| 761 | ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1, | 775 | ret = platform_msi_domain_alloc_irqs(&pdev->dev, 1, |
| @@ -866,8 +880,9 @@ free_hw_desq: | |||
| 866 | free_msi_irqs: | 880 | free_msi_irqs: |
| 867 | platform_msi_domain_free_irqs(&pdev->dev); | 881 | platform_msi_domain_free_irqs(&pdev->dev); |
| 868 | disable_clk: | 882 | disable_clk: |
| 869 | if (!IS_ERR(xor_dev->clk)) | 883 | clk_disable_unprepare(xor_dev->clk); |
| 870 | clk_disable_unprepare(xor_dev->clk); | 884 | disable_reg_clk: |
| 885 | clk_disable_unprepare(xor_dev->reg_clk); | ||
| 871 | return ret; | 886 | return ret; |
| 872 | } | 887 | } |
| 873 | 888 | ||
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index e3ff162c03fc..d0cacdb0713e 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c | |||
| @@ -917,7 +917,7 @@ rcar_dmac_chan_prep_sg(struct rcar_dmac_chan *chan, struct scatterlist *sgl, | |||
| 917 | 917 | ||
| 918 | rcar_dmac_chan_configure_desc(chan, desc); | 918 | rcar_dmac_chan_configure_desc(chan, desc); |
| 919 | 919 | ||
| 920 | max_chunk_size = (RCAR_DMATCR_MASK + 1) << desc->xfer_shift; | 920 | max_chunk_size = RCAR_DMATCR_MASK << desc->xfer_shift; |
| 921 | 921 | ||
| 922 | /* | 922 | /* |
| 923 | * Allocate and fill the transfer chunk descriptors. We own the only | 923 | * Allocate and fill the transfer chunk descriptors. We own the only |
