Skip to content

Commit e6d69a6

Browse files
committed
Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma
Pull slave-dmaengine changes from Vinod Koul: "This brings for slave dmaengine: - Change dma notification flag to DMA_COMPLETE from DMA_SUCCESS as dmaengine can only transfer and not verify validaty of dma transfers - Bunch of fixes across drivers: - cppi41 driver fixes from Daniel - 8 channel freescale dma engine support and updated bindings from Hongbo - msx-dma fixes and cleanup by Markus - DMAengine updates from Dan: - Bartlomiej and Dan finalized a rework of the dma address unmap implementation. - In the course of testing 1/ a collection of enhancements to dmatest fell out. Notably basic performance statistics, and fixed / enhanced test control through new module parameters 'run', 'wait', 'noverify', and 'verbose'. Thanks to Andriy and Linus [Walleij] for their review. - Testing the raid related corner cases of 1/ triggered bugs in the recently added 16-source operation support in the ioatdma driver. - Some minor fixes / cleanups to mv_xor and ioatdma" * 'next' of git://git.infradead.org/users/vkoul/slave-dma: (99 commits) dma: mv_xor: Fix mis-usage of mmio 'base' and 'high_base' registers dma: mv_xor: Remove unneeded NULL address check ioat: fix ioat3_irq_reinit ioat: kill msix_single_vector support raid6test: add new corner case for ioatdma driver ioatdma: clean up sed pool kmem_cache ioatdma: fix selection of 16 vs 8 source path ioatdma: fix sed pool selection ioatdma: Fix bug in selftest after removal of DMA_MEMSET. dmatest: verbose mode dmatest: convert to dmaengine_unmap_data dmatest: add a 'wait' parameter dmatest: add basic performance metrics dmatest: add support for skipping verification and random data setup dmatest: use pseudo random numbers dmatest: support xor-only, or pq-only channels in tests dmatest: restore ability to start test at module load and init dmatest: cleanup redundant "dmatest: " prefixes dmatest: replace stored results mechanism, with uniform messages Revert "dmatest: append verify result to results" ...
2 parents 5a1efc6 + df12a31 commit e6d69a6

71 files changed

Lines changed: 1979 additions & 2272 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/devicetree/bindings/dma/atmel-dma.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The three cells in order are:
2828
dependent:
2929
- bit 7-0: peripheral identifier for the hardware handshaking interface. The
3030
identifier can be different for tx and rx.
31-
- bit 11-8: FIFO configuration. 0 for half FIFO, 1 for ALAP, 1 for ASAP.
31+
- bit 11-8: FIFO configuration. 0 for half FIFO, 1 for ALAP, 2 for ASAP.
3232

3333
Example:
3434

‎Documentation/devicetree/bindings/powerpc/fsl/dma.txt‎

Lines changed: 101 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
1-
* Freescale 83xx DMA Controller
1+
* Freescale DMA Controllers
22

3-
Freescale PowerPC 83xx have on chip general purpose DMA controllers.
3+
** Freescale Elo DMA Controller
4+
This is a little-endian 4-channel DMA controller, used in Freescale mpc83xx
5+
series chips such as mpc8315, mpc8349, mpc8379 etc.
46

57
Required properties:
68

7-
- compatible : compatible list, contains 2 entries, first is
8-
"fsl,CHIP-dma", where CHIP is the processor
9-
(mpc8349, mpc8360, etc.) and the second is
10-
"fsl,elo-dma"
11-
- reg : <registers mapping for DMA general status reg>
12-
- ranges : Should be defined as specified in 1) to describe the
13-
DMA controller channels.
9+
- compatible : must include "fsl,elo-dma"
10+
- reg : DMA General Status Register, i.e. DGSR which contains
11+
status for all the 4 DMA channels
12+
- ranges : describes the mapping between the address space of the
13+
DMA channels and the address space of the DMA controller
1414
- cell-index : controller index. 0 for controller @ 0x8100
15-
- interrupts : <interrupt mapping for DMA IRQ>
15+
- interrupts : interrupt specifier for DMA IRQ
1616
- interrupt-parent : optional, if needed for interrupt mapping
1717

18-
1918
- DMA channel nodes:
20-
- compatible : compatible list, contains 2 entries, first is
21-
"fsl,CHIP-dma-channel", where CHIP is the processor
22-
(mpc8349, mpc8350, etc.) and the second is
23-
"fsl,elo-dma-channel". However, see note below.
24-
- reg : <registers mapping for channel>
25-
- cell-index : dma channel index starts at 0.
19+
- compatible : must include "fsl,elo-dma-channel"
20+
However, see note below.
21+
- reg : DMA channel specific registers
22+
- cell-index : DMA channel index starts at 0.
2623

2724
Optional properties:
28-
- interrupts : <interrupt mapping for DMA channel IRQ>
29-
(on 83xx this is expected to be identical to
30-
the interrupts property of the parent node)
25+
- interrupts : interrupt specifier for DMA channel IRQ
26+
(on 83xx this is expected to be identical to
27+
the interrupts property of the parent node)
3128
- interrupt-parent : optional, if needed for interrupt mapping
3229

3330
Example:
@@ -70,30 +67,27 @@ Example:
7067
};
7168
};
7269

73-
* Freescale 85xx/86xx DMA Controller
74-
75-
Freescale PowerPC 85xx/86xx have on chip general purpose DMA controllers.
70+
** Freescale EloPlus DMA Controller
71+
This is a 4-channel DMA controller with extended addresses and chaining,
72+
mainly used in Freescale mpc85xx/86xx, Pxxx and BSC series chips, such as
73+
mpc8540, mpc8641 p4080, bsc9131 etc.
7674

7775
Required properties:
7876

79-
- compatible : compatible list, contains 2 entries, first is
80-
"fsl,CHIP-dma", where CHIP is the processor
81-
(mpc8540, mpc8540, etc.) and the second is
82-
"fsl,eloplus-dma"
83-
- reg : <registers mapping for DMA general status reg>
77+
- compatible : must include "fsl,eloplus-dma"
78+
- reg : DMA General Status Register, i.e. DGSR which contains
79+
status for all the 4 DMA channels
8480
- cell-index : controller index. 0 for controller @ 0x21000,
8581
1 for controller @ 0xc000
86-
- ranges : Should be defined as specified in 1) to describe the
87-
DMA controller channels.
82+
- ranges : describes the mapping between the address space of the
83+
DMA channels and the address space of the DMA controller
8884

8985
- DMA channel nodes:
90-
- compatible : compatible list, contains 2 entries, first is
91-
"fsl,CHIP-dma-channel", where CHIP is the processor
92-
(mpc8540, mpc8560, etc.) and the second is
93-
"fsl,eloplus-dma-channel". However, see note below.
94-
- cell-index : dma channel index starts at 0.
95-
- reg : <registers mapping for channel>
96-
- interrupts : <interrupt mapping for DMA channel IRQ>
86+
- compatible : must include "fsl,eloplus-dma-channel"
87+
However, see note below.
88+
- cell-index : DMA channel index starts at 0.
89+
- reg : DMA channel specific registers
90+
- interrupts : interrupt specifier for DMA channel IRQ
9791
- interrupt-parent : optional, if needed for interrupt mapping
9892

9993
Example:
@@ -134,6 +128,76 @@ Example:
134128
};
135129
};
136130

131+
** Freescale Elo3 DMA Controller
132+
DMA controller which has same function as EloPlus except that Elo3 has 8
133+
channels while EloPlus has only 4, it is used in Freescale Txxx and Bxxx
134+
series chips, such as t1040, t4240, b4860.
135+
136+
Required properties:
137+
138+
- compatible : must include "fsl,elo3-dma"
139+
- reg : contains two entries for DMA General Status Registers,
140+
i.e. DGSR0 which includes status for channel 1~4, and
141+
DGSR1 for channel 5~8
142+
- ranges : describes the mapping between the address space of the
143+
DMA channels and the address space of the DMA controller
144+
145+
- DMA channel nodes:
146+
- compatible : must include "fsl,eloplus-dma-channel"
147+
- reg : DMA channel specific registers
148+
- interrupts : interrupt specifier for DMA channel IRQ
149+
- interrupt-parent : optional, if needed for interrupt mapping
150+
151+
Example:
152+
dma@100300 {
153+
#address-cells = <1>;
154+
#size-cells = <1>;
155+
compatible = "fsl,elo3-dma";
156+
reg = <0x100300 0x4>,
157+
<0x100600 0x4>;
158+
ranges = <0x0 0x100100 0x500>;
159+
dma-channel@0 {
160+
compatible = "fsl,eloplus-dma-channel";
161+
reg = <0x0 0x80>;
162+
interrupts = <28 2 0 0>;
163+
};
164+
dma-channel@80 {
165+
compatible = "fsl,eloplus-dma-channel";
166+
reg = <0x80 0x80>;
167+
interrupts = <29 2 0 0>;
168+
};
169+
dma-channel@100 {
170+
compatible = "fsl,eloplus-dma-channel";
171+
reg = <0x100 0x80>;
172+
interrupts = <30 2 0 0>;
173+
};
174+
dma-channel@180 {
175+
compatible = "fsl,eloplus-dma-channel";
176+
reg = <0x180 0x80>;
177+
interrupts = <31 2 0 0>;
178+
};
179+
dma-channel@300 {
180+
compatible = "fsl,eloplus-dma-channel";
181+
reg = <0x300 0x80>;
182+
interrupts = <76 2 0 0>;
183+
};
184+
dma-channel@380 {
185+
compatible = "fsl,eloplus-dma-channel";
186+
reg = <0x380 0x80>;
187+
interrupts = <77 2 0 0>;
188+
};
189+
dma-channel@400 {
190+
compatible = "fsl,eloplus-dma-channel";
191+
reg = <0x400 0x80>;
192+
interrupts = <78 2 0 0>;
193+
};
194+
dma-channel@480 {
195+
compatible = "fsl,eloplus-dma-channel";
196+
reg = <0x480 0x80>;
197+
interrupts = <79 2 0 0>;
198+
};
199+
};
200+
137201
Note on DMA channel compatible properties: The compatible property must say
138202
"fsl,elo-dma-channel" or "fsl,eloplus-dma-channel" to be used by the Elo DMA
139203
driver (fsldma). Any DMA channel used by fsldma cannot be used by another

‎Documentation/dmatest.txt‎

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,48 @@ be built as module or inside kernel. Let's consider those cases.
1515

1616
Part 2 - When dmatest is built as a module...
1717

18-
After mounting debugfs and loading the module, the /sys/kernel/debug/dmatest
19-
folder with nodes will be created. There are two important files located. First
20-
is the 'run' node that controls run and stop phases of the test, and the second
21-
one, 'results', is used to get the test case results.
22-
23-
Note that in this case test will not run on load automatically.
24-
2518
Example of usage:
19+
% modprobe dmatest channel=dma0chan0 timeout=2000 iterations=1 run=1
20+
21+
...or:
22+
% modprobe dmatest
2623
% echo dma0chan0 > /sys/module/dmatest/parameters/channel
2724
% echo 2000 > /sys/module/dmatest/parameters/timeout
2825
% echo 1 > /sys/module/dmatest/parameters/iterations
29-
% echo 1 > /sys/kernel/debug/dmatest/run
26+
% echo 1 > /sys/module/dmatest/parameters/run
27+
28+
...or on the kernel command line:
29+
30+
dmatest.channel=dma0chan0 dmatest.timeout=2000 dmatest.iterations=1 dmatest.run=1
3031

3132
Hint: available channel list could be extracted by running the following
3233
command:
3334
% ls -1 /sys/class/dma/
3435

35-
After a while you will start to get messages about current status or error like
36-
in the original code.
36+
Once started a message like "dmatest: Started 1 threads using dma0chan0" is
37+
emitted. After that only test failure messages are reported until the test
38+
stops.
3739

3840
Note that running a new test will not stop any in progress test.
3941

40-
The following command should return actual state of the test.
41-
% cat /sys/kernel/debug/dmatest/run
42-
43-
To wait for test done the user may perform a busy loop that checks the state.
44-
45-
% while [ $(cat /sys/kernel/debug/dmatest/run) = "Y" ]
46-
> do
47-
> echo -n "."
48-
> sleep 1
49-
> done
50-
> echo
42+
The following command returns the state of the test.
43+
% cat /sys/module/dmatest/parameters/run
44+
45+
To wait for test completion userpace can poll 'run' until it is false, or use
46+
the wait parameter. Specifying 'wait=1' when loading the module causes module
47+
initialization to pause until a test run has completed, while reading
48+
/sys/module/dmatest/parameters/wait waits for any running test to complete
49+
before returning. For example, the following scripts wait for 42 tests
50+
to complete before exiting. Note that if 'iterations' is set to 'infinite' then
51+
waiting is disabled.
52+
53+
Example:
54+
% modprobe dmatest run=1 iterations=42 wait=1
55+
% modprobe -r dmatest
56+
...or:
57+
% modprobe dmatest run=1 iterations=42
58+
% cat /sys/module/dmatest/parameters/wait
59+
% modprobe -r dmatest
5160

5261
Part 3 - When built-in in the kernel...
5362

@@ -62,21 +71,22 @@ case. You always could check them at run-time by running
6271

6372
Part 4 - Gathering the test results
6473

65-
The module provides a storage for the test results in the memory. The gathered
66-
data could be used after test is done.
74+
Test results are printed to the kernel log buffer with the format:
6775

68-
The special file 'results' in the debugfs represents gathered data of the in
69-
progress test. The messages collected are printed to the kernel log as well.
76+
"dmatest: result <channel>: <test id>: '<error msg>' with src_off=<val> dst_off=<val> len=<val> (<err code>)"
7077

7178
Example of output:
72-
% cat /sys/kernel/debug/dmatest/results
73-
dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)
79+
% dmesg | tail -n 1
80+
dmatest: result dma0chan0-copy0: #1: No errors with src_off=0x7bf dst_off=0x8ad len=0x3fea (0)
7481

7582
The message format is unified across the different types of errors. A number in
7683
the parens represents additional information, e.g. error code, error counter,
77-
or status.
84+
or status. A test thread also emits a summary line at completion listing the
85+
number of tests executed, number that failed, and a result code.
7886

79-
Comparison between buffers is stored to the dedicated structure.
87+
Example:
88+
% dmesg | tail -n 1
89+
dmatest: dma0chan0-copy0: summary 1 test, 0 failures 1000 iops 100000 KB/s (0)
8090

81-
Note that the verify result is now accessible only via file 'results' in the
82-
debugfs.
91+
The details of a data miscompare error are also emitted, but do not follow the
92+
above format.

‎arch/arm/common/edma.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ static irqreturn_t dma_irq_handler(int irq, void *data)
404404
BIT(slot));
405405
if (edma_cc[ctlr]->intr_data[channel].callback)
406406
edma_cc[ctlr]->intr_data[channel].callback(
407-
channel, DMA_COMPLETE,
407+
channel, EDMA_DMA_COMPLETE,
408408
edma_cc[ctlr]->intr_data[channel].data);
409409
}
410410
} while (sh_ipr);
@@ -459,7 +459,7 @@ static irqreturn_t dma_ccerr_handler(int irq, void *data)
459459
callback) {
460460
edma_cc[ctlr]->intr_data[k].
461461
callback(k,
462-
DMA_CC_ERROR,
462+
EDMA_DMA_CC_ERROR,
463463
edma_cc[ctlr]->intr_data
464464
[k].data);
465465
}

‎arch/arm/include/asm/hardware/iop3xx-adma.h‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -393,36 +393,6 @@ static inline int iop_chan_zero_sum_slot_count(size_t len, int src_cnt,
393393
return slot_cnt;
394394
}
395395

396-
static inline int iop_desc_is_pq(struct iop_adma_desc_slot *desc)
397-
{
398-
return 0;
399-
}
400-
401-
static inline u32 iop_desc_get_dest_addr(struct iop_adma_desc_slot *desc,
402-
struct iop_adma_chan *chan)
403-
{
404-
union iop3xx_desc hw_desc = { .ptr = desc->hw_desc, };
405-
406-
switch (chan->device->id) {
407-
case DMA0_ID:
408-
case DMA1_ID:
409-
return hw_desc.dma->dest_addr;
410-
case AAU_ID:
411-
return hw_desc.aau->dest_addr;
412-
default:
413-
BUG();
414-
}
415-
return 0;
416-
}
417-
418-
419-
static inline u32 iop_desc_get_qdest_addr(struct iop_adma_desc_slot *desc,
420-
struct iop_adma_chan *chan)
421-
{
422-
BUG();
423-
return 0;
424-
}
425-
426396
static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
427397
struct iop_adma_chan *chan)
428398
{

‎arch/arm/include/asm/hardware/iop_adma.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ struct iop_adma_chan {
8282
* @slot_cnt: total slots used in an transaction (group of operations)
8383
* @slots_per_op: number of slots per operation
8484
* @idx: pool index
85-
* @unmap_src_cnt: number of xor sources
86-
* @unmap_len: transaction bytecount
8785
* @tx_list: list of descriptors that are associated with one operation
8886
* @async_tx: support for the async_tx api
8987
* @group_list: list of slots that make up a multi-descriptor transaction
@@ -99,8 +97,6 @@ struct iop_adma_desc_slot {
9997
u16 slot_cnt;
10098
u16 slots_per_op;
10199
u16 idx;
102-
u16 unmap_src_cnt;
103-
size_t unmap_len;
104100
struct list_head tx_list;
105101
struct dma_async_tx_descriptor async_tx;
106102
union {

‎arch/arm/mach-iop13xx/include/mach/adma.h‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -218,20 +218,6 @@ iop_chan_xor_slot_count(size_t len, int src_cnt, int *slots_per_op)
218218
#define iop_chan_pq_slot_count iop_chan_xor_slot_count
219219
#define iop_chan_pq_zero_sum_slot_count iop_chan_xor_slot_count
220220

221-
static inline u32 iop_desc_get_dest_addr(struct iop_adma_desc_slot *desc,
222-
struct iop_adma_chan *chan)
223-
{
224-
struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
225-
return hw_desc->dest_addr;
226-
}
227-
228-
static inline u32 iop_desc_get_qdest_addr(struct iop_adma_desc_slot *desc,
229-
struct iop_adma_chan *chan)
230-
{
231-
struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
232-
return hw_desc->q_dest_addr;
233-
}
234-
235221
static inline u32 iop_desc_get_byte_count(struct iop_adma_desc_slot *desc,
236222
struct iop_adma_chan *chan)
237223
{
@@ -350,18 +336,6 @@ iop_desc_init_pq(struct iop_adma_desc_slot *desc, int src_cnt,
350336
hw_desc->desc_ctrl = u_desc_ctrl.value;
351337
}
352338

353-
static inline int iop_desc_is_pq(struct iop_adma_desc_slot *desc)
354-
{
355-
struct iop13xx_adma_desc_hw *hw_desc = desc->hw_desc;
356-
union {
357-
u32 value;
358-
struct iop13xx_adma_desc_ctrl field;
359-
} u_desc_ctrl;
360-
361-
u_desc_ctrl.value = hw_desc->desc_ctrl;
362-
return u_desc_ctrl.field.pq_xfer_en;
363-
}
364-
365339
static inline void
366340
iop_desc_init_pq_zero_sum(struct iop_adma_desc_slot *desc, int src_cnt,
367341
unsigned long flags)

0 commit comments

Comments
 (0)