Commit 86eaf54d authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'dmaengine-fix-4.4-rc2' of git://git.infradead.org/users/vkoul/slave-dma

Pull dmaengine fixes from Vinod Koul:
 "This has odd fixes spreadout drivers, not major here

   - usbdmac fixes for pm
   - edma build and logic fixes
   - build warn fixes for few drivers"

* tag 'dmaengine-fix-4.4-rc2' of git://git.infradead.org/users/vkoul/slave-dma:
  dmaengine: at_hdmac: use %pad format string for dma_addr_t
  dmaengine: at_xdmac: use %pad format string for dma_addr_t
  dmaengine: imx-sdma: remove __init annotation on sdma_event_remap
  dmaengine: edma: predecence bug in GET_NUM_QDMACH()
  dmaengine: edma: fix build without CONFIG_OF
  dmaengine: of_dma: Correct return code for of_dma_request_slave_channel in case !CONFIG_OF
  dmaengine: sh: usb-dmac: Fix pm_runtime_{enable,disable}() imbalance
  dmaengine: sh: usb-dmac: Fix crash on runtime suspend
parents c69bde78 2c5d7407
...@@ -729,8 +729,8 @@ atc_prep_dma_interleaved(struct dma_chan *chan, ...@@ -729,8 +729,8 @@ atc_prep_dma_interleaved(struct dma_chan *chan,
return NULL; return NULL;
dev_info(chan2dev(chan), dev_info(chan2dev(chan),
"%s: src=0x%08x, dest=0x%08x, numf=%d, frame_size=%d, flags=0x%lx\n", "%s: src=%pad, dest=%pad, numf=%d, frame_size=%d, flags=0x%lx\n",
__func__, xt->src_start, xt->dst_start, xt->numf, __func__, &xt->src_start, &xt->dst_start, xt->numf,
xt->frame_size, flags); xt->frame_size, flags);
/* /*
...@@ -824,8 +824,8 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, ...@@ -824,8 +824,8 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
u32 ctrla; u32 ctrla;
u32 ctrlb; u32 ctrlb;
dev_vdbg(chan2dev(chan), "prep_dma_memcpy: d0x%x s0x%x l0x%zx f0x%lx\n", dev_vdbg(chan2dev(chan), "prep_dma_memcpy: d%pad s%pad l0x%zx f0x%lx\n",
dest, src, len, flags); &dest, &src, len, flags);
if (unlikely(!len)) { if (unlikely(!len)) {
dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n"); dev_dbg(chan2dev(chan), "prep_dma_memcpy: length is zero!\n");
...@@ -938,8 +938,8 @@ atc_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value, ...@@ -938,8 +938,8 @@ atc_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value,
void __iomem *vaddr; void __iomem *vaddr;
dma_addr_t paddr; dma_addr_t paddr;
dev_vdbg(chan2dev(chan), "%s: d0x%x v0x%x l0x%zx f0x%lx\n", __func__, dev_vdbg(chan2dev(chan), "%s: d%pad v0x%x l0x%zx f0x%lx\n", __func__,
dest, value, len, flags); &dest, value, len, flags);
if (unlikely(!len)) { if (unlikely(!len)) {
dev_dbg(chan2dev(chan), "%s: length is zero!\n", __func__); dev_dbg(chan2dev(chan), "%s: length is zero!\n", __func__);
...@@ -1022,8 +1022,8 @@ atc_prep_dma_memset_sg(struct dma_chan *chan, ...@@ -1022,8 +1022,8 @@ atc_prep_dma_memset_sg(struct dma_chan *chan,
dma_addr_t dest = sg_dma_address(sg); dma_addr_t dest = sg_dma_address(sg);
size_t len = sg_dma_len(sg); size_t len = sg_dma_len(sg);
dev_vdbg(chan2dev(chan), "%s: d0x%08x, l0x%zx\n", dev_vdbg(chan2dev(chan), "%s: d%pad, l0x%zx\n",
__func__, dest, len); __func__, &dest, len);
if (!is_dma_fill_aligned(chan->device, dest, 0, len)) { if (!is_dma_fill_aligned(chan->device, dest, 0, len)) {
dev_err(chan2dev(chan), "%s: buffer is not aligned\n", dev_err(chan2dev(chan), "%s: buffer is not aligned\n",
...@@ -1439,9 +1439,9 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, ...@@ -1439,9 +1439,9 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
unsigned int periods = buf_len / period_len; unsigned int periods = buf_len / period_len;
unsigned int i; unsigned int i;
dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@0x%08x - %d (%d/%d)\n", dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@%pad - %d (%d/%d)\n",
direction == DMA_MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE", direction == DMA_MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
buf_addr, &buf_addr,
periods, buf_len, period_len); periods, buf_len, period_len);
if (unlikely(!atslave || !buf_len || !period_len)) { if (unlikely(!atslave || !buf_len || !period_len)) {
......
...@@ -385,9 +385,9 @@ static void vdbg_dump_regs(struct at_dma_chan *atchan) {} ...@@ -385,9 +385,9 @@ static void vdbg_dump_regs(struct at_dma_chan *atchan) {}
static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli) static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
{ {
dev_crit(chan2dev(&atchan->chan_common), dev_crit(chan2dev(&atchan->chan_common),
" desc: s0x%x d0x%x ctrl0x%x:0x%x l0x%x\n", " desc: s%pad d%pad ctrl0x%x:0x%x l0x%pad\n",
lli->saddr, lli->daddr, &lli->saddr, &lli->daddr,
lli->ctrla, lli->ctrlb, lli->dscr); lli->ctrla, lli->ctrlb, &lli->dscr);
} }
......
...@@ -920,8 +920,8 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan, ...@@ -920,8 +920,8 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan,
desc->lld.mbr_cfg = chan_cc; desc->lld.mbr_cfg = chan_cc;
dev_dbg(chan2dev(chan), dev_dbg(chan2dev(chan),
"%s: lld: mbr_sa=0x%08x, mbr_da=0x%08x, mbr_ubc=0x%08x, mbr_cfg=0x%08x\n", "%s: lld: mbr_sa=%pad, mbr_da=%pad, mbr_ubc=0x%08x, mbr_cfg=0x%08x\n",
__func__, desc->lld.mbr_sa, desc->lld.mbr_da, __func__, &desc->lld.mbr_sa, &desc->lld.mbr_da,
desc->lld.mbr_ubc, desc->lld.mbr_cfg); desc->lld.mbr_ubc, desc->lld.mbr_cfg);
/* Chain lld. */ /* Chain lld. */
...@@ -953,8 +953,8 @@ at_xdmac_prep_interleaved(struct dma_chan *chan, ...@@ -953,8 +953,8 @@ at_xdmac_prep_interleaved(struct dma_chan *chan,
if ((xt->numf > 1) && (xt->frame_size > 1)) if ((xt->numf > 1) && (xt->frame_size > 1))
return NULL; return NULL;
dev_dbg(chan2dev(chan), "%s: src=0x%08x, dest=0x%08x, numf=%d, frame_size=%d, flags=0x%lx\n", dev_dbg(chan2dev(chan), "%s: src=%pad, dest=%pad, numf=%d, frame_size=%d, flags=0x%lx\n",
__func__, xt->src_start, xt->dst_start, xt->numf, __func__, &xt->src_start, &xt->dst_start, xt->numf,
xt->frame_size, flags); xt->frame_size, flags);
src_addr = xt->src_start; src_addr = xt->src_start;
...@@ -1179,8 +1179,8 @@ static struct at_xdmac_desc *at_xdmac_memset_create_desc(struct dma_chan *chan, ...@@ -1179,8 +1179,8 @@ static struct at_xdmac_desc *at_xdmac_memset_create_desc(struct dma_chan *chan,
desc->lld.mbr_cfg = chan_cc; desc->lld.mbr_cfg = chan_cc;
dev_dbg(chan2dev(chan), dev_dbg(chan2dev(chan),
"%s: lld: mbr_da=0x%08x, mbr_ds=0x%08x, mbr_ubc=0x%08x, mbr_cfg=0x%08x\n", "%s: lld: mbr_da=%pad, mbr_ds=%pad, mbr_ubc=0x%08x, mbr_cfg=0x%08x\n",
__func__, desc->lld.mbr_da, desc->lld.mbr_ds, desc->lld.mbr_ubc, __func__, &desc->lld.mbr_da, &desc->lld.mbr_ds, desc->lld.mbr_ubc,
desc->lld.mbr_cfg); desc->lld.mbr_cfg);
return desc; return desc;
...@@ -1193,8 +1193,8 @@ at_xdmac_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value, ...@@ -1193,8 +1193,8 @@ at_xdmac_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value,
struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan); struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan);
struct at_xdmac_desc *desc; struct at_xdmac_desc *desc;
dev_dbg(chan2dev(chan), "%s: dest=0x%08x, len=%d, pattern=0x%x, flags=0x%lx\n", dev_dbg(chan2dev(chan), "%s: dest=%pad, len=%d, pattern=0x%x, flags=0x%lx\n",
__func__, dest, len, value, flags); __func__, &dest, len, value, flags);
if (unlikely(!len)) if (unlikely(!len))
return NULL; return NULL;
...@@ -1229,8 +1229,8 @@ at_xdmac_prep_dma_memset_sg(struct dma_chan *chan, struct scatterlist *sgl, ...@@ -1229,8 +1229,8 @@ at_xdmac_prep_dma_memset_sg(struct dma_chan *chan, struct scatterlist *sgl,
/* Prepare descriptors. */ /* Prepare descriptors. */
for_each_sg(sgl, sg, sg_len, i) { for_each_sg(sgl, sg, sg_len, i) {
dev_dbg(chan2dev(chan), "%s: dest=0x%08x, len=%d, pattern=0x%x, flags=0x%lx\n", dev_dbg(chan2dev(chan), "%s: dest=%pad, len=%d, pattern=0x%x, flags=0x%lx\n",
__func__, sg_dma_address(sg), sg_dma_len(sg), __func__, &sg_dma_address(sg), sg_dma_len(sg),
value, flags); value, flags);
desc = at_xdmac_memset_create_desc(chan, atchan, desc = at_xdmac_memset_create_desc(chan, atchan,
sg_dma_address(sg), sg_dma_address(sg),
......
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
/* CCCFG register */ /* CCCFG register */
#define GET_NUM_DMACH(x) (x & 0x7) /* bits 0-2 */ #define GET_NUM_DMACH(x) (x & 0x7) /* bits 0-2 */
#define GET_NUM_QDMACH(x) (x & 0x70 >> 4) /* bits 4-6 */ #define GET_NUM_QDMACH(x) ((x & 0x70) >> 4) /* bits 4-6 */
#define GET_NUM_PAENTRY(x) ((x & 0x7000) >> 12) /* bits 12-14 */ #define GET_NUM_PAENTRY(x) ((x & 0x7000) >> 12) /* bits 12-14 */
#define GET_NUM_EVQUE(x) ((x & 0x70000) >> 16) /* bits 16-18 */ #define GET_NUM_EVQUE(x) ((x & 0x70000) >> 16) /* bits 16-18 */
#define GET_NUM_REGN(x) ((x & 0x300000) >> 20) /* bits 20-21 */ #define GET_NUM_REGN(x) ((x & 0x300000) >> 20) /* bits 20-21 */
...@@ -1565,7 +1565,7 @@ static void edma_tc_set_pm_state(struct edma_tc *tc, bool enable) ...@@ -1565,7 +1565,7 @@ static void edma_tc_set_pm_state(struct edma_tc *tc, bool enable)
struct platform_device *tc_pdev; struct platform_device *tc_pdev;
int ret; int ret;
if (!tc) if (!IS_ENABLED(CONFIG_OF) || !tc)
return; return;
tc_pdev = of_find_device_by_node(tc->node); tc_pdev = of_find_device_by_node(tc->node);
......
...@@ -1462,7 +1462,7 @@ static void sdma_load_firmware(const struct firmware *fw, void *context) ...@@ -1462,7 +1462,7 @@ static void sdma_load_firmware(const struct firmware *fw, void *context)
#define EVENT_REMAP_CELLS 3 #define EVENT_REMAP_CELLS 3
static int __init sdma_event_remap(struct sdma_engine *sdma) static int sdma_event_remap(struct sdma_engine *sdma)
{ {
struct device_node *np = sdma->dev->of_node; struct device_node *np = sdma->dev->of_node;
struct device_node *gpr_np = of_parse_phandle(np, "gpr", 0); struct device_node *gpr_np = of_parse_phandle(np, "gpr", 0);
......
...@@ -679,8 +679,11 @@ static int usb_dmac_runtime_suspend(struct device *dev) ...@@ -679,8 +679,11 @@ static int usb_dmac_runtime_suspend(struct device *dev)
struct usb_dmac *dmac = dev_get_drvdata(dev); struct usb_dmac *dmac = dev_get_drvdata(dev);
int i; int i;
for (i = 0; i < dmac->n_channels; ++i) for (i = 0; i < dmac->n_channels; ++i) {
if (!dmac->channels[i].iomem)
break;
usb_dmac_chan_halt(&dmac->channels[i]); usb_dmac_chan_halt(&dmac->channels[i]);
}
return 0; return 0;
} }
...@@ -799,11 +802,10 @@ static int usb_dmac_probe(struct platform_device *pdev) ...@@ -799,11 +802,10 @@ static int usb_dmac_probe(struct platform_device *pdev)
ret = pm_runtime_get_sync(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "runtime PM get sync failed (%d)\n", ret); dev_err(&pdev->dev, "runtime PM get sync failed (%d)\n", ret);
return ret; goto error_pm;
} }
ret = usb_dmac_init(dmac); ret = usb_dmac_init(dmac);
pm_runtime_put(&pdev->dev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to reset device\n"); dev_err(&pdev->dev, "failed to reset device\n");
...@@ -851,10 +853,13 @@ static int usb_dmac_probe(struct platform_device *pdev) ...@@ -851,10 +853,13 @@ static int usb_dmac_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto error; goto error;
pm_runtime_put(&pdev->dev);
return 0; return 0;
error: error:
of_dma_controller_free(pdev->dev.of_node); of_dma_controller_free(pdev->dev.of_node);
pm_runtime_put(&pdev->dev);
error_pm:
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
return ret; return ret;
} }
......
...@@ -80,7 +80,7 @@ static inline int of_dma_router_register(struct device_node *np, ...@@ -80,7 +80,7 @@ static inline int of_dma_router_register(struct device_node *np,
static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np, static inline struct dma_chan *of_dma_request_slave_channel(struct device_node *np,
const char *name) const char *name)
{ {
return NULL; return ERR_PTR(-ENODEV);
} }
static inline struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec, static inline struct dma_chan *of_dma_simple_xlate(struct of_phandle_args *dma_spec,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment