Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp273117rdb; Thu, 18 Jan 2024 03:13:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHM5eOCj21lpo4++4IvuusqiojWlCyv1UnMWRx51mJ8XJts3LPnVOsc+NvVI4eMeHGZCZXC X-Received: by 2002:a62:8453:0:b0:6db:605c:b9e4 with SMTP id k80-20020a628453000000b006db605cb9e4mr482372pfd.31.1705576408756; Thu, 18 Jan 2024 03:13:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705576408; cv=pass; d=google.com; s=arc-20160816; b=0so6nDORGbFJrtmlQ8n3Ohj8x3tUMb8ll++jfQi7lVbHlL54KhmWHl8/7OTKsBRbqT usKcyhOc1KVMwzzQd7GPSRIiOlIJ3zIcoQ95/fB4evI1t3enr0xfGa/HSnp2rnasmkoe d4/SM0oAVMlp9k7m0RErXCXUOBjashai1tCoqTX8zymcA+ET6pEjFY9Pj535Rzm8nFl/ vjI+CTcAnesGLbYFofZdaYdJKnR19rOsDRcvKThqDBOCZTt0IhEYm/7BndA/5diFvULi VzxthuANQUDe80kCNTq/0+MiZfcvoOe6a+VoWR81FSdEGMZDhIhPGOh8YgG/LSD7TNTn HpNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:in-reply-to:date:subject:cc:to:from:user-agent :references:dkim-signature; bh=Y4uHAeqYi5UbjFdjn2MkRkjrrfT/Qceh7mxKT6NHIxU=; fh=CF7X3v6PzS2lPgES2gHUwrokEI4oftg+Y4tAuvVSSCs=; b=peVb9kWamfib3Sz+2ieWLIhbH44sIgs9/i1MvUIpaNFbGDkcU8glYg3/tdrTVarWm9 lKJHJy0wL9IvJgjswL4xhgSv1YGgQ/Z640WyCGxkfuetka9LcDziyUeXMapRSKxCY7QP zkhvk2JWGzyO6MH9sQGvztJFu6w6jCrnXLAn/LPq0p3FXTq3R3FW8c0bM4RuBuLXUt/l vcbLfDDKWRPRFcTj+rkAwm1MDUyfsGGwS+2RbhzjsIU9/euQz7l3P8F/0I/yJ045ZS9X EjgLRZVRTxF0bC//51mnuClW68jRgPwHNPdfIqv3nRBqqBUCYavnGkLcM/Ib6VfjJ/7x LuDA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tkos.co.il header.s=default header.b=muPu86A6; arc=pass (i=1 spf=pass spfdomain=tkos.co.il dkim=pass dkdomain=tkos.co.il dmarc=pass fromdomain=tkos.co.il); spf=pass (google.com: domain of linux-kernel+bounces-30032-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id u16-20020a056a00099000b006db9cce4848si3275869pfg.275.2024.01.18.03.13.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 03:13:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30032-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; dkim=pass header.i=@tkos.co.il header.s=default header.b=muPu86A6; arc=pass (i=1 spf=pass spfdomain=tkos.co.il dkim=pass dkdomain=tkos.co.il dmarc=pass fromdomain=tkos.co.il); spf=pass (google.com: domain of linux-kernel+bounces-30032-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30032-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=tkos.co.il 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 10AE0B24FA3 for ; Thu, 18 Jan 2024 11:11:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A52EB25106; Thu, 18 Jan 2024 11:10:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tkos.co.il header.i=@tkos.co.il header.b="muPu86A6" Received: from mail.tkos.co.il (guitar.tkos.co.il [84.110.109.230]) (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 75DFC2421B; Thu, 18 Jan 2024 11:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=84.110.109.230 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705576235; cv=none; b=IutRLsUSexEVkpDscJm3RS/oUIczsQ7x/FQbRdc1QMuM0He2t+CZ0BsQf4ETa7xCt2QS9dm31975GkbkBliT0sbOqhwaOi1xQEsh0EvMA6fj6yVlSH3OFvgxTbJjFbWkgxPQwYHXnCY1Ri5JZjbooA1mGZRJczV6v19vue4aBLs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705576235; c=relaxed/simple; bh=GMtd0pstpQcqTleYbfyojTxp00ZU0XHSVR8HGIiOeDM=; h=Received:DKIM-Signature:References:User-agent:From:To:Cc:Subject: Date:In-reply-to:Message-ID:MIME-Version:Content-Type; b=Ri4l8iINXU3sRVV9pf0WCf9l7APHKxRh9Kkc7Tnz+295TWJq1c4Dn3Zos5UypUAZ327djnonSvPH70IeQJDCaOuzPl87MmNezqLOMvtWDbJPpc21dpmDqkJ5q2fR9kmi/XrpcoztDEquixmDJVaZIu3wryW3V+UTTxeq7u27SEk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tkos.co.il; spf=pass smtp.mailfrom=tkos.co.il; dkim=pass (2048-bit key) header.d=tkos.co.il header.i=@tkos.co.il header.b=muPu86A6; arc=none smtp.client-ip=84.110.109.230 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=tkos.co.il Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tkos.co.il Received: from localhost (unknown [10.0.8.2]) by mail.tkos.co.il (Postfix) with ESMTP id B46D94408C7; Thu, 18 Jan 2024 13:10:19 +0200 (IST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tkos.co.il; s=default; t=1705576219; bh=GMtd0pstpQcqTleYbfyojTxp00ZU0XHSVR8HGIiOeDM=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=muPu86A6ftu2HlsG9jhNTjR4XMmDWwggPY7ZxAaroE5GJfLGriZw3+wA9p66vm7W+ b8v5Fu/BLRu59D2qzb9u7SfoGNmDj0Pdk0GjuunjUdwgywMoSRZoioVkXDxS8M64gU hLP4ed3Dt6wUXVqgm/0NtCFzBKULdsnd2sxFrMtDwtB6YlDCFtoZjzPUN+ODHJ7JCI fgaPMmhnZzDPlDpoKLgdjQ9xW6efT57tO4cVlgk3HrJ7FH8fSJ/IIrb7B+OqebjDNK 7+E1UwyottHI3VU/1jwXOq1CcaBVwAho0Hz/mJNlsxhg3VAyMn+tef/Iokd5FkBz35 EikZ6YBQ0ROhQ== References: <30d81f73-e27e-6cc4-5458-686e3ddd2e5c@linux.com> User-agent: mu4e 1.10.8; emacs 29.1 From: Baruch Siach To: "Christoph Lameter (Ampere)" Cc: Christoph Hellwig , Marek Szyprowski , Rob Herring , Frank Rowand , Catalin Marinas , Will Deacon , Robin Murphy , iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Petr =?utf-8?B?VGVzYcWZw61r?= , Ramon Fried Subject: Re: [PATCH RFC 1/4] of: get dma area lower limit Date: Thu, 18 Jan 2024 12:59:58 +0200 In-reply-to: <30d81f73-e27e-6cc4-5458-686e3ddd2e5c@linux.com> Message-ID: <87cytyx5gf.fsf@tarshish> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Hi Christoph On Wed, Jan 17 2024, Christoph Lameter (Ampere) wrote: > On Wed, 27 Dec 2023, Baruch Siach wrote: >> of_dma_get_max_cpu_address() returns the highest CPU address that >> devices can use for DMA. The implicit assumption is that all CPU >> addresses below that limit are suitable for DMA. However the >> 'dma-ranges' property this code uses also encodes a lower limit for DMA >> that is potentially non zero. > > All of memory can be used for DMA by default (==ZONE_NORMAL). ZONE_DMA defines > a special range for devices that are unable to perform DMA to all of > memory. Usually due to the lack of address bit support. > > So I guess that the platform in question here has as a general limit as to > what address spaces I/O devices can do DMA to? DMA to/from devices in bus with 'dma-ranges' property is limited to address space described in 'dma-ranges'. The arm64 platform currently uses 'dma-ranges' as a hint to set ZONE_DMA limits globally. This series is meant to make ZONE_DMA limits adjustment code work better for platforms where the lower DMA limit is above 4GB. This commit adds the ability to extract the lower limit from 'dma-ranges'. baruch -- ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -