Re: [PATCH 13/22] nds32: use generic dma_noncoherent_ops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Am 23.04.2018 um 18:49 schrieb Greentime Hu:
> 2018-04-20 16:03 GMT+08:00 Christoph Hellwig <hch@xxxxxx>:
>> Switch to the generic noncoherent direct mapping implementation.
>>
>> This makes sure kmap_atomic_pfn is consistently used for access to
>> virtual addresses instead of either using the slower plain kmap
>> or blindly expecting page_address() to work.
>>
>> This makes sure the cache_sync routines is called in the unmap_sg
>> case, to match the unmap_single and sync_{single,sg}_to_cpu cases.
>>
>> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> 
>   CC      arch/nds32/kernel/dma.o
> arch/nds32/kernel/dma.c: In function 'arch_sync_dma_for_device':
> arch/nds32/kernel/dma.c:333:10: error: 'direction' undeclared (first
> use in this function)
>   switch (direction) {
>           ^~~~~~~~~
> arch/nds32/kernel/dma.c:333:10: note: each undeclared identifier is
> reported only once for each function it appears in
> arch/nds32/kernel/dma.c: In function 'arch_sync_dma_for_cpu':
> arch/nds32/kernel/dma.c:353:10: error: 'direction' undeclared (first
> use in this function)
>   switch (direction) {
>           ^~~~~~~~~
> arch/nds32/kernel/dma.c:358:30: error: 'end' undeclared (first use in
> this function)
>    cpu_dma_inval_range(start, end);
>                               ^~~
> make[1]: *** [arch/nds32/kernel/dma.o] Error 1
> make: *** [arch/nds32/kernel] Error 2
> 
> After this building error, the ftmac100.c driver is broken. Not sure
> what happened.

Christoph used 'direction' as in the original consistent_sync(), but the
parameter is now named 'dir' in the new function. Changing

+void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
+               size_t size, enum dma_data_direction dir)

to

+void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
+               size_t size, enum dma_data_direction direction)

(or using 'dir' in place of 'direction' in the switch clauses) should
fix that.

Christoph also forgot to declare and assign 'end'. Adding back the

unsigned long end = start + size;

after

+       unsigned long start = (unsigned long)addr;

should fix the second error.

If your ftmac100 driver relies on the DMA API, it wouldn't be expected
to work if kernel and module views of the DMA API disagree.

HTH,

	Michael

> --
> To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux