Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1218212rdb; Fri, 22 Dec 2023 21:00:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyy9QdnAGyJUb8RABJdDfkp5put85yhHE5cr1YJZm/Cmu+Gy933fsirjfZpS7HanMrXOq4 X-Received: by 2002:a05:6e02:3185:b0:35f:eb7c:9d4 with SMTP id cb5-20020a056e02318500b0035feb7c09d4mr816508ilb.0.1703307610508; Fri, 22 Dec 2023 21:00:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703307610; cv=none; d=google.com; s=arc-20160816; b=KFqFUtkWbbPGGzzMQ8xrZjA+TPy7eOTl4YTvqAoUSrmlF7VsnHq2uzAZTKZSU5UtuG L030cPGikRYrTSFxLZcqlsPA854LPGgZO8D2XZJ8zCjMrYIfI1UFYFiO4qen8/J76Pfw A3JiggxusAr2nvdDauCaJAKYq1t/byvqSvA12Y3qOTuFS4YimnKAo4IZiC79yKbsYjbu h00KnHj0Z782WdzHX4YHF7dJ52+KT6MxsEm937Iu/aXDX2J1FVfGegMiu64Sl8+wJ9ES Q1PmCE7N90qz5XVOJzn8BGqAZoqis4vy5ezyUFCAJCW1poN34UbG7/VtCjFuo58bLXiU i+qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=NlnmoZGPoBQ8dG858LHUrMG0DxgE9G0kMgx+9IkuyTs=; fh=7oYL0jqD5wj1y/iiuuPXBGIVt5W57cfNUxABS3iDNm4=; b=aZ6Q9DF1YkaSUnJSm9wYO8ikUG+bVb8ojE+Xqy5qI3ZveAFTA5gLyL0+BkTNRmlqKf YAv1Uun4k/orVc2KPnCr3Qxv/11ZOff3KveT63yAD7HksMLUdYYGchrMM3i3h+pfO6l+ b/tpsL/EzLWylCUOVzdbNY6IoUGbkSGSTu0mVPH1TOZow7QXvKK22so5iV0uzrjxwp60 dtaBq4zKW850EuB0Zd3F31osMT0fmYOgAfeRYhP3F0whKhOTBjm0G7hlFO3dzLk1I0NO zsW4xvpP/PcutSQ5OwNuWiERsv18TDv8/1YNm5ay33fq0S21ZkXtDfSiJZByoQW7qYPe Hlgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-10291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10291-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l18-20020a170903245200b001d4043206aasi4175700pls.396.2023.12.22.21.00.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 21:00:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-10291-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10291-linux.lists.archive=gmail.com@vger.kernel.org" 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 538EEB217F8 for ; Sat, 23 Dec 2023 04:59:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 723654A34; Sat, 23 Dec 2023 04:59:21 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (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 3800246AD for ; Sat, 23 Dec 2023 04:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id C624168B05; Sat, 23 Dec 2023 05:59:12 +0100 (CET) Date: Sat, 23 Dec 2023 05:59:12 +0100 From: Christoph Hellwig To: Jiaxun Yang Cc: Maxim Kochetkov , Conor Dooley , 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 Subject: Re: [PATCH 1/1] riscv: set ARCH_DMA_DEFAULT_COHERENT if RISCV_DMA_NONCOHERENT is not set Message-ID: <20231223045912.GA21836@lst.de> References: <20231221185152.327231-1-fido_max@inbox.ru> <20231221-discount-decade-e306e5878c46@spud> <20231222041428.GA2803@lst.de> <20231222-outburst-spoiling-75082a7826dd@spud> <7bc138f7-d5e9-471a-ae82-d6c490645623@flygoat.com> <6fe34090-656d-491f-8173-217d20144166@inbox.ru> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) On Fri, Dec 22, 2023 at 04:01:43PM +0000, Jiaxun Yang wrote: >> >> But arch_setup_dma_ops() is called only from of_dma_configure_id() and >> acpi_dma_configure_id(). So it works only for DT and ACPI devices. What >> about platform_device? > > Ah I see, that's the problem, in MIPS's use case all DMA capable devices > are following platform's default coherency. For RISC-V we assume all device > are enabled by ACPI or DT. > > Perhaps you can override it in driver, but that will make drivers platform > dependent. > > I'll leave this question to Christoph. I've already said it. You must not have DMA capable devices that aren't declared in ACPI or OF, just like on any modern Linux platform. What devices are you concerned about anyway Maxim?