* Re: [PATCH 4/8] pseries: phyp dump: use sysfs to release reserved mem
From: Stephen Rothwell @ 2008-01-08 3:45 UTC (permalink / raw)
To: Manish Ahuja; +Cc: mahuja, linuxppc-dev, linasvepstas, lkessler, strosake
In-Reply-To: <4782C225.3060305@austin.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 697 bytes --]
On Mon, 07 Jan 2008 18:21:57 -0600 Manish Ahuja <ahuja@austin.ibm.com> wrote:
>
> +static int __init phyp_dump_setup(void)
> +{
>
> + /* Is there dump data waiting for us? */
> + rtas = of_find_node_by_path("/rtas");
> + dump_header = of_get_property(rtas, "ibm,kernel-dump", &header_len);
^^^^^^^^^^^
You could pass NULL here as header_len appears to be unused. Also you
need "of_node_put(rtas)" somewhere (probably just here would do).
> + if (dump_header == NULL) {
> + release_all();
> + return 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: [PATCH][POWERPC] Workaround for iommu page alignment (#2)
From: Olof Johansson @ 2008-01-08 3:48 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev list, Paul Mackerras, Linux Kernel list
In-Reply-To: <1199748862.6734.20.camel@pasglop>
On Tue, Jan 08, 2008 at 10:34:22AM +1100, Benjamin Herrenschmidt wrote:
> powerpc: Workaround for iommu page alignment
>
> Our iommu page size is currently always 4K. That means with our current
> code, drivers may do a dma_map_sg() of a 64K page and obtain a dma_addr_t
> that is only 4K aligned.
>
> This works fine in most cases except some infiniband HW it seems, where
> they tell the HW about the page size and it ignores the low bits of the
> DMA address.
>
> This works around it by making our IOMMU code enforce a PAGE_SIZE alignment
> for mappings of objects that are page aligned in the first place and whose
> size is larger or equal to a page.
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>
> And this version actually does what the comment says (I had forgotten
> to quilt ref... a common mistake).
And sloppy of me to not catch it. Anyway:
Acked-by: Olof Johansson <olof@lixom.net>
I wonder how long until there's a device that has some other < PAGE_SIZE
alignment bug^Wrequirement that we'll need to meet too. :(
-Olof
^ permalink raw reply
* RE: [PATCH 3/3] USB device tree cleanups
From: Li Yang @ 2008-01-08 3:32 UTC (permalink / raw)
To: Stephen Rothwell; +Cc: linuxppc-dev
In-Reply-To: <20080108101028.db21d18a.sfr@canb.auug.org.au>
> -----Original Message-----
> From: linuxppc-dev-bounces+leoli=3Dfreescale.com@ozlabs.org=20
> [mailto:linuxppc-dev-bounces+leoli=3Dfreescale.com@ozlabs.org]=20
> On Behalf Of Stephen Rothwell
> Sent: Tuesday, January 08, 2008 7:10 AM
> To: Li Yang
> Cc: linuxppc-dev@ozlabs.org; paulus@samba.org
> Subject: Re: [PATCH 3/3] USB device tree cleanups
>=20
> On Mon, 7 Jan 2008 20:03:20 +0800 Li Yang=20
> <leoli@freescale.com> wrote:
> >
> > +++ b/arch/powerpc/sysdev/fsl_soc.c
> > @@ -533,9 +533,7 @@ static int __init fsl_usb_of_init(void)
> > *usb_dev_dr_client =3D NULL;
> > int ret;
> > =20
> > - for (np =3D NULL, i =3D 0;
> > - (np =3D of_find_compatible_node(np, "usb",=20
> "fsl-usb2-mph")) !=3D NULL;
> > - i++) {
> > + for_each_compatible_node(np, NULL, "fsl-usb2-mph") {
>=20
> 'i' is no longer being updated (or indeed set to anything)=20
> but is still used in the loop - at least in Paulus' current tree).
Good catch. My careless mistake. Thanks.
- Leo
^ permalink raw reply
* Re: [PATCH 2/8] pseries: phyp dump: config file
From: Stephen Rothwell @ 2008-01-08 3:18 UTC (permalink / raw)
To: Manish Ahuja; +Cc: mahuja, linuxppc-dev, linasvepstas, lkessler, strosake
In-Reply-To: <4782C0C8.2050702@austin.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 445 bytes --]
On Mon, 07 Jan 2008 18:16:08 -0600 Manish Ahuja <ahuja@austin.ibm.com> wrote:
>
>
> Add hypervisor-assisted dump to kernel config
>
> Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
This patch should probably come last in the series so that all the code
is there before some bisecting autobuilder tries to configure it.
--
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: [PATCH 3/8] pseries: phyp dump: reserve-release proof-of-concept
From: Stephen Rothwell @ 2008-01-08 3:16 UTC (permalink / raw)
To: Manish Ahuja; +Cc: mahuja, linuxppc-dev, linasvepstas, lkessler, strosake
In-Reply-To: <4782C2FB.7020105@austin.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1771 bytes --]
Hi Manish,
Just some trivial things ...
On Mon, 07 Jan 2008 18:25:31 -0600 Manish Ahuja <ahuja@austin.ibm.com> wrote:
>
>
> +++ linux-2.6.24-rc2-git4/include/asm-powerpc/phyp_dump.h 2007-11-19 17:44:21.000000000 -0600
> +#ifndef _PPC64_PHYP_DUMP_H
We more usually use _ASM_POWERPC_PHYP_DUMP_H
> +#define _PPC64_PHYP_DUMP_H
> +
> +#ifdef CONFIG_PHYP_DUMP
Do these things really need protecting by this CONFIG variable? i.e. does
anything change depending on the visibility of these various symbols?
> +++ linux-2.6.24-rc2-git4/arch/powerpc/platforms/pseries/phyp_dump.c 2007-11-19 19:07:49.000000000 -0600
> @@ -0,0 +1,71 @@
> +/*
> + * Hypervisor-assisted dump
> + *
> + * Linas Vepstas, Manish Ahuja 2007
> + * Copyrhgit (c) 2007 IBM Corp.
^^^^^^^^^
typo. and you should really be using '©' in new copyright notices (or
nothing).
> +/**
> + * release_memory_range -- release memory previously lmb_reserved
> + * @start_pfn: starting physical frame number
> + * @nr_pages: number of pages to free.
> + *
> + * This routine will release memory that had been previously
> + * lmb_reserved in early boot. The released memory becomes
> + * available for genreal use.
^^^^^^^
typo.
> +release_memory_range(unsigned long start_pfn, unsigned long nr_pages)
> +{
> + struct page *rpage;
> + unsigned long end_pfn;
> + long i;
> +
> + end_pfn = start_pfn + nr_pages;
> +
> + for (i=start_pfn; i <= end_pfn; i++) {
spaces around '='
> +static int __init phyp_dump_setup(void)
> +{
> +}
> +
> +subsys_initcall(phyp_dump_setup);
Normally we don't leave a blank line here.
--
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: [PATCH v6] qe: add ability to upload QE firmware
From: Stephen Rothwell @ 2008-01-08 2:37 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
In-Reply-To: <11997441442105-git-send-email-timur@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]
On Mon, 7 Jan 2008 16:15:44 -0600 Timur Tabi <timur@freescale.com> wrote:
>
> +struct qe_firmware_info *qe_get_firmware_info(void)
> +{
> + /* Find the 'firmware' child node */
> + while ((fw = of_get_next_child(qe, fw)))
If you use:
for_each_child_of_node(qe, fw)
You don't need to initialise 'fw' in its declararion.
> + /* Did we find the 'firmware' node? */
> + if (!fw) {
> + of_node_put(fw);
This of_node_put is not necessary (as fw is NULL);
> + prop = of_find_property(fw, "extended-modes", NULL);
> + if (prop && (prop->length == sizeof(u64))) {
> + const u64 *iprop = prop->value;
> +
> + qe_firmware_info.extended_modes = *iprop;
> + }
Why not:
const u64 *iprop;
int len;
iprop = of_get_property(fs, "extended-modes", &len);
if (iprop && (len == sizeof(u64))
qe_firmware_info.extended_modes = *iprop;
> + prop = of_find_property(fw, "virtual-traps", NULL);
> + if (prop && (prop->length == 32)) {
> + const u32 *iprop = prop->value;
> +
> + for (i = 0; i < ARRAY_SIZE(qe_firmware_info.vtraps); i++)
> + qe_firmware_info.vtraps[i] = iprop[i];
> + }
And similarly?
--
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
* How complete should the DTS be?
From: Sean MacLennan @ 2008-01-08 2:07 UTC (permalink / raw)
To: linuxppc-dev
Just a general question about DTS "completeness". Like all 440EP
processors, the taco has two i2c buses. However, only one bus has
anything connected to it.
Should I show both bus entries in the DTS, or only the one that is used?
I have generally only been showing the devices that are present. i.e.
Only one emac, only one serial port.
Is there a convention for this?
Cheers,
Sean
^ permalink raw reply
* [PATCH] i2c-ibm_iic driver - new patch
From: Sean MacLennan @ 2008-01-08 2:03 UTC (permalink / raw)
To: Arnd Bergmann, linuxppc-dev, Stefan Roese
In-Reply-To: <20080106001238.GI4326@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]
Second attempt. I think I have covered all the comments. It now should
work with both ppc and powerpc architectures.
You can now specify fast-mode in the .dts file.
You can now specify an index for each entry. If you don't I try to
chose reasonable defaults. i.e. I keep a static int that is incremented.
If you mix index entries with non-index entries, you are on your own.
Below is the example for the taco, I have shown fast-mode set in IIC1 as
an example:
IIC0: i2c@ef600700 {
device_type = "i2c";
compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
reg = <ef600700 14>;
interrupt-parent = <&UIC0>;
interrupts = <2 4>;
index = <0>;
};
IIC1: i2c@ef600800 {
device_type = "i2c";
compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
reg = <ef600800 14>;
interrupt-parent = <&UIC0>;
interrupts = <7 4>;
index = <1>;
fast-mode;
};
Cheers,
Sean
[-- Attachment #2: i2c-patch --]
[-- Type: text/plain, Size: 6512 bytes --]
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index c466c6c..e9e1493 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -241,7 +241,6 @@ config I2C_PIIX4
config I2C_IBM_IIC
tristate "IBM PPC 4xx on-chip I2C interface"
- depends on IBM_OCP
help
Say Y here if you want to use IIC peripheral found on
embedded IBM PPC 4xx based systems.
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 9b43ff7..0b10bb1 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -6,7 +6,10 @@
* Copyright (c) 2003, 2004 Zultys Technologies.
* Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
*
- * Based on original work by
+ * Copyright (c) 2008 PIKA Technologies
+ * Sean MacLennan <smaclennan@pikatech.com>
+ *
+ * Based on original work by
* Ian DaSilva <idasilva@mvista.com>
* Armin Kuster <akuster@mvista.com>
* Matt Porter <mporter@mvista.com>
@@ -39,12 +42,17 @@
#include <asm/io.h>
#include <linux/i2c.h>
#include <linux/i2c-id.h>
+
+#ifdef CONFIG_IBM_OCP
#include <asm/ocp.h>
#include <asm/ibm4xx.h>
+#else
+#include <linux/of_platform.h>
+#endif
#include "i2c-ibm_iic.h"
-#define DRIVER_VERSION "2.1"
+#define DRIVER_VERSION "2.2"
MODULE_DESCRIPTION("IBM IIC driver v" DRIVER_VERSION);
MODULE_LICENSE("GPL");
@@ -657,6 +665,7 @@ static inline u8 iic_clckdiv(unsigned int opb)
return (u8)((opb + 9) / 10 - 1);
}
+#ifdef CONFIG_IBM_OCP
/*
* Register single IIC interface
*/
@@ -831,3 +840,192 @@ static void __exit iic_exit(void)
module_init(iic_init);
module_exit(iic_exit);
+#else
+/*
+ * Register single IIC interface
+ */
+static int __devinit iic_probe(struct of_device *ofdev,
+ const struct of_device_id *match)
+{
+ static int index = 0;
+ struct device_node *np = ofdev->node;
+ struct ibm_iic_private* dev;
+ struct i2c_adapter* adap;
+ const u32 *addrp, *freq;
+ u64 addr;
+ int ret;
+
+ if (!(dev = kzalloc(sizeof(*dev), GFP_KERNEL))) {
+ printk(KERN_CRIT "ibm-iic: failed to allocate device data\n");
+ return -ENOMEM;
+ }
+
+ /* This assumes we don't mix index and non-index entries. */
+ if((addrp = of_get_property(np, "index", NULL)))
+ dev->idx = *addrp;
+ else
+ dev->idx = index++;
+
+ dev_set_drvdata(&ofdev->dev, dev);
+
+ if((addrp = of_get_address(np, 0, NULL, NULL)) == NULL ||
+ (addr = of_translate_address(np, addrp)) == OF_BAD_ADDR) {
+ printk(KERN_CRIT "ibm-iic%d: Unable to get iic address\n",
+ dev->idx);
+ ret = -EBUSY;
+ goto fail1;
+ }
+
+ if (!(dev->vaddr = ioremap(addr, sizeof(struct iic_regs)))){
+ printk(KERN_CRIT "ibm-iic%d: failed to ioremap device registers\n",
+ dev->idx);
+ ret = -ENXIO;
+ goto fail1;
+ }
+
+ init_waitqueue_head(&dev->wq);
+
+ if(iic_force_poll)
+ dev->irq = NO_IRQ;
+ else if((dev->irq = irq_of_parse_and_map(np, 0)) == NO_IRQ)
+ printk(KERN_ERR __FILE__ ": irq_of_parse_and_map failed\n");
+
+ if (dev->irq != NO_IRQ) {
+ /* Disable interrupts until we finish initialization,
+ assumes level-sensitive IRQ setup...
+ */
+ iic_interrupt_mode(dev, 0);
+ if(request_irq(dev->irq, iic_handler, 0, "IBM IIC", dev)){
+ printk(KERN_ERR "ibm-iic%d: request_irq %d failed\n",
+ dev->idx, dev->irq);
+ /* Fallback to the polling mode */
+ dev->irq = NO_IRQ;
+ }
+ }
+
+ if (dev->irq == NO_IRQ)
+ printk(KERN_WARNING "ibm-iic%d: using polling mode\n",
+ dev->idx);
+
+ /* Board specific settings */
+ if(iic_force_fast || of_get_property(np, "fast-mode", NULL))
+ dev->fast_mode = 1;
+ else
+ dev->fast_mode = 0;
+
+ /* clckdiv is the same for *all* IIC interfaces, but I'd rather
+ * make a copy than introduce another global. --ebs
+ */
+ if((freq = of_get_property(np, "clock-frequency", NULL)) == NULL &&
+ (freq = of_get_property(np->parent, "clock-frequency", NULL)) == NULL) {
+ printk(KERN_CRIT "ibm-iic%d: Unable to get bus frequency\n", dev->idx);
+ ret = -EBUSY;
+ goto fail;
+ }
+
+ dev->clckdiv = iic_clckdiv(*freq);
+ DBG("%d: clckdiv = %d\n", dev->idx, dev->clckdiv);
+
+ /* Initialize IIC interface */
+ iic_dev_init(dev);
+
+ /* Register it with i2c layer */
+ adap = &dev->adap;
+ adap->dev.parent = &ofdev->dev;
+ strcpy(adap->name, "IBM IIC");
+ i2c_set_adapdata(adap, dev);
+ adap->id = I2C_HW_OCP;
+ adap->class = I2C_CLASS_HWMON;
+ adap->algo = &iic_algo;
+ adap->client_register = NULL;
+ adap->client_unregister = NULL;
+ adap->timeout = 1;
+ adap->retries = 1;
+ adap->nr = dev->idx;
+
+ if ((ret = i2c_add_numbered_adapter(adap)) < 0) {
+ printk(KERN_CRIT "ibm-iic%d: failed to register i2c adapter\n",
+ dev->idx);
+ goto fail;
+ }
+
+ printk(KERN_INFO "ibm-iic%d: using %s mode\n", dev->idx,
+ dev->fast_mode ? "fast (400 kHz)" : "standard (100 kHz)");
+
+ return 0;
+
+fail:
+ if (dev->irq != NO_IRQ){
+ iic_interrupt_mode(dev, 0);
+ free_irq(dev->irq, dev);
+ }
+
+ iounmap(dev->vaddr);
+fail1:
+ dev_set_drvdata(&ofdev->dev, NULL);
+ kfree(dev);
+ return ret;
+}
+
+/*
+ * Cleanup initialized IIC interface
+ */
+static int __devexit iic_remove(struct of_device *ofdev)
+{
+ struct ibm_iic_private* dev = (struct ibm_iic_private*)dev_get_drvdata(&ofdev->dev);
+
+ BUG_ON(dev == NULL);
+ if (i2c_del_adapter(&dev->adap)){
+ printk(KERN_CRIT "ibm-iic%d: failed to delete i2c adapter :(\n",
+ dev->idx);
+ /* That's *very* bad, just shutdown IRQ ... */
+ if (dev->irq >= 0){
+ iic_interrupt_mode(dev, 0);
+ free_irq(dev->irq, dev);
+ dev->irq = -1;
+ }
+ } else {
+ if (dev->irq != NO_IRQ){
+ iic_interrupt_mode(dev, 0);
+ free_irq(dev->irq, dev);
+ }
+ iounmap(dev->vaddr);
+ kfree(dev);
+ }
+
+ return 0;
+}
+
+
+static struct of_device_id ibm_iic_match[] =
+{
+ { .type = "i2c", .compatible = "ibm,iic-405ex", },
+ { .type = "i2c", .compatible = "ibm,iic-405gp", },
+ { .type = "i2c", .compatible = "ibm,iic-440gp", },
+ { .type = "i2c", .compatible = "ibm,iic-440gpx", },
+ { .type = "i2c", .compatible = "ibm,iic-440grx", },
+ {}
+};
+
+static struct of_platform_driver ibm_iic_driver =
+{
+ .name = "ibm-iic",
+ .match_table = ibm_iic_match,
+ .probe = iic_probe,
+ .remove = iic_remove,
+};
+
+static int __init ibm_iic_init(void)
+{
+ printk(KERN_INFO "IBM IIC driver v" DRIVER_VERSION "\n");
+ return of_register_platform_driver(&ibm_iic_driver);
+}
+module_init(ibm_iic_init);
+
+static void __exit ibm_iic_exit(void)
+{
+ of_unregister_platform_driver(&ibm_iic_driver);
+}
+module_exit(ibm_iic_exit);
+#endif
+
^ permalink raw reply related
* Re: How to config linux kernel(ARCH=powerpc)?
From: Josh Boyer @ 2008-01-08 1:55 UTC (permalink / raw)
To: tony, jie han; +Cc: linuxppc-embedded
In-Reply-To: <200801080918222817608@163.com>
On Tue, 8 Jan 2008 09:18:23 +0800
"tony" <hangtoo@163.com> wrote:
> hi Jie
> maybe you should try it like this:
> linux-2.6-denx->make ARCH=ppc CROSS_COMPILE=ppc_4xx- pasemi_defconfig
> make sure you have installed the ppc_4xx- tools.
Um.. no. pasemi is a 64bit CPU. Get the powerpc tree from kernel.org,
make sure you have a PowerPC 64bit toolchain, and try with make
ARCH=powerpc
josh
^ permalink raw reply
* Re:How to config linux kernel(ARCH=powerpc)?
From: tony @ 2008-01-08 1:18 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 194 bytes --]
hi Jie
maybe you should try it like this:
linux-2.6-denx->make ARCH=ppc CROSS_COMPILE=ppc_4xx- pasemi_defconfig
make sure you have installed the ppc_4xx- tools.
good luck
tony
[-- Attachment #2: Type: text/html, Size: 945 bytes --]
^ permalink raw reply
* Re: [PATCH] i2c-ibm_iic driver
From: Sean MacLennan @ 2008-01-08 1:16 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev
In-Reply-To: <200801051224.52693.arnd@arndb.de>
Arnd Bergmann wrote:
> If there is a good reason to specify fast or slow mode per board, you may want
> to make that a property in the device node.
>
I tried to add fast_mode to the .dts file and failed.
IIC1: i2c@ef600800 {
device_type = "i2c";
compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
reg = <ef600800 14>;
interrupt-parent = <&UIC0>;
interrupts = <7 4>;
fast-mode = <0>;
};
As soon as a I add the fast-mode line I get the following error on boot:
fdt_wrapper_setprop():105 FDT_ERR_NOSPACE
Remove the line and I boot. Any ideas?
Cheers,
Sean
^ permalink raw reply
* Re: [PATCH 3/8] pseries: phyp dump: reserve-release proof-of-concept
From: Michael Ellerman @ 2008-01-08 1:13 UTC (permalink / raw)
To: linasvepstas; +Cc: mahuja, linuxppc-dev, lkessler, strosake, Arnd Bergmann
In-Reply-To: <3ae3aa420801071649w6a8d3939y176dc389d68f4870@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1945 bytes --]
On Mon, 2008-01-07 at 18:49 -0600, Linas Vepstas wrote:
> On 07/01/2008, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 08 January 2008, Manish Ahuja wrote:
> >
> > > Initial patch for reserving memory in early boot, and freeing it later.
> > > If the previous boot had ended with a crash, the reserved memory would contain
> > > a copy of the crashed kernel data.
> > >
> > > Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
> > > Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
> >
> > I think the signed-off-by chain needs to be modified. The way it appears,
> > you handled the patch first, then sent it to Linas, who forwarded it
> > to whoever will take the patches from the list.
> > This obviously isn't true, since you are actually the one who is sending
> > out the patches. Moreover, I believe that the linas@austin.ibm.com
> > address is now dead, and shouldn't be used for this any more.
>
> Hmm. I wanted to indicate that the work was done while I was at IBM;
> clearly, no one is going through git and changing old, expired email
> addrs, and so submission based on the old addr seemed appropriate.
>
> I'm taking the Signed-off-by line as a quasi-legal thing: a fancy ID string,
> identifying the author(s), rather than a new way to manage email
> address books.
No one's changing the git history (you can't), but it seems silly to
submit a patch with an address that is already dead. There is a general
expectation that if/when someone finds a bug in the code they can email
the signed-off-by addresses and get a real person.
As far as indicating it was written at IBM, that should be covered by
the copyright notices.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
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: 189 bytes --]
^ permalink raw reply
* Re: [RFC 1/2] mpc5200: Add common clock setting routine mpc52xx_set_psc_clkdiv()
From: Stephen Rothwell @ 2008-01-08 1:04 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, dragos.carp
In-Reply-To: <20080107190335.13535.29837.stgit@trillian.secretlab.ca>
[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]
On Mon, 07 Jan 2008 12:03:59 -0700 Grant Likely <grant.likely@secretlab.ca> wrote:
>
> +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
>
> -static struct of_device_id __init mpc52xx_ids[] = {
Why not just leave this here and mark in __initdata?
> +/**
> + * mpc52xx_declare_of_platform_devices: register internal devices and children
> + * of the localplus bus to the of_platform
> + * bus.
> + */
> void __init
> mpc52xx_declare_of_platform_devices(void)
> {
> + const static struct of_device_id mpc52xx_bus_ids[] = {
Or just mark it __initdata instead of const?
> + { .compatible = "fsl,mpc5200-immr", },
> + { .compatible = "fsl,lpb", },
> + { .type = "builtin", .compatible = "mpc5200", }, /* efika */
> + { .type = "soc", .compatible = "mpc5200", }, /* old */
And you lost the comment about the last two being deprecated mates.
> +mpc52xx_map_common_devices(void)
> {
> struct device_node *np;
> - struct of_device_id gpt_ids[] = {
> + const static struct of_device_id gpt_ids[] = {
Again __initdata?
> + const static struct of_device_id cdm_ids[] = {
And again?
--
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: [PATCH v2] [POWERPC] Update MPC8610 HPCD to support audio drivers
From: Stephen Rothwell @ 2008-01-08 0:56 UTC (permalink / raw)
To: Timur Tabi; +Cc: liam.girdwood, alsa-devel, linuxppc-dev
In-Reply-To: <1199732204578-git-send-email-timur@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 922 bytes --]
Hi Timur,
On Mon, 7 Jan 2008 12:56:43 -0600 Timur Tabi <timur@freescale.com> wrote:
>
> +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
> @@ -34,9 +34,27 @@
>
> #include <asm/mpic.h>
>
> +#include <linux/of_platform.h>
> #include <sysdev/fsl_pci.h>
> #include <sysdev/fsl_soc.h>
>
> +static struct of_device_id mpc8610_ids[] = {
__initdata
> + { .compatible = "fsl,mpc8610", },
> + {}
> +};
> +
> +static int __init mpc8610_declare_of_platform_devices(void)
> +{
> + if (!machine_is(mpc86xx_hpcd))
> + return 0;
> +
> + /* Without this call, the SSI device driver won't get probed. */
> + of_platform_bus_probe(NULL, mpc8610_ids, NULL);
> +
> + return 0;
> +}
> +device_initcall(mpc8610_declare_of_platform_devices);
We have machine_device_initcall for this now.
--
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: [PATCH 6/8] pseries: phyp dump: debugging print routines.
From: Arnd Bergmann @ 2008-01-08 0:49 UTC (permalink / raw)
To: linuxppc-dev; +Cc: mahuja, lkessler, linasvepstas, strosake
In-Reply-To: <4782C53D.4060506@austin.ibm.com>
On Tuesday 08 January 2008, Manish Ahuja wrote:
> +#ifdef DEBUG
> +static void print_dump_header(const struct phyp_dump_header *ph)
> +{
> +=A0=A0=A0=A0=A0=A0=A0printk(KERN_INFO "dump header:\n");
> ...
> +=A0=A0=A0=A0=A0=A0=A0printk(KERN_INFO "SRSD length_copied =3D%lx\n",ph->=
kernel_data.length_copied);
> +}
> +#endif
> +
If you move the #if to inside of the function,
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0printk (KERN_ERR "phyp-du=
mp: unexpected error (%d) on register\n", rc);
> +#ifdef DEBUG
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0print_dump_header (ph);
> +#endif
> =A0=A0=A0=A0=A0=A0=A0=A0}
> =A0=A0=A0=A0=A0=A0=A0=A0}
> +#ifdef DEBUG
> +=A0=A0=A0=A0=A0=A0=A0print_dump_header (dump_header);
> +#endif
you don't need the #ifdefs here.
Arnd <><
^ permalink raw reply
* Re: [PATCH 3/8] pseries: phyp dump: reserve-release proof-of-concept
From: Manish Ahuja @ 2008-01-08 0:50 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: mahuja, linuxppc-dev, linasvepstas, lkessler, strosake
In-Reply-To: <200801080126.51897.arnd@arndb.de>
Arnd,
Sorry this patch ended up out of sequence. I reposted it properly again in the other thread.
We did talk about using gmail address, but Linas was more comfortable using this as this is
where he was, when we did this. Hence the use of Austin address with gmail being on the cc list.
I am sure he will chime in with more details about it when he gets the opportunity.
Thanks,
Manish
Arnd Bergmann wrote:
> On Tuesday 08 January 2008, Manish Ahuja wrote:
>
>> Initial patch for reserving memory in early boot, and freeing it later.
>> If the previous boot had ended with a crash, the reserved memory would contain
>> a copy of the crashed kernel data.
>>
>> Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
>> Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
>
> I think the signed-off-by chain needs to be modified. The way it appears,
> you handled the patch first, then sent it to Linas, who forwarded it
> to whoever will take the patches from the list.
>
> This obviously isn't true, since you are actually the one who is sending
> out the patches. Moreover, I believe that the linas@austin.ibm.com
> address is now dead, and shouldn't be used for this any more.
>
> So, depending on which of you two wrote the majority of a patch, I think
> it should be either
>
> | Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
> | Acked-by: Linas Vepstas <linasvepstas@gmail.com>
>
> or
>
> | From: Linas Vepstas <linasvepstas@gmail.com>
> | Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
>
> Arnd <><
^ permalink raw reply
* Re: [PATCH 3/8] pseries: phyp dump: reserve-release proof-of-concept
From: Linas Vepstas @ 2008-01-08 0:49 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: mahuja, linuxppc-dev, lkessler, strosake
In-Reply-To: <200801080126.51897.arnd@arndb.de>
On 07/01/2008, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 08 January 2008, Manish Ahuja wrote:
>
> > Initial patch for reserving memory in early boot, and freeing it later.
> > If the previous boot had ended with a crash, the reserved memory would contain
> > a copy of the crashed kernel data.
> >
> > Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
> > Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
>
> I think the signed-off-by chain needs to be modified. The way it appears,
> you handled the patch first, then sent it to Linas, who forwarded it
> to whoever will take the patches from the list.
Well,
-- there was dual authorship. I remangled the patches while Manish wrote
code & tested. And I'd mailed them out the first time around, so you could
say I forwarded after heavy editing.
> This obviously isn't true, since you are actually the one who is sending
> out the patches. Moreover, I believe that the linas@austin.ibm.com
> address is now dead, and shouldn't be used for this any more.
Hmm. I wanted to indicate that the work was done while I was at IBM;
clearly, no one is going through git and changing old, expired email
addrs, and so submission based on the old addr seemed appropriate.
I'm taking the Signed-off-by line as a quasi-legal thing: a fancy ID string,
identifying the author(s), rather than a new way to manage email
address books.
> So, depending on which of you two wrote the majority of a patch, I think
> it should be either
I'm not sure there was a clear majority. I think Manish did more work
in general, but we hacked this together side by side. I got him to create
working tested code; I busted it up into individual, clean, documented,
mailing-list ready chunks.
--linas
^ permalink raw reply
* Re: [RFC] Add of_find_matching_node() helper function
From: Stephen Rothwell @ 2008-01-08 0:48 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, paulus
In-Reply-To: <20080107181418.11906.13427.stgit@trillian.secretlab.ca>
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
Hi Grant,
On Mon, 07 Jan 2008 11:15:56 -0700 Grant Likely <grant.likely@secretlab.ca> wrote:
>
> +++ b/include/linux/of.h
> @@ -60,5 +66,7 @@ extern const void *of_get_property(const struct device_node *node,
> int *lenp);
> extern int of_n_addr_cells(struct device_node *np);
> extern int of_n_size_cells(struct device_node *np);
> +extern const struct of_device_id *of_match_node(
> + const struct of_device_id *matches, const struct device_node *node);
>
> #endif /* _LINUX_OF_H */
> diff --git a/include/linux/of_device.h b/include/linux/of_device.h
> index 212bffb..6dc1195 100644
> --- a/include/linux/of_device.h
> +++ b/include/linux/of_device.h
> @@ -10,8 +10,6 @@
>
> #define to_of_device(d) container_of(d, struct of_device, dev)
>
> -extern const struct of_device_id *of_match_node(
> - const struct of_device_id *matches, const struct device_node *node);
> extern const struct of_device_id *of_match_device(
> const struct of_device_id *matches, const struct of_device *dev);
So you should really change all the callers of of_match_node to include linux/of.h.
--
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 8/8] pseries: phyp dump: Tracking memory range freed.
From: Manish Ahuja @ 2008-01-08 0:39 UTC (permalink / raw)
To: linuxppc-dev; +Cc: mahuja, linasvepstas, lkessler, strosake
In-Reply-To: <4782B985.2090508@austin.ibm.com>
This patch tracks the size freed. For now it does a simple
rudimentary calculation of the ranges freed. The idea is
to keep it simple at the external shell script level and
send in large chunks for now.
Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
-----
---
arch/powerpc/platforms/pseries/phyp_dump.c | 36 +++++++++++++++++++++++++++++
include/asm-powerpc/phyp_dump.h | 3 ++
2 files changed, 39 insertions(+)
Index: 2.6.24-rc5/include/asm-powerpc/phyp_dump.h
===================================================================
--- 2.6.24-rc5.orig/include/asm-powerpc/phyp_dump.h 2008-01-07 22:55:28.000000000 -0600
+++ 2.6.24-rc5/include/asm-powerpc/phyp_dump.h 2008-01-07 22:58:02.000000000 -0600
@@ -24,6 +24,9 @@ struct phyp_dump {
/* Memory that is reserved during very early boot. */
unsigned long init_reserve_start;
unsigned long init_reserve_size;
+ /* Scratch area memory details */
+ unsigned long scratch_reserve_start;
+ unsigned long scratch_reserve_size;
};
extern struct phyp_dump *phyp_dump_info;
Index: 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c
===================================================================
--- 2.6.24-rc5.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2008-01-07 22:57:27.000000000 -0600
+++ 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c 2008-01-07 22:58:02.000000000 -0600
@@ -287,6 +287,39 @@ release_memory_range(unsigned long start
}
}
+/**
+ * track_freed_range -- Counts the range being freed.
+ * Once the counter goes to zero, it re-registers dump for
+ * future use.
+ */
+static void
+track_freed_range(unsigned long addr, unsigned long length)
+{
+ static unsigned long scratch_area_size, reserved_area_size;
+
+ if (addr < phyp_dump_info->init_reserve_start)
+ return;
+
+ if ((addr >= phyp_dump_info->init_reserve_start) &&
+ (addr <= phyp_dump_info->init_reserve_start +
+ phyp_dump_info->init_reserve_size))
+ reserved_area_size += length;
+
+ if ((addr >= phyp_dump_info->scratch_reserve_start) &&
+ (addr <= phyp_dump_info->scratch_reserve_start +
+ phyp_dump_info->scratch_reserve_size))
+ scratch_area_size += length;
+
+ if ((reserved_area_size == phyp_dump_info->init_reserve_start) &&
+ (scratch_area_size == phyp_dump_info->scratch_reserve_size)) {
+
+ invalidate_last_dump(&phdr,
+ phyp_dump_info->scratch_reserve_start);
+ register_dump_area (&phdr,
+ phyp_dump_info->scratch_reserve_start);
+ }
+}
+
/* ------------------------------------------------- */
/**
* sysfs_release_region -- sysfs interface to release memory range.
@@ -310,6 +343,8 @@ store_release_region(struct kset *kset,
if (ret != 2)
return -EINVAL;
+ track_freed_range(start_addr, length);
+
/* Range-check - don't free any reserved memory that
* wasn't reserved for phyp-dump */
if (start_addr < phyp_dump_info->init_reserve_start)
@@ -414,6 +449,7 @@ static int __init phyp_dump_setup(void)
}
/* Don't allow user to release the 256MB scratch area */
+ /* this might be wrong */
phyp_dump_info->init_reserve_size = free_area_length;
/* Should we create a dump_subsys, analogous to s390/ipl.c ? */
^ permalink raw reply
* How to config linux kernel(ARCH=powerpc)?
From: jie han @ 2008-01-08 0:32 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 808 bytes --]
Hi everyone:
I downloaded linux kernel 2.6 from www.denx.de and unzip the kernel source code.My operation is make mrproper at first and then make pasemi_defconfig,it didn't work,the show message as follow:
linux-2.6-denx->make mrproper
linux-2.6-denx->make pasemi_defconfig
kernel/power/Kconfig:68:warning: 'select' used by config symbol 'PM_SLEEP_SMP' refers to undefined symbol 'HOTPLUG_CPU'
***
*** Can't find default configuration "arch/ppc/configs/pasemi_defconfig"!
***
make[1]: *** [pasemi_defconfig] Error 1
make: *** [pasemi_defconfig] Error 2
I make the other default config file under arch/powperpc/configs directory,it show the same wrong message.How can I do fix it ?Thanks ahead,
Sincerely,
Jie
---------------------------------
Never miss a thing. Make Yahoo your homepage.
[-- Attachment #2: Type: text/html, Size: 939 bytes --]
^ permalink raw reply
* [PATCH 7/8] pseries: phyp dump: Unregister and print dump areas.
From: Manish Ahuja @ 2008-01-08 0:37 UTC (permalink / raw)
To: linuxppc-dev; +Cc: mahuja, linasvepstas, lkessler, strosake
In-Reply-To: <4782B985.2090508@austin.ibm.com>
Routines to invalidate and unregister dump routines.
Unregister has not been used yet, I will release another
patch for that at a later stage with the kdump integration patches.
There is also a routine which calculates the regions to be
freed and exports that through sysfs.
Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
---
arch/powerpc/platforms/pseries/phyp_dump.c | 79 ++++++++++++++++++++++++++---
1 file changed, 73 insertions(+), 6 deletions(-)
Index: 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c
===================================================================
--- 2.6.24-rc5.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2008-01-07 18:06:11.000000000 -0600
+++ 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c 2008-01-07 22:57:27.000000000 -0600
@@ -69,6 +69,10 @@ static struct phyp_dump_header phdr;
#define DUMP_SOURCE_CPU 0x0001
#define DUMP_SOURCE_HPTE 0x0002
#define DUMP_SOURCE_RMO 0x0011
+#define DUMP_ERROR_FLAG 0x2000
+#define DUMP_TRIGGERED 0x4000
+#define DUMP_PERFORMED 0x8000
+
/**
* init_dump_header() - initialize the header declaring a dump
@@ -187,10 +191,15 @@ static void print_dump_header(const stru
static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
{
int rc;
- ph->cpu_data.destination_address += addr;
- ph->hpte_data.destination_address += addr;
- ph->kernel_data.destination_address += addr;
+ /* Add addr value if not initialized before */
+ if (ph->cpu_data.destination_address == 0) {
+ ph->cpu_data.destination_address += addr;
+ ph->hpte_data.destination_address += addr;
+ ph->kernel_data.destination_address += addr;
+ }
+
+ /* ToDo Invalidate kdump and free memory range. */
do {
rc = rtas_call(ibm_configure_kernel_dump, 3, 1, NULL,
1, ph, sizeof(struct phyp_dump_header));
@@ -205,6 +214,49 @@ static void register_dump_area(struct ph
}
}
+static void invalidate_last_dump(struct phyp_dump_header *ph, unsigned long addr)
+{
+ int rc;
+
+ /* Add addr value if not initialized before */
+ if (ph->cpu_data.destination_address == 0) {
+ ph->cpu_data.destination_address = addr;
+ ph->hpte_data.destination_address += addr;
+ ph->kernel_data.destination_address += addr;
+ }
+
+ do {
+ rc = rtas_call(ibm_configure_kernel_dump, 3, 1, NULL,
+ 2, ph, sizeof(struct phyp_dump_header));
+ } while (rtas_busy_delay(rc));
+
+ if (rc)
+ {
+ printk (KERN_ERR "phyp-dump: unexpected error (%d) on invalidate\n", rc);
+#ifdef DEBUG
+ print_dump_header (ph);
+#endif
+ }
+}
+
+static void unregister_dump_area(struct phyp_dump_header *ph)
+{
+ int rc;
+
+ do {
+ rc = rtas_call(ibm_configure_kernel_dump, 3, 1, NULL,
+ 3, ph, sizeof(struct phyp_dump_header));
+ } while (rtas_busy_delay(rc));
+
+ if (rc)
+ {
+ printk (KERN_ERR "phyp-dump: unexpected error (%d) on unregister\n", rc);
+#ifdef DEBUG
+ print_dump_header (ph);
+#endif
+ }
+}
+
/* ------------------------------------------------- */
/**
* release_memory_range -- release memory previously lmb_reserved
@@ -279,7 +331,17 @@ store_release_region(struct kset *kset,
static ssize_t
show_release_region(struct kset * kset, char *buf)
{
- return sprintf(buf, "ola\n");
+ u64 second_addr_range;
+
+ /* total reserved size - start of scratch area */
+ second_addr_range = phdr.cpu_data.destination_address -
+ phyp_dump_info->init_reserve_size;
+ return sprintf(buf, "CPU:0x%lx-0x%lx: HPTE:0x%lx-0x%lx:"
+ " DUMP:0x%lx-0x%lx, 0x%lx-0x%lx:\n",
+ phdr.cpu_data.destination_address, phdr.cpu_data.length_copied,
+ phdr.hpte_data.destination_address, phdr.hpte_data.length_copied,
+ phdr.kernel_data.destination_address, phdr.kernel_data.length_copied,
+ phyp_dump_info->init_reserve_start, second_addr_range);
}
static struct subsys_attribute rr = __ATTR(release_region, 0600,
@@ -344,6 +406,13 @@ static int __init phyp_dump_setup(void)
goto release_mem;
}
+ /* re-register the dump area, if old dump was invalid */
+ if ((dump_header) && (dump_header->status & DUMP_ERROR_FLAG)) {
+ invalidate_last_dump (&phdr, dump_area_start);
+ register_dump_area (&phdr, dump_area_start);
+ goto release_mem;
+ }
+
/* Don't allow user to release the 256MB scratch area */
phyp_dump_info->init_reserve_size = free_area_length;
@@ -354,8 +423,6 @@ static int __init phyp_dump_setup(void)
goto release_mem;
}
- /* ToDo: re-register the dump area, for next time. */
-
return 0;
release_mem:
^ permalink raw reply
* Re: [PATCH] Use <linux/of_{platform, device}.h> and not <asm/...> variants.
From: Stephen Rothwell @ 2008-01-08 0:36 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev
In-Reply-To: <E1JBwNX-0006XF-26@jdl.com>
[-- Attachment #1: Type: text/plain, Size: 565 bytes --]
Hi Jon,
On Mon, 07 Jan 2008 12:07:15 -0600 Jon Loeliger <jdl@jdl.com> wrote:
>
> From: Jon Loeliger <jdl@freescale.com>
>
> Signed-off-by: Jon Loeliger <jdl@freescale.com>
> ---
>
> Paul,
>
> Continue to fight the Good Fight by removing
> old include file references that managed to
> creep in recently.
>
> These are the last few in arch/powerpc directly.
> If you could pick this up for .25, that be good!
Thanks for doing this.
--
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 6/8] pseries: phyp dump: debugging print routines.
From: Manish Ahuja @ 2008-01-08 0:35 UTC (permalink / raw)
To: linuxppc-dev; +Cc: mahuja, linasvepstas, lkessler, strosake
In-Reply-To: <4782B985.2090508@austin.ibm.com>
Provide some basic debugging support.
Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
Signed-off-by: Linas Vepsts <linas@austin.ibm.com>
-----
arch/powerpc/platforms/pseries/phyp_dump.c | 53 ++++++++++++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
Index: 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c
===================================================================
--- 2.6.24-rc5.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2008-01-01 23:24:10.000000000 -0600
+++ 2.6.24-rc5/arch/powerpc/platforms/pseries/phyp_dump.c 2008-01-01 23:24:27.000000000 -0600
@@ -2,7 +2,7 @@
* Hypervisor-assisted dump
*
* Linas Vepstas, Manish Ahuja 2007
- * Copyrhgit (c) 2007 IBM Corp.
+ * Copyright (c) 2007 IBM Corp.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -139,6 +139,51 @@ static unsigned long init_dump_header(st
return addr_offset;
}
+#ifdef DEBUG
+static void print_dump_header(const struct phyp_dump_header *ph)
+{
+ printk(KERN_INFO "dump header:\n");
+ /* setup some ph->sections required */
+ printk(KERN_INFO "version = %d\n", ph->version);
+ printk(KERN_INFO "Sections = %d\n", ph->num_of_sections);
+ printk(KERN_INFO "Status = 0x%x\n", ph->status);
+
+ /* No ph->disk, so all should be set to 0 */
+ printk(KERN_INFO "Offset to first section 0x%x\n", ph->first_offset_section);
+ printk(KERN_INFO "dump disk sections should be zero\n");
+ printk(KERN_INFO "dump disk section = %d\n",ph->dump_disk_section);
+ printk(KERN_INFO "block num = %ld\n",ph->block_num_dd);
+ printk(KERN_INFO "number of blocks = %ld\n",ph->num_of_blocks_dd);
+ printk(KERN_INFO "dump disk offset = %d\n",ph->offset_dd);
+ printk(KERN_INFO "Max auto time= %d\n",ph->maxtime_to_auto);
+
+ /*set cpu state and hpte states as well scratch pad area */
+ printk(KERN_INFO " CPU AREA \n");
+ printk(KERN_INFO "cpu dump_flags =%d\n",ph->cpu_data.dump_flags);
+ printk(KERN_INFO "cpu source_type =%d\n",ph->cpu_data.source_type);
+ printk(KERN_INFO "cpu error_flags =%d\n",ph->cpu_data.error_flags);
+ printk(KERN_INFO "cpu source_address =%lx\n",ph->cpu_data.source_address);
+ printk(KERN_INFO "cpu source_length =%lx\n",ph->cpu_data.source_length);
+ printk(KERN_INFO "cpu length_copied =%lx\n",ph->cpu_data.length_copied);
+
+ printk(KERN_INFO " HPTE AREA \n");
+ printk(KERN_INFO "HPTE dump_flags =%d\n",ph->hpte_data.dump_flags);
+ printk(KERN_INFO "HPTE source_type =%d\n",ph->hpte_data.source_type);
+ printk(KERN_INFO "HPTE error_flags =%d\n",ph->hpte_data.error_flags);
+ printk(KERN_INFO "HPTE source_address =%lx\n",ph->hpte_data.source_address);
+ printk(KERN_INFO "HPTE source_length =%lx\n",ph->hpte_data.source_length);
+ printk(KERN_INFO "HPTE length_copied =%lx\n",ph->hpte_data.length_copied);
+
+ printk(KERN_INFO " SRSD AREA \n");
+ printk(KERN_INFO "SRSD dump_flags =%d\n",ph->kernel_data.dump_flags);
+ printk(KERN_INFO "SRSD source_type =%d\n",ph->kernel_data.source_type);
+ printk(KERN_INFO "SRSD error_flags =%d\n",ph->kernel_data.error_flags);
+ printk(KERN_INFO "SRSD source_address =%lx\n",ph->kernel_data.source_address);
+ printk(KERN_INFO "SRSD source_length =%lx\n",ph->kernel_data.source_length);
+ printk(KERN_INFO "SRSD length_copied =%lx\n",ph->kernel_data.length_copied);
+}
+#endif
+
static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
{
int rc;
@@ -154,6 +199,9 @@ static void register_dump_area(struct ph
if (rc)
{
printk (KERN_ERR "phyp-dump: unexpected error (%d) on register\n", rc);
+#ifdef DEBUG
+ print_dump_header (ph);
+#endif
}
}
@@ -271,6 +319,9 @@ static int __init phyp_dump_setup(void)
release_all();
return -ENOSYS;
}
+#ifdef DEBUG
+ print_dump_header (dump_header);
+#endif
/* Is there dump data waiting for us? If there isn't,
* then register a new dump area, and release all of
^ permalink raw reply
* Re: [PATCH 3/7] sbc8560: add support for Wind River SBC8560 in arch/powerpc
From: Stephen Rothwell @ 2008-01-08 0:32 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: linuxppc-dev
In-Reply-To: <11997159352727-git-send-email-paul.gortmaker@windriver.com>
[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]
Hi Paul,
On Mon, 7 Jan 2008 09:25:28 -0500 Paul Gortmaker <paul.gortmaker@windriver.com> wrote:
>
> +++ b/arch/powerpc/platforms/85xx/sbc8560.c
>
> +static void __init sbc8560_pic_init(void)
> +{
>
> +#ifdef CONFIG_CPM2
> + /* Setup CPM2 PIC */
> + np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pic");
> + if (np == NULL) {
> + printk(KERN_ERR "PIC init: can not find fsl,cpm2-pic node\n");
> + return;
> + }
> + irq = irq_of_parse_and_map(np, 0);
What happens if that fails?
> +
> + cpm2_pic_init(np);
> + of_node_put(np);
> + set_irq_chained_handler(irq, cpm2_cascade);
Does passing NO_IRQ matter here (in the case that irq_of_parse_and_map fails)?
> +static const struct cpm_pin sbc8560_pins[] = {
Of course, these could be __initdata (but not const as well). Sorry
about not mentioning this last time and it is a trivial change that
should not stop this stuff going in.
> +static int __init sbc8560_probe(void)
> +{
> + unsigned long root = of_get_flat_dt_root();
> +
> + return of_flat_dt_is_compatible(root, "SBC8560");
To use the flattened device tree accessors, you should include asm/prom.h
--
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 5/8] pseries: phyp dump: register dump area.
From: Manish Ahuja @ 2008-01-08 0:28 UTC (permalink / raw)
To: linuxppc-dev; +Cc: mahuja, linasvepstas, lkessler, strosake
In-Reply-To: <4782B985.2090508@austin.ibm.com>
Set up the actual dump header, register it with the hypervisor.
Signed-off-by: Manish Ahuja <mahuja@us.ibm.com>
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
------
arch/powerpc/platforms/pseries/phyp_dump.c | 169 +++++++++++++++++++++++++++--
1 file changed, 163 insertions(+), 6 deletions(-)
Index: linux-2.6.24-rc3-git1/arch/powerpc/platforms/pseries/phyp_dump.c
===================================================================
--- linux-2.6.24-rc3-git1.orig/arch/powerpc/platforms/pseries/phyp_dump.c 2007-11-21 15:55:37.000000000 -0600
+++ linux-2.6.24-rc3-git1/arch/powerpc/platforms/pseries/phyp_dump.c 2007-11-21 16:06:52.000000000 -0600
@@ -30,6 +30,134 @@ struct phyp_dump *phyp_dump_info = &phyp
static int ibm_configure_kernel_dump;
/* ------------------------------------------------- */
+/* RTAS interfaces to declare the dump regions */
+
+struct dump_section {
+ u32 dump_flags;
+ u16 source_type;
+ u16 error_flags;
+ u64 source_address;
+ u64 source_length;
+ u64 length_copied;
+ u64 destination_address;
+};
+
+struct phyp_dump_header {
+ u32 version;
+ u16 num_of_sections;
+ u16 status;
+
+ u32 first_offset_section;
+ u32 dump_disk_section;
+ u64 block_num_dd;
+ u64 num_of_blocks_dd;
+ u32 offset_dd;
+ u32 maxtime_to_auto;
+ /* No dump disk path string used */
+
+ struct dump_section cpu_data;
+ struct dump_section hpte_data;
+ struct dump_section kernel_data;
+};
+
+/* The dump header *must be* in low memory, so .bss it */
+static struct phyp_dump_header phdr;
+
+#define NUM_DUMP_SECTIONS 3
+#define DUMP_HEADER_VERSION 0x1
+#define DUMP_REQUEST_FLAG 0x1
+#define DUMP_SOURCE_CPU 0x0001
+#define DUMP_SOURCE_HPTE 0x0002
+#define DUMP_SOURCE_RMO 0x0011
+
+/**
+ * init_dump_header() - initialize the header declaring a dump
+ * Returns: length of dump save area.
+ *
+ * When the hypervisor saves crashed state, it needs to put
+ * it somewhere. The dump header tells the hypervisor where
+ * the data can be saved.
+ */
+static unsigned long init_dump_header(struct phyp_dump_header *ph)
+{
+ struct device_node *rtas;
+ const unsigned int *sizes;
+ int len;
+ unsigned long cpu_state_size = 0;
+ unsigned long hpte_region_size = 0;
+ unsigned long addr_offset = 0;
+
+ /* Get the required dump region sizes */
+ rtas = of_find_node_by_path("/rtas");
+ sizes = of_get_property(rtas, "ibm,configure-kernel-dump-sizes", &len);
+ if (!sizes || len < 20)
+ return 0;
+
+ if (sizes[0] == 1)
+ cpu_state_size = *((unsigned long *) &sizes[1]);
+
+ if (sizes[3] == 2)
+ hpte_region_size = *((unsigned long *) &sizes[4]);
+
+ /* Set up the dump header */
+ ph->version = DUMP_HEADER_VERSION;
+ ph->num_of_sections = NUM_DUMP_SECTIONS;
+ ph->status = 0;
+
+ ph->first_offset_section =
+ (u32) &(((struct phyp_dump_header *) 0)->cpu_data);
+ ph->dump_disk_section = 0;
+ ph->block_num_dd = 0;
+ ph->num_of_blocks_dd = 0;
+ ph->offset_dd = 0;
+
+ ph->maxtime_to_auto = 0; /* disabled */
+
+ /* The first two sections are mandatory */
+ ph->cpu_data.dump_flags = DUMP_REQUEST_FLAG;
+ ph->cpu_data.source_type = DUMP_SOURCE_CPU;
+ ph->cpu_data.source_address = 0;
+ ph->cpu_data.source_length = cpu_state_size;
+ ph->cpu_data.destination_address = addr_offset;
+ addr_offset += cpu_state_size;
+
+ ph->hpte_data.dump_flags = DUMP_REQUEST_FLAG;
+ ph->hpte_data.source_type = DUMP_SOURCE_HPTE;
+ ph->hpte_data.source_address = 0;
+ ph->hpte_data.source_length = hpte_region_size;
+ ph->hpte_data.destination_address = addr_offset;
+ addr_offset += hpte_region_size;
+
+ /* This section describes the low kernel region */
+ ph->kernel_data.dump_flags = DUMP_REQUEST_FLAG;
+ ph->kernel_data.source_type = DUMP_SOURCE_RMO;
+ ph->kernel_data.source_address = PHYP_DUMP_RMR_START;
+ ph->kernel_data.source_length = PHYP_DUMP_RMR_END;
+ ph->kernel_data.destination_address = addr_offset;
+ addr_offset += ph->kernel_data.source_length;
+
+ return addr_offset;
+}
+
+static void register_dump_area(struct phyp_dump_header *ph, unsigned long addr)
+{
+ int rc;
+ ph->cpu_data.destination_address += addr;
+ ph->hpte_data.destination_address += addr;
+ ph->kernel_data.destination_address += addr;
+
+ do {
+ rc = rtas_call(ibm_configure_kernel_dump, 3, 1, NULL,
+ 1, ph, sizeof(struct phyp_dump_header));
+ } while (rtas_busy_delay(rc));
+
+ if (rc)
+ {
+ printk (KERN_ERR "phyp-dump: unexpected error (%d) on register\n", rc);
+ }
+}
+
+/* ------------------------------------------------- */
/**
* release_memory_range -- release memory previously lmb_reserved
* @start_pfn: starting physical frame number
@@ -125,7 +253,11 @@ static void release_all (void)
static int __init phyp_dump_setup(void)
{
struct device_node *rtas;
- const int *dump_header;
+ const struct phyp_dump_header *dump_header;
+ unsigned long dump_area_start;
+ unsigned long dump_area_length;
+ unsigned long free_area_length;
+ unsigned long start_pfn, nr_pages;
int header_len = 0;
int rc;
@@ -140,22 +272,47 @@ static int __init phyp_dump_setup(void)
return -ENOSYS;
}
- /* Is there dump data waiting for us? */
+ /* Is there dump data waiting for us? If there isn't,
+ * then register a new dump area, and release all of
+ * the rest of the reserved ram.
+ *
+ * The /rtas/ibm,kernel-dump rtas node is present only
+ * if there is dump data waiting for us.
+ */
rtas = of_find_node_by_path("/rtas");
dump_header = of_get_property(rtas, "ibm,kernel-dump", &header_len);
+
+ dump_area_length = init_dump_header (&phdr);
+ free_area_length = phyp_dump_info->init_reserve_size - dump_area_length;
+ dump_area_start = phyp_dump_info->init_reserve_start + free_area_length;
+ dump_area_start = dump_area_start & PAGE_MASK; /* align down */
+ free_area_length = dump_area_start - phyp_dump_info->init_reserve_start;
+
if (dump_header == NULL) {
- release_all();
- return 0;
+ register_dump_area (&phdr, dump_area_start);
+ goto release_mem;
}
+ /* Don't allow user to release the 256MB scratch area */
+ phyp_dump_info->init_reserve_size = free_area_length;
+
/* Should we create a dump_subsys, analogous to s390/ipl.c ? */
rc = subsys_create_file(&kernel_subsys, &rr);
if (rc) {
printk (KERN_ERR "phyp-dump: unable to create sysfs file (%d)\n", rc);
- release_all();
- return 0;
+ goto release_mem;
}
+ /* ToDo: re-register the dump area, for next time. */
+
+ return 0;
+
+release_mem:
+ /* release everything except the top 256 MB scratch area */
+ start_pfn = PFN_DOWN(phyp_dump_info->init_reserve_start);
+ nr_pages = PFN_DOWN(free_area_length);
+ release_memory_range(start_pfn, nr_pages);
+
return 0;
}
> documentation explaining what this is :-) . Yes, its supposed
> to be an improvement over kdump.
>
> The patches mostly work; a list of open issues / todo list
> is included in the documentation. It also appears that
> the not-yet-released firmware versions this was tested
> on are still, ahem, incomplete; this work is also pending.
>
> -- Linas & Manish
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ 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