linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes
@ 2017-12-07  5:24 Kedareswara rao Appana
  2017-12-07  5:24 ` [PATCH v2 1/4] dmaengine: zynqmp_dma: Fix kernel doc-format Kedareswara rao Appana
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Kedareswara rao Appana @ 2017-12-07  5:24 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, michal.simek, appanad, sr,
	dave.jiang, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel

This patch series does the below
--> Fixes kernel doc format style issues.
--> Fixes warings in the driver.
--> Fixes issues with overflow interrupt.
--> Fixes race condition in the probe.

This patch series got created on top of the below patch
"dmaengine: zynqmp_dma: Add runtime pm support"

Changes for v2:
--> New patch added "dmaengine: zynqmp_dma: Fix race condition in the probe"
to the series.

Kedareswara rao Appana (4):
  dmaengine: zynqmp_dma: Fix kernel doc-format
  dmaengine: zynqmp_dma: Fix warning variable 'val' set but not used
  dmaengine: zynqmp_dma: Fix issues with overflow interrupt
  dmaengine: zynqmp_dma: Fix race condition in the probe

 drivers/dma/xilinx/zynqmp_dma.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/4] dmaengine: zynqmp_dma: Fix kernel doc-format
  2017-12-07  5:24 [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes Kedareswara rao Appana
@ 2017-12-07  5:24 ` Kedareswara rao Appana
  2017-12-07  5:24 ` [PATCH v2 2/4] dmaengine: zynqmp_dma: Fix warning variable 'val' set but not used Kedareswara rao Appana
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kedareswara rao Appana @ 2017-12-07  5:24 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, michal.simek, appanad, sr,
	dave.jiang, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel

This patch fixes the below kernel doc warnings
drivers/dma/xilinx/zynqmp_dma.c:552: info: Scanning doc for
zynqmp_dma_device_config
drivers/dma/xilinx/zynqmp_dma.c:558: warning: No description found for
return value of 'zynqmp_dma_device_config'
drivers/dma/xilinx/zynqmp_dma.c:649: info: Scanning doc for
zynqmp_dma_free_descriptors
drivers/dma/xilinx/zynqmp_dma.c:653: warning: No description found for
parameter 'chan'
drivers/dma/xilinx/zynqmp_dma.c:653: warning: Excess function parameter
'dchan' description in 'zynqmp_dma_free_descriptors'

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
Changes for v2:
--> None.

 drivers/dma/xilinx/zynqmp_dma.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 4fa14bf..4376e4a 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -552,6 +552,8 @@ static void zynqmp_dma_config(struct zynqmp_dma_chan *chan)
  * zynqmp_dma_device_config - Zynqmp dma device configuration
  * @dchan: DMA channel
  * @config: DMA device config
+ *
+ * Return: 0 always
  */
 static int zynqmp_dma_device_config(struct dma_chan *dchan,
 				    struct dma_slave_config *config)
@@ -647,7 +649,7 @@ static void zynqmp_dma_issue_pending(struct dma_chan *dchan)
 
 /**
  * zynqmp_dma_free_descriptors - Free channel descriptors
- * @dchan: DMA channel pointer
+ * @chan: ZynqMP DMA channel pointer
  */
 static void zynqmp_dma_free_descriptors(struct zynqmp_dma_chan *chan)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/4] dmaengine: zynqmp_dma: Fix warning variable 'val' set but not used
  2017-12-07  5:24 [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes Kedareswara rao Appana
  2017-12-07  5:24 ` [PATCH v2 1/4] dmaengine: zynqmp_dma: Fix kernel doc-format Kedareswara rao Appana
@ 2017-12-07  5:24 ` Kedareswara rao Appana
  2017-12-07  5:24 ` [PATCH v2 3/4] dmaengine: zynqmp_dma: Fix issues with overflow interrupt Kedareswara rao Appana
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Kedareswara rao Appana @ 2017-12-07  5:24 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, michal.simek, appanad, sr,
	dave.jiang, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel

This patch fixes the below warning

