Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp882363rdb; Fri, 22 Dec 2023 07:45:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOmayVRLQzKno1o69LE3RaV/XEd42fdWXetvM/NRcbXV9PJXmc9NVe06o1wHnUt85jTkew X-Received: by 2002:a17:903:a8c:b0:1d3:f9ac:c9d3 with SMTP id mo12-20020a1709030a8c00b001d3f9acc9d3mr958043plb.76.1703259949516; Fri, 22 Dec 2023 07:45:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703259949; cv=none; d=google.com; s=arc-20160816; b=vgbbqahPi0iKo3iQlnLVf2AkkLARqK1sWr3A7E95guSQYlYc0odIEArcBSWPbyVlDt 4w4tbYjk4ISsIjk8Ox+gwHq2D7+/+EvIQ6R7Fbucph8p4i3U08qSbgsLf+dVaEOH87FD SO8Ttn42pc0aQ/MKlLHjKumZMWxf/l0Ya7Pe+UnU+2jNTnC8THT0wyD8JM8Zjh5+8JZp SDohwXCPN6V1UIX8oPbHib61AW5gUoclYW6J9sIA1kPE7HNYvpXvHvuGF7glaXeRcqTS +2bCY2Pr9u/1OnOUHz9gWB8uFEMP7D+0BIO6WODZbFRTVcN6NNaNM+HGZYu4wX1pgD61 i0sA== 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=6zFESOLYOJ1DDdmVNp/WKfFuDXzWx4mPHU++2AdAS2g=; fh=Ge1c6b6zx3/vcFsDbDbQh1Sd45cTdKC0G9PbgG+Ordo=; b=wG8cBvzyShE+k2noDqr7WqRF0QIAfp3x7fAd9TRZSuN6Rh0vW2e6lOEPeBTcdyVKHN 2tnnAuAMD3WlpUgLlFCGZPXYzzwON5LOMj9zD1VRwSB6z6vSv1/kTS1b+kQwFzOm9KFE gp/BuRqtjMETWVmV+sfa67+QFj+GcamphYcXdPcr2u7ZLcGZHnqODKQiqU3Z4XWS7Fqx hRa9Bgxsz6VqHLQToRg5NuP7zA2AIhgNYAeU8SppTHbkXjM8gwhbw8u0ybNLZmgM057R PYj9fclD9D5tGHVLnrFSI2yJg/6MutSWn8yK9fb2bIbFJJw24elmSiaqrTY2MQp9t7QG forA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=fm3 header.b=CE0wOMBN; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=dNC8d1TP; spf=pass (google.com: domain of linux-kernel+bounces-9851-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9851-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 ix9-20020a170902f80900b001cfe02fa89esi3347439plb.117.2023.12.22.07.45.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 07:45:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9851-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=CE0wOMBN; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=dNC8d1TP; spf=pass (google.com: domain of linux-kernel+bounces-9851-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9851-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 E2A63284ED0 for ; Fri, 22 Dec 2023 15:45:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72B282377F; Fri, 22 Dec 2023 15:45:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="CE0wOMBN"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="dNC8d1TP" X-Original-To: linux-kernel@vger.kernel.org Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (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 9B04323760 for ; Fri, 22 Dec 2023 15:45:41 +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 compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id B8A963200A28; Fri, 22 Dec 2023 10:45:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 22 Dec 2023 10:45:40 -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=1703259939; x=1703346339; bh=6zFESOLYOJ1DDdmVNp/WKfFuDXzWx4mPHU++2AdAS2g=; b= CE0wOMBNfNkM5XslHkcIoMwIII73hgIWhectOKaBavXEURdejv5SkIt/AmUEIOB2 VtmlXetJnVsIHm3YBTV9/tIHkVigfANDBoYL3zy2lQv3PyH1+106swdLJ6ehpYwV p2ilAP65ViFjfUgwsG2xxUZ9pIY4K3nHxEEIpIvGGDsa4coB7E+So2RrUnCxLiRu n9r4yRdJV8XJCmFK5TAnRLWxdIWJ0ttpO/NNcNlg6xec8M5KuDwhQyHXNpXP40Rb q9EKE8Io399D5T2sWn6g0dUIOpNCHJAzUTkyTP0BrWxa5obBkbo3smNJZsCVCxZm wATeiKpkEee0ifRPtnuv6A== 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=1703259939; x= 1703346339; bh=6zFESOLYOJ1DDdmVNp/WKfFuDXzWx4mPHU++2AdAS2g=; b=d NC8d1TPuieHSHEmdIbIcvr2O+PE//rfojR7jBxJ/WYHaXsWaS4tL3k6Cdc+bRTmb O3CkS+Ks11zxOYFYN0Fcu6DfswY1MvhB2aWCpfT5Hp+mdvNW6bkoAFxq2Nvnj57f eJBNsf7hKi7wVuirD/ylgYjQ2n0PQkGIx+pBwB6ntyDudwUwz/+UdhQKd1QfTtBY MMQF+UdI+L+Vcn1KddVtPQxUmGR2pkHdZQf3Mne+kyxLKdQfWLCVzSI5nqP7aOAF pG6XaUZpwy20qEUCx3Z/Xf9FH9ymSb9jE4fCdjzyiOIgoPh7dc9ToQ08x55/E4mq oFBkEhE51zpAeEFd2P1tQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddujedgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeflihgr gihunhcujggrnhhguceojhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomheqne cuggftrfgrthhtvghrnhepleeuffehheegleeuvdelgffhueekjeetueevuefhffdtgfeu hfeggfeukefffedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 22 Dec 2023 10:45:37 -0500 (EST) Message-ID: <7bc138f7-d5e9-471a-ae82-d6c490645623@flygoat.com> Date: Fri, 22 Dec 2023 15:45:34 +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 , Conor Dooley Cc: Christoph Hellwig , 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 References: <20231221185152.327231-1-fido_max@inbox.ru> <20231221-discount-decade-e306e5878c46@spud> <20231222041428.GA2803@lst.de> <20231222-outburst-spoiling-75082a7826dd@spud> From: Jiaxun Yang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 在 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