mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Allow 'nonposted-mmio' on single devices
@ 2025-03-19 14:25 Konrad Dybcio
  2025-03-19 14:25 ` [PATCH 1/2] of: address: Expand nonposted-mmio to non-Apple Silicon platforms Konrad Dybcio
  2025-03-19 14:25 ` [PATCH 2/2] of: address: Allow to specify nonposted-mmio per-device Konrad Dybcio
  0 siblings, 2 replies; 5+ messages in thread
From: Konrad Dybcio @ 2025-03-19 14:25 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan
  Cc: Bjorn Andersson, Melody Olvera, Marijn Suijten, devicetree,
	linux-kernel, Konrad Dybcio

For a plethora of reasons, usually not very pretty, a single device on
a given bus/platform may require a different type of memory mapping.

With nonposted-mmio specifically, we want to limit the scope of setting
it where it's not necessary, so as not to shoot ourselves in the foot
in the performance department.

This series allows mapping a single device as nE on arm64.
A user will be sent separately, as a new node for a QC platform.

The dt-bindings part is handled in the checker itself, see the following:
https://github.com/devicetree-org/dt-schema/pull/156

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
Konrad Dybcio (2):
      of: address: Expand nonposted-mmio to non-Apple Silicon platforms
      of: address: Allow to specify nonposted-mmio per-device

 drivers/of/address.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
---
base-commit: c4d4884b67802c41fd67399747165d65c770621a
change-id: 20250315-topic-nonposted_mmio-5393a3de0d35

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] of: address: Expand nonposted-mmio to non-Apple Silicon platforms
  2025-03-19 14:25 [PATCH 0/2] Allow 'nonposted-mmio' on single devices Konrad Dybcio
@ 2025-03-19 14:25 ` Konrad Dybcio
  2025-03-21 16:27   ` Rob Herring (Arm)
  2025-03-19 14:25 ` [PATCH 2/2] of: address: Allow to specify nonposted-mmio per-device Konrad Dybcio
  1 sibling, 1 reply; 5+ messages in thread
From: Konrad Dybcio @ 2025-03-19 14:25 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan
  Cc: Bjorn Andersson, Melody Olvera, Marijn Suijten, devicetree,
	linux-kernel, Konrad Dybcio

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

The nE memory attribute may be utilized by various implementations,
not limited to Apple Silicon platforms.

Drop the early CONFIG_ARCH_APPLE check.

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

diff --git a/drivers/of/address.c b/drivers/of/address.c
index d177a2b9edaf8de28b1b132156e9a951763c4e79..2041ea112ded70e11d3831b403901c36c8c29a93 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -1031,15 +1031,9 @@ EXPORT_SYMBOL_GPL(of_dma_is_coherent);
  *
  * Returns true if the "nonposted-mmio" property was found for
  * the device's bus.
- *
- * This is currently only enabled on builds that support Apple ARM devices, as
- * an optimization.
  */
 static bool of_mmio_is_nonposted(const struct device_node *np)
 {
-	if (!IS_ENABLED(CONFIG_ARCH_APPLE))
-		return false;
-
 	struct device_node *parent __free(device_node) = of_get_parent(np);
 	if (!parent)
 		return false;

-- 
2.48.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] of: address: Allow to specify nonposted-mmio per-device
  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-19 14:25 ` Konrad Dybcio
  2025-03-21 16:27   ` Rob Herring (Arm)
  1 sibling, 1 reply; 5+ messages in thread
From: Konrad Dybcio @ 2025-03-19 14:25 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan
  Cc: Bjorn Andersson, Melody Olvera, Marijn Suijten, devicetree,
	linux-kernel, Konrad Dybcio

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] of: address: Expand nonposted-mmio to non-Apple Silicon platforms
  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)
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring (Arm) @ 2025-03-21 16:27 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Bjorn Andersson, Melody Olvera, Marijn Suijten, Konrad Dybcio,
	Saravana Kannan, devicetree, linux-kernel


On Wed, 19 Mar 2025 15:25:57 +0100, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> 
> The nE memory attribute may be utilized by various implementations,
> not limited to Apple Silicon platforms.
> 
> Drop the early CONFIG_ARCH_APPLE check.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
>  drivers/of/address.c | 6 ------
>  1 file changed, 6 deletions(-)
> 

Applied, thanks!


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] of: address: Allow to specify nonposted-mmio per-device
  2025-03-19 14:25 ` [PATCH 2/2] of: address: Allow to specify nonposted-mmio per-device Konrad Dybcio
@ 2025-03-21 16:27   ` Rob Herring (Arm)
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring (Arm) @ 2025-03-21 16:27 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Marijn Suijten, linux-kernel, Saravana Kannan, Melody Olvera,
	devicetree, Bjorn Andersson, Konrad Dybcio


On Wed, 19 Mar 2025 15:25:58 +0100, Konrad Dybcio wrote:
> 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(-)
> 

Applied, thanks!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-03-21 16:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/2] of: address: Allow to specify nonposted-mmio per-device Konrad Dybcio
2025-03-21 16:27   ` Rob Herring (Arm)

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®