From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Ishizaki Kou <kou.ishizaki@toshiba.co.jp>
Cc: linuxppc-dev@ozlabs.org, paulus@samba.org
Subject: Re: [PATCH 2/11] cell: generalize io-workarounds code
Date: Wed, 16 Apr 2008 17:18:01 +1000 [thread overview]
Message-ID: <1208330282.6958.264.camel@pasglop> (raw)
In-Reply-To: <20080314.212034.-1625856941.kouish@swc.toshiba.co.jp>
On Fri, 2008-03-14 at 21:20 +0900, Ishizaki Kou wrote:
> This patch splits cell io-workaround code into spider-pci dependent
> code and a generic part, and also adds interfaces to the generic
> io-workaround mechanism.
>
> Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
> ---
>
> Please test on CellBlade because I don't have any access to CellBlade.
Unfortunately, that crashes on spider based cell blade, see below:
> +
> + /* setup dummy read */
> + /*
> + * On CellBlade, we can't know that which XDR memory is used by
> + * kmalloc() to allocate dummy_page_va.
> + * In order to imporve the performance, the XDR which is used to
> + * allocate dummy_page_va is the nearest the spider-pci.
> + * We have to select the CBE which is the nearest the spider-pci
> + * to allocate memory from the best XDR, but I don't know that
> + * how to do.
> + *
> + * Celleb does not have this problem, because it has only one XDR.
> + */
> + dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL);
> + if (!dummy_page_va) {
> + pr_err("SPIDERPCI-IOWA:Alloc dummy_page_va failed.\n");
> + return -1;
> + }
> +
> + dummy_page_da = dma_map_single(phb->parent, dummy_page_va,
> + PAGE_SIZE, DMA_FROM_DEVICE);
> + if (dma_mapping_error(dummy_page_da)) {
> + pr_err("SPIDER-IOWA:Map dummy page filed.\n");
> + kfree(dummy_page_va);
> + return -1;
> + }
The above dma_map_single() will crash on QS20 because there is no
phb->parent on these. The QS20 uses the "old style" PCI probing
mechanism where PCI busses are setup off the root node at setup_arch
time and have no struct device attached, which means yo ucan't call
dma_map_single on them unfortunately.
Now I wonder...
> +int __init spiderpci_iowa_init(struct iowa_bus *bus, void *data)
> +{
> + void __iomem *regs = NULL;
> + struct spiderpci_iowa_private *priv;
> + struct device_node *np = bus->phb->dn;
> + struct resource r;
> + unsigned long offset = (unsigned long)data;
> +
> + pr_debug("SPIDERPCI-IOWA:Bus initialize for spider(%s)\n",
> + np->full_name);
> +
.../...
Is the above spiderpci_iowa_init() function ever used on Celleb ? It
looks to me like Celleb relies on the new of_platform stuff to create
the PCI host bridges off OF devices, after boot, in which case that
would work for you. That would mean that the above function is really
only useful for busses created in setup_arch() which is really only the
QS20 cell blade, right ?
In that case, I think that function should be moved to the cell blade
setup.c file instead of here. Now, regarding the above problem, I'm not
sure what is the best fix at this stage. We can't create sane struct
device objects at setup_arch() time.
We could create a hand-made platform or of_platform device from the
above function for every bridge that doesn't have one and hook up it's
DMA ops... I suppose that would fix it.
I've started hacking something but didn't yet get it working, I'll
continue tomorrow unless you come up with some other solution.
Cheers,
Ben.
next prev parent reply other threads:[~2008-04-16 7:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-14 12:20 [PATCH 2/11] cell: generalize io-workarounds code Ishizaki Kou
2008-03-24 10:41 ` Benjamin Herrenschmidt
2008-03-24 10:44 ` Benjamin Herrenschmidt
2008-03-27 11:02 ` Ishizaki Kou
2008-03-27 21:08 ` Benjamin Herrenschmidt
2008-04-02 10:52 ` Ishizaki Kou
2008-04-02 11:00 ` Benjamin Herrenschmidt
2008-04-04 6:42 ` Ishizaki Kou
2008-04-04 7:50 ` Benjamin Herrenschmidt
2008-04-09 7:46 ` Ishizaki Kou
2008-04-16 7:18 ` Benjamin Herrenschmidt [this message]
2008-04-17 1:48 ` Benjamin Herrenschmidt
2008-04-24 3:07 ` Ishizaki Kou
2008-04-24 3:30 ` Benjamin Herrenschmidt
2008-04-24 3:10 ` Ishizaki Kou
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=1208330282.6958.264.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=kou.ishizaki@toshiba.co.jp \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/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).