mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joshua Kinard <kumba@gentoo.org>
To: Christoph Hellwig <hch@infradead.org>,
	Thomas Bogendoerfer <tbogendoerfer@suse.de>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	Paul Burton <paul.burton@mips.com>,
	James Hogan <jhogan@kernel.org>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: add support for SGI Octane (IP30)
Date: Fri, 11 Oct 2019 20:33:43 -0400	[thread overview]
Message-ID: <5c6ab720-218a-14aa-9112-a12b88b63bc2@gentoo.org> (raw)
In-Reply-To: <20191009184311.GA20261@infradead.org>

On 10/9/2019 14:43, Christoph Hellwig wrote:
>> +++ b/arch/mips/sgi-ip30/ip30-pci.c
>> @@ -0,0 +1,19 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/*
>> + * ip30-pci.c: misc PCI related helper code for IP30 architecture
>> + */
>> +
>> +#include <asm/pci/bridge.h>
>> +
>> +dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
>> +{
>> +	struct pci_dev *pdev = to_pci_dev(dev);
>> +	struct bridge_controller *bc = BRIDGE_CONTROLLER(pdev->bus);
>> +
>> +	return bc->baddr + paddr;
>> +}
>> +
>> +phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dma_addr)
>> +{
>> +	return dma_addr & ~(0xffUL << 56);
>> +}
> 
> This file is duplicated from ip27.  I think we should aim to share
> it given the common hardware even if it is mostly trivial.
> 

It's possible that we may need to add an IP30-specific WAR here eventually.
 OpenBSD code has this to say about BRIDGE on IP30 systems:

http://bxr.su/OpenBSD/sys/arch/sgi/sgi/ip30_machdep.c

144    /*
145     * Register DMA-reachable memory constraints.
146     * The xbridge(4) is limited to a 31-bit region (its IOMMU features
147     * are too restricted to be of use).
148     */
149    dma_constraint.ucr_low = 0;
150    dma_constraint.ucr_high = (1UL << 31) - 1;

I never figured out how in Linux one does something equivalent.  I knew it
needed to be done in the older dma-coherence.h file, and now in the newer
__phys_to_dma() function here.  This is, if memory recalls correctly,
because >2GB RAM in Octane causes issues w/ BRIDGE DMA access.

OpenBSD applies this same limit to IP27, but I have a sneaking suspicion
that it's strictly an IP30 hardware bug, because my Onyx2 has 8GB of RAM and
it usually boots fine on its own.  Pop more than 2GB into an Octane, though,
and, if it boots at all, disk or network I/O will usually bus error it at
some point.

-- 
Joshua Kinard
Gentoo/MIPS
kumba@gentoo.org
rsa6144/5C63F4E3F5C6C943 2015-04-27
177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943

"The past tempts us, the present confuses us, the future frightens us.  And
our lives slip away, moment by moment, lost in that vast, terrible in-between."

--Emperor Turhan, Centauri Republic

  parent reply	other threads:[~2019-10-12  0:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09 15:59 Thomas Bogendoerfer
2019-10-09 18:43 ` Christoph Hellwig
2019-10-10 13:01   ` Thomas Bogendoerfer
2019-10-10 13:53     ` Christoph Hellwig
2019-10-10 14:48       ` Thomas Bogendoerfer
2019-10-10 14:58         ` Carlo Pisani
2019-10-12  0:33   ` Joshua Kinard [this message]
2019-10-14 11:34     ` Thomas Bogendoerfer

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=5c6ab720-218a-14aa-9112-a12b88b63bc2@gentoo.org \
    --to=kumba@gentoo.org \
    --cc=hch@infradead.org \
    --cc=jhogan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=tbogendoerfer@suse.de \
    /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®