Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp879663rdg; Fri, 13 Oct 2023 04:12:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHmV83OyDSWwDQbb913SXU84n7w+9I4hNjs7nf01+3l98P3jYNGMIhj4XBI86c+6Dz0Ay+9 X-Received: by 2002:a17:903:481:b0:1c9:da1a:8b14 with SMTP id jj1-20020a170903048100b001c9da1a8b14mr4829096plb.1.1697195547674; Fri, 13 Oct 2023 04:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697195547; cv=none; d=google.com; s=arc-20160816; b=dnLVumBHNtVSyFj3+QB5tCv3YzvyPSPGejsHpF6Tcv2k4/LMNFSy2vZDOCzIpAtqmd xaLkfRGurl+JtbdVBXSdEtXE5GiVUc2bbVweq4K6omeoLxJPAxEen5qZniUDlEwl266x QW946OUkHL5LXEvuq+waq7MOxcySCb2kP3Z24HT11f0o5ZUxiTeyi72/YnAG9jWq9AzC 5HlmFyfQ7RvTG9Gsks1VPli1VFbiw0d09sB/fUDardKmE3htioChSPu1oHL2CrcLqiKp hgO6K48O24OmFx/F5nRvMKsYsI2F8OWwgzXgSl/5kY+j3buPQ+h2d+94kWYaFVk774cE aiGw== 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=MiVVs4OuylkI3fVTrXy7w2Gaj7YhB6j3dis7eFtgCTg=; fh=9xP/AacHt4GI74LvuF1DKE5Lgf1kpK1ZhYs7r8d9wO4=; b=HX5Do64bPgz2SRoXVuNFY09EOlxTllfZlOwaTAQl9qwHaazOVB5Hxzhe1D7BEgsDHW t9BH0smVsV3eMVI5dQ5UGyD+crmnx/rf09+0WZL4SsR6+oS3nCxXM6KzdXgyOnoeI0RE ENjHBPPSp9qEchK2l+UW5xnmhT+Etex/Rbp069VcwOrI8fywDvxb+ZpiFKYOdOodv8gW 7MWhNAI56rbj2lsDKaNEqceLaaa8DmYsrJxbCbreymhlu2cnPMIyJuXLakZFsE4G9qrM DFMClLlV+kkttWZB0fGsY2+lejcTZvQv0eNrjDUua8Ns5drB3KZnXAynbgSEe5UfnfYR +5cQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id b14-20020a170902d50e00b001c73489c6a5si4602259plg.484.2023.10.13.04.12.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Oct 2023 04:12:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 4D3CE839D9C0; Fri, 13 Oct 2023 04:12:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbjJMLMT (ORCPT + 99 others); Fri, 13 Oct 2023 07:12:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230120AbjJMLMS (ORCPT ); Fri, 13 Oct 2023 07:12:18 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B4B9791 for ; Fri, 13 Oct 2023 04:12:14 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.43]) by gateway (Coremail) with SMTP id _____8BxHOsMJillY7IxAA--.25707S3; Fri, 13 Oct 2023 19:12:12 +0800 (CST) Received: from [10.20.42.43] (unknown [10.20.42.43]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Cxjd4KJilleMkiAA--.9894S3; Fri, 13 Oct 2023 19:12:12 +0800 (CST) Message-ID: <9c2ec240-bca0-4f99-96db-a5156bbd82e5@loongson.cn> Date: Fri, 13 Oct 2023 19:12:09 +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: AQAAf8Cxjd4KJilleMkiAA--.9894S3 X-CM-SenderInfo: xvxlyxpqjiv03j6o00pqjv00gofq/ X-Coremail-Antispam: 1Uk129KBj9xXoWruw1fWr4xXFy8GFy8uFy5WrX_yoWfGrX_uF yDWwsrGwn5WF1DJwnYkr4IqrWagrn2vry8Ca9rJF13J343X3yxKF4kGr95Zw18JF4rGr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FFERENT_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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 13 Oct 2023 04:12:25 -0700 (PDT) Hi, On 2023/10/10 20:26, Xi Ruoyao wrote: >> For DMA non-coherent buffers, we should try to implement arch-specific dma_map_ops, >> invalidate the CPU cache and flush the CPU write buffer before the device do DMA. Instead >> of pretend to be DMA coherent for all buffers, a kernel cmdline is not a system level >> solution for all of GPU drivers and OS release. > IIUC this is a hardware bug of 7A1000 and 7A2000, so the proper location > of the workaround is in the bridge chip driver. Or am I > misunderstanding something? The ls2k1000 and ls2k2000 SoC (which don't use with 7A1000 and 7A2000) are also suffer form this problem. If this is a hardware bug of 7A1000 and 7A2000, why forbidden WC mapping of pages in system RAM? The problem of this patch and the <16c52e503043> commit is that it forbidden all WC mappings by default. Even pages in system RAM.