Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp453776rdb; Thu, 21 Dec 2023 14:27:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJ4MbzfbKgCFJBbdm0PYcDfRAd8lGCY3KA+FzKxU63TDciZhZGEhyVmnMtOD4+mT7QAK1u X-Received: by 2002:a17:90a:9505:b0:286:6cc1:7818 with SMTP id t5-20020a17090a950500b002866cc17818mr407478pjo.91.1703197667506; Thu, 21 Dec 2023 14:27:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703197667; cv=none; d=google.com; s=arc-20160816; b=r97J1CjyAygzmsGOvhVJzjrLY0epXO6sW6RzPUbmZA7Qde2i3E4vRrjKYu0jfbvwTT db8q9KNWLkuNTHVU5iYHhkiWnR1taSWlx7ereLE6TgjqSVtsJEU21SXjx+0Gl+rNDWz3 ovGrKk2lrpKZJtU4jgKH+NVHalhlfqJouB4YAip1FttW2mKxu9mX7405070/GjgLFhUK /NWsiPThtll+TUk6cO+GiCv7/1mY3I1JF4chqIpUREFcC0UpyTe98UmxE3X//dt5i+Te lP2+IjuVHIohPyJR58w6QeIQnbxQE3y6OceA2FRDVbBIHXoiXLqZhWHXNO5c+23wNmDf shNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:feedback-id :dkim-signature:dkim-signature; bh=D3XrcpmwSUo4Jh0flb6Uu5UWPtnHv0fDYb0xkIsdRag=; fh=OWYi0b0CrWpgT5Soa7QGQ9f/OQUejNx4+pvn3mNABqg=; b=Eve/0007l8VxeTU8jKHegEpjwNa5hGgcmScrGdfAbCTXcJRCninnz9GnbKdnrlP8Xo Ip7e0C9KuPHWngsSBx8MgcRJt9qdzgsj8ictUSQ0et1X5LHhXwLepP59uHArHz53w/w7 j7AwBIBMHykQwCawiLuuXotSvDrV4UaxdY8kdvDQUVSYAuiiaRqMFmQYrpEM2OVQQIYB RFCn27pQwYmvGBspM5cR8AHriTnttZwsfZbloP8gR+OwDtShy88g4+ytlMc7Z95GKELK HECc7xWd5Lr3ib+2oETgpJIepj4Cesl0nt0kGj3to1uvD4kB3BLnYF7AMFt5t9UJ/nJg AVbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm3 header.b=ajp0ZrzO; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=daLkiNZe; spf=pass (google.com: domain of linux-kernel+bounces-9129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c19-20020a17090a8d1300b0028b3b607137si5669442pjo.116.2023.12.21.14.27.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 14:27:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm3 header.b=ajp0ZrzO; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=daLkiNZe; spf=pass (google.com: domain of linux-kernel+bounces-9129-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9129-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 09C5D287370 for ; Thu, 21 Dec 2023 22:27:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C60478E67; Thu, 21 Dec 2023 22:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="ajp0ZrzO"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="daLkiNZe" X-Original-To: linux-kernel@vger.kernel.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD1DB6519C for ; Thu, 21 Dec 2023 22:27:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=flygoat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flygoat.com Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id C24FD5C011A; Thu, 21 Dec 2023 17:27:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 21 Dec 2023 17:27:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1703197656; x=1703284056; bh=D3XrcpmwSUo4Jh0flb6Uu5UWPtnHv0fDYb0xkIsdRag=; b= ajp0ZrzORgYya9RxrSC/ZBpVlPkUGrydFB9a1C+Gca7EalgQtn7FiKb9R6Odhy7J i8kvMh8/kcjR0gORarpO5NYUepVVHH1E+rCRWr7fbrBe42mOoAHaN38taZmWd4nP teNmi6NTfY4WZbLiNi3XSopXBJpsRSFwHtiG46STDydYXnyNIQrMOEWY0tuUdU/9 kGy0OXlT0EQWicbrMmuhIwot0mUTsBu7AmeTxQ7YwcbY4SSHyh+SCjedZ9V7WRDT 0SNX8m1iSAyMcYZM0lCZ1Ye5/DPCHAzbDf/XHyabnt80gA/1Pcj5WB4nrInI6CEt tuMdl17WUq3scRUQ0pcPUA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1703197656; x= 1703284056; bh=D3XrcpmwSUo4Jh0flb6Uu5UWPtnHv0fDYb0xkIsdRag=; b=d aLkiNZeElD4ukKPg/YCO1frIjgShagfukeUV8psUNAy/UzDB3ZFAcFjtZShvACNN o5KcC1zX2m/YQv+k1q+eZj6ryK3zfbaOHghRKytJqH/0SK4+VlCzjOGPQYK+GS2U v9xmURPfylN6VLoAapHJbeDZJhdBjcDQ3Nw+tNKL+lM4XbKDb4HPkH30OSJ1+Y6w A/2B7W+8AaWXj64lkw0L7ZVDIFeGEExk+Lt2mzOOwI4UJ1eOviNRsrY72/kz26XX ObF4FDZYiFaKZUQDYrxfinuginoTMO69ZTZkAiHeIAxUha3kqUmHK2AXznNOujn+ qkUCa87FZPwiQFu9e9InA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdduhedgudefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomheplfhi rgiguhhnucgjrghnghcuoehjihgrgihunhdrhigrnhhgsehflhihghhorghtrdgtohhmqe enucggtffrrghtthgvrhhnpeekffevjeffffejffetffejhffhtedugfejvdeiudfftedv udelhedtjeffgeffkeenucffohhmrghinhepihhnfhhrrgguvggrugdrohhrghenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjihgrgihunhdr higrnhhgsehflhihghhorghtrdgtohhm X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 21 Dec 2023 17:27:34 -0500 (EST) Message-ID: Date: Thu, 21 Dec 2023 22:27:33 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] riscv: set ARCH_DMA_DEFAULT_COHERENT if RISCV_DMA_NONCOHERENT is not set Content-Language: en-US To: Maxim Kochetkov Cc: 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, Conor Dooley , hch@lst.de References: <20231221185152.327231-1-fido_max@inbox.ru> <20231221-discount-decade-e306e5878c46@spud> From: Jiaxun Yang In-Reply-To: <20231221-discount-decade-e306e5878c46@spud> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 2023/12/21 20:29, Conor Dooley 写道: > + Christoph > > I don't think this patch is correct. Regardless of whether we support > cache management operations, DMA is assumed to be coherent unless > peripherals etc are specified to otherwise in DT (or however ACPI deals > with that kind of thing). > > What problem are you trying to solve here? > > On Thu, Dec 21, 2023 at 09:51:52PM +0300, Maxim Kochetkov wrote: >> Not all the RISCV are DMA coherent by default. Sorry for chime in here. IMO if your platform is not coherent by default, just insert "dma-noncoherent" at devicetree root node. Thanks - Jiaxun > What is a "RISCV"? I believe this sentence should be "not all RISC-V > systems are DMA coherent." but that is provided for by the > "dma-noncoherent" property, set for peripherals (or buses) that are not > DMA coherent. > >> Moreover we have >> RISCV_DMA_NONCOHERENT option. >> So set ARCH_DMA_DEFAULT_COHERENT only when RISCV_DMA_NONCOHERENT is not set >> >> Fixes: c00a60d6f4a1 ("of: address: always use dma_default_coherent for default coherency") >> Signed-off-by: Maxim Kochetkov >> --- >> arch/riscv/Kconfig | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig >> index d6824bec2c00..111c5d92d503 100644 >> --- a/arch/riscv/Kconfig >> +++ b/arch/riscv/Kconfig >> @@ -14,7 +14,7 @@ config RISCV >> def_bool y >> select ACPI_GENERIC_GSI if ACPI >> select ACPI_REDUCED_HARDWARE_ONLY if ACPI >> - select ARCH_DMA_DEFAULT_COHERENT >> + select ARCH_DMA_DEFAULT_COHERENT if !RISCV_DMA_NONCOHERENT > I think this is actually buggy, for things like distro kernels > RISCV_DMA_COHERENT will always be set, but those kernels are expected > to be used on systems that are cache coherent also. > > Thanks, > Conor. > >> select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION >> select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2 >> select ARCH_ENABLE_THP_MIGRATION if TRANSPARENT_HUGEPAGE >> -- >> 2.40.1 >> >> >> _______________________________________________ >> linux-riscv mailing list >> linux-riscv@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-riscv