Commit 30813656 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'dmaengine-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine

Pull dmaengine fixes from Vinod Koul:

 - HAS_IOMEM fixes for fsl edma and intel idma

 - return-value fix, interrupt vector setting and typo fix for xilinx
   xdma

 - email updates for codeaurora email domain move

 - correct pause status for pl330 driver

 - idxd clear flag on disable fix

 - function documentation fix for owl dma

 - potential un-allocated memory fix for mcf driver

* tag 'dmaengine-fix-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
  dmaengine: xilinx: xdma: Fix typo
  dmaengine: xilinx: xdma: Fix interrupt vector setting
  dmaengine: owl-dma: Modify mismatched function name
  dmaengine: idxd: Clear PRS disable flag when disabling IDXD device
  dmaengine: pl330: Return DMA_PAUSED when transaction is paused
  dmaengine: qcom_hidma: Update codeaurora email domain
  dmaengine: mcf-edma: Fix a potential un-allocated memory access
  dmaengine: xilinx: xdma: Fix Judgment of the return value
  idmaengine: make FSL_EDMA and INTEL_IDMA64 depends on HAS_IOMEM
parents 374a7f47 422dbc66
...@@ -2,7 +2,7 @@ What: /sys/devices/platform/hidma-*/chid ...@@ -2,7 +2,7 @@ What: /sys/devices/platform/hidma-*/chid
/sys/devices/platform/QCOM8061:*/chid /sys/devices/platform/QCOM8061:*/chid
Date: Dec 2015 Date: Dec 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Contains the ID of the channel within the HIDMA instance. Contains the ID of the channel within the HIDMA instance.
It is used to associate a given HIDMA channel with the It is used to associate a given HIDMA channel with the
......
...@@ -2,7 +2,7 @@ What: /sys/devices/platform/hidma-mgmt*/chanops/chan*/priority ...@@ -2,7 +2,7 @@ What: /sys/devices/platform/hidma-mgmt*/chanops/chan*/priority
/sys/devices/platform/QCOM8060:*/chanops/chan*/priority /sys/devices/platform/QCOM8060:*/chanops/chan*/priority
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Contains either 0 or 1 and indicates if the DMA channel is a Contains either 0 or 1 and indicates if the DMA channel is a
low priority (0) or high priority (1) channel. low priority (0) or high priority (1) channel.
...@@ -11,7 +11,7 @@ What: /sys/devices/platform/hidma-mgmt*/chanops/chan*/weight ...@@ -11,7 +11,7 @@ What: /sys/devices/platform/hidma-mgmt*/chanops/chan*/weight
/sys/devices/platform/QCOM8060:*/chanops/chan*/weight /sys/devices/platform/QCOM8060:*/chanops/chan*/weight
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Contains 0..15 and indicates the weight of the channel among Contains 0..15 and indicates the weight of the channel among
equal priority channels during round robin scheduling. equal priority channels during round robin scheduling.
...@@ -20,7 +20,7 @@ What: /sys/devices/platform/hidma-mgmt*/chreset_timeout_cycles ...@@ -20,7 +20,7 @@ What: /sys/devices/platform/hidma-mgmt*/chreset_timeout_cycles
/sys/devices/platform/QCOM8060:*/chreset_timeout_cycles /sys/devices/platform/QCOM8060:*/chreset_timeout_cycles
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Contains the platform specific cycle value to wait after a Contains the platform specific cycle value to wait after a
reset command is issued. If the value is chosen too short, reset command is issued. If the value is chosen too short,
...@@ -32,7 +32,7 @@ What: /sys/devices/platform/hidma-mgmt*/dma_channels ...@@ -32,7 +32,7 @@ What: /sys/devices/platform/hidma-mgmt*/dma_channels
/sys/devices/platform/QCOM8060:*/dma_channels /sys/devices/platform/QCOM8060:*/dma_channels
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Contains the number of dma channels supported by one instance Contains the number of dma channels supported by one instance
of HIDMA hardware. The value may change from chip to chip. of HIDMA hardware. The value may change from chip to chip.
...@@ -41,7 +41,7 @@ What: /sys/devices/platform/hidma-mgmt*/hw_version_major ...@@ -41,7 +41,7 @@ What: /sys/devices/platform/hidma-mgmt*/hw_version_major
/sys/devices/platform/QCOM8060:*/hw_version_major /sys/devices/platform/QCOM8060:*/hw_version_major
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Version number major for the hardware. Version number major for the hardware.
...@@ -49,7 +49,7 @@ What: /sys/devices/platform/hidma-mgmt*/hw_version_minor ...@@ -49,7 +49,7 @@ What: /sys/devices/platform/hidma-mgmt*/hw_version_minor
/sys/devices/platform/QCOM8060:*/hw_version_minor /sys/devices/platform/QCOM8060:*/hw_version_minor
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Version number minor for the hardware. Version number minor for the hardware.
...@@ -57,7 +57,7 @@ What: /sys/devices/platform/hidma-mgmt*/max_rd_xactions ...@@ -57,7 +57,7 @@ What: /sys/devices/platform/hidma-mgmt*/max_rd_xactions
/sys/devices/platform/QCOM8060:*/max_rd_xactions /sys/devices/platform/QCOM8060:*/max_rd_xactions
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Contains a value between 0 and 31. Maximum number of Contains a value between 0 and 31. Maximum number of
read transactions that can be issued back to back. read transactions that can be issued back to back.
...@@ -69,7 +69,7 @@ What: /sys/devices/platform/hidma-mgmt*/max_read_request ...@@ -69,7 +69,7 @@ What: /sys/devices/platform/hidma-mgmt*/max_read_request
/sys/devices/platform/QCOM8060:*/max_read_request /sys/devices/platform/QCOM8060:*/max_read_request
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Size of each read request. The value needs to be a power Size of each read request. The value needs to be a power
of two and can be between 128 and 1024. of two and can be between 128 and 1024.
...@@ -78,7 +78,7 @@ What: /sys/devices/platform/hidma-mgmt*/max_wr_xactions ...@@ -78,7 +78,7 @@ What: /sys/devices/platform/hidma-mgmt*/max_wr_xactions
/sys/devices/platform/QCOM8060:*/max_wr_xactions /sys/devices/platform/QCOM8060:*/max_wr_xactions
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Contains a value between 0 and 31. Maximum number of Contains a value between 0 and 31. Maximum number of
write transactions that can be issued back to back. write transactions that can be issued back to back.
...@@ -91,7 +91,7 @@ What: /sys/devices/platform/hidma-mgmt*/max_write_request ...@@ -91,7 +91,7 @@ What: /sys/devices/platform/hidma-mgmt*/max_write_request
/sys/devices/platform/QCOM8060:*/max_write_request /sys/devices/platform/QCOM8060:*/max_write_request
Date: Nov 2015 Date: Nov 2015
KernelVersion: 4.4 KernelVersion: 4.4
Contact: "Sinan Kaya <okaya@codeaurora.org>" Contact: "Sinan Kaya <okaya@kernel.org>"
Description: Description:
Size of each write request. The value needs to be a power Size of each write request. The value needs to be a power
of two and can be between 128 and 1024. of two and can be between 128 and 1024.
...@@ -211,6 +211,7 @@ config FSL_DMA ...@@ -211,6 +211,7 @@ config FSL_DMA
config FSL_EDMA config FSL_EDMA
tristate "Freescale eDMA engine support" tristate "Freescale eDMA engine support"
depends on OF depends on OF
depends on HAS_IOMEM
select DMA_ENGINE select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS select DMA_VIRTUAL_CHANNELS
help help
...@@ -280,6 +281,7 @@ config IMX_SDMA ...@@ -280,6 +281,7 @@ config IMX_SDMA
config INTEL_IDMA64 config INTEL_IDMA64
tristate "Intel integrated DMA 64-bit support" tristate "Intel integrated DMA 64-bit support"
depends on HAS_IOMEM
select DMA_ENGINE select DMA_ENGINE
select DMA_VIRTUAL_CHANNELS select DMA_VIRTUAL_CHANNELS
help help
......
...@@ -384,9 +384,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq) ...@@ -384,9 +384,7 @@ static void idxd_wq_disable_cleanup(struct idxd_wq *wq)
wq->threshold = 0; wq->threshold = 0;
wq->priority = 0; wq->priority = 0;
wq->enqcmds_retries = IDXD_ENQCMDS_RETRIES; wq->enqcmds_retries = IDXD_ENQCMDS_RETRIES;
clear_bit(WQ_FLAG_DEDICATED, &wq->flags); wq->flags = 0;
clear_bit(WQ_FLAG_BLOCK_ON_FAULT, &wq->flags);
clear_bit(WQ_FLAG_ATS_DISABLE, &wq->flags);
memset(wq->name, 0, WQ_NAME_SIZE); memset(wq->name, 0, WQ_NAME_SIZE);
wq->max_xfer_bytes = WQ_DEFAULT_MAX_XFER; wq->max_xfer_bytes = WQ_DEFAULT_MAX_XFER;
idxd_wq_set_max_batch_size(idxd->data->type, wq, WQ_DEFAULT_MAX_BATCH); idxd_wq_set_max_batch_size(idxd->data->type, wq, WQ_DEFAULT_MAX_BATCH);
......
...@@ -190,7 +190,13 @@ static int mcf_edma_probe(struct platform_device *pdev) ...@@ -190,7 +190,13 @@ static int mcf_edma_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
if (!pdata->dma_channels) {
dev_info(&pdev->dev, "setting default channel number to 64");
chans = 64;
} else {
chans = pdata->dma_channels; chans = pdata->dma_channels;
}
len = sizeof(*mcf_edma) + sizeof(*mcf_chan) * chans; len = sizeof(*mcf_edma) + sizeof(*mcf_chan) * chans;
mcf_edma = devm_kzalloc(&pdev->dev, len, GFP_KERNEL); mcf_edma = devm_kzalloc(&pdev->dev, len, GFP_KERNEL);
if (!mcf_edma) if (!mcf_edma)
...@@ -202,11 +208,6 @@ static int mcf_edma_probe(struct platform_device *pdev) ...@@ -202,11 +208,6 @@ static int mcf_edma_probe(struct platform_device *pdev)
mcf_edma->drvdata = &mcf_data; mcf_edma->drvdata = &mcf_data;
mcf_edma->big_endian = 1; mcf_edma->big_endian = 1;
if (!mcf_edma->n_chans) {
dev_info(&pdev->dev, "setting default channel number to 64");
mcf_edma->n_chans = 64;
}
mutex_init(&mcf_edma->fsl_edma_mutex); mutex_init(&mcf_edma->fsl_edma_mutex);
mcf_edma->membase = devm_platform_ioremap_resource(pdev, 0); mcf_edma->membase = devm_platform_ioremap_resource(pdev, 0);
......
...@@ -192,7 +192,7 @@ struct owl_dma_pchan { ...@@ -192,7 +192,7 @@ struct owl_dma_pchan {
}; };
/** /**
* struct owl_dma_pchan - Wrapper for DMA ENGINE channel * struct owl_dma_vchan - Wrapper for DMA ENGINE channel
* @vc: wrapped virtual channel * @vc: wrapped virtual channel
* @pchan: the physical channel utilized by this channel * @pchan: the physical channel utilized by this channel
* @txd: active transaction on this channel * @txd: active transaction on this channel
......
...@@ -403,6 +403,12 @@ enum desc_status { ...@@ -403,6 +403,12 @@ enum desc_status {
* of a channel can be BUSY at any time. * of a channel can be BUSY at any time.
*/ */
BUSY, BUSY,
/*
* Pause was called while descriptor was BUSY. Due to hardware
* limitations, only termination is possible for descriptors
* that have been paused.
*/
PAUSED,
/* /*
* Sitting on the channel work_list but xfer done * Sitting on the channel work_list but xfer done
* by PL330 core * by PL330 core
...@@ -2041,7 +2047,7 @@ static inline void fill_queue(struct dma_pl330_chan *pch) ...@@ -2041,7 +2047,7 @@ static inline void fill_queue(struct dma_pl330_chan *pch)
list_for_each_entry(desc, &pch->work_list, node) { list_for_each_entry(desc, &pch->work_list, node) {
/* If already submitted */ /* If already submitted */
if (desc->status == BUSY) if (desc->status == BUSY || desc->status == PAUSED)
continue; continue;
ret = pl330_submit_req(pch->thread, desc); ret = pl330_submit_req(pch->thread, desc);
...@@ -2326,6 +2332,7 @@ static int pl330_pause(struct dma_chan *chan) ...@@ -2326,6 +2332,7 @@ static int pl330_pause(struct dma_chan *chan)
{ {
struct dma_pl330_chan *pch = to_pchan(chan); struct dma_pl330_chan *pch = to_pchan(chan);
struct pl330_dmac *pl330 = pch->dmac; struct pl330_dmac *pl330 = pch->dmac;
struct dma_pl330_desc *desc;
unsigned long flags; unsigned long flags;
pm_runtime_get_sync(pl330->ddma.dev); pm_runtime_get_sync(pl330->ddma.dev);
...@@ -2335,6 +2342,10 @@ static int pl330_pause(struct dma_chan *chan) ...@@ -2335,6 +2342,10 @@ static int pl330_pause(struct dma_chan *chan)
_stop(pch->thread); _stop(pch->thread);
spin_unlock(&pl330->lock); spin_unlock(&pl330->lock);
list_for_each_entry(desc, &pch->work_list, node) {
if (desc->status == BUSY)
desc->status = PAUSED;
}
spin_unlock_irqrestore(&pch->lock, flags); spin_unlock_irqrestore(&pch->lock, flags);
pm_runtime_mark_last_busy(pl330->ddma.dev); pm_runtime_mark_last_busy(pl330->ddma.dev);
pm_runtime_put_autosuspend(pl330->ddma.dev); pm_runtime_put_autosuspend(pl330->ddma.dev);
...@@ -2425,7 +2436,7 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie, ...@@ -2425,7 +2436,7 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
else if (running && desc == running) else if (running && desc == running)
transferred = transferred =
pl330_get_current_xferred_count(pch, desc); pl330_get_current_xferred_count(pch, desc);
else if (desc->status == BUSY) else if (desc->status == BUSY || desc->status == PAUSED)
/* /*
* Busy but not running means either just enqueued, * Busy but not running means either just enqueued,
* or finished and not yet marked done * or finished and not yet marked done
...@@ -2442,6 +2453,9 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie, ...@@ -2442,6 +2453,9 @@ pl330_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
case DONE: case DONE:
ret = DMA_COMPLETE; ret = DMA_COMPLETE;
break; break;
case PAUSED:
ret = DMA_PAUSED;
break;
case PREP: case PREP:
case BUSY: case BUSY:
ret = DMA_IN_PROGRESS; ret = DMA_IN_PROGRESS;
......
...@@ -668,6 +668,8 @@ static int xdma_set_vector_reg(struct xdma_device *xdev, u32 vec_tbl_start, ...@@ -668,6 +668,8 @@ static int xdma_set_vector_reg(struct xdma_device *xdev, u32 vec_tbl_start,
val |= irq_start << shift; val |= irq_start << shift;
irq_start++; irq_start++;
irq_num--; irq_num--;
if (!irq_num)
break;
} }
/* write IRQ register */ /* write IRQ register */
...@@ -715,7 +717,7 @@ static int xdma_irq_init(struct xdma_device *xdev) ...@@ -715,7 +717,7 @@ static int xdma_irq_init(struct xdma_device *xdev)
ret = request_irq(irq, xdma_channel_isr, 0, ret = request_irq(irq, xdma_channel_isr, 0,
"xdma-c2h-channel", &xdev->c2h_chans[j]); "xdma-c2h-channel", &xdev->c2h_chans[j]);
if (ret) { if (ret) {
xdma_err(xdev, "H2C channel%d request irq%d failed: %d", xdma_err(xdev, "C2H channel%d request irq%d failed: %d",
j, irq, ret); j, irq, ret);
goto failed_init_c2h; goto failed_init_c2h;
} }
...@@ -892,7 +894,7 @@ static int xdma_probe(struct platform_device *pdev) ...@@ -892,7 +894,7 @@ static int xdma_probe(struct platform_device *pdev)
} }
reg_base = devm_ioremap_resource(&pdev->dev, res); reg_base = devm_ioremap_resource(&pdev->dev, res);
if (!reg_base) { if (IS_ERR(reg_base)) {
xdma_err(xdev, "ioremap failed"); xdma_err(xdev, "ioremap failed");
goto failed; goto failed;
} }
......
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