devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baruch Siach <baruch@tkos.co.il>
To: Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>
Cc: "Baruch Siach" <baruch@tkos.co.il>,
	"Robin Murphy" <robin.murphy@arm.com>,
	iommu@lists.linux.dev, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Petr Tesařík" <petr@tesarici.cz>,
	"Ramon Fried" <ramon@neureality.ai>
Subject: [PATCH RFC 0/4] arm64: support DMA zone starting above 4GB
Date: Wed, 27 Dec 2023 17:04:24 +0200	[thread overview]
Message-ID: <cover.1703683642.git.baruch@tkos.co.il> (raw)

DMA zones code assumes that DMA lower limit is zero. When there is no RAM 
below 4GB, arm64 platform code sets DMA/DMA32 zone limits to cover the entire 
RAM[0].

The platform I have has RAM starting at 32GB. Devices with 30-bit DMA mask are 
mapped to 1GB at the bottom of RAM, between 32GB - 33GB. A DMA zone over the 
entire RAM breaks DMA allocation for these devices.

In response to a previous RFC hack[1] Catalin Marinas suggested to add a
separate offset value as base address for the DMA zone. This RFC series 
attempts to implement that suggestion.

With this series applied, the DMA zone covers the right RAM range for my 
platform.

[0] See commit 791ab8b2e3db ("arm64: Ignore any DMA offsets in the 
    max_zone_phys() calculation")

[1] https://lore.kernel.org/all/9af8a19c3398e7dc09cfc1fbafed98d795d9f83e.1699464622.git.baruch@tkos.co.il/

Baruch Siach (4):
  of: get dma area lower limit
  of: unittest: add test for of_dma_get_cpu_limits() 'min' param
  dma-direct: add offset to zone_dma_bits
  arm64: mm: take DMA zone offset into account

 arch/arm64/mm/init.c       | 18 +++++++++++++-----
 drivers/of/address.c       | 38 +++++++++++++++++++++++++++-----------
 drivers/of/unittest.c      | 17 ++++++++++-------
 include/linux/dma-direct.h |  1 +
 include/linux/of.h         | 11 ++++++++---
 kernel/dma/direct.c        | 10 ++++++----
 kernel/dma/pool.c          |  2 +-
 kernel/dma/swiotlb.c       |  5 +++--
 8 files changed, 69 insertions(+), 33 deletions(-)

-- 
2.43.0


             reply	other threads:[~2023-12-27 15:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-27 15:04 Baruch Siach [this message]
2023-12-27 15:04 ` [PATCH RFC 1/4] of: get dma area lower limit Baruch Siach
2024-01-17 22:23   ` Christoph Lameter (Ampere)
2024-01-18 10:59     ` Baruch Siach
2023-12-27 15:04 ` [PATCH RFC 2/4] of: unittest: add test for of_dma_get_cpu_limits() 'min' param Baruch Siach
2023-12-27 15:04 ` [PATCH RFC 3/4] dma-direct: add offset to zone_dma_bits Baruch Siach
2024-01-08 17:55   ` Catalin Marinas
2024-01-09 10:03     ` Baruch Siach
2024-01-09 10:54       ` Catalin Marinas
2024-01-09 13:54         ` Baruch Siach
2024-01-09 17:51           ` Catalin Marinas
2023-12-27 15:04 ` [PATCH RFC 4/4] arm64: mm: take DMA zone offset into account Baruch Siach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1703683642.git.baruch@tkos.co.il \
    --to=baruch@tkos.co.il \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=petr@tesarici.cz \
    --cc=ramon@neureality.ai \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).