drivers/dma/xilinx/zynqmp_dma.c: In function 'zynqmp_dma_handle_ovfl_int':
drivers/dma/xilinx/zynqmp_dma.c:522:6: warning: variable 'val' set but not used [-Wunused-but-set-variable]

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
Changes for v2:
--> None.

 drivers/dma/xilinx/zynqmp_dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index 4376e4a..b9b5c0a 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -524,12 +524,10 @@ static void zynqmp_dma_start(struct zynqmp_dma_chan *chan)
  */
 static void zynqmp_dma_handle_ovfl_int(struct zynqmp_dma_chan *chan, u32 status)
 {
-	u32 val;
-
 	if (status & ZYNQMP_DMA_IRQ_DST_ACCT_ERR)
-		val = readl(chan->regs + ZYNQMP_DMA_IRQ_DST_ACCT);
+		readl(chan->regs + ZYNQMP_DMA_IRQ_DST_ACCT);
 	if (status & ZYNQMP_DMA_IRQ_SRC_ACCT_ERR)
-		val = readl(chan->regs + ZYNQMP_DMA_IRQ_SRC_ACCT);
+		readl(chan->regs + ZYNQMP_DMA_IRQ_SRC_ACCT);
 }
 
 static void zynqmp_dma_config(struct zynqmp_dma_chan *chan)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/4] dmaengine: zynqmp_dma: Fix issues with overflow interrupt
  2017-12-07  5:24 [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes Kedareswara rao Appana
  2017-12-07  5:24 ` [PATCH v2 1/4] dmaengine: zynqmp_dma: Fix kernel doc-format Kedareswara rao Appana
  2017-12-07  5:24 ` [PATCH v2 2/4] dmaengine: zynqmp_dma: Fix warning variable 'val' set but not used Kedareswara rao Appana
@ 2017-12-07  5:24 ` Kedareswara rao Appana
  2017-12-07  5:24 ` [PATCH v2 4/4] dmaengine: zynqmp_dma: Fix race condition in the probe Kedareswara rao Appana
  2017-12-18  4:07 ` [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes Vinod Koul
  4 siblings, 0 replies; 6+ messages in thread
From: Kedareswara rao Appana @ 2017-12-07  5:24 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, michal.simek, appanad, sr,
	dave.jiang, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel

This patch fixes the below issues.
--> Need to clear the channel data count register
when overflow interrupts occurs.
--> Reduce the log level from _info to _dbg when
overflow interrupt occurs.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
Changes for v2:
--> None.

 drivers/dma/xilinx/zynqmp_dma.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index b9b5c0a..a297a26 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -48,6 +48,7 @@
 #define ZYNQMP_DMA_SRC_START_MSB	0x15C
 #define ZYNQMP_DMA_DST_START_LSB	0x160
 #define ZYNQMP_DMA_DST_START_MSB	0x164
+#define ZYNQMP_DMA_TOTAL_BYTE		0x188
 #define ZYNQMP_DMA_RATE_CTRL		0x18C
 #define ZYNQMP_DMA_IRQ_SRC_ACCT		0x190
 #define ZYNQMP_DMA_IRQ_DST_ACCT		0x194
@@ -513,6 +514,7 @@ static int zynqmp_dma_alloc_chan_resources(struct dma_chan *dchan)
 static void zynqmp_dma_start(struct zynqmp_dma_chan *chan)
 {
 	writel(ZYNQMP_DMA_INT_EN_DEFAULT_MASK, chan->regs + ZYNQMP_DMA_IER);
+	writel(0, chan->regs + ZYNQMP_DMA_TOTAL_BYTE);
 	chan->idle = false;
 	writel(ZYNQMP_DMA_ENABLE, chan->regs + ZYNQMP_DMA_CTRL2);
 }
@@ -524,6 +526,8 @@ static void zynqmp_dma_start(struct zynqmp_dma_chan *chan)
  */
 static void zynqmp_dma_handle_ovfl_int(struct zynqmp_dma_chan *chan, u32 status)
 {
+	if (status & ZYNQMP_DMA_BYTE_CNT_OVRFL)
+		writel(0, chan->regs + ZYNQMP_DMA_TOTAL_BYTE);
 	if (status & ZYNQMP_DMA_IRQ_DST_ACCT_ERR)
 		readl(chan->regs + ZYNQMP_DMA_IRQ_DST_ACCT);
 	if (status & ZYNQMP_DMA_IRQ_SRC_ACCT_ERR)
@@ -724,7 +728,7 @@ static irqreturn_t zynqmp_dma_irq_handler(int irq, void *data)
 
 	if (status & ZYNQMP_DMA_INT_OVRFL) {
 		zynqmp_dma_handle_ovfl_int(chan, status);
-		dev_info(chan->dev, "Channel %p overflow interrupt\n", chan);
+		dev_dbg(chan->dev, "Channel %p overflow interrupt\n", chan);
 		ret = IRQ_HANDLED;
 	}
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 4/4] dmaengine: zynqmp_dma: Fix race condition in the probe
  2017-12-07  5:24 [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes Kedareswara rao Appana
                   ` (2 preceding siblings ...)
  2017-12-07  5:24 ` [PATCH v2 3/4] dmaengine: zynqmp_dma: Fix issues with overflow interrupt Kedareswara rao Appana
@ 2017-12-07  5:24 ` Kedareswara rao Appana
  2017-12-18  4:07 ` [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes Vinod Koul
  4 siblings, 0 replies; 6+ messages in thread
From: Kedareswara rao Appana @ 2017-12-07  5:24 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, michal.simek, appanad, sr,
	dave.jiang, kedare06
  Cc: dmaengine, linux-arm-kernel, linux-kernel

Incase of interrupt property is not present,
Driver is trying to free an invalid irq,
This patch fixes it by adding a check before freeing the irq.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
---
Changes for v2:
--> New patch.

 drivers/dma/xilinx/zynqmp_dma.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index a297a26..f146458 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -851,7 +851,8 @@ static void zynqmp_dma_chan_remove(struct zynqmp_dma_chan *chan)
 	if (!chan)
 		return;
 
-	devm_free_irq(chan->zdev->dev, chan->irq, chan);
+	if (chan->irq)
+		devm_free_irq(chan->zdev->dev, chan->irq, chan);
 	tasklet_kill(&chan->tasklet);
 	list_del(&chan->common.device_node);
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes
  2017-12-07  5:24 [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes Kedareswara rao Appana
                   ` (3 preceding siblings ...)
  2017-12-07  5:24 ` [PATCH v2 4/4] dmaengine: zynqmp_dma: Fix race condition in the probe Kedareswara rao Appana
@ 2017-12-18  4:07 ` Vinod Koul
  4 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2017-12-18  4:07 UTC (permalink / raw)
  To: Kedareswara rao Appana
  Cc: dan.j.williams, michal.simek, appanad, sr, dave.jiang, kedare06,
	dmaengine, linux-arm-kernel, linux-kernel

On Thu, Dec 07, 2017 at 10:54:24AM +0530, Kedareswara rao Appana wrote:
> This patch series does the below
> --> Fixes kernel doc format style issues.
> --> Fixes warings in the driver.
> --> Fixes issues with overflow interrupt.
> --> Fixes race condition in the probe.

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-12-18  4:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-07  5:24 [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes Kedareswara rao Appana
2017-12-07  5:24 ` [PATCH v2 1/4] dmaengine: zynqmp_dma: Fix kernel doc-format Kedareswara rao Appana
2017-12-07  5:24 ` [PATCH v2 2/4] dmaengine: zynqmp_dma: Fix warning variable 'val' set but not used Kedareswara rao Appana
2017-12-07  5:24 ` [PATCH v2 3/4] dmaengine: zynqmp_dma: Fix issues with overflow interrupt Kedareswara rao Appana
2017-12-07  5:24 ` [PATCH v2 4/4] dmaengine: zynqmp_dma: Fix race condition in the probe Kedareswara rao Appana
2017-12-18  4:07 ` [PATCH v2 0/4] dmaengine: zynqmp_dma: Bug fixes Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).