All of lore.kernel.org
 help / color / mirror / Atom feed
From: vladimir.murzin@arm.com (Vladimir Murzin)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC v2 PATCH 0/3] Fix dma_alloc_coherent() and friends for NOMMU
Date: Tue, 13 Dec 2016 15:04:31 +0000	[thread overview]
Message-ID: <58500DFF.6010801@arm.com> (raw)
In-Reply-To: <1BE9400D-BACB-4C07-B6F0-1963D90A7029@esh.hu>

Hi,

On 13/12/16 14:33, Szemz? Andr?s wrote:
> Hi,
> 
>> On 2016. Dec 13., at 14:45, Vladimir Murzin <vladimir.murzin@arm.com> wrote:
>>
>> Hi,
>>
>> It seem that addition of cache support for M-class cpus uncovered
>> latent bug in DMA usage. NOMMU memory model has been treated as being
>> always consistent; however, for R/M classes of cpu memory can be
>> covered by MPU which in turn might configure RAM as Normal
>> i.e. bufferable and cacheable. It breaks dma_alloc_coherent() and
>> friends, since data can stuck in caches now or be buffered.
>>
>> This patch set is trying to address the issue by providing region of
>> memory suitable for consistent DMA operations. It is supposed that such
>> region is marked by MPU as non-cacheable. Since we have MPU support in
>> Linux for R-class only and M-class setting MPU in bootloader, proposed
>> interface to advertise such memory is via "memdma=size at start" command
>> line option, to avoid clashing with normal memory (which usually comes
>> from dts) it'd be safer to use it together with "mem=" command line
>> option. Meanwhile, I'm open to suggestions for the better way telling
>> Linux of such memory.
>>
> 
> I have tested these patches on my ATMEL SAME70 armv7m board.
> 
> After setting the memory regions and attributes in the bootloader and providing the required 
> command line parameters, the DMA issues fixed.
> 
> I have tested an usart, sdcard, and ethernet driver with DMA enabled.
> 
> Booting Linux on physical CPU 0x0
> Linux version 4.9.0 (root at debian) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) ) #4 Mon Dec 12 20:27:21 CET 201
> 6
> CPU: ARMv7-M [410fc271] revision 1 (ARMv7M), cr=00000000
> CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
> OF: fdt:Machine model: SAME70-sampione board
> Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 15748
> Kernel command line: console=ttyS1,115200 root=/dev/mmcblk0p2 rw init=/linuxrc rootwait mem=62M memdma=2M at 0x73e00000
> 
> So you can add my Tested-by.
> 
> Thanks for the patches!

Glad to hear it works for you! Thanks for reporting and testing!

Cheers
Vladimir

> 
> Regards,
> Andras
> 
> 
> 

  reply	other threads:[~2016-12-13 15:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-13 13:45 [RFC v2 PATCH 0/3] Fix dma_alloc_coherent() and friends for NOMMU Vladimir Murzin
2016-12-13 13:45 ` [RFC v2 PATCH 1/3] ARM: NOMMU: introduce dma operations for noMMU Vladimir Murzin
2017-01-02 15:26   ` Benjamin Gaignard
2017-01-04 10:33     ` Vladimir Murzin
2017-01-06 13:58       ` Benjamin Gaignard
2017-01-09 13:54         ` Vladimir Murzin
2016-12-13 13:45 ` [RFC v2 PATCH 2/3] ARM: NOMMU: set ARM_DMA_MEM_BUFFERABLE for M-class cpus Vladimir Murzin
2016-12-13 13:45 ` [RFC v2 PATCH 3/3] ARM: dma-mapping: remove traces of NOMMU code Vladimir Murzin
2016-12-13 14:07 ` [RFC v2 PATCH 0/3] Fix dma_alloc_coherent() and friends for NOMMU Russell King - ARM Linux
2016-12-13 14:14   ` Vladimir Murzin
2016-12-13 14:25     ` Robin Murphy
2016-12-13 15:02       ` Vladimir Murzin
2016-12-13 18:32         ` Robin Murphy
2016-12-14 10:15           ` Vladimir Murzin
2016-12-13 14:33 ` Szemző András
2016-12-13 15:04   ` Vladimir Murzin [this message]
2016-12-16 14:57 ` Alexandre Torgue
2016-12-16 15:00   ` Vladimir Murzin
2016-12-16 15:33     ` Alexandre Torgue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58500DFF.6010801@arm.com \
    --to=vladimir.murzin@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.