All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Vladimir Murzin <vladimir.murzin@arm.com>
Cc: Russell King - ARM Linux <linux@armlinux.org.uk>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	sza@esh.hu, Robin Murphy <robin.murphy@arm.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	kbuild-all@01.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	gregkh <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v4 6/7] ARM: NOMMU: Set ARM_DMA_MEM_BUFFERABLE for M-class cpus
Date: Wed, 24 May 2017 10:36:37 +0200	[thread overview]
Message-ID: <CAK8P3a0s-SLGwhdxX+FDsmRKnYh2nWPKPvwsn_qMOk_1Wb5YMQ@mail.gmail.com> (raw)
In-Reply-To: <741c708e-9036-a0e1-46e1-90d82a195dff@arm.com>

On Wed, May 24, 2017 at 10:31 AM, Vladimir Murzin
<vladimir.murzin@arm.com> wrote:
> On 23/05/17 21:33, Arnd Bergmann wrote:
>> On Tue, May 23, 2017 at 10:01 PM, Russell King - ARM Linux
>> <linux@armlinux.org.uk> wrote:
>>> On Mon, Apr 24, 2017 at 11:16:56AM +0100, Vladimir Murzin wrote:
>>>> Now, we have dedicated non-cacheable region for consistent DMA
>>>> operations. However, that region can still be marked as bufferable by
>>>> MPU, so it'd be safer to have barriers by default.
>>>
>>> What do you actually want here?  Your patch doesn't quite make sense,
>>> the commit description seems to indicate that you require this option
>>> to be set for V7M, but the patch says otherwise.
>>>
>>>>  config ARM_DMA_MEM_BUFFERABLE
>>>> -     bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K) && !CPU_V7
>>>> -     default y if CPU_V6 || CPU_V6K || CPU_V7
>>>> +     bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K || CPU_V7M) && !CPU_V7
>>>
>>> This "if" conditional conditionalises the visibility of the option,
>>> it doesn't conditionalise the value.
>>>
>>>> +     default y if CPU_V6 || CPU_V6K || CPU_V7 || CPU_V7M
>>>
>>> Taking both of these changes together what you end up with is an option
>>> presented to the user for "Use non-cacheable memory for DMA" which
>>> they can choose to disable.
>>>
>>> If you require this option to be set, that's incorrect - your modification
>>> to the default line is correct, but the first line is not.  To achieve
>>> that, you want the if condition to evaluate false for V7M, thereby hiding
>>> the option from the user.  In that case, the default value will always be
>>> assigned to the option.
>>
>> I had the opposite comment in the previous version ;-)
>> https://lkml.org/lkml/2017/4/19/185
>>
>> I think the current patch is correct, but the description could still be
>> clarified: On some of the beefier ARMv7-M machines (with DMA
>> and write buffers) we want this enabled, while those that didn't
>> need it until now also won't need it in the future.
>
> Ok. Do you want it go into commit message or option description or maybe both?

I'd say both. It would also be helpful to identify specifically which platforms
require this, and then add a 'select ARM_DMA_MEM_BUFFERABLE' from
the platform, as we do from Moxart.

      Arnd

WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 6/7] ARM: NOMMU: Set ARM_DMA_MEM_BUFFERABLE for M-class cpus
Date: Wed, 24 May 2017 10:36:37 +0200	[thread overview]
Message-ID: <CAK8P3a0s-SLGwhdxX+FDsmRKnYh2nWPKPvwsn_qMOk_1Wb5YMQ@mail.gmail.com> (raw)
In-Reply-To: <741c708e-9036-a0e1-46e1-90d82a195dff@arm.com>

