mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konradybcio@kernel.org>
To: Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@google.com>
Cc: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>,
	 Melody Olvera <quic_molvera@quicinc.com>,
	 Marijn Suijten <marijn.suijten@somainline.org>,
	devicetree@vger.kernel.org,  linux-kernel@vger.kernel.org,
	 Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: [PATCH 2/2] of: address: Allow to specify nonposted-mmio per-device
Date: Wed, 19 Mar 2025 15:25:58 +0100	[thread overview]
Message-ID: <20250319-topic-nonposted_mmio-v1-2-dfb886fbd15f@oss.qualcomm.com> (raw)
In-Reply-To: <20250319-topic-nonposted_mmio-v1-0-dfb886fbd15f@oss.qualcomm.com>

From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Certain IP blocks may strictly require/expect a nE mapping to function
correctly, while others may be fine without it (which is preferred for
performance reasons).

Allow specifying nonposted-mmio on a per-device basis.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
 drivers/of/address.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/of/address.c b/drivers/of/address.c
index 2041ea112ded70e11d3831b403901c36c8c29a93..f0f8f0dd191cfe05dfc29246da5fe665d5fb9c6e 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -1035,10 +1035,11 @@ EXPORT_SYMBOL_GPL(of_dma_is_coherent);
 static bool of_mmio_is_nonposted(const struct device_node *np)
 {
 	struct device_node *parent __free(device_node) = of_get_parent(np);
-	if (!parent)
-		return false;
 
-	return of_property_read_bool(parent, "nonposted-mmio");
+	if (of_property_read_bool(np, "nonposted-mmio"))
+		return true;
+
+	return parent && of_property_read_bool(parent, "nonposted-mmio");
 }
 
 static int __of_address_to_resource(struct device_node *dev, int index, int bar_no,

-- 
2.48.1


  parent reply	other threads:[~2025-03-19 14:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 14:25 [PATCH 0/2] Allow 'nonposted-mmio' on single devices Konrad Dybcio
2025-03-19 14:25 ` [PATCH 1/2] of: address: Expand nonposted-mmio to non-Apple Silicon platforms Konrad Dybcio
2025-03-21 16:27   ` Rob Herring (Arm)
2025-03-19 14:25 ` Konrad Dybcio [this message]
2025-03-21 16:27   ` [PATCH 2/2] of: address: Allow to specify nonposted-mmio per-device Rob Herring (Arm)

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=20250319-topic-nonposted_mmio-v1-2-dfb886fbd15f@oss.qualcomm.com \
    --to=konradybcio@kernel.org \
    --cc=bjorn.andersson@oss.qualcomm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_molvera@quicinc.com \
    --cc=robh@kernel.org \
    --cc=saravanak@google.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

all inboxes | Powered by JetHome®