All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses
@ 2021-04-15 18:00 Leonardo Bras
  2021-04-15 18:59   ` Rob Herring
  2021-04-21 12:51 ` Rob Herring
  0 siblings, 2 replies; 22+ messages in thread
From: Leonardo Bras @ 2021-04-15 18:00 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand, aik; +Cc: Leonardo Bras, devicetree, linux-kernel

Many other resource flag parsers already add this flag when the input
has bits 24 & 25 set, so update this one to do the same.

Some devices (like virtio-net) have more than one memory resource
(like MMIO32 and MMIO64) and without this flag it would be needed to
verify the address range to know which one is which.

Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
---
 drivers/of/address.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/of/address.c b/drivers/of/address.c
index 73ddf2540f3f..dc7147843783 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -116,9 +116,12 @@ static unsigned int of_bus_pci_get_flags(const __be32 *addr)
 		flags |= IORESOURCE_IO;
 		break;
 	case 0x02: /* 32 bits */
-	case 0x03: /* 64 bits */
 		flags |= IORESOURCE_MEM;
 		break;
+
+	case 0x03: /* 64 bits */
+		flags |= IORESOURCE_MEM | IORESOURCE_MEM_64;
+		break;
 	}
 	if (w & 0x40000000)
 		flags |= IORESOURCE_PREFETCH;
-- 
2.30.2


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

end of thread, other threads:[~2021-06-09 18:50 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 18:00 [PATCH 1/1] of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses Leonardo Bras
2021-04-15 18:59 ` Rob Herring
2021-04-15 18:59   ` Rob Herring
2021-04-16 20:57   ` Leonardo Bras
2021-04-16 20:57     ` Leonardo Bras
2021-04-19 15:44     ` Rob Herring
2021-04-19 15:44       ` Rob Herring
2021-04-20  0:35       ` Leonardo Bras
2021-04-20  0:35         ` Leonardo Bras
2021-04-20  1:39         ` Rob Herring
2021-04-20  1:39           ` Rob Herring
2021-04-20  2:02           ` Leonardo Bras
2021-04-20  2:02             ` Leonardo Bras
2021-04-20 22:34             ` Rob Herring
2021-04-20 22:34               ` Rob Herring
2021-04-21 14:14               ` Leonardo Bras
2021-04-21 14:14                 ` Leonardo Bras
2021-04-16 21:27   ` Leonardo Bras
2021-04-16 21:27     ` Leonardo Bras
2021-06-09 18:50   ` Bjorn Helgaas
2021-06-09 18:50     ` Bjorn Helgaas
2021-04-21 12:51 ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.