On Wed, May 24, 2017 at 10:31 AM, Vladimir Murzin
<vladimir.murzin@arm.com> wrote:
> On 23/05/17 21:33, Arnd Bergmann wrote:
>> On Tue, May 23, 2017 at 10:01 PM, Russell King - ARM Linux
>> <linux@armlinux.org.uk> wrote:
>>> On Mon, Apr 24, 2017 at 11:16:56AM +0100, Vladimir Murzin wrote:
>>>> Now, we have dedicated non-cacheable region for consistent DMA
>>>> operations. However, that region can still be marked as bufferable by
>>>> MPU, so it'd be safer to have barriers by default.
>>>
>>> What do you actually want here?  Your patch doesn't quite make sense,
>>> the commit description seems to indicate that you require this option
>>> to be set for V7M, but the patch says otherwise.
>>>
>>>>  config ARM_DMA_MEM_BUFFERABLE
>>>> -     bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K) && !CPU_V7
>>>> -     default y if CPU_V6 || CPU_V6K || CPU_V7
>>>> +     bool "Use non-cacheable memory for DMA" if (CPU_V6 || CPU_V6K || CPU_V7M) && !CPU_V7
>>>
>>> This "if" conditional conditionalises the visibility of the option,
>>> it doesn't conditionalise the value.
>>>
>>>> +     default y if CPU_V6 || CPU_V6K || CPU_V7 || CPU_V7M
>>>
>>> Taking both of these changes together what you end up with is an option
>>> presented to the user for "Use non-cacheable memory for DMA" which
>>> they can choose to disable.
>>>
>>> If you require this option to be set, that's incorrect - your modification
>>> to the default line is correct, but the first line is not.  To achieve
>>> that, you want the if condition to evaluate false for V7M, thereby hiding
>>> the option from the user.  In that case, the default value will always be
>>> assigned to the option.
>>
>> I had the opposite comment in the previous version ;-)
>> https://lkml.org/lkml/2017/4/19/185
>>
>> I think the current patch is correct, but the description could still be
>> clarified: On some of the beefier ARMv7-M machines (with DMA
>> and write buffers) we want this enabled, while those that didn't
>> need it until now also won't need it in the future.
>
> Ok. Do you want it go into commit message or option description or maybe both?

I'd say both. It would also be helpful to identify specifically which platforms
require this, and then add a 'select ARM_DMA_MEM_BUFFERABLE' from
the platform, as we do from Moxart.

      Arnd

  reply	other threads:[~2017-05-24  8:37 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-24 10:16 [PATCH v4 0/7] ARM: Fix dma_alloc_coherent() and friends for NOMMU Vladimir Murzin
2017-04-24 10:16 ` Vladimir Murzin
2017-04-24 10:16 ` [PATCH v4 1/7] dma: Take into account dma_pfn_offset Vladimir Murzin
2017-04-24 10:16   ` Vladimir Murzin
2017-04-24 10:16 ` [PATCH v4 2/7] dma: Add simple dma_noop_mmap Vladimir Murzin
2017-04-24 10:16   ` Vladimir Murzin
2017-04-24 10:16 ` [PATCH v4 3/7] drivers: dma-coherent: Account dma_pfn_offset when used with device tree Vladimir Murzin
2017-04-24 10:16   ` Vladimir Murzin
2017-04-24 10:16 ` [PATCH v4 4/7] drivers: dma-coherent: Introduce default DMA pool Vladimir Murzin
2017-04-24 10:16   ` Vladimir Murzin
2017-04-24 10:16 ` [PATCH v4 5/7] ARM: NOMMU: Introduce dma operations for noMMU Vladimir Murzin
2017-04-24 10:16   ` Vladimir Murzin
2017-04-24 10:16 ` [PATCH v4 6/7] ARM: NOMMU: Set ARM_DMA_MEM_BUFFERABLE for M-class cpus Vladimir Murzin
2017-04-24 10:16   ` Vladimir Murzin
2017-05-23 20:01   ` Russell King - ARM Linux
2017-05-23 20:01     ` Russell King - ARM Linux
2017-05-23 20:33     ` Arnd Bergmann
2017-05-23 20:33       ` Arnd Bergmann
2017-05-24  8:31       ` Vladimir Murzin
2017-05-24  8:31         ` Vladimir Murzin
2017-05-24  8:36         ` Arnd Bergmann [this message]
2017-05-24  8:36           ` Arnd Bergmann
2017-05-24  9:08           ` Vladimir Murzin
2017-05-24  9:08             ` Vladimir Murzin
2017-05-24  9:20             ` Arnd Bergmann
2017-05-24  9:20               ` Arnd Bergmann
2017-04-24 10:16 ` [PATCH v4 7/7] ARM: dma-mapping: Remove traces of NOMMU code Vladimir Murzin
2017-04-24 10:16   ` Vladimir Murzin
2017-05-02  8:32 ` [PATCH v4 0/7] ARM: Fix dma_alloc_coherent() and friends for NOMMU Vladimir Murzin
2017-05-02  8:32   ` Vladimir Murzin
2017-05-15  8:52   ` Vladimir Murzin
2017-05-15  8:52     ` Vladimir Murzin
2017-05-23 20:04     ` Russell King - ARM Linux
2017-05-23 20:04       ` Russell King - ARM Linux
2017-05-24  8:49       ` Vladimir Murzin
2017-05-24  8:49         ` Vladimir Murzin

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=CAK8P3a0s-SLGwhdxX+FDsmRKnYh2nWPKPvwsn_qMOk_1Wb5YMQ@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=alexandre.torgue@st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=robin.murphy@arm.com \
    --cc=sza@esh.hu \
    --cc=vladimir.murzin@arm.com \
    /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.