diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2014-08-03 13:13:07 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-08-04 04:00:31 -0400 |
commit | f02323ec68328c3db3e3c23490cd80f9ce9c00fa (patch) | |
tree | 39f627314dfa617ee842a6d67a1bf96103f448b9 /drivers/dma | |
parent | 67b166847009b009cd9fbcdef6b71558f49e1bd6 (diff) |
dmaengine: nbpfaxi: convert to tasklet
It is common among dmaengine drivers to use a tasklet for bottom half
interrupt processing. Convert nbpfaxi to do the same.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/nbpfaxi.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c index 5b40ac8d82d1..cea6a3768e2e 100644 --- a/drivers/dma/nbpfaxi.c +++ b/drivers/dma/nbpfaxi.c | |||
@@ -197,6 +197,7 @@ struct nbpf_desc_page { | |||
197 | */ | 197 | */ |
198 | struct nbpf_channel { | 198 | struct nbpf_channel { |
199 | struct dma_chan dma_chan; | 199 | struct dma_chan dma_chan; |
200 | struct tasklet_struct tasklet; | ||
200 | void __iomem *base; | 201 | void __iomem *base; |
201 | struct nbpf_device *nbpf; | 202 | struct nbpf_device *nbpf; |
202 | char name[16]; | 203 | char name[16]; |
@@ -1111,9 +1112,9 @@ static struct dma_chan *nbpf_of_xlate(struct of_phandle_args *dma_spec, | |||
1111 | return dchan; | 1112 | return dchan; |
1112 | } | 1113 | } |
1113 | 1114 | ||
1114 | static irqreturn_t nbpf_chan_irqt(int irq, void *dev) | 1115 | static void nbpf_chan_tasklet(unsigned long data) |
1115 | { | 1116 | { |
1116 | struct nbpf_channel *chan = dev; | 1117 | struct nbpf_channel *chan = (struct nbpf_channel *)data; |
1117 | struct nbpf_desc *desc, *tmp; | 1118 | struct nbpf_desc *desc, *tmp; |
1118 | dma_async_tx_callback callback; | 1119 | dma_async_tx_callback callback; |
1119 | void *param; | 1120 | void *param; |
@@ -1176,8 +1177,6 @@ static irqreturn_t nbpf_chan_irqt(int irq, void *dev) | |||
1176 | if (must_put) | 1177 | if (must_put) |
1177 | nbpf_desc_put(desc); | 1178 | nbpf_desc_put(desc); |
1178 | } | 1179 | } |
1179 | |||
1180 | return IRQ_HANDLED; | ||
1181 | } | 1180 | } |
1182 | 1181 | ||
1183 | static irqreturn_t nbpf_chan_irq(int irq, void *dev) | 1182 | static irqreturn_t nbpf_chan_irq(int irq, void *dev) |
@@ -1186,6 +1185,7 @@ static irqreturn_t nbpf_chan_irq(int irq, void *dev) | |||
1186 | bool done = nbpf_status_get(chan); | 1185 | bool done = nbpf_status_get(chan); |
1187 | struct nbpf_desc *desc; | 1186 | struct nbpf_desc *desc; |
1188 | irqreturn_t ret; | 1187 | irqreturn_t ret; |
1188 | bool bh = false; | ||
1189 | 1189 | ||
1190 | if (!done) | 1190 | if (!done) |
1191 | return IRQ_NONE; | 1191 | return IRQ_NONE; |
@@ -1200,7 +1200,8 @@ static irqreturn_t nbpf_chan_irq(int irq, void *dev) | |||
1200 | ret = IRQ_NONE; | 1200 | ret = IRQ_NONE; |
1201 | goto unlock; | 1201 | goto unlock; |
1202 | } else { | 1202 | } else { |
1203 | ret = IRQ_WAKE_THREAD; | 1203 | ret = IRQ_HANDLED; |
1204 | bh = true; | ||
1204 | } | 1205 | } |
1205 | 1206 | ||
1206 | list_move_tail(&desc->node, &chan->done); | 1207 | list_move_tail(&desc->node, &chan->done); |
@@ -1216,6 +1217,9 @@ static irqreturn_t nbpf_chan_irq(int irq, void *dev) | |||
1216 | unlock: | 1217 | unlock: |
1217 | spin_unlock(&chan->lock); | 1218 | spin_unlock(&chan->lock); |
1218 | 1219 | ||
1220 | if (bh) | ||
1221 | tasklet_schedule(&chan->tasklet); | ||
1222 | |||
1219 | return ret; | 1223 | return ret; |
1220 | } | 1224 | } |
1221 | 1225 | ||
@@ -1258,8 +1262,9 @@ static int nbpf_chan_probe(struct nbpf_device *nbpf, int n) | |||
1258 | 1262 | ||
1259 | snprintf(chan->name, sizeof(chan->name), "nbpf %d", n); | 1263 | snprintf(chan->name, sizeof(chan->name), "nbpf %d", n); |
1260 | 1264 | ||
1261 | ret = devm_request_threaded_irq(dma_dev->dev, chan->irq, | 1265 | tasklet_init(&chan->tasklet, nbpf_chan_tasklet, (unsigned long)chan); |
1262 | nbpf_chan_irq, nbpf_chan_irqt, IRQF_SHARED, | 1266 | ret = devm_request_irq(dma_dev->dev, chan->irq, |
1267 | nbpf_chan_irq, IRQF_SHARED, | ||
1263 | chan->name, chan); | 1268 | chan->name, chan); |
1264 | if (ret < 0) | 1269 | if (ret < 0) |
1265 | return ret; | 1270 | return ret; |