Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp860504rdb; Fri, 22 Dec 2023 07:12:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/4GbquuKLB+OcNnAHufH85l7zCVjx1Nuk/sdunABcktylOzPwJLligg6cbaE8XexZPdc0 X-Received: by 2002:a17:906:212:b0:a22:e7c2:8c75 with SMTP id 18-20020a170906021200b00a22e7c28c75mr915975ejd.5.1703257957518; Fri, 22 Dec 2023 07:12:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703257957; cv=none; d=google.com; s=arc-20160816; b=ZSDLfcGaGjddSTlevFpWdsqTDdfoVPwE4JAHpuRo0uM71IuJC7OPTBd0WbIYJVWjDA msFfPHYt7ZSoUj/Mf0th6YSSwBuOvjtQHGc+hH/87lS9DJfvlEN+jQfnncinSCLzKVpC r4hk5wtf7jvuG6DJDQBt4R8aaZylciSvYWOVAsxSJGO4pYMrdh0eK5XKHErbdnzUpymV M1mrYdj4qUBRXSBmqK3St8TbthhqN3nfqcGLAP3U3Ab51OOa9xIcgg303DEgRGEjgGPr LhOVVa0bMsawvCydtv9lUhSUSzzwrkUBalAGKw8P4i/G1yANrLEhreoWtLJU9lYb9RV0 KLSw== 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=S9tuhPF69BhL+CsxV0z0CbHuu/EPEoPYIg/LHGIvtt0=; fh=Kvx5tBuElToyBhN9+1M3E3z0ApwsY/elkeH/QJ0d8ms=; b=kkBNAZ5kg+a29v5VbhLhH/cF/lJnYRylt6r5QqGUXnaTZ3QFB6pvHFCx0zSfFs4FVH op4YqpDj8VHf6hFySrxG7Zz/GGcZxb074GYPqva4lukY6ejauXCCqGELWgSg52lRwJCv qb/NTGkdjCYci4nJIKJA9+ktxJV+QuS4n25LprWUy1WXVTOLin5JoMj/4pqf0T0p1MUA IqR653eikd4yIxk1dxsjzm1Dmg8G2vAgI87C9rdEks2zhHfs5W/pJNa/luTlpYc51q4x HlPGi/EeARc7JjKmexaa21fXZjc9hNlTXw4G8VHck21pf84TCnWS4gmkd5o4meWWaaCO lXww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9809-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9809-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id gi19-20020a1709070c9300b00a232e088c69si1746859ejc.290.2023.12.22.07.12.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 07:12:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9809-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9809-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9809-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C33821F27C42 for ; Fri, 22 Dec 2023 15:04:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2629123777; Fri, 22 Dec 2023 15:04:33 +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 BD9C023749 for ; Fri, 22 Dec 2023 15:04:29 +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 96F8668BEB; Fri, 22 Dec 2023 16:04:18 +0100 (CET) Date: Fri, 22 Dec 2023 16:04:17 +0100 From: Christoph Hellwig To: Conor Dooley Cc: Maxim Kochetkov , Christoph Hellwig , Jiaxun Yang , 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: <20231222150417.GA23363@lst.de> References: <20231221185152.327231-1-fido_max@inbox.ru> <20231221-discount-decade-e306e5878c46@spud> <20231222041428.GA2803@lst.de> <20231222-outburst-spoiling-75082a7826dd@spud> 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: <20231222-outburst-spoiling-75082a7826dd@spud> User-Agent: Mutt/1.5.17 (2007-11-01) On Fri, Dec 22, 2023 at 02:54:19PM +0000, Conor Dooley wrote: > > of_dma_is_coherent() affects only DT devices. And we can override it with > > "dma-coherent"/"dma-noncoherent". ACPI devices can specify by > > "attr == DEV_DMA_COHERENT". But all other devices (platform_device, usb, > > I would have expected that usb devices "inherit" the value from the usb > controller whose bus they are on. Similarly, platform devices are on a > bus that should be marked as non-coherent if that is the case. > Christoph certainly knows better how things operate here however. usb is not a DMAable devices, you need to use the USB layer helpers that call the DMA API on the host controller's device. platform_device must have a device tree and the dma-noncoherent attribute somewhere in the hierarchy.