devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	Lizhi Hou <lizhi.hou@amd.com>
Cc: Max Zhen <max.zhen@amd.com>, Sonal Santan <sonal.santan@amd.com>,
	Stefano Stabellini <stefano.stabellini@xilinx.com>,
	Jonathan Cameron <Jonathan.Cameron@Huawei.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Allan Nielsen <allan.nielsen@microchip.com>,
	Horatiu Vultur <horatiu.vultur@microchip.com>,
	Steen Hegelund <steen.hegelund@microchip.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Herve Codina <herve.codina@bootlin.com>
Subject: [PATCH v2 0/3] Fix DT based address translations
Date: Tue, 17 Oct 2023 13:02:15 +0200	[thread overview]
Message-ID: <20231017110221.189299-1-herve.codina@bootlin.com> (raw)

Hi,

This patch series fixes a DT based address translation (translations
using the ranges property).

The issue is present with a ranges property made of a 3 cells child
address, a 3 cells parent address and a 2 cells child size.
This can happen with the recent addition of of_pci_prop_ranges() in
commit 407d1a51921e ("PCI: Create device tree node for bridge")

The issue description is fully described in the first patch commit log.

In this series,
  - The first patch fixes the issue.
  - The second patch avoids duplicated code.
  - The third patch adds unit tests related address translations.

I previously sent the first patch alone:
  https://lore.kernel.org/linux-kernel/20231003065236.121987-1-herve.codina@bootlin.com/
This series v2 has to be considered as the next iteration based on the
review done on my previous patch sent alone.

Best regards,
Hervé

Changes v1 -> v2

 - Patch 1
   Simplify of_bus_default_flags_map().
   Fix the commit log (pci-ep-bus ranges[0] size is 0x200_0000 instead
   of 0x2000_0000).

 - Patch 2 (new in v2)
   Remove duplicated code.

 - Patch 3 (new in v2)
   Add unit tests.

Herve Codina (3):
  of: address: Fix address translation when address-size is greater than
    2
  of: address: Remove duplicated functions
  of: unittest: Add tests for address translations

 drivers/of/address.c                        |  43 ++++++---
 drivers/of/unittest-data/tests-address.dtsi | 101 ++++++++++++++++++++
 drivers/of/unittest.c                       |  74 ++++++++++++++
 3 files changed, 205 insertions(+), 13 deletions(-)

-- 
2.41.0


             reply	other threads:[~2023-10-17 11:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 11:02 Herve Codina [this message]
2023-10-17 11:02 ` [PATCH v2 1/3] of: address: Fix address translation when address-size is greater than 2 Herve Codina
2023-10-17 11:02 ` [PATCH v2 2/3] of: address: Remove duplicated functions Herve Codina
2023-10-17 11:02 ` [PATCH v2 3/3] of: unittest: Add tests for address translations Herve Codina
2023-10-27  7:53   ` kernel test robot
2023-10-26 13:58 ` [PATCH v2 0/3] Fix DT based " Rob Herring

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=20231017110221.189299-1-herve.codina@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=Jonathan.Cameron@Huawei.com \
    --cc=allan.nielsen@microchip.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhi.hou@amd.com \
    --cc=max.zhen@amd.com \
    --cc=robh+dt@kernel.org \
    --cc=sonal.santan@amd.com \
    --cc=steen.hegelund@microchip.com \
    --cc=stefano.stabellini@xilinx.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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).