mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Sui Jingfeng <suijingfeng@loongson.cn>,
	WANG Xuerui <kernel@xen0n.name>, Icenowy Zheng <uwu@icenowy.me>,
	Huacai Chen <chenhuacai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Weihao Li <liweihao@loongson.cn>,
	"Mike Rapoport (IBM)" <rppt@kernel.org>,
	Jun Yi <yijun@loongson.cn>, Baoquan He <bhe@redhat.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	David Hildenbrand <david@redhat.com>,
	Hongchen Zhang <zhanghongchen@loongson.cn>,
	Binbin Zhou <zhoubinbin@loongson.cn>,
	Zhen Lei <thunder.leizhen@huawei.com>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Thomas Gleixner <tglx@linutronix.de>,
	Zhihong Dong <donmor3000@hotmail.com>,
	loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] loongarch/mm: disable WUC for pgprot_writecombine as same as ioremap_wc
Date: Fri, 13 Oct 2023 21:15:10 +0800	[thread overview]
Message-ID: <049fbd3906b60f75be3900f20f6974967da374f3.camel@xry111.site> (raw)
In-Reply-To: <73ddfc81-3f94-4403-8bb2-d537742a7042@loongson.cn>

On Fri, 2023-10-13 at 20:51 +0800, Sui Jingfeng wrote:
> Hi,
> 
> 
> On 2023/10/10 20:26, Xi Ruoyao wrote:
> > > - For buffers at VRAM(device memory), we replace the WC mappings with uncached mappings.
> > > - For buffers reside in RAM, we replace the WC mappings with cached mappings.
> > > 
> > > By this way, we were able to minimum the side effects, and meet the usable requirements
> > > for all of the GPU drivers.
> > AFAIK there has been some clear NAK from DRM maintainers towards this
> > "approach".  So it's not possible to be applied upstream.
> 
> 
> Yeah, domain specific reviewers are really hard to persuade to accept our solution.
> Probably because they are not know our hardware very well.

The problem: why this is only an issue with DRM devices?  Work around it
in DRM subsystem just does not make sense to me, at all.

You cannot exclude the possibility that another subsystem will start to
hit the same issue in the future.  Then such a "solution" will cause #if
CONFIG_LOONGARCH scattering everywhere and doing so is completely
unmaintainable.

> But the side effects of this patch is really too hurt to accept. In this case, if you really want to make
> a progress by workaround.

This is not a valid reason.  For example, the spectre-like bug
workarounds hurts the performance as well, but we enable them on
affected CPUs by default.

> I think you could try scan the PCI device in the whole
> system on boot time. Turn off the WC mappings when there is a AMD or ATI GPUs found.

Again, why this is only an issue with AMD or ATI GPUs?

Can you provide some detailed documentations about this hardware issue
so the community can help to figure out a solution?

> Leave the the WC mappings open at the rest of cases. But this is yet another ugly
> workaround. Perhaps it is a bit of better than this because there is no way left.

And this also won't work with PCI hotplug, I'm not sure if it's
supported now but I'm 99% sure you'll add it in the future.

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2023-10-13 13:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231009042841.635366-1-uwu@icenowy.me>
2023-10-09 14:32 ` Sui Jingfeng
2023-10-10  0:15   ` WANG Xuerui
2023-10-10  3:02     ` Sui Jingfeng
2023-10-10 12:26       ` Xi Ruoyao
2023-10-13 11:12         ` Sui Jingfeng
2023-10-13 12:51         ` Sui Jingfeng
2023-10-13 13:15           ` Xi Ruoyao [this message]
2023-10-13 13:53             ` Xi Ruoyao
2025-01-21  9:19               ` Sui Jingfeng
2024-12-02 16:23         ` Sui Jingfeng
2024-12-17 18:18           ` Shuah
2024-12-18  3:24             ` Sui Jingfeng
2024-12-18  6:23               ` Icenowy Zheng
2024-12-18 10:05                 ` Sui Jingfeng
2024-12-18 12:37                   ` Icenowy Zheng
2024-12-19  3:17                     ` Sui Jingfeng
2024-12-19  4:54                       ` Icenowy Zheng
2024-12-20 16:43               ` Shuah
2024-12-17 23:44           ` Icenowy Zheng
2024-12-18  3:05             ` Sui Jingfeng
2024-12-18  5:47               ` Icenowy Zheng
2024-12-18 10:29                 ` Sui Jingfeng
2024-12-18 12:43                   ` Icenowy Zheng
2024-12-19  2:54                     ` Sui Jingfeng
2024-12-19  4:49                       ` Icenowy Zheng
2024-12-19  5:49                         ` Sui Jingfeng
2024-12-19  6:34                           ` Icenowy Zheng
2024-12-19  7:46                             ` Sui Jingfeng
2024-12-19  6:38                           ` Icenowy Zheng
2024-12-19 10:39                             ` Sui Jingfeng
2023-10-10  0:50   ` Icenowy Zheng

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=049fbd3906b60f75be3900f20f6974967da374f3.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=chenhuacai@kernel.org \
    --cc=david@redhat.com \
    --cc=donmor3000@hotmail.com \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liweihao@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=rppt@kernel.org \
    --cc=suijingfeng@loongson.cn \
    --cc=tglx@linutronix.de \
    --cc=thunder.leizhen@huawei.com \
    --cc=uwu@icenowy.me \
    --cc=willy@infradead.org \
    --cc=yangtiezhu@loongson.cn \
    --cc=yijun@loongson.cn \
    --cc=zhanghongchen@loongson.cn \
    --cc=zhoubinbin@loongson.cn \
    /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®