mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: Maxim Kochetkov <fido_max@inbox.ru>, Conor Dooley <conor@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	robh@kernel.org, mpe@ellerman.id.au, aou@eecs.berkeley.edu,
	palmer@dabbelt.com, paul.walmsley@sifive.com
Subject: Re: [PATCH 1/1] riscv: set ARCH_DMA_DEFAULT_COHERENT if RISCV_DMA_NONCOHERENT is not set
Date: Fri, 22 Dec 2023 15:45:34 +0000	[thread overview]
Message-ID: <7bc138f7-d5e9-471a-ae82-d6c490645623@flygoat.com> (raw)
In-Reply-To: <be10eb21-a0ef-416e-9c0c-d53326996fba@inbox.ru>



在 2023/12/22 15:38, Maxim Kochetkov 写道:
>
>
> On 22.12.2023 17:54, Conor Dooley wrote:
>
>>> etc..) do not have this feature. These devices will use value from
>>> device_initialize(). And we have no possibility to change
>>> dma_default_coherent value by disabling ARCH_DMA_DEFAULT_COHERENT.
>>> Moreover, changing dma_default_coherent from false to true may cause
>>> regression for other devices.
>>
>> How can there be a regression when dma has been coherent by default for
>> the RISC-V kernel from day 1?
>
> Before ARCH_DMA_DEFAULT_COHERENT patch dma_default_coherent was used 
> unassigned as "false" in device_initialize():
> ..........
> #if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
>     defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
>     defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
>     dev->dma_coherent = dma_default_coherent;
> #endif
> ..........
> And now it becomes "true". It may change behavior of other non-DT 
> drivers.
I don't see any problem here, default is default.
Actually leaving those device with  dev->dma_coherent = false is risky, 
because
we can't guarantee underlying cache flush functions are here.

If a non-dt device do need to override it, it should be done in 
arch_setup_dma_ops.

Thanks
- Jiaxun

  reply	other threads:[~2023-12-22 15:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 18:51 Maxim Kochetkov
2023-12-21 20:29 ` Conor Dooley
2023-12-21 22:27   ` Jiaxun Yang
2023-12-22  4:14     ` Christoph Hellwig
2023-12-22 14:39       ` Maxim Kochetkov
2023-12-22 14:54         ` Conor Dooley
2023-12-22 15:04           ` Christoph Hellwig
2023-12-22 15:38           ` Maxim Kochetkov
2023-12-22 15:45             ` Jiaxun Yang [this message]
2023-12-22 15:53               ` Maxim Kochetkov
2023-12-22 16:01                 ` Jiaxun Yang
2023-12-23  4:59                   ` Christoph Hellwig
2023-12-25  6:47                     ` Maxim Kochetkov

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=7bc138f7-d5e9-471a-ae82-d6c490645623@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor@kernel.org \
    --cc=fido_max@inbox.ru \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mpe@ellerman.id.au \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®