linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Christoph Hellwig <hch@infradead.org>,
	Florian Fainelli <f.fainelli@gmail.com>
Cc: devicetree <devicetree@vger.kernel.org>,
	Rob Herring <robh@kernel.org>,
	linux-pci <linux-pci@vger.kernel.org>,
	Bjorn Helgaas <helgaas@kernel.org>,
	Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
	Robin Murphy <robin.murphy@arm.con>,
	Robin Murphy <robin.murphy@arm.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-rpi-kernel <linux-rpi-kernel@lists.infradead.org>
Subject: Re: RPi4 can't deal with 64 bit PCI accesses
Date: Thu, 25 Feb 2021 10:41:47 +0000	[thread overview]
Message-ID: <ba1c43f5f6f7f374d1f26316985dd18d9348d307.camel@infradead.org> (raw)
In-Reply-To: <20210224202538.GA2346950@infradead.org>


[-- Attachment #1.1: Type: text/plain, Size: 1663 bytes --]

On Wed, 2021-02-24 at 20:25 +0000, Christoph Hellwig wrote:
> On Wed, Feb 24, 2021 at 08:55:10AM -0800, Florian Fainelli wrote:
> > > Working around kernel I/O accessors is all very well, but another
> > > concern for PCI in particular is when things like framebuffer memory can
> > > get mmap'ed into userspace (or even memremap'ed within the kernel). Even
> > > in AArch32, compiled code may result in 64-bit accesses being generated
> > > depending on how the CPU and interconnect handle LDRD/STRD/LDM/STM/etc.,
> > > so it's basically not safe to ever let that happen at all.
> > 
> > Agreed, this makes finding a generic solution a tiny bit harder. Do you
> > have something in mind Nicolas?
> 
> The only workable solution is a new
> 
> bool 64bit_mmio_supported(void)
> 
> check that is used like:
> 
> 	if (64bit_mmio_supported())
> 		readq(foodev->regs, REG_OFFSET);
> 	else
> 		lo_hi_readq(foodev->regs, REG_OFFSET);
> 
> where 64bit_mmio_supported() return false for all 32-bit kernels,
> true for all non-broken 64-bit kernels and is an actual function
> for arm64 multiplatforms builds that include te RPi quirk.
> 
> The above would then replace the existing magic from the
> <linux/io-64-nonatomic-lo-hi.h> and <linux/io-64-nonatomic-hi-lo.h>
> headers.

Is it completely impossible to do 64-bit cycles with this host bridge?

I'm now having nasty flashbacks to an SH platform with a host bridge
that screwed up byte access for direct MMIO — but *could* do those MMIO
cycles accurately if we did them through an indirect method similar to
config cycles. Is there any such mechanism on the offending hardware?

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5174 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-02-25 10:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2021-02-22 17:55 ` Russell King - ARM Linux admin

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=ba1c43f5f6f7f374d1f26316985dd18d9348d307.camel@infradead.org \
    --to=dwmw2@infradead.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=hch@infradead.org \
    --cc=helgaas@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=nsaenzjulienne@suse.de \
    --cc=robh@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=robin.murphy@arm.con \
    /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).