Skip to contentSkip to conversation

pch_dma: Use GFP_ATOMIC because called from interrupt context

PATCH Applied Tomoya MORINAGA 2 participants 4 messages Feb 12, 2013 – Mar 4, 2013 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pch_dma: Use GFP_ATOMIC because called from interrupt context

pdc_desc_get() is called from pd_prep_slave_sg, and the function is called from interrupt context(e.g. Uart driver "pch_uart.c"). In fact, I saw kernel error message.
So, GFP_ATOMIC must be used not GFP_NOIO.

---
 drivers/dma/pch_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/pch_dma.c +1 -1
index 987ab5c..d5cbd44 100644
@@ -476,7 +476,7 @@ static struct pch_dma_desc *pdc_desc_get(struct pch_dma_chan *pd_chan)
 	dev_dbg(chan2dev(&pd_chan->chan), "scanned %d descriptors\n", i);
 
 	if (!ret) {
-		ret = pdc_alloc_desc(&pd_chan->chan, GFP_NOIO);
+		ret = pdc_alloc_desc(&pd_chan->chan, GFP_ATOMIC);
 		if (ret) {
 			spin_lock(&pd_chan->lock);
 			pd_chan->descs_allocated++;
Signature · 1 line
1.7.4.4
#1 lore raw

Hi

Could you review this patch ?
8 days have passed...

thanks,
tomoya

Quoted 25 lines · Tomoya MORINAGA

pdc_desc_get() is called from pd_prep_slave_sg, and the function is called from interrupt context(e.g. Uart driver "pch_uart.c"). In fact, I saw kernel error message.
So, GFP_ATOMIC must be used not GFP_NOIO.

---
 drivers/dma/pch_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/pch_dma.c +1 -2
index 987ab5c..d5cbd44 100644
@@ -476,7 +476,7 @@ static struct pch_dma_desc *pdc_desc_get(struct pch_dma_chan *pd_chan)
        dev_dbg(chan2dev(&pd_chan->chan), "scanned %d descriptors\n", i);
 
        if (!ret) {
-               ret = pdc_alloc_desc(&pd_chan->chan, GFP_NOIO);
+               ret = pdc_alloc_desc(&pd_chan->chan, GFP_ATOMIC);
                if (ret) {
                        spin_lock(&pd_chan->lock);
                        pd_chan->descs_allocated++;
--

1.7.4.4

Signature · 2 lines
ROHM Co., Ltd.
tomoya
#2 lore raw
Quoted 4 lines · Tomoya MORINAGA

Hi

Could you review this patch ?
8 days have passed...

Sorry looks like I missed it. I have queued it up and will apply after -rc1

--
~Vinod

Quoted 34 lines

thanks,
tomoya

Quoted 25 lines · Tomoya MORINAGA

pdc_desc_get() is called from pd_prep_slave_sg, and the function is called from interrupt context(e.g. Uart driver "pch_uart.c"). In fact, I saw kernel error message.
So, GFP_ATOMIC must be used not GFP_NOIO.

---
 drivers/dma/pch_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/pch_dma.c +1 -2
index 987ab5c..d5cbd44 100644
@@ -476,7 +476,7 @@ static struct pch_dma_desc *pdc_desc_get(struct pch_dma_chan *pd_chan)
        dev_dbg(chan2dev(&pd_chan->chan), "scanned %d descriptors\n", i);
 
        if (!ret) {
-               ret = pdc_alloc_desc(&pd_chan->chan, GFP_NOIO);
+               ret = pdc_alloc_desc(&pd_chan->chan, GFP_ATOMIC);
                if (ret) {
                        spin_lock(&pd_chan->lock);
                        pd_chan->descs_allocated++;
--

1.7.4.4

Signature · 2 lines
ROHM Co., Ltd.
tomoya
Applied
#3 lore raw
In reply to Tomoya MORINAGA
Quoted 7 lines · Tomoya MORINAGA
Quoted 6 lines

pdc_desc_get() is called from pd_prep_slave_sg, and the function is called from interrupt context(e.g. Uart driver "pch_uart.c"). In fact, I saw kernel error message.
So, GFP_ATOMIC must be used not GFP_NOIO.

Applied, thanks

Quoted 23 lines
Quoted 19 lines
---
 drivers/dma/pch_dma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/dma/pch_dma.c +1 -2
index 987ab5c..d5cbd44 100644
@@ -476,7 +476,7 @@ static struct pch_dma_desc *pdc_desc_get(struct pch_dma_chan *pd_chan)
        dev_dbg(chan2dev(&pd_chan->chan), "scanned %d descriptors\n", i);
 
        if (!ret) {
-               ret = pdc_alloc_desc(&pd_chan->chan, GFP_NOIO);
+               ret = pdc_alloc_desc(&pd_chan->chan, GFP_ATOMIC);
                if (ret) {
                        spin_lock(&pd_chan->lock);
                        pd_chan->descs_allocated++;
--

1.7.4.4

Signature · 2 lines
ROHM Co., Ltd.
tomoya