* Re: [PATCH] PCI Error Recovery: e100 network device driver
From: Zhang, Yanmin @ 2006-04-29 2:48 UTC (permalink / raw)
To: Linas Vepstas
Cc: netdev, LKML, jesse.brandeburg, linuxppc-dev, john.ronciak,
jeffrey.t.kirsher, linux-pci, Jeff Garzik
In-Reply-To: <20060406222359.GA30037@austin.ibm.com>
On Fri, 2006-04-07 at 06:24, Linas Vepstas wrote:
> Please apply and forward upstream.
>
> --linas
>
> [PATCH] PCI Error Recovery: e100 network device driver
>
> Various PCI bus errors can be signaled by newer PCI controllers. This
> patch adds the PCI error recovery callbacks to the intel ethernet e100
> device driver. The patch has been tested, and appears to work well.
>
> Signed-off-by: Linas Vepstas <linas@linas.org>
> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
I am enabling PCI-Express AER (Advanced Error Reporting) in kernel and
glad to see many drivers to support pci error handling.
>
> ----
>
> drivers/net/e100.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 65 insertions(+)
>
> Index: linux-2.6.17-rc1/drivers/net/e100.c
> ===================================================================
> --- linux-2.6.17-rc1.orig/drivers/net/e100.c 2006-04-05 09:56:06.000000000 -0500
> +++ linux-2.6.17-rc1/drivers/net/e100.c 2006-04-06 15:17:29.000000000 -0500
> @@ -2781,6 +2781,70 @@ static void e100_shutdown(struct pci_dev
> }
>
>
> +/* ------------------ PCI Error Recovery infrastructure -------------- */
> +/** e100_io_error_detected() is called when PCI error is detected */
> +static pci_ers_result_t e100_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
> +{
> + struct net_device *netdev = pci_get_drvdata(pdev);
> +
> + /* Same as calling e100_down(netdev_priv(netdev)), but generic */
> + netdev->stop(netdev);
e100 stop method e100_close calls e100_down which would do IO. Does it
violate the rule defined in Documentation/pci-error-recovery.txt that
error_detected shouldn't do any IO?
Suggest to create a new function, such like e100_close_noreset.
> +
> + /* Detach; put netif into state similar to hotplug unplug */
> + netif_poll_enable(netdev);
> + netif_device_detach(netdev);
> +
> + /* Request a slot reset. */
> + return PCI_ERS_RESULT_NEED_RESET;
> +}
> +
> +/** e100_io_slot_reset is called after the pci bus has been reset.
> + * Restart the card from scratch. */
> +static pci_ers_result_t e100_io_slot_reset(struct pci_dev *pdev)
> +{
> + struct net_device *netdev = pci_get_drvdata(pdev);
> + struct nic *nic = netdev_priv(netdev);
> +
> + if(pci_enable_device(pdev)) {
> + printk(KERN_ERR "e100: Cannot re-enable PCI device after reset.\n");
> + return PCI_ERS_RESULT_DISCONNECT;
> + }
> + pci_set_master(pdev);
> +
> + /* Only one device per card can do a reset */
> + if (0 != PCI_FUNC (pdev->devfn))
> + return PCI_ERS_RESULT_RECOVERED;
> + e100_hw_reset(nic);
> + e100_phy_init(nic);
Should pci_set_master be called after e100_hw_reset like in function
e100_probe?
> +
> + return PCI_ERS_RESULT_RECOVERED;
> +}
> +
> +/** e100_io_resume is called when the error recovery driver
> + * tells us that its OK to resume normal operation.
> + */
> +static void e100_io_resume(struct pci_dev *pdev)
> +{
> + struct net_device *netdev = pci_get_drvdata(pdev);
> + struct nic *nic = netdev_priv(netdev);
> +
> + /* ack any pending wake events, disable PME */
> + pci_enable_wake(pdev, 0, 0);
> +
> + netif_device_attach(netdev);
> + if(netif_running(netdev)) {
> + e100_open (netdev);
> + mod_timer(&nic->watchdog, jiffies);
e100_open calls e100_up which already sets watchdog timer. Why to set
it again?
> + }
> +}
> +
^ permalink raw reply
* Re: [PATCH 0/4] NUMA support for spufs
From: Andrew Morton @ 2006-04-29 2:47 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, cbe-oss-dev, arnd, linux-kernel
In-Reply-To: <17490.53283.417700.559725@cargo.ozlabs.ibm.com>
Paul Mackerras <paulus@samba.org> wrote:
>
> Arnd Bergmann writes:
>
> > The current version of spufs breaks upon boot when NUMA support is enabled.
> > I'd like to fix that before 2.6.17 so we can use the same kernel image
> > on Cell that we use on other powerpc systems using NUMA.
>
> Andrew,
>
> If 2/4 of this series looks OK to you to go into 2.6.17,
OK by me. 1/4 touches __add_pages(), which it undergoing quite a bit of
churn at present, but we'll work it out.
> let me know
> and I'll push the others to Linus (or you can if you prefer).
I'll queue all four for the next batch (within the next 48 hours). If you
merge them first then no probs.
^ permalink raw reply
* Re: [RFC , PATCH] support for the ibm,pa_features cpu property
From: Stephen Rothwell @ 2006-04-29 2:38 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17490.52602.577587.524391@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 916 bytes --]
Hi Paul,
On Sat, 29 Apr 2006 12:20:42 +1000 Paul Mackerras <paulus@samba.org> wrote:
>
> + /* find descriptor with type == 0 */
> + for (;;) {
> + if (tablelen < 3 || tablelen < 2 + pa_feature_table[1])
^
Shouldn't that be 0?
> + goto out; /* not found */
> + if (pa_feature_table[0] == 0)
^
And this 1?
> + break;
> + tablelen -= 2 + pa_feature_table[1];
^
0
> + pa_feature_table += 2 + pa_feature_table[1];
^
0
> + }
> +
> + /* check if the specifier is long enough */
> + if (pabyte >= pa_feature_table[1])
^
0
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: alignment exceptionhandler sleeps in invalid context
From: Michael Ellerman @ 2006-04-29 2:34 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, Olaf Hering
In-Reply-To: <17489.63055.968862.256370@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]
On Fri, 2006-04-28 at 21:02 +1000, Paul Mackerras wrote:
> Olaf Hering writes:
>
> > I'm not sure where the bug is. Does it mean the network stack does
> > something nasty, or is the exception handler itself broken? (probably the latter)
> > This is 2.6.16.9 on a p270.
>
> This patch should fix it, I hope. If you can verify that it fixes it
> I'll send it to Linus.
>
> Paul.
>
> diff --git a/include/asm-powerpc/uaccess.h b/include/asm-powerpc/uaccess.h
> index 3872e92..b02d858 100644
> --- a/include/asm-powerpc/uaccess.h
> +++ b/include/asm-powerpc/uaccess.h
> @@ -179,7 +179,8 @@ do { \
> #define __put_user_nocheck(x, ptr, size) \
> ({ \
> long __pu_err; \
> - might_sleep(); \
> + if ((unsigned long)ptr < PAGE_OFFSET) \
> + might_sleep(); \
+ if (!is_kernel_addr((unsigned long)ptr)) \
+ might_sleep(); \
In asm/page.h :)
cheers
--
Michael Ellerman
IBM OzLabs
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
* Re: sign extension for 32bit syscalls on ppc64
From: Paul Mackerras @ 2006-04-29 2:33 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20060429113059.150cadd6.sfr@canb.auug.org.au>
Stephen Rothwell writes:
> They do need to be sign extended for the new *at syscalls where you can pass
> a sepecial value AT_FDCWD (-10) to represent the current directory ...
So, compat_sys_openat() in fs/compat.c looks wrong to me then, if
AT_FDCWD is part of the ABI and not just an internal thing. And I'm
now not sure whether some of the other *at syscalls do in fact need
compat wrappers...
Paul.
^ permalink raw reply
* Re: [PATCH 0/4] NUMA support for spufs
From: Paul Mackerras @ 2006-04-29 2:32 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, cbe-oss-dev, Arnd Bergmann, linux-kernel
In-Reply-To: <20060429011827.502138000@localhost.localdomain>
Arnd Bergmann writes:
> The current version of spufs breaks upon boot when NUMA support is enabled.
> I'd like to fix that before 2.6.17 so we can use the same kernel image
> on Cell that we use on other powerpc systems using NUMA.
Andrew,
If 2/4 of this series looks OK to you to go into 2.6.17, let me know
and I'll push the others to Linus (or you can if you prefer).
Thanks,
Paul.
^ permalink raw reply
* Re: [RFC , PATCH] support for the ibm,pa_features cpu property
From: Paul Mackerras @ 2006-04-29 2:20 UTC (permalink / raw)
To: will_schmidt; +Cc: linuxppc-dev list
In-Reply-To: <1146249684.27214.18.camel@localhost.localdomain>
Will Schmidt writes:
> This is an initial pass at the functionality. This has been tested in
> the case where the property is missing, but still needs to be tested
> against a system where the property actually exists. :-o
Some random comments, and a modified version of your patch...
- We may want to make a table giving the correspondence between
pa-features byte/bit numbers and our feature bits, and then just
have code that walks through the table and sets/clears feature bits
as appropriate.
- If we are setting/clearing feature bits that are used with the asm
feature macros, we'll have to do this much earlier, in prom.c,
before the device tree is unflattened.
Paul.
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4467c49..022b9b3 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -106,6 +106,78 @@ static struct notifier_block ppc64_panic
.priority = INT_MIN /* may not return; must be done last */
};
+/*
+ * ibm,pa-features is a per-cpu property that contains a string of
+ * attribute descriptors, each of which has a 2 byte header plus up
+ * to 254 bytes worth of processor attribute bits. First header
+ * byte specifies the number of bytes following the header.
+ * Second header byte is an "attribute-specifier" type, of which
+ * zero is the only currently-defined value.
+ * Implementation: Pass in the byte and bit offset for the feature
+ * that we are interested in. The function will return -1 if the
+ * pa-features property is missing, or a 1/0 to indicate if the feature
+ * is supported/not supported. Note that the bit numbers are
+ * big-endian to match the definition in PAPR.
+ */
+static int get_pa_feature(int pabyte, int pabit)
+{
+ struct device_node *cpu;
+ unsigned char *pa_feature_table;
+ int tablelen;
+ int ret = -1;
+
+ cpu = of_find_node_by_type(NULL, "cpu");
+ if (cpu == NULL)
+ return -1;
+
+ pa_feature_table = get_property(cpu, "ibm,pa-features", &tablelen);
+ if (pa_feature_table == NULL)
+ goto out;
+
+ /* find descriptor with type == 0 */
+ for (;;) {
+ if (tablelen < 3 || tablelen < 2 + pa_feature_table[1])
+ goto out; /* not found */
+ if (pa_feature_table[0] == 0)
+ break;
+ tablelen -= 2 + pa_feature_table[1];
+ pa_feature_table += 2 + pa_feature_table[1];
+ }
+
+ /* check if the specifier is long enough */
+ if (pabyte >= pa_feature_table[1])
+ goto out;
+
+ ret = (pa_feature_table[2 + pabyte] >> (7 - pabit)) & 1;
+
+ out:
+ of_node_put(cpu);
+ return ret;
+}
+
+/*
+ * set values within the cur_cpu_spec table according to
+ * the ibm,pa_features property.
+ * potential entries include:
+ * Byte 0, bit 1 - FPU available
+ * Byte 1, bit 2 - cache-inhibited large pages supported
+ * Byte 2, bit 3 - DAR set on alignment interrupt.
+ */
+static void check_cpu_features(void)
+{
+ int hasit;
+
+ /* test for support of cache-inhibited large pages */
+ hasit = get_pa_feature(1, 2);
+ if (hasit >= 0)
+ if (hasit)
+ cur_cpu_spec->cpu_features |= CPU_FTR_CI_LARGE_PAGE;
+ else
+ cur_cpu_spec->cpu_features &= ~CPU_FTR_CI_LARGE_PAGE;
+
+ /* add more here in future... */
+}
+
#ifdef CONFIG_SMP
static int smt_enabled_cmdline;
@@ -425,6 +497,8 @@ #endif
parse_early_param();
+ check_cpu_features();
+
check_smt_enabled();
smp_setup_cpu_maps();
^ permalink raw reply related
* Re: [RFC , PATCH] support for the ibm,pa_features cpu property
From: Paul Mackerras @ 2006-04-29 1:57 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev list
In-Reply-To: <20060428192149.GJ5518@pb15.lixom.net>
Olof Johansson writes:
> Do you know why they went for this brand new extra architected bitfield
> instead of continuing down the way that processor features always have
> been documented before, by adding a property to the cpu device node?
They wanted to cover basically everything that we have CPU feature
bits for, plus some other things. That would have been a lot of new
properties, so they went for one that had a bitmap in it, and made it
extensible in two different directions for good measure while they
were at it. :)
> (Now, the naming convention of calling it a "pa feature" is unfortunate,
> but nothing I can really complain about since our stuff is not yet in
> tree.)
The "pa" is just "processor architecture", nothing to do with your
employer. :)
Paul.
^ permalink raw reply
* Re: [PATCH 1/3] powerpc: Make rtas console _much_ faster
From: Michael Ellerman @ 2006-04-29 1:56 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Arnd Bergmann, linux-kernel, linuxppc-dev, Paul Mackerras,
cbe-oss-dev
In-Reply-To: <200604290245.57507.arnd@arndb.de>
[-- Attachment #1: Type: text/plain, Size: 2562 bytes --]
I'll clean this one up a little before merging it as per Ryan's email of
a week or two ago. New patch today or tomorrow.
Even though this is 1/3 the rest of the series should be fine to merge,
right Arnd?
cheers
On Sat, 2006-04-29 at 02:45 +0200, Arnd Bergmann wrote:
> Currently the hvc_rtas driver is painfully slow to use. Our "benchmark" is
> ls -R /etc, which spits out about 27866 characters. The theoretical maximum
> speed would be about 2.2 seconds, the current code takes ~50 seconds.
>
> The core of the problem is that sometimes when the tty layer asks us to push
> characters the firmware isn't able to handle some or all of them, and so
> returns an error. The current code sees this and just returns to the tty code
> with the buffer half sent.
>
> There's the khvcd thread which will eventually wake up and try to push more
> characters, that will usually work because the firmware's had time to push
> the characters out. But the thread only wakes up every 10 milliseconds, which
> isn't fast enough.
>
> There's already code in the hvc_console driver to make the khvcd thread do
> a "quick" loop, where it just calls yield() instead of sleeping. The only code
> that triggered that behaviour was recently removed though, which I don't
> quite understand.
>
> Still, if we set HVC_POLL_QUICK whenever the push hvc_push() doesn't push all
> characters (ie. RTAS blocks), we can get good performance out of the hvc_rtas
> backend. With this patch the "benchmark" takes ~2.8 seconds.
>
> Cc: Ryan Arnold <rsa@us.ibm.com>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
>
> ---
>
> drivers/char/hvc_console.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linus-2.6/drivers/char/hvc_console.c
> ===================================================================
> --- linus-2.6.orig/drivers/char/hvc_console.c
> +++ linus-2.6/drivers/char/hvc_console.c
> @@ -570,7 +570,7 @@ static int hvc_poll(struct hvc_struct *h
> hvc_push(hp);
> /* Reschedule us if still some write pending */
> if (hp->n_outbuf > 0)
> - poll_mask |= HVC_POLL_WRITE;
> + poll_mask |= HVC_POLL_WRITE | HVC_POLL_QUICK;
>
> /* No tty attached, just skip */
> tty = hp->tty;
>
> --
--
Michael Ellerman
IBM OzLabs
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 191 bytes --]
^ permalink raw reply
* Re: [PATCH] [2.6.18] powerpc: kill union tce_entry
From: Stephen Rothwell @ 2006-04-29 1:40 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev, paulus
In-Reply-To: <20060428140835.GG5518@pb15.lixom.net>
[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]
On Fri, 28 Apr 2006 09:08:35 -0500 Olof Johansson <olof@lixom.net> wrote:
>
> - struct {
> - unsigned int tb_cacheBits :6; /* Cache hash bits - not used */
> - unsigned int tb_rsvd :6;
> - unsigned long tb_rpn :40; /* Real page number */
> - unsigned int tb_valid :1; /* Tce is valid (vb only) */
> - unsigned int tb_allio :1; /* Tce is valid for all lps (vb only) */
> - unsigned int tb_lpindex :8; /* LpIndex for user of TCE (vb only) */
> - unsigned int tb_pciwr :1; /* Write allowed (pci only) */
> - unsigned int tb_rdwr :1; /* Read allowed (pci), Write allowed (vb) */
> - } te_bits;
> +#define TCE_RPN_MASK 0xfffffffffful /* 40-bit RPN (4K pages) */
> +#define TCE_RPN_SHIFT 12
> +#define TCE_VALID 0x200 /* TCE valid */
> +#define TCE_ALLIO 0x100 /* TCE valid for all lpars */
Shouldn't the above two be 0x800 and 0x400 respectively (or is my bit
counting/ordering mucked up)?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: sign extension for 32bit syscalls on ppc64
From: Stephen Rothwell @ 2006-04-29 1:30 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17490.42497.351114.712494@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 658 bytes --]
On Sat, 29 Apr 2006 09:32:17 +1000 Paul Mackerras <paulus@samba.org> wrote:
>
> However, it's debatable whether file descriptor arguments really need
> to be sign-extended. Although they are typed as int, negative values
> are not generally valid (although there are one or two cases where
> they are), and an fd value of 4294967295 will generate an EBADF error
> just as well as -1 will.
They do need to be sign extended for the new *at syscalls where you can pass
a sepecial value AT_FDCWD (-10) to represent the current directory ...
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: patches for 2.6.18
From: Stephen Rothwell @ 2006-04-29 1:22 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17489.60365.655344.949668@cargo.ozlabs.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 765 bytes --]
On Fri, 28 Apr 2006 20:17:49 +1000 Paul Mackerras <paulus@samba.org> wrote:
>
> If you have patches that aren't 2.6.17 material, but you would like to
> see them in 2.6.18, now is the time to be posting them to the list, so
> that I can put them in the powerpc.git tree, and they can get some
> testing before 2.6.17 comes out. Please don't wait for the 2-week
> merge window to send them. That 2-week merge window is the window for
> me to send stuff to Linus, not the window for you to send stuff to me.
The four I sent a couple of days ago that put the iSeries vio stuff into
the device tree would be good to go into the powerpc.git tree.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [PATCH 4/4] powerpc: cell: Add numa id to struct spu
From: Arnd Bergmann @ 2006-04-29 1:18 UTC (permalink / raw)
To: Andrew Morton
Cc: Arnd Bergmann, linuxppc-dev, Paul Mackerras, cbe-oss-dev,
linux-kernel
In-Reply-To: <20060429011827.502138000@localhost.localdomain>
From: Jeremy Kerr <jk@ozlabs.org>
Add an nid member to the spu structure, and store the numa id of the spu
there on creation.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
---
Index: linus-2.6/arch/powerpc/platforms/cell/spu_base.c
===================================================================
--- linus-2.6.orig/arch/powerpc/platforms/cell/spu_base.c 2006-04-29 02:51:33.000000000 +0200
+++ linus-2.6/arch/powerpc/platforms/cell/spu_base.c 2006-04-29 02:56:58.000000000 +0200
@@ -525,8 +525,8 @@
return id ? *id : 0;
}
-static int __init cell_spuprop_present(struct device_node *spe,
- const char *prop)
+static int __init cell_spuprop_present(struct spu *spu, struct device_node *spe,
+ const char *prop)
{
static DEFINE_MUTEX(add_spumem_mutex);
@@ -537,7 +537,6 @@
int proplen;
unsigned long start_pfn, nr_pages;
- int node_id;
struct pglist_data *pgdata;
struct zone *zone;
int ret;
@@ -548,14 +547,7 @@
start_pfn = p->address >> PAGE_SHIFT;
nr_pages = ((unsigned long)p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;
- /*
- * XXX need to get the correct NUMA node in here. This may
- * be different from the spe::node_id property, e.g. when
- * the host firmware is not NUMA aware.
- */
- node_id = 0;
-
- pgdata = NODE_DATA(node_id);
+ pgdata = NODE_DATA(spu->nid);
zone = pgdata->node_zones;
/* XXX rethink locking here */
@@ -566,8 +558,8 @@
return ret;
}
-static void __iomem * __init map_spe_prop(struct device_node *n,
- const char *name)
+static void __iomem * __init map_spe_prop(struct spu *spu,
+ struct device_node *n, const char *name)
{
struct address_prop {
unsigned long address;
@@ -585,7 +577,7 @@
prop = p;
- err = cell_spuprop_present(n, name);
+ err = cell_spuprop_present(spu, n, name);
if (err && (err != -EEXIST))
goto out;
@@ -603,44 +595,45 @@
iounmap((u8 __iomem *)spu->local_store);
}
-static int __init spu_map_device(struct spu *spu, struct device_node *spe)
+static int __init spu_map_device(struct spu *spu, struct device_node *node)
{
char *prop;
int ret;
ret = -ENODEV;
- prop = get_property(spe, "isrc", NULL);
+ prop = get_property(node, "isrc", NULL);
if (!prop)
goto out;
spu->isrc = *(unsigned int *)prop;
- spu->name = get_property(spe, "name", NULL);
+ spu->name = get_property(node, "name", NULL);
if (!spu->name)
goto out;
- prop = get_property(spe, "local-store", NULL);
+ prop = get_property(node, "local-store", NULL);
if (!prop)
goto out;
spu->local_store_phys = *(unsigned long *)prop;
/* we use local store as ram, not io memory */
- spu->local_store = (void __force *)map_spe_prop(spe, "local-store");
+ spu->local_store = (void __force *)
+ map_spe_prop(spu, node, "local-store");
if (!spu->local_store)
goto out;
- prop = get_property(spe, "problem", NULL);
+ prop = get_property(node, "problem", NULL);
if (!prop)
goto out_unmap;
spu->problem_phys = *(unsigned long *)prop;
- spu->problem= map_spe_prop(spe, "problem");
+ spu->problem= map_spe_prop(spu, node, "problem");
if (!spu->problem)
goto out_unmap;
- spu->priv1= map_spe_prop(spe, "priv1");
+ spu->priv1= map_spe_prop(spu, node, "priv1");
/* priv1 is not available on a hypervisor */
- spu->priv2= map_spe_prop(spe, "priv2");
+ spu->priv2= map_spe_prop(spu, node, "priv2");
if (!spu->priv2)
goto out_unmap;
ret = 0;
@@ -668,6 +661,10 @@
goto out_free;
spu->node = find_spu_node_id(spe);
+ spu->nid = of_node_to_nid(spe);
+ if (spu->nid == -1)
+ spu->nid = 0;
+
spu->stop_code = 0;
spu->slb_replace = 0;
spu->mm = NULL;
Index: linus-2.6/include/asm-powerpc/spu.h
===================================================================
--- linus-2.6.orig/include/asm-powerpc/spu.h 2006-04-29 02:51:29.000000000 +0200
+++ linus-2.6/include/asm-powerpc/spu.h 2006-04-29 02:56:58.000000000 +0200
@@ -117,6 +117,7 @@
struct list_head list;
struct list_head sched_list;
int number;
+ int nid;
u32 isrc;
u32 node;
u64 flags;
--
^ permalink raw reply
* [PATCH 3/4] powerpc: Allow devices to register with numa topology
From: Arnd Bergmann @ 2006-04-29 1:18 UTC (permalink / raw)
To: Andrew Morton
Cc: Arnd Bergmann, linuxppc-dev, Paul Mackerras, cbe-oss-dev,
linux-kernel
In-Reply-To: <20060429011827.502138000@localhost.localdomain>
From: Jeremy Kerr <jk@ozlabs.org>
Change of_node_to_nid() to traverse the device tree, looking for a numa
id. Cell uses this to assign ids to SPUs, which are children of the CPU
node. Existing users of of_node_to_nid() are altered to use
of_node_to_nid_single(), which doesn't do the traversal.
Export an attach_sysdev_to_node() function, allowing system devices (eg.
SPUs) to link themselves into the numa topology in sysfs.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
---
Index: linus-2.6/arch/powerpc/mm/numa.c
===================================================================
--- linus-2.6.orig/arch/powerpc/mm/numa.c 2006-04-29 01:50:25.000000000 +0200
+++ linus-2.6/arch/powerpc/mm/numa.c 2006-04-29 02:02:28.000000000 +0200
@@ -194,7 +194,7 @@
/* Returns nid in the range [0..MAX_NUMNODES-1], or -1 if no useful numa
* info is found.
*/
-static int of_node_to_nid(struct device_node *device)
+static int of_node_to_nid_single(struct device_node *device)
{
int nid = -1;
unsigned int *tmp;
@@ -216,6 +216,28 @@
return nid;
}
+/* Walk the device tree upwards, looking for an associativity id */
+int of_node_to_nid(struct device_node *device)
+{
+ struct device_node *tmp;
+ int nid = -1;
+
+ of_node_get(device);
+ while (device) {
+ nid = of_node_to_nid_single(device);
+ if (nid != -1)
+ break;
+
+ tmp = device;
+ device = of_get_parent(tmp);
+ of_node_put(tmp);
+ }
+ of_node_put(device);
+
+ return nid;
+}
+EXPORT_SYMBOL_GPL(of_node_to_nid);
+
/*
* In theory, the "ibm,associativity" property may contain multiple
* associativity lists because a resource may be multiply connected
@@ -300,7 +322,7 @@
goto out;
}
- nid = of_node_to_nid(cpu);
+ nid = of_node_to_nid_single(cpu);
if (nid < 0 || !node_online(nid))
nid = any_online_node(NODE_MASK_ALL);
@@ -393,7 +415,7 @@
cpu = find_cpu_node(i);
BUG_ON(!cpu);
- nid = of_node_to_nid(cpu);
+ nid = of_node_to_nid_single(cpu);
of_node_put(cpu);
/*
@@ -437,7 +459,7 @@
* have associativity properties. If none, then
* everything goes to default_nid.
*/
- nid = of_node_to_nid(memory);
+ nid = of_node_to_nid_single(memory);
if (nid < 0)
nid = default_nid;
node_set_online(nid);
@@ -776,7 +798,7 @@
ha_new_range:
start = read_n_cells(n_mem_addr_cells, &memcell_buf);
size = read_n_cells(n_mem_size_cells, &memcell_buf);
- nid = of_node_to_nid(memory);
+ nid = of_node_to_nid_single(memory);
/* Domains not present at boot default to 0 */
if (nid < 0 || !node_online(nid))
Index: linus-2.6/include/asm-powerpc/topology.h
===================================================================
--- linus-2.6.orig/include/asm-powerpc/topology.h 2006-04-29 01:50:25.000000000 +0200
+++ linus-2.6/include/asm-powerpc/topology.h 2006-04-29 02:02:28.000000000 +0200
@@ -4,6 +4,9 @@
#include <linux/config.h>
+struct sys_device;
+struct device_node;
+
#ifdef CONFIG_NUMA
#include <asm/mmzone.h>
@@ -27,6 +30,8 @@
return first_cpu(tmp);
}
+int of_node_to_nid(struct device_node *device);
+
#define pcibus_to_node(node) (-1)
#define pcibus_to_cpumask(bus) (cpu_online_map)
@@ -57,10 +62,29 @@
extern void __init dump_numa_cpu_topology(void);
+extern int sysfs_add_device_to_node(struct sys_device *dev, int nid);
+extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid);
+
#else
+static inline int of_node_to_nid(struct device_node *device)
+{
+ return 0;
+}
+
static inline void dump_numa_cpu_topology(void) {}
+static inline int sysfs_add_device_to_node(struct sys_device *dev, int nid)
+{
+ return 0;
+}
+
+static inline void sysfs_remove_device_from_node(struct sys_device *dev,
+ int nid)
+{
+}
+
+
#include <asm-generic/topology.h>
#endif /* CONFIG_NUMA */
Index: linus-2.6/arch/powerpc/kernel/sysfs.c
===================================================================
--- linus-2.6.orig/arch/powerpc/kernel/sysfs.c 2006-04-29 01:50:25.000000000 +0200
+++ linus-2.6/arch/powerpc/kernel/sysfs.c 2006-04-29 02:02:28.000000000 +0200
@@ -322,13 +322,31 @@
}
}
}
+
+int sysfs_add_device_to_node(struct sys_device *dev, int nid)
+{
+ struct node *node = &node_devices[nid];
+ return sysfs_create_link(&node->sysdev.kobj, &dev->kobj,
+ kobject_name(&dev->kobj));
+}
+
+void sysfs_remove_device_from_node(struct sys_device *dev, int nid)
+{
+ struct node *node = &node_devices[nid];
+ sysfs_remove_link(&node->sysdev.kobj, kobject_name(&dev->kobj));
+}
+
#else
static void register_nodes(void)
{
return;
}
+
#endif
+EXPORT_SYMBOL_GPL(sysfs_add_device_to_node);
+EXPORT_SYMBOL_GPL(sysfs_remove_device_from_node);
+
/* Only valid if CPU is present. */
static ssize_t show_physical_id(struct sys_device *dev, char *buf)
{
--
^ permalink raw reply
* [PATCH 2/4] sparsemem interaction with memory add bug fixes
From: Arnd Bergmann @ 2006-04-29 1:18 UTC (permalink / raw)
To: Andrew Morton
Cc: Arnd Bergmann, linux-kernel, linuxppc-dev, Paul Mackerras,
cbe-oss-dev
In-Reply-To: <20060429011827.502138000@localhost.localdomain>
From: Mike Kravetz <mjkravetz@verizon.net>
This patch fixes two bugs with the way sparsemem interacts with memory add.
They are:
- memory leak if memmap for section already exists
- calling alloc_bootmem_node() after boot
These bugs were discovered and a first cut at the fixes were provided by
Arnd Bergmann <arnd@arndb.de> and Joel Schopp <jschopp@us.ibm.com>.
Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
---
mm/sparse.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff -puN mm/sparse.c~sparsemem-interaction-with-memory-add-bug-fixes mm/sparse.c
--- 25/mm/sparse.c~sparsemem-interaction-with-memory-add-bug-fixes Wed Apr 12 14:38:04 2006
+++ 25-akpm/mm/sparse.c Wed Apr 12 14:38:04 2006
@@ -32,7 +32,10 @@ static struct mem_section *sparse_index_
unsigned long array_size = SECTIONS_PER_ROOT *
sizeof(struct mem_section);
- section = alloc_bootmem_node(NODE_DATA(nid), array_size);
+ if (system_state == SYSTEM_RUNNING)
+ section = kmalloc_node(array_size, GFP_KERNEL, nid);
+ else
+ section = alloc_bootmem_node(NODE_DATA(nid), array_size);
if (section)
memset(section, 0, array_size);
@@ -281,9 +284,9 @@ int sparse_add_one_section(struct zone *
ret = sparse_init_one_section(ms, section_nr, memmap);
- if (ret <= 0)
- __kfree_section_memmap(memmap, nr_pages);
out:
pgdat_resize_unlock(pgdat, &flags);
+ if (ret <= 0)
+ __kfree_section_memmap(memmap, nr_pages);
return ret;
}
_
--
^ permalink raw reply
* [PATCH 1/4] spufs: fix for CONFIG_NUMA
From: Arnd Bergmann @ 2006-04-29 1:18 UTC (permalink / raw)
To: Andrew Morton
Cc: Arnd Bergmann, linuxppc-dev, Paul Mackerras, cbe-oss-dev,
linux-kernel
In-Reply-To: <20060429011827.502138000@localhost.localdomain>
From: Joel H Schopp <jschopp@us.ibm.com>
Based on an older patch from Mike Kravetz <kravetz@us.ibm.com>
We need to have a mem_map for high addresses in order to make
fops->no_page work on spufs mem and register files. So far, we
have used the memory_present() function during early bootup,
but that did not work when CONFIG_NUMA was enabled.
We now use the __add_pages() function to add the mem_map
when loading the spufs module, which is a lot nicer.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
---
Index: linus-2.6/arch/powerpc/platforms/cell/setup.c
===================================================================
--- linus-2.6.orig/arch/powerpc/platforms/cell/setup.c 2006-04-29 02:51:29.000000000 +0200
+++ linus-2.6/arch/powerpc/platforms/cell/setup.c 2006-04-29 02:51:33.000000000 +0200
@@ -29,6 +29,8 @@
#include <linux/seq_file.h>
#include <linux/root_dev.h>
#include <linux/console.h>
+#include <linux/mutex.h>
+#include <linux/memory_hotplug.h>
#include <asm/mmu.h>
#include <asm/processor.h>
@@ -46,6 +48,7 @@
#include <asm/cputable.h>
#include <asm/ppc-pci.h>
#include <asm/irq.h>
+#include <asm/spu.h>
#include "interrupt.h"
#include "iommu.h"
@@ -69,77 +72,6 @@
of_node_put(root);
}
-#ifdef CONFIG_SPARSEMEM
-static int __init find_spu_node_id(struct device_node *spe)
-{
- unsigned int *id;
-#ifdef CONFIG_NUMA
- struct device_node *cpu;
- cpu = spe->parent->parent;
- id = (unsigned int *)get_property(cpu, "node-id", NULL);
-#else
- id = NULL;
-#endif
- return id ? *id : 0;
-}
-
-static void __init cell_spuprop_present(struct device_node *spe,
- const char *prop, int early)
-{
- struct address_prop {
- unsigned long address;
- unsigned int len;
- } __attribute__((packed)) *p;
- int proplen;
-
- unsigned long start_pfn, end_pfn, pfn;
- int node_id;
-
- p = (void*)get_property(spe, prop, &proplen);
- WARN_ON(proplen != sizeof (*p));
-
- node_id = find_spu_node_id(spe);
-
- start_pfn = p->address >> PAGE_SHIFT;
- end_pfn = (p->address + p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;
-
- /* We need to call memory_present *before* the call to sparse_init,
- but we can initialize the page structs only *after* that call.
- Thus, we're being called twice. */
- if (early)
- memory_present(node_id, start_pfn, end_pfn);
- else {
- /* As the pages backing SPU LS and I/O are outside the range
- of regular memory, their page structs were not initialized
- by free_area_init. Do it here instead. */
- for (pfn = start_pfn; pfn < end_pfn; pfn++) {
- struct page *page = pfn_to_page(pfn);
- set_page_links(page, ZONE_DMA, node_id, pfn);
- init_page_count(page);
- reset_page_mapcount(page);
- SetPageReserved(page);
- INIT_LIST_HEAD(&page->lru);
- }
- }
-}
-
-static void __init cell_spumem_init(int early)
-{
- struct device_node *node;
- for (node = of_find_node_by_type(NULL, "spe");
- node; node = of_find_node_by_type(node, "spe")) {
- cell_spuprop_present(node, "local-store", early);
- cell_spuprop_present(node, "problem", early);
- cell_spuprop_present(node, "priv1", early);
- cell_spuprop_present(node, "priv2", early);
- }
-}
-#else
-static void __init cell_spumem_init(int early)
-{
-}
-#endif
-
static void cell_progress(char *s, unsigned short hex)
{
printk("*** %04x : %s\n", hex, s ? s : "");
@@ -172,8 +104,6 @@
#endif
mmio_nvram_init();
-
- cell_spumem_init(0);
}
/*
@@ -189,8 +119,6 @@
ppc64_interrupt_controller = IC_CELL_PIC;
- cell_spumem_init(1);
-
DBG(" <- cell_init_early()\n");
}
Index: linus-2.6/arch/powerpc/platforms/cell/Kconfig
===================================================================
--- linus-2.6.orig/arch/powerpc/platforms/cell/Kconfig 2006-04-29 02:51:29.000000000 +0200
+++ linus-2.6/arch/powerpc/platforms/cell/Kconfig 2006-04-29 02:51:33.000000000 +0200
@@ -12,7 +12,8 @@
config SPUFS_MMAP
bool
- depends on SPU_FS && SPARSEMEM && !PPC_64K_PAGES
+ depends on SPU_FS && SPARSEMEM
+ select MEMORY_HOTPLUG
default y
endmenu
Index: linus-2.6/arch/powerpc/platforms/cell/spu_base.c
===================================================================
--- linus-2.6.orig/arch/powerpc/platforms/cell/spu_base.c 2006-04-29 02:51:29.000000000 +0200
+++ linus-2.6/arch/powerpc/platforms/cell/spu_base.c 2006-04-29 02:51:33.000000000 +0200
@@ -516,6 +516,56 @@
}
EXPORT_SYMBOL_GPL(spu_irq_setaffinity);
+static int __init find_spu_node_id(struct device_node *spe)
+{
+ unsigned int *id;
+ struct device_node *cpu;
+ cpu = spe->parent->parent;
+ id = (unsigned int *)get_property(cpu, "node-id", NULL);
+ return id ? *id : 0;
+}
+
+static int __init cell_spuprop_present(struct device_node *spe,
+ const char *prop)
+{
+ static DEFINE_MUTEX(add_spumem_mutex);
+
+ struct address_prop {
+ unsigned long address;
+ unsigned int len;
+ } __attribute__((packed)) *p;
+ int proplen;
+
+ unsigned long start_pfn, nr_pages;
+ int node_id;
+ struct pglist_data *pgdata;
+ struct zone *zone;
+ int ret;
+
+ p = (void*)get_property(spe, prop, &proplen);
+ WARN_ON(proplen != sizeof (*p));
+
+ start_pfn = p->address >> PAGE_SHIFT;
+ nr_pages = ((unsigned long)p->len + PAGE_SIZE - 1) >> PAGE_SHIFT;
+
+ /*
+ * XXX need to get the correct NUMA node in here. This may
+ * be different from the spe::node_id property, e.g. when
+ * the host firmware is not NUMA aware.
+ */
+ node_id = 0;
+
+ pgdata = NODE_DATA(node_id);
+ zone = pgdata->node_zones;
+
+ /* XXX rethink locking here */
+ mutex_lock(&add_spumem_mutex);
+ ret = __add_pages(zone, start_pfn, nr_pages);
+ mutex_unlock(&add_spumem_mutex);
+
+ return ret;
+}
+
static void __iomem * __init map_spe_prop(struct device_node *n,
const char *name)
{
@@ -526,6 +576,8 @@
void *p;
int proplen;
+ void* ret = NULL;
+ int err = 0;
p = get_property(n, name, &proplen);
if (proplen != sizeof (struct address_prop))
@@ -533,7 +585,14 @@
prop = p;
- return ioremap(prop->address, prop->len);
+ err = cell_spuprop_present(n, name);
+ if (err && (err != -EEXIST))
+ goto out;
+
+ ret = ioremap(prop->address, prop->len);
+
+ out:
+ return ret;
}
static void spu_unmap(struct spu *spu)
@@ -593,17 +652,6 @@
return ret;
}
-static int __init find_spu_node_id(struct device_node *spe)
-{
- unsigned int *id;
- struct device_node *cpu;
-
- cpu = spe->parent->parent;
- id = (unsigned int *)get_property(cpu, "node-id", NULL);
-
- return id ? *id : 0;
-}
-
static int __init create_spu(struct device_node *spe)
{
struct spu *spu;
Index: linus-2.6/mm/memory_hotplug.c
===================================================================
--- linus-2.6.orig/mm/memory_hotplug.c 2006-04-29 02:51:29.000000000 +0200
+++ linus-2.6/mm/memory_hotplug.c 2006-04-29 02:51:33.000000000 +0200
@@ -69,12 +69,16 @@
for (i = 0; i < nr_pages; i += PAGES_PER_SECTION) {
err = __add_section(zone, phys_start_pfn + i);
- if (err)
+ /* We want to keep adding the rest of the
+ * sections if the first ones already exist
+ */
+ if (err && (err != -EEXIST))
break;
}
return err;
}
+EXPORT_SYMBOL_GPL(__add_pages);
static void grow_zone_span(struct zone *zone,
unsigned long start_pfn, unsigned long end_pfn)
--
^ permalink raw reply
* [PATCH 0/4] NUMA support for spufs
From: Arnd Bergmann @ 2006-04-29 1:18 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, Paul Mackerras, cbe-oss-dev, linux-kernel
The current version of spufs breaks upon boot when NUMA support is enabled.
I'd like to fix that before 2.6.17 so we can use the same kernel image
on Cell that we use on other powerpc systems using NUMA.
This series has four patches, the first two are required to make it work
at all, the other two are there for a somewhat cleaner solution.
The second patch (sparsemem-interaction-with-memory-add-bug-fixes.patch)
actually comes from 2.6.17-rc2-mm1, but in order to make this work,
we need it included in mainline along with the others.
Arnd <><
--
^ permalink raw reply
* Re: FT u-boot shim
From: Tom Rini @ 2006-04-29 0:52 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: linuxppc-dev@ozlabs.org list, Paul Mackerras
In-Reply-To: <20060429003232.9926C353DAC@atlas.denx.de>
On Sat, Apr 29, 2006 at 02:32:32AM +0200, Wolfgang Denk wrote:
> In message <20060428232211.GE458@smtp.west.cox.net> you wrote:
> >
> > You wouldn't have the dtb combined in the kernel image, unless you have
> > the shim. This is instead of loading a separate dtb anyhow.
>
> Now you got me completely confused. [Maybe I should go to bed.]
>
> Kumar wrote:
>
> > What I envision as the way one boots for something like u-boot is one
> > of three options:
> > 1. using an old u-boot + boot wrapper (bd_t -> wrapper -> kernel)
> > 2. using a u-boot that is ft aware + dtb (boot command in u-boot
> > takes kernel & dtb images, updates blob and passes to kernel)
> > 3. using a u-boot that is ft aware + built in dtb.
>
> In my understanding, 1. is with a shim; 2. is loading a separate dtb
> (probably as multi-file image), and 3. is when U-Boot provides the
> dtb. Am I missing something?
I'm suggesting that we make 2 easier. U-Boot needs the file mkuimage'd
anyways. Why not make it easier and make adding the dtb part of that
step instead of a seperate load? It's still quite easy to replace if
you're testing new dtb's out.
--
Tom Rini
http://gate.crashing.org/~trini/
^ permalink raw reply
* [PATCH 1/3] powerpc: Make rtas console _much_ faster
From: Arnd Bergmann @ 2006-04-29 0:45 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linux-kernel, linuxppc-dev, cbe-oss-dev, Arnd Bergmann
In-Reply-To: <20060429004019.126937000@localhost.localdomain>
Currently the hvc_rtas driver is painfully slow to use. Our "benchmark" is
ls -R /etc, which spits out about 27866 characters. The theoretical maximum
speed would be about 2.2 seconds, the current code takes ~50 seconds.
The core of the problem is that sometimes when the tty layer asks us to push
characters the firmware isn't able to handle some or all of them, and so
returns an error. The current code sees this and just returns to the tty code
with the buffer half sent.
There's the khvcd thread which will eventually wake up and try to push more
characters, that will usually work because the firmware's had time to push
the characters out. But the thread only wakes up every 10 milliseconds, which
isn't fast enough.
There's already code in the hvc_console driver to make the khvcd thread do
a "quick" loop, where it just calls yield() instead of sleeping. The only code
that triggered that behaviour was recently removed though, which I don't
quite understand.
Still, if we set HVC_POLL_QUICK whenever the push hvc_push() doesn't push all
characters (ie. RTAS blocks), we can get good performance out of the hvc_rtas
backend. With this patch the "benchmark" takes ~2.8 seconds.
Cc: Ryan Arnold <rsa@us.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
---
drivers/char/hvc_console.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linus-2.6/drivers/char/hvc_console.c
===================================================================
--- linus-2.6.orig/drivers/char/hvc_console.c
+++ linus-2.6/drivers/char/hvc_console.c
@@ -570,7 +570,7 @@ static int hvc_poll(struct hvc_struct *h
hvc_push(hp);
/* Reschedule us if still some write pending */
if (hp->n_outbuf > 0)
- poll_mask |= HVC_POLL_WRITE;
+ poll_mask |= HVC_POLL_WRITE | HVC_POLL_QUICK;
/* No tty attached, just skip */
tty = hp->tty;
--
^ permalink raw reply
* [PATCH 3/3] powerpc: update cell_defconfig
From: Arnd Bergmann @ 2006-04-29 0:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Arnd Bergmann, linuxppc-dev, cbe-oss-dev, linux-kernel
In-Reply-To: <20060429004019.126937000@localhost.localdomain>
reflect the changes to Kconfig since the last update.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
---
Index: linus-2.6/arch/powerpc/configs/cell_defconfig
===================================================================
--- linus-2.6.orig/arch/powerpc/configs/cell_defconfig 2006-04-29 01:50:25.000000000 +0200
+++ linus-2.6/arch/powerpc/configs/cell_defconfig 2006-04-29 02:05:56.000000000 +0200
@@ -9,6 +9,7 @@
CONFIG_MMU=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_PPC=y
CONFIG_EARLY_PRINTK=y
@@ -55,6 +56,7 @@
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# CONFIG_CPUSETS is not set
+# CONFIG_RELAY is not set
CONFIG_INITRAMFS_SOURCE=""
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
# CONFIG_EMBEDDED is not set
@@ -69,10 +71,6 @@
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_SHMEM=y
-CONFIG_CC_ALIGN_FUNCTIONS=0
-CONFIG_CC_ALIGN_LABELS=0
-CONFIG_CC_ALIGN_LOOPS=0
-CONFIG_CC_ALIGN_JUMPS=0
CONFIG_SLAB=y
# CONFIG_TINY_SHMEM is not set
CONFIG_BASE_SMALL=0
@@ -84,7 +82,6 @@
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
-CONFIG_OBSOLETE_MODPARM=y
# CONFIG_MODVERSIONS is not set
# CONFIG_MODULE_SRCVERSION_ALL is not set
CONFIG_KMOD=y
@@ -93,6 +90,7 @@
#
# Block layer
#
+# CONFIG_BLK_DEV_IO_TRACE is not set
#
# IO Schedulers
@@ -126,6 +124,7 @@
CONFIG_MMIO_NVRAM=y
CONFIG_CELL_IIC=y
# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
# CONFIG_CPU_FREQ is not set
# CONFIG_WANT_EARLY_SERIAL is not set
@@ -167,7 +166,6 @@
CONFIG_SPARSEMEM_EXTREME=y
# CONFIG_MEMORY_HOTPLUG is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
-CONFIG_MIGRATION=y
# CONFIG_PPC_64K_PAGES is not set
CONFIG_SCHED_SMT=y
CONFIG_PROC_DEVICETREE=y
@@ -184,7 +182,6 @@
# CONFIG_PPC_INDIRECT_PCI is not set
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
-CONFIG_PCI_LEGACY_PROC=y
# CONFIG_PCI_DEBUG is not set
#
@@ -226,6 +223,7 @@
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
CONFIG_INET_TUNNEL=y
CONFIG_INET_DIAG=y
CONFIG_INET_TCP_DIAG=y
@@ -242,6 +240,7 @@
CONFIG_INET6_AH=m
CONFIG_INET6_ESP=m
CONFIG_INET6_IPCOMP=m
+CONFIG_INET6_XFRM_TUNNEL=m
CONFIG_INET6_TUNNEL=m
CONFIG_IPV6_TUNNEL=m
CONFIG_NETFILTER=y
@@ -632,6 +631,7 @@
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set
@@ -717,7 +717,6 @@
# CONFIG_I2C_PARPORT_LIGHT is not set
# CONFIG_I2C_PROSAVAGE is not set
# CONFIG_I2C_SAVAGE4 is not set
-# CONFIG_SCx200_ACB is not set
# CONFIG_I2C_SIS5595 is not set
# CONFIG_I2C_SIS630 is not set
# CONFIG_I2C_SIS96X is not set
@@ -736,9 +735,7 @@
# CONFIG_SENSORS_PCF8574 is not set
# CONFIG_SENSORS_PCA9539 is not set
# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_RTC8564 is not set
# CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_RTC_X1205_I2C is not set
# CONFIG_I2C_DEBUG_CORE is not set
# CONFIG_I2C_DEBUG_ALGO is not set
# CONFIG_I2C_DEBUG_BUS is not set
@@ -766,10 +763,6 @@
#
#
-# Multimedia Capabilities Port drivers
-#
-
-#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set
@@ -818,6 +811,19 @@
# CONFIG_MMC is not set
#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# LED drivers
+#
+
+#
+# LED Triggers
+#
+
+#
# InfiniBand support
#
CONFIG_INFINIBAND=y
@@ -834,6 +840,11 @@
#
#
+# Real Time Clock
+#
+# CONFIG_RTC_CLASS is not set
+
+#
# File systems
#
CONFIG_EXT2_FS=y
@@ -889,7 +900,6 @@
CONFIG_HUGETLBFS=y
CONFIG_HUGETLB_PAGE=y
CONFIG_RAMFS=y
-# CONFIG_RELAYFS_FS is not set
# CONFIG_CONFIGFS_FS is not set
#
--
^ permalink raw reply
* [PATCH 2/3] spufs: Disable local interrupts for SPE hash_page calls.
From: Arnd Bergmann @ 2006-04-29 0:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: Arnd Bergmann, linuxppc-dev, cbe-oss-dev, linux-kernel
In-Reply-To: <20060429004019.126937000@localhost.localdomain>
This patch disables and saves local interrupts during
hash_page processing for SPE contexts.
We have to do it explicitly in the spu_irq_class_1_bottom
function. For the interrupt handlers, we get the behaviour
implicitly by using SA_INTERRUPT to disable interrupts while
in the handler.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
---
Index: linus-2.6/arch/powerpc/platforms/cell/spu_base.c
===================================================================
--- linus-2.6.orig/arch/powerpc/platforms/cell/spu_base.c
+++ linus-2.6/arch/powerpc/platforms/cell/spu_base.c
@@ -306,19 +306,19 @@ spu_request_irqs(struct spu *spu)
snprintf(spu->irq_c0, sizeof (spu->irq_c0), "spe%02d.0", spu->number);
ret = request_irq(irq_base + spu->isrc,
- spu_irq_class_0, 0, spu->irq_c0, spu);
+ spu_irq_class_0, SA_INTERRUPT, spu->irq_c0, spu);
if (ret)
goto out;
snprintf(spu->irq_c1, sizeof (spu->irq_c1), "spe%02d.1", spu->number);
ret = request_irq(irq_base + IIC_CLASS_STRIDE + spu->isrc,
- spu_irq_class_1, 0, spu->irq_c1, spu);
+ spu_irq_class_1, SA_INTERRUPT, spu->irq_c1, spu);
if (ret)
goto out1;
snprintf(spu->irq_c2, sizeof (spu->irq_c2), "spe%02d.2", spu->number);
ret = request_irq(irq_base + 2*IIC_CLASS_STRIDE + spu->isrc,
- spu_irq_class_2, 0, spu->irq_c2, spu);
+ spu_irq_class_2, SA_INTERRUPT, spu->irq_c2, spu);
if (ret)
goto out2;
goto out;
@@ -487,10 +487,14 @@ int spu_irq_class_1_bottom(struct spu *s
ea = spu->dar;
dsisr = spu->dsisr;
if (dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED)) {
+ u64 flags;
+
access = (_PAGE_PRESENT | _PAGE_USER);
access |= (dsisr & MFC_DSISR_ACCESS_PUT) ? _PAGE_RW : 0UL;
+ local_irq_save(flags);
if (hash_page(ea, access, 0x300) != 0)
error |= CLASS1_ENABLE_STORAGE_FAULT_INTR;
+ local_irq_restore(flags);
}
if (error & CLASS1_ENABLE_STORAGE_FAULT_INTR) {
if ((ret = spu_handle_mm_fault(spu)) != 0)
--
^ permalink raw reply
* [PATCH 0/3] cell: 2.6.17-rc3 bug fixes
From: Arnd Bergmann @ 2006-04-29 0:40 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, cbe-oss-dev, linux-kernel
Two small bug fixes for cell, and an update to cell_defconfig.
Please apply.
Arnd <><
^ permalink raw reply
* Re: FT u-boot shim
From: Wolfgang Denk @ 2006-04-29 0:32 UTC (permalink / raw)
To: Tom Rini; +Cc: linuxppc-dev@ozlabs.org list, Paul Mackerras
In-Reply-To: <20060428232211.GE458@smtp.west.cox.net>
In message <20060428232211.GE458@smtp.west.cox.net> you wrote:
>
> You wouldn't have the dtb combined in the kernel image, unless you have
> the shim. This is instead of loading a separate dtb anyhow.
Now you got me completely confused. [Maybe I should go to bed.]
Kumar wrote:
> What I envision as the way one boots for something like u-boot is one
> of three options:
> 1. using an old u-boot + boot wrapper (bd_t -> wrapper -> kernel)
> 2. using a u-boot that is ft aware + dtb (boot command in u-boot
> takes kernel & dtb images, updates blob and passes to kernel)
> 3. using a u-boot that is ft aware + built in dtb.
In my understanding, 1. is with a shim; 2. is loading a separate dtb
(probably as multi-file image), and 3. is when U-Boot provides the
dtb. Am I missing something?
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
If you fail to plan, plan to fail.
^ permalink raw reply
* Re: FT u-boot shim
From: Wolfgang Denk @ 2006-04-28 23:55 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev@ozlabs.org list
In-Reply-To: <17490.42678.793678.267072@cargo.ozlabs.ibm.com>
In message <17490.42678.793678.267072@cargo.ozlabs.ibm.com> you wrote:
>
> > > 2. using a u-boot that is ft aware + dtb (boot command in u-boot
> > > takes kernel & dtb images, updates blob and passes to kernel)
> > > 3. using a u-boot that is ft aware + built in dtb.
...
> I imagine 3. would be more convenient for users than 2., or at least
> it would seem to mean less typing for them.
This is not necessarily the case. We discussed that kernel & dtb
could be combined in what U-Boot calls a single "multi-file image".
>From the user's point of view there would be no difference to the
current state: he has to deal with a single image file, and needs
only it's start address in emory as argument to the "bootm" command.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Cleverness and Style have no place in getting a project completed.
-- Tom Christiansen
^ permalink raw reply
* Re: alignment exceptionhandler sleeps in invalid context
From: Paul Mackerras @ 2006-04-28 23:41 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, Olaf Hering
In-Reply-To: <27BDABD8-B970-4F2C-AA0A-07D55A9D3303@kernel.crashing.org>
Kumar Gala writes:
> I was going to ask how this was actually hit. It seems odd that we
> would have an alignment error in the network stack. From the oops
> can we determine what the instruction was that faulted and what
> address it was trying to access.
No, it's not particularly odd, given that our get_unaligned() and
put_unaligned() in include/asm-powerpc/unaligned.h just do a single
access. That makes the common case (address is actually aligned, or
cpu handles it in hardware) fast at the expense of occasionally taking
an alignment exception.
Paul.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox