dmaengine: xgene-dma: Fix double IRQ issue by setting IRQ_DISABLE_UNLAZY flag
PATCH 1/1 dmaengine: xgene-dma: Fix double IRQ issue by setting IRQ_DISABLE_UNLAZY flag
From: Rameshwar Prasad Sahu <[email protected]>
For interrupt controller that doesn't support irq_disable and hardware with level interrupt, an extra interrupt can be pending. This patch fixes the issue by setting IRQ_DISABLE_UNLAZY flag for the interrupt line.
Reference: http://git.kernel.org/tip/e9849777d0e27cdd2902805be51da73e7c79578c
--- drivers/dma/xgene-dma.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/dma/xgene-dma.c +4 -0
@@ -29,6 +29,7 @@#include <linux/dmapool.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/irq.h> #include <linux/module.h> #include <linux/of_device.h>
@@ -1610,6 +1611,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)/* Register DMA channel rx irq */ for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_set_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY ); ret =devm_request_irq (chan->dev, chan->rx_irq, xgene_dma_chan_ring_isr,0 , chan->name, chan);
@@ -1620,6 +1622,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)for (j =0 ; j < i; j++) { chan = &pdma->chan[i]; +irq_clear_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );devm_free_irq (chan->dev, chan->rx_irq, chan); }
@@ -1640,6 +1643,7 @@ static void xgene_dma_free_irqs(struct xgene_dma *pdma)for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_clear_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );devm_free_irq (chan->dev, chan->rx_irq, chan); } }
--
1.7.1
Quoted 7 lines · Rameshswar Prasad Sahu
From: Rameshwar Prasad Sahu <[email protected]>
For interrupt controller that doesn't support
irq_disableand hardware with level interrupt, an extra interrupt can be pending. This patch fixes the issue by settingIRQ_DISABLE_UNLAZYflag for the interrupt line.Reference: http://git.kernel.org/tip/e9849777d0e27cdd2902805be51da73e7c79578c
I seem to have got this patch thrice :(
Quoted 19 lines
Signed-off-by Rameshwar Prasad Sahu <[email protected]>--- drivers/dma/xgene-dma.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)drivers/dma/xgene-dma.c +1
-0@@ -29,6 +29,7 @@#include <linux/dmapool.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/irq.h> #include <linux/module.h> #include <linux/of_device.h>
drivers/dma/xgene-dma.c static int xgene_dma_request_irqs(struct xgene_dma *pdma) · line 1614
Quoted 4 lines
drivers/dma/xgene-dma.c +1
-0@@ -1610,6 +1611,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)/* Register DMA channel rx irq */ for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_set_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );
Why not use irq_settings_disable_unlazy(), at least read the reference you pointed out!
Quoted 21 lines
drivers/dma/xgene-dma.c +2
-1ret =devm_request_irq (chan->dev, chan->rx_irq, xgene_dma_chan_ring_isr,0 , chan->name, chan);@@ -1620,6 +1622,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)for (j =0 ; j < i; j++) { chan = &pdma->chan[i]; +irq_clear_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );devm_free_irq (chan->dev, chan->rx_irq, chan); }@@ -1640,6 +1643,7 @@ static void xgene_dma_free_irqs(struct xgene_dma *pdma)for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_clear_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );devm_free_irq (chan->dev, chan->rx_irq, chan); } } --1.7.1
Signature · 1 line
~Vinod
Hi Vinod,
Quoted 10 lines · Vinod Koul
Quoted 7 lines · Rameshswar Prasad Sahu
From: Rameshwar Prasad Sahu <[email protected]>
For interrupt controller that doesn't support
irq_disableand hardware with level interrupt, an extra interrupt can be pending. This patch fixes the issue by settingIRQ_DISABLE_UNLAZYflag for the interrupt line.Reference: http://git.kernel.org/tip/e9849777d0e27cdd2902805be51da73e7c79578c
I seem to have got this patch thrice :(
Due to mail failure (some issue was in my email client) to some email-id it was multiple times,
Quoted 19 lines
Quoted 19 lines
Signed-off-by Rameshwar Prasad Sahu <[email protected]>--- drivers/dma/xgene-dma.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)drivers/dma/xgene-dma.c +1
-0@@ -29,6 +29,7 @@#include <linux/dmapool.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/irq.h> #include <linux/module.h> #include <linux/of_device.h>
Quoted 8 lines
drivers/dma/xgene-dma.c static int xgene_dma_request_irqs(struct xgene_dma *pdma) · line 1614
Quoted 5 lines
drivers/dma/xgene-dma.c +1
-0@@ -1610,6 +1611,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)/* Register DMA channel rx irq */ for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_set_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );Why not use
irq_settings_disable_unlazy(), at least read the reference you pointed out!
irq_settings_disable_unlazy() is helper function to test IRQ_DISABLE_UNLAZY flag is set or not, it's not for setting this flag. FYI...
+static inline bool irq_settings_disable_unlazy(struct irq_desc *desc) +{
+ return desc->status_use_accessors & _IRQ_DISABLE_UNLAZY; +}
Quoted 25 lines
Quoted 21 lines
drivers/dma/xgene-dma.c +2
-1ret =devm_request_irq (chan->dev, chan->rx_irq, xgene_dma_chan_ring_isr,0 , chan->name, chan);@@ -1620,6 +1622,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)for (j =0 ; j < i; j++) { chan = &pdma->chan[i]; +irq_clear_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );devm_free_irq (chan->dev, chan->rx_irq, chan); }@@ -1640,6 +1643,7 @@ static void xgene_dma_free_irqs(struct xgene_dma *pdma)for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_clear_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );devm_free_irq (chan->dev, chan->rx_irq, chan); } } --Quoted 1 line
1.7.1
--
~Vinod
Quoted 10 lines · Rameshwar Sahu
Hi Vinod,
Quoted 7 lines · Vinod Koul
Quoted 6 lines · Rameshswar Prasad Sahu
From: Rameshwar Prasad Sahu <[email protected]>
For interrupt controller that doesn't support
irq_disableand hardware with level interrupt, an extra interrupt can be pending. This patch fixes the issue by settingIRQ_DISABLE_UNLAZYflag for the interrupt line.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Reference: http://git.kernel.org/tip/e9849777d0e27cdd2902805be51da73e7c79578c
I seem to have got this patch thrice :(
Due to mail failure (some issue was in my email client) to some email-id it was multiple times,
git send-email ?
Quoted 31 lines
Quoted 19 lines
Quoted 19 lines
Signed-off-by Rameshwar Prasad Sahu <[email protected]>--- drivers/dma/xgene-dma.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)drivers/dma/xgene-dma.c +1
-0@@ -29,6 +29,7 @@#include <linux/dmapool.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/irq.h> #include <linux/module.h> #include <linux/of_device.h> Quoted 8 lines
drivers/dma/xgene-dma.c static int xgene_dma_request_irqs(struct xgene_dma *pdma) · line 1614
Quoted 5 lines
drivers/dma/xgene-dma.c +1
-0@@ -1610,6 +1611,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)/* Register DMA channel rx irq */ for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_set_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );Why not use
irq_settings_disable_unlazy(), at least read the reference you pointed out!
irq_settings_disable_unlazy()is helper function to testIRQ_DISABLE_UNLAZYflag is set or not, it's not for setting this flag. FYI...
Review
Quoted 4 lines
(quoted diff) +4
-0+static inline bool irq_settings_disable_unlazy(struct irq_desc *desc) +{ + return desc->status_use_accessors & _IRQ_DISABLE_UNLAZY; +}
Ah yes, I saw clear API and assumed there would be set. Then I think we should add a set helper as well as the usage is intended for drivers to set this flag
Thomas,
Any reason why you didn't add a set helper, only test and clear?
Signature · 1 line
~Vinod
Quoted 11 lines · Vinod Koul
Quoted 10 lines · Rameshwar Sahu
Hi Vinod,
Quoted 7 lines · Vinod Koul
Quoted 6 lines · Rameshswar Prasad Sahu
From: Rameshwar Prasad Sahu <[email protected]>
For interrupt controller that doesn't support
irq_disableand hardware with level interrupt, an extra interrupt can be pending. This patch fixes the issue by settingIRQ_DISABLE_UNLAZYflag for the interrupt line.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Reference: http://git.kernel.org/tip/e9849777d0e27cdd2902805be51da73e7c79578c
I seem to have got this patch thrice :(
Due to mail failure (some issue was in my email client) to some email-id it was multiple times,
git send-email ?
Yes, was not able to send Arnd Bergmann.
Quoted 47 lines
Quoted 32 lines
Quoted 20 lines
Quoted 20 lines
Signed-off-by Rameshwar Prasad Sahu <[email protected]>--- drivers/dma/xgene-dma.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)drivers/dma/xgene-dma.c +1
-0@@ -29,6 +29,7 @@#include <linux/dmapool.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/irq.h> #include <linux/module.h> #include <linux/of_device.h> Quoted 8 lines
drivers/dma/xgene-dma.c static int xgene_dma_request_irqs(struct xgene_dma *pdma) · line 1614
Quoted 5 lines
drivers/dma/xgene-dma.c +1
-0@@ -1610,6 +1611,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)/* Register DMA channel rx irq */ for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_set_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );Why not use
irq_settings_disable_unlazy(), at least read the reference you pointed out!
irq_settings_disable_unlazy()is helper function to testIRQ_DISABLE_UNLAZYflag is set or not, it's not for setting this flag. FYI...Review
Quoted 4 lines
(quoted diff) +4
-0+static inline bool irq_settings_disable_unlazy(struct irq_desc *desc) +{ + return desc->status_use_accessors & _IRQ_DISABLE_UNLAZY; +}Ah yes, I saw clear API and assumed there would be set. Then I think we should add a set helper as well as the usage is intended for drivers to set this flag
Thomas,
Any reason why you didn't add a set helper, only test and clear?
--
~Vinod
Quoted 22 lines · Vinod Koul
Quoted 12 lines · Rameshwar Sahu
Quoted 8 lines
drivers/dma/xgene-dma.c static int xgene_dma_request_irqs(struct xgene_dma *pdma) · line 1614
Quoted 5 lines
drivers/dma/xgene-dma.c +1
-0@@ -1610,6 +1611,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)/* Register DMA channel rx irq */ for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_set_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );Why not use
irq_settings_disable_unlazy(), at least read the reference you pointed out!
irq_settings_disable_unlazy()is helper function to testIRQ_DISABLE_UNLAZYflag is set or not, it's not for setting this flag. FYI...Review
Quoted 4 lines
(quoted diff) +4
-0+static inline bool irq_settings_disable_unlazy(struct irq_desc *desc) +{ + return desc->status_use_accessors & _IRQ_DISABLE_UNLAZY; +}Ah yes, I saw clear API and assumed there would be set. Then I think we should add a set helper as well as the usage is intended for drivers to set this flag
Quoted 3 lines
Thomas,
Any reason why you didn't add a set helper, only test and clear?
Why would I? Those helpers are core internal and not usable in random drivers.
Drivers have irq_set_status_flags()/irq_clear_status_flags() ...
Thanks,
tglx
A message that is not in the archive (sent off-list or not yet received): CAOHikRALt92uf598bH2hWq-QKOVRxd+OEjZ2pRkRj5-F8ApD5w@mail.gmail.com
Quoted 34 lines · Suman Tripathi
Quoted 31 lines · Thomas Gleixner
Quoted 28 lines · Vinod Koul
Quoted 15 lines · Rameshwar Sahu
Quoted 11 lines
drivers/dma/xgene-dma.c static int xgene_dma_request_irqs(struct · line 1616
Quoted 7 lines
drivers/dma/xgene-dma.c +1
-0@@ -1610,6 +1611,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)/* Register DMA channel rx irq */ for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_set_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );Why not use
irq_settings_disable_unlazy(), at least read the reference you
pointed out!
irq_settings_disable_unlazy()is helper function to testIRQ_DISABLE_UNLAZYflag is set or not, it's not for setting this flag. FYI...Review
Quoted 4 lines
(quoted diff) +4
-0+static inline bool irq_settings_disable_unlazy(struct irq_desc *desc) +{ + return desc->status_use_accessors & _IRQ_DISABLE_UNLAZY; +}Ah yes, I saw clear API and assumed there would be set. Then I think we should add a set helper as well as the usage is intended for drivers to set this flag
Thomas,
Any reason why you didn't add a set helper, only test and clear?
Quoted 7 lines
Quoted 2 lines
Why would I? Those helpers are core internal and not usable in random drivers.
i think the problem is the name of the function. It should be something
irq_check_settings_disable_unlazy
resending in plain text mode. Sorry for this.
I think the problem is the name of the function. It should be something
irq_check_settings_disable_unlazy
Quoted 20 lines
Quoted 4 lines
Drivers have irq_set_status_flags()/irq_clear_status_flags() ...
Quoted 8 lines
Thanks,
tglx
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel--
Thanks,
with regards,
Suman Tripathi
Signature · 3 lines
Thanks, with regards, Suman Tripathi
Quoted 8 lines · Suman Tripathi
Quoted 3 lines · Thomas Gleixner
Why would I? Those helpers are core internal and not usable in random drivers.
i think the problem is the name of the function. It should be something
irq_check_settings_disable_unlazy
And why is that relevant to a driver? Again, those helpers are core internal and well understood.
Thanks,
tglx
Quoted 23 lines · Thomas Gleixner
Quoted 22 lines · Vinod Koul
Quoted 12 lines · Rameshwar Sahu
Quoted 8 lines
drivers/dma/xgene-dma.c static int xgene_dma_request_irqs(struct xgene_dma *pdma) · line 1614
Quoted 5 lines
drivers/dma/xgene-dma.c +1
-0@@ -1610,6 +1611,7 @@ static int xgene_dma_request_irqs(struct xgene_dma *pdma)/* Register DMA channel rx irq */ for (i =0 ; i <XGENE_DMA_MAX_CHANNEL ; i++) { chan = &pdma->chan[i]; +irq_set_status_flags (chan->rx_irq,IRQ_DISABLE_UNLAZY );Why not use
irq_settings_disable_unlazy(), at least read the reference you pointed out!
irq_settings_disable_unlazy()is helper function to testIRQ_DISABLE_UNLAZYflag is set or not, it's not for setting this flag. FYI...Review
Quoted 4 lines
(quoted diff) +4
-0+static inline bool irq_settings_disable_unlazy(struct irq_desc *desc) +{ + return desc->status_use_accessors & _IRQ_DISABLE_UNLAZY; +}Ah yes, I saw clear API and assumed there would be set. Then I think we should add a set helper as well as the usage is intended for drivers to set this flag
Quoted 7 lines
Quoted 3 lines
Thomas,
Any reason why you didn't add a set helper, only test and clear?
Why would I? Those helpers are core internal and not usable in random drivers.
Drivers have irq_set_status_flags()/irq_clear_status_flags() ...
The effect of irq_set_status_flags(irq, IRQ_DISABLE_UNLAZY) is same as providing a helper. If your recommendation is to use this by driver then I am find with the approach too
Thanks
Signature · 1 line
~Vinod
Quoted 8 lines · Rameshswar Prasad Sahu
From: Rameshwar Prasad Sahu <[email protected]>
For interrupt controller that doesn't support
irq_disableand hardware with level interrupt, an extra interrupt can be pending. This patch fixes the issue by settingIRQ_DISABLE_UNLAZYflag for the interrupt line.Reference: http://git.kernel.org/tip/e9849777d0e27cdd2902805be51da73e7c79578c
Applied now
Signature · 1 line
~Vinod