Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp935652rdg; Fri, 13 Oct 2023 05:52:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGL9/zByo74ILcccHZqLweRcpkw+n1XWfWBsquwwM26CwDzyX0TNSSaJIKs58LVFpli1nTf X-Received: by 2002:a17:902:cec7:b0:1c9:9144:574b with SMTP id d7-20020a170902cec700b001c99144574bmr14478886plg.49.1697201545290; Fri, 13 Oct 2023 05:52:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697201545; cv=none; d=google.com; s=arc-20160816; b=GeiKRFiwlZd3XWFYrxfs8XEDFnR6Vs8zY5uHtsrVgcEDAYKGEbZQKQMtdoRSGSU/M9 ZJCWnVXDqIYZFl99MqOMIcHxb5O+hvWFMqIV2K2KeN1yjgx+uf/5dfX4G9eLnUNb2qso K8ELv+sw8lNmYksab9Y93gxLcxCwmX7OJV8pNBToniqLF6n3Td1KYsOlSna1hz7Ow+Ae OgnBmCWME0Zeq6z7VSWPEfGIT6r3n/4dsE/Kyi3hAm7k0Tkh7W9xBqT3z+UpTXJHb3aS IN1tU8MMLN/WIOA9SG+Iz//OWEq7PaLngG7m1Nz6HSR670VLC4RQNCDrYkbXG6TZ5vA8 VzYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=owSplM/Au2YV7muR/tF4SeRMonJiHeFz59Cto2OufDY=; fh=9xP/AacHt4GI74LvuF1DKE5Lgf1kpK1ZhYs7r8d9wO4=; b=euDT72eoSFoEmOtjaUfklVMQUIIaRcYWfM2ZlCL+q8KPAN8GVrPlBWXH6NRNV98dLq sFWLme43zJU51BH4jZqbtOUiIlQqjfXyeHJb/krWS9duvOq4s3VY8i6sc6c528Xa3e7h j2rq0H9mXN+6Xz7NXyfuqQAj0xCZsl4CVn/Fg5sDRgdhoMBmqHwZfzCzzpaBHy+xZhYY c8K0WJl2wssIAzijzjOFeLNcQ8xg9PBDeXhrnVR77BNTFhk20UPO4s6DilJpGf4n6aY/ aqUkMKtQhI5rh5qRGv8ZTwAEEIBIkbzGcFPlKTpjA9uAIs9gqiRLCqqPzdiuvluhlI5d hGIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id b11-20020a170902d88b00b001c3e8a6748asi4135284plz.644.2023.10.13.05.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 05:52:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 94B4382DFD3B; Fri, 13 Oct 2023 05:52:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231470AbjJMMwB (ORCPT + 99 others); Fri, 13 Oct 2023 08:52:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230197AbjJMMv7 (ORCPT ); Fri, 13 Oct 2023 08:51:59 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C5FECBD for ; Fri, 13 Oct 2023 05:51:53 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8AxZ+hmPSllO7cxAA--.59996S3; Fri, 13 Oct 2023 20:51:50 +0800 (CST) Received: from [10.20.42.43] (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxjNxjPSllVeUiAA--.7995S3; Fri, 13 Oct 2023 20:51:49 +0800 (CST) Message-ID: <73ddfc81-3f94-4403-8bb2-d537742a7042@loongson.cn> Date: Fri, 13 Oct 2023 20:51:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] loongarch/mm: disable WUC for pgprot_writecombine as same as ioremap_wc Content-Language: en-US To: Xi Ruoyao , WANG Xuerui , Icenowy Zheng , Huacai Chen Cc: Andrew Morton , Weihao Li , "Mike Rapoport (IBM)" , Jun Yi , Baoquan He , "Matthew Wilcox (Oracle)" , David Hildenbrand , Hongchen Zhang , Binbin Zhou , Zhen Lei , Tiezhu Yang , Thomas Gleixner , Zhihong Dong , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org References: <20231009042841.635366-1-uwu@icenowy.me> <4f1af31b-15be-cb47-6b34-45de1b5696be@loongson.cn> <42b0e6f6-c2b5-49c6-b1f2-0200bef913da@xen0n.name> <3641d3fe-c2e7-868f-ab0d-3951c9a78b6d@loongson.cn> <8373ccfd93b0402caf9f5c06a2d9b93b3c0d0b49.camel@xry111.site> From: Sui Jingfeng In-Reply-To: <8373ccfd93b0402caf9f5c06a2d9b93b3c0d0b49.camel@xry111.site> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: AQAAf8DxjNxjPSllVeUiAA--.7995S3 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj9xXoW7Xr4rCFykXF1fWrWftFWfCrX_yoWDZrg_uF Wv9asrGw4fWFsrtF47tr4Ygr9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spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 13 Oct 2023 05:52:22 -0700 (PDT) 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. 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. 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. 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.