Skip to content

Commit b05e0f5

Browse files
committed
Merge tag 'dmaengine-fix-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine
Pull dmaengine fixes from Vinod Koul: "A couple of fixes in apple driver, core and kernedoc fix for dmaengine subsystem: - apple admac driver fixes for current_tx, src_addr_widths and global' interrupt flags handling - xdma kerneldoc fix - core fix for use of devm_add_action_or_reset" * tag 'dmaengine-fix-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dmaengine: apple-admac: Fix 'current_tx' not getting freed dmaengine: apple-admac: Set src_addr_widths capability dmaengine: apple-admac: Handle 'global' interrupt flags dmaengine: xilinx: xdma: Fix some kernel-doc comments dmaengine: Actually use devm_add_action_or_reset()
2 parents 0bcc402 + d9503be commit b05e0f5

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

drivers/dma/apple-admac.c

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575

7676
#define REG_TX_INTSTATE(idx) (0x0030 + (idx) * 4)
7777
#define REG_RX_INTSTATE(idx) (0x0040 + (idx) * 4)
78+
#define REG_GLOBAL_INTSTATE(idx) (0x0050 + (idx) * 4)
7879
#define REG_CHAN_INTSTATUS(ch, idx) (0x8010 + (ch) * 0x200 + (idx) * 4)
7980
#define REG_CHAN_INTMASK(ch, idx) (0x8020 + (ch) * 0x200 + (idx) * 4)
8081

@@ -511,7 +512,10 @@ static int admac_terminate_all(struct dma_chan *chan)
511512
admac_stop_chan(adchan);
512513
admac_reset_rings(adchan);
513514

514-
adchan->current_tx = NULL;
515+
if (adchan->current_tx) {
516+
list_add_tail(&adchan->current_tx->node, &adchan->to_free);
517+
adchan->current_tx = NULL;
518+
}
515519
/*
516520
* Descriptors can only be freed after the tasklet
517521
* has been killed (in admac_synchronize).
@@ -672,13 +676,14 @@ static void admac_handle_chan_int(struct admac_data *ad, int no)
672676
static irqreturn_t admac_interrupt(int irq, void *devid)
673677
{
674678
struct admac_data *ad = devid;
675-
u32 rx_intstate, tx_intstate;
679+
u32 rx_intstate, tx_intstate, global_intstate;
676680
int i;
677681

678682
rx_intstate = readl_relaxed(ad->base + REG_RX_INTSTATE(ad->irq_index));
679683
tx_intstate = readl_relaxed(ad->base + REG_TX_INTSTATE(ad->irq_index));
684+
global_intstate = readl_relaxed(ad->base + REG_GLOBAL_INTSTATE(ad->irq_index));
680685

681-
if (!tx_intstate && !rx_intstate)
686+
if (!tx_intstate && !rx_intstate && !global_intstate)
682687
return IRQ_NONE;
683688

684689
for (i = 0; i < ad->nchannels; i += 2) {
@@ -693,6 +698,12 @@ static irqreturn_t admac_interrupt(int irq, void *devid)
693698
rx_intstate >>= 1;
694699
}
695700

701+
if (global_intstate) {
702+
dev_warn(ad->dev, "clearing unknown global interrupt flag: %x\n",
703+
global_intstate);
704+
writel_relaxed(~(u32) 0, ad->base + REG_GLOBAL_INTSTATE(ad->irq_index));
705+
}
706+
696707
return IRQ_HANDLED;
697708
}
698709

@@ -850,6 +861,9 @@ static int admac_probe(struct platform_device *pdev)
850861

851862
dma->directions = BIT(DMA_MEM_TO_DEV) | BIT(DMA_DEV_TO_MEM);
852863
dma->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
864+
dma->src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |
865+
BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |
866+
BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);
853867
dma->dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) |
854868
BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) |
855869
BIT(DMA_SLAVE_BUSWIDTH_4_BYTES);

drivers/dma/dmaengine.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,7 @@ int dmaenginem_async_device_register(struct dma_device *device)
13421342
if (ret)
13431343
return ret;
13441344

1345-
return devm_add_action(device->dev, dmaenginem_async_device_unregister, device);
1345+
return devm_add_action_or_reset(device->dev, dmaenginem_async_device_unregister, device);
13461346
}
13471347
EXPORT_SYMBOL(dmaenginem_async_device_register);
13481348

drivers/dma/xilinx/xdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ xdma_alloc_desc(struct xdma_chan *chan, u32 desc_num)
277277

278278
/**
279279
* xdma_xfer_start - Start DMA transfer
280-
* @xdma_chan: DMA channel pointer
280+
* @xchan: DMA channel pointer
281281
*/
282282
static int xdma_xfer_start(struct xdma_chan *xchan)
283283
{

0 commit comments

Comments
 (0)