linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RPi4 can't deal with 64 bit PCI accesses
@ 2021-02-22 15:47 Nicolas Saenz Julienne
  2021-02-22 16:18 ` Ard Biesheuvel
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Nicolas Saenz Julienne @ 2021-02-22 15:47 UTC (permalink / raw)
  To: linux-pci, linux-arm-kernel, linux-rpi-kernel, devicetree
  Cc: Florian Fainelli, Rob Herring, Bjorn Helgaas,
	bcm-kernel-feedback-list, Robin Murphy

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

Hi everyone,
Raspberry Pi 4, a 64bit arm system on chip, contains a PCIe bus that can't
handle 64bit accesses to its MMIO address space, in other words, writeq() has
to be split into two distinct writel() operations. This isn't ideal, as it
misrepresents PCI's promise of being able to treat device memory as regular
memory, ultimately breaking a bunch of PCI device drivers[1].

I'd like to have a go at fixing this in a way that can be distributed in a
generic distro without prejudice to other users.

AFAIK there is no way to detect this limitation through generic PCIe
capabilities, so one solution would be to expose it through firmware
(devicetree in this case), and pass the limitations through 'struct device' so
as for the drivers to choose the right access method in a way that doesn't
affect performance much[2]. All in all, most of this doesn't need to be
PCI-centric as the property could be applied to any MMIO bus.

Thoughts? Opinions? Is it overkill just for a single SoC?

Regards,
Nicolas

[1] https://github.com/raspberrypi/linux/issues/4158#issuecomment-782351510
[2] Things might get even weirder as the order in which the 32bit operations
    are performed might matter (low/high vs high/low).


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-02-26  5:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 15:47 RPi4 can't deal with 64 bit PCI accesses Nicolas Saenz Julienne
2021-02-22 16:18 ` Ard Biesheuvel
2021-02-22 16:36   ` Nicolas Saenz Julienne
2021-02-22 16:56 ` Robin Murphy
2021-02-24 16:55   ` Florian Fainelli
2021-02-24 20:25     ` Christoph Hellwig
2021-02-24 20:35       ` Florian Fainelli
2021-02-25 10:29         ` Neil Armstrong
2021-02-25 11:10           ` Robin Murphy
2021-02-25 11:35             ` Nicolas Saenz Julienne
2021-02-26  5:32               ` Christoph Hellwig
2021-02-25 10:41       ` David Woodhouse
2021-02-22 17:55 ` Russell King - ARM Linux admin

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).