linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: ELDK 4.2/kilauea/3.5+ kernel broken
       [not found] <507EF5AD.5070203__24977.4320669987$1350497770$gmane$org@gmail.com>
@ 2012-10-18 16:27 ` Robert Berger
  2012-10-18 16:33 ` Robert Berger
       [not found] ` <50802F4C.3000309__36526.1883860969$1350578085$gmane$org@gmail.com>
  2 siblings, 0 replies; 13+ messages in thread
From: Robert Berger @ 2012-10-18 16:27 UTC (permalink / raw)
  To: Robert Berger; +Cc: linuxppc-dev, mla

git bisect tells us this:

247540b03bfcbbe26b86692c9424195d76eb67f0 is the first bad commit
commit 247540b03bfcbbe26b86692c9424195d76eb67f0
Author: Mai La <mla@apm.com>
Date:   Sun Mar 18 17:59:08 2012 +0000

    powerpc/44x: Fix PCI MSI support for Maui APM821xx SoC and Bluestone
board

    This patch consists of:
    - Enable PCI MSI as default for Bluestone board
    - Change definition of number of MSI interrupts as it depends on SoC
    - Fix returning ENODEV as finding MSI node
    - Fix MSI physical high and low address
    - Keep MSI data logically

    Signed-off-by: Mai La <mla@apm.com>
    Signed-off-by: Josh Boyer <jwboyer@gmail.com>

:040000 040000 607afba6ee61212756f2bcf5acd687d6266c39a8
2868a82b0ede19c9e38ec8a571a1004e555e1098 M      arch

Which I can confirm:

this works:
git checkout 47da421981571c69ef29740cc55fa7248682e167
save this version of arch/powerpc/sysdev/ppc4xx_msi.c

this reboots:
git checkout 247540b03bfcbbe26b86692c9424195d76eb67f0

fix .config
CONFIG_PPC_DISABLE_WERROR=y
#CONDIF_PPC_WERROR is not used

cp ../ppc4xx_msi.c from 47da421981571c69ef29740cc55fa7248682e167 to
arch/powerpc/sysdev/ppc4xx_msi.c and voila this works.

Regards,

Robert

..."I don't understand why people are frightened of new ideas. It's the
old ideas that frighten me." -- John Cage

My public pgp key is available,at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x90320BF1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
       [not found] <507EF5AD.5070203__24977.4320669987$1350497770$gmane$org@gmail.com>
  2012-10-18 16:27 ` ELDK 4.2/kilauea/3.5+ kernel broken Robert Berger
@ 2012-10-18 16:33 ` Robert Berger
       [not found] ` <50802F4C.3000309__36526.1883860969$1350578085$gmane$org@gmail.com>
  2 siblings, 0 replies; 13+ messages in thread
From: Robert Berger @ 2012-10-18 16:33 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mla, Robert Berger

git bisect tells us this:

247540b03bfcbbe26b86692c9424195d76eb67f0 is the first bad commit
commit 247540b03bfcbbe26b86692c9424195d76eb67f0
Author: Mai La <mla@apm.com>
Date:   Sun Mar 18 17:59:08 2012 +0000

    powerpc/44x: Fix PCI MSI support for Maui APM821xx SoC and Bluestone
board

    This patch consists of:
    - Enable PCI MSI as default for Bluestone board
    - Change definition of number of MSI interrupts as it depends on SoC
    - Fix returning ENODEV as finding MSI node
    - Fix MSI physical high and low address
    - Keep MSI data logically

    Signed-off-by: Mai La <mla@apm.com>
    Signed-off-by: Josh Boyer <jwboyer@gmail.com>

:040000 040000 607afba6ee61212756f2bcf5acd687d6266c39a8
2868a82b0ede19c9e38ec8a571a1004e555e1098 M      arch

Which I can confirm:

this works:
git checkout 47da421981571c69ef29740cc55fa7248682e167
save this version of arch/powerpc/sysdev/ppc4xx_msi.c

this reboots:
git checkout 247540b03bfcbbe26b86692c9424195d76eb67f0

fix .config
CONFIG_PPC_DISABLE_WERROR=y
#CONDIF_PPC_WERROR is not used

cp ../ppc4xx_msi.c from 47da421981571c69ef29740cc55fa7248682e167 to
arch/powerpc/sysdev/ppc4xx_msi.c and voila this works.

Regards,

Robert

..."I don't understand why people are frightened of new ideas. It's the
old ideas that frighten me." -- John Cage

My public pgp key is available,at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x90320BF1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
       [not found] ` <50802F4C.3000309__36526.1883860969$1350578085$gmane$org@gmail.com>
@ 2012-10-18 17:45   ` Robert Berger
  2012-10-18 19:03     ` Benjamin Herrenschmidt
       [not found]     ` <1350587006.2476.12.camel__24873.815305955$1350587085$gmane$org@pasglop>
  0 siblings, 2 replies; 13+ messages in thread
From: Robert Berger @ 2012-10-18 17:45 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mla, Robert Berger, wd

[-- Attachment #1: Type: text/plain, Size: 348 bytes --]

FYI:

When I replace arch/powerpc/sysdev/ppc4xx_msi.c from a 3.6 kernel with a
ppc4xx_msi.c from 47da421981571c69ef29740cc55fa7248682e167 it boots from
nfs with a defconfig, so this seems to be the guilty one.

Please find attached the difference between the good and bad
ppc4xx_msi.c files.

I'll be happy to test your patches;)

Regards,

Robert

[-- Attachment #2: diff.txt --]
[-- Type: text/plain, Size: 4209 bytes --]

diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c
index 82c6702..1c2d7af 100644
--- a/arch/powerpc/sysdev/ppc4xx_msi.c
+++ b/arch/powerpc/sysdev/ppc4xx_msi.c
@@ -28,11 +28,10 @@
 #include <linux/of_platform.h>
 #include <linux/interrupt.h>
 #include <linux/export.h>
-#include <linux/kernel.h>
 #include <asm/prom.h>
 #include <asm/hw_irq.h>
 #include <asm/ppc-pci.h>
-#include <asm/dcr.h>
+#include <boot/dcr.h>
 #include <asm/dcr-regs.h>
 #include <asm/msi_bitmap.h>
 
@@ -44,14 +43,13 @@
 #define PEIH_FLUSH0	0x30
 #define PEIH_FLUSH1	0x38
 #define PEIH_CNTRST	0x48
-
-static int msi_irqs;
+#define NR_MSI_IRQS	4
 
 struct ppc4xx_msi {
 	u32 msi_addr_lo;
 	u32 msi_addr_hi;
 	void __iomem *msi_regs;
-	int *msi_virqs;
+	int msi_virqs[NR_MSI_IRQS];
 	struct msi_bitmap bitmap;
 	struct device_node *msi_dev;
 };
@@ -63,7 +61,7 @@ static int ppc4xx_msi_init_allocator(struct platform_device *dev,
 {
 	int err;
 
-	err = msi_bitmap_alloc(&msi_data->bitmap, msi_irqs,
+	err = msi_bitmap_alloc(&msi_data->bitmap, NR_MSI_IRQS,
 			      dev->dev.of_node);
 	if (err)
 		return err;
@@ -85,11 +83,6 @@ static int ppc4xx_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
 	struct msi_desc *entry;
 	struct ppc4xx_msi *msi_data = &ppc4xx_msi;
 
-	msi_data->msi_virqs = kmalloc((msi_irqs) * sizeof(int),
-					    GFP_KERNEL);
-	if (!msi_data->msi_virqs)
-		return -ENOMEM;
-
 	list_for_each_entry(entry, &dev->msi_list, list) {
 		int_no = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1);
 		if (int_no >= 0)
@@ -157,11 +150,12 @@ static int ppc4xx_setup_pcieh_hw(struct platform_device *dev,
 	if (!sdr_addr)
 		return -1;
 
-	mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));	/*HIGH addr */
-	mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));	/* Low addr */
+	SDR0_WRITE(sdr_addr, (u64)res.start >> 32);	 /*HIGH addr */
+	SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
+
 
 	msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
-	if (!msi->msi_dev)
+	if (msi->msi_dev)
 		return -ENODEV;
 
 	msi->msi_regs = of_iomap(msi->msi_dev, 0);
@@ -173,12 +167,9 @@ static int ppc4xx_setup_pcieh_hw(struct platform_device *dev,
 		(u32) (msi->msi_regs + PEIH_TERMADH), (u32) (msi->msi_regs));
 
 	msi_virt = dma_alloc_coherent(&dev->dev, 64, &msi_phys, GFP_KERNEL);
-	if (!msi_virt)
-		return -ENOMEM;
-	msi->msi_addr_hi = upper_32_bits(msi_phys);
-	msi->msi_addr_lo = lower_32_bits(msi_phys & 0xffffffff);
-	dev_dbg(&dev->dev, "PCIE-MSI: msi address high 0x%x, low 0x%x\n",
-		msi->msi_addr_hi, msi->msi_addr_lo);
+	msi->msi_addr_hi = 0x0;
+	msi->msi_addr_lo = (u32) msi_phys;
+	dev_dbg(&dev->dev, "PCIE-MSI: msi address 0x%x\n", msi->msi_addr_lo);
 
 	/* Progam the Interrupt handler Termination addr registers */
 	out_be32(msi->msi_regs + PEIH_TERMADH, msi->msi_addr_hi);
@@ -194,8 +185,6 @@ static int ppc4xx_setup_pcieh_hw(struct platform_device *dev,
 	out_be32(msi->msi_regs + PEIH_MSIED, *msi_data);
 	out_be32(msi->msi_regs + PEIH_MSIMK, *msi_mask);
 
-	dma_free_coherent(&dev->dev, 64, msi_virt, msi_phys);
-
 	return 0;
 }
 
@@ -205,7 +194,7 @@ static int ppc4xx_of_msi_remove(struct platform_device *dev)
 	int i;
 	int virq;
 
-	for (i = 0; i < msi_irqs; i++) {
+	for (i = 0; i < NR_MSI_IRQS; i++) {
 		virq = msi->msi_virqs[i];
 		if (virq != NO_IRQ)
 			irq_dispose_mapping(virq);
@@ -226,6 +215,8 @@ static int __devinit ppc4xx_msi_probe(struct platform_device *dev)
 	struct resource res;
 	int err = 0;
 
+	msi = &ppc4xx_msi;/*keep the msi data for further use*/
+
 	dev_dbg(&dev->dev, "PCIE-MSI: Setting up MSI support...\n");
 
 	msi = kzalloc(sizeof(struct ppc4xx_msi), GFP_KERNEL);
@@ -243,10 +234,6 @@ static int __devinit ppc4xx_msi_probe(struct platform_device *dev)
 		goto error_out;
 	}
 
-	msi_irqs = of_irq_count(dev->dev.of_node);
-	if (!msi_irqs)
-		return -ENODEV;
-
 	if (ppc4xx_setup_pcieh_hw(dev, res, msi))
 		goto error_out;
 
@@ -255,7 +242,6 @@ static int __devinit ppc4xx_msi_probe(struct platform_device *dev)
 		dev_err(&dev->dev, "Error allocating MSI bitmap\n");
 		goto error_out;
 	}
-	ppc4xx_msi = *msi;
 
 	ppc_md.setup_msi_irqs = ppc4xx_setup_msi_irqs;
 	ppc_md.teardown_msi_irqs = ppc4xx_teardown_msi_irqs;

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
  2012-10-18 17:45   ` Robert Berger
@ 2012-10-18 19:03     ` Benjamin Herrenschmidt
  2012-10-18 20:05       ` Robert Berger
       [not found]     ` <1350587006.2476.12.camel__24873.815305955$1350587085$gmane$org@pasglop>
  1 sibling, 1 reply; 13+ messages in thread
From: Benjamin Herrenschmidt @ 2012-10-18 19:03 UTC (permalink / raw)
  To: Robert Berger; +Cc: linuxppc-dev, wd, mla

On Thu, 2012-10-18 at 20:45 +0300, Robert Berger wrote:
> -       mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));      /*HIGH addr */
> -       mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));  /* Low addr */
> +       SDR0_WRITE(sdr_addr, (u64)res.start >> 32);      /*HIGH addr */
> +       SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
> +
>  
>         msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
> -       if (!msi->msi_dev)
> +       if (msi->msi_dev)
>                 return -ENODEV; 

The above changes look bad. The first one is stupid, the second one is clearly broken.

The diff us from good to bad right ? Looks like somebody added a very busted patch.

If I look at the code in current upstream, I see:

	mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));	/*HIGH addr */
	mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));	/* Low addr */

	msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
	if (!msi->msi_dev)
		return -ENODEV;


Which looks correct. So this might be something specific to ELDK ?

Cheers,
Ben.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
  2012-10-18 19:03     ` Benjamin Herrenschmidt
@ 2012-10-18 20:05       ` Robert Berger
  2012-10-19  3:16         ` Mai La
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Berger @ 2012-10-18 20:05 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, wd, mla

Hi,

On 10/18/2012 10:03 PM, Benjamin Herrenschmidt wrote:
> On Thu, 2012-10-18 at 20:45 +0300, Robert Berger wrote:
>> -       mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));      /*HIGH addr */
>> -       mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));  /* Low addr */
>> +       SDR0_WRITE(sdr_addr, (u64)res.start >> 32);      /*HIGH addr */
>> +       SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
>> +
>>  
>>         msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
>> -       if (!msi->msi_dev)
>> +       if (msi->msi_dev)
>>                 return -ENODEV; 
> 
> The above changes look bad. The first one is stupid, the second one is clearly broken.
> 
> The diff us from good to bad right ? Looks like somebody added a very busted patch.

this (from 3.6) does not work:

-       mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));      /*HIGH
addr */
-       mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));  /* Low
addr */

The good old file (which works) is this:

+       SDR0_WRITE(sdr_addr, (u64)res.start >> 32);      /*HIGH addr */
+       SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
+

> 
> If I look at the code in current upstream, I see:
> 
> 	mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));	/*HIGH addr */
> 	mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));	/* Low addr */
> 
> 	msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
> 	if (!msi->msi_dev)
> 		return -ENODEV;
> 
> 
> Which looks correct. So this might be something specific to ELDK ?

I will be on the road from tomorrow for a week or so, but maybe I can
isolate the exact lines which break it. I can also try a newer compiler
to see if this changes anything.

Is there someone out there with a kilauea board who can boot a 3.6.
mainline kernel with a default config with a rootfs over nfs?

> 
> Cheers,
> Ben.
> 
> 

Regards,

Robert

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
  2012-10-18 20:05       ` Robert Berger
@ 2012-10-19  3:16         ` Mai La
  2012-10-19  6:35           ` Robert Berger
  0 siblings, 1 reply; 13+ messages in thread
From: Mai La @ 2012-10-19  3:16 UTC (permalink / raw)
  To: Robert Berger; +Cc: wd, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 3035 bytes --]

Hi,

My patch was:

@@ -150,12 +157,11 @@ static int ppc4xx_setup_pcieh_hw(struct
platform_device *dev,
        if (!sdr_addr)
                return -1;

-       SDR0_WRITE(sdr_addr, (u64)res.start >> 32);      /*HIGH addr */
-       SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
-
+       mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));      /*HIGH addr
*/
+       mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));  /* Low addr
*/

        msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
-       if (msi->msi_dev)
+       if (!msi->msi_dev)
                return -ENODEV;

        msi->msi_regs = of_iomap(msi->msi_dev, 0);


1. The first few lines: change from SDR0_WRITE to mtdcri since the old one
cause crash. I use ELDK 4.2.

2. The second one should mean that: if not find any node then return error.
So it should be "!msi->msi_dev"

Regards,
Mai La.


On Fri, Oct 19, 2012 at 3:05 AM, Robert Berger <robert.karl.berger@gmail.com
> wrote:

> Hi,
>
> On 10/18/2012 10:03 PM, Benjamin Herrenschmidt wrote:
> > On Thu, 2012-10-18 at 20:45 +0300, Robert Berger wrote:
> >> -       mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));      /*HIGH
> addr */
> >> -       mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));  /* Low
> addr */
> >> +       SDR0_WRITE(sdr_addr, (u64)res.start >> 32);      /*HIGH addr */
> >> +       SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
> >> +
> >>
> >>         msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
> >> -       if (!msi->msi_dev)
> >> +       if (msi->msi_dev)
> >>                 return -ENODEV;
> >
> > The above changes look bad. The first one is stupid, the second one is
> clearly broken.
> >
> > The diff us from good to bad right ? Looks like somebody added a very
> busted patch.
>
> this (from 3.6) does not work:
>
> -       mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));      /*HIGH
> addr */
> -       mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));  /* Low
> addr */
>
> The good old file (which works) is this:
>
> +       SDR0_WRITE(sdr_addr, (u64)res.start >> 32);      /*HIGH addr */
> +       SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
> +
>
> >
> > If I look at the code in current upstream, I see:
> >
> >       mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));      /*HIGH
> addr */
> >       mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));  /* Low
> addr */
> >
> >       msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
> >       if (!msi->msi_dev)
> >               return -ENODEV;
> >
> >
> > Which looks correct. So this might be something specific to ELDK ?
>
> I will be on the road from tomorrow for a week or so, but maybe I can
> isolate the exact lines which break it. I can also try a newer compiler
> to see if this changes anything.
>
> Is there someone out there with a kilauea board who can boot a 3.6.
> mainline kernel with a default config with a rootfs over nfs?
>
> >
> > Cheers,
> > Ben.
> >
> >
>
> Regards,
>
> Robert
>

[-- Attachment #2: Type: text/html, Size: 3890 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
  2012-10-19  3:16         ` Mai La
@ 2012-10-19  6:35           ` Robert Berger
  0 siblings, 0 replies; 13+ messages in thread
From: Robert Berger @ 2012-10-19  6:35 UTC (permalink / raw)
  To: Mai La; +Cc: wd, linuxppc-dev

Hi,

On 10/19/2012 06:16 AM, Mai La wrote:
> Hi,
> 
> My patch was:
> 
> @@ -150,12 +157,11 @@ static int ppc4xx_setup_pcieh_hw(struct
> platform_device *dev,
>         if (!sdr_addr)
>                 return -1;
> 
> -       SDR0_WRITE(sdr_addr, (u64)res.start >> 32);      /*HIGH addr */
> -       SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
> -
> +       mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start));      /*HIGH
> addr */
> +       mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start));  /* Low
> addr */
> 
>         msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
> -       if (msi->msi_dev)
> +       if (!msi->msi_dev)
>                 return -ENODEV;
> 
>         msi->msi_regs = of_iomap(msi->msi_dev, 0);
> 
> 
> 1. The first few lines: change from SDR0_WRITE to mtdcri since the old
> one cause crash. I use ELDK 4.2.

The old one does not cause a crash for me.  As I said on a kilauea board
with ELDK 4.2 a 3.6 kernel, default config and everything reverted to
the good old file I can boot happily with a rootfs from nfs.

If I use the file as it is in 3.6 I don't see the kernel booting. but it
crashes.

> 
> 2. The second one should mean that: if not find any node then return
> error. So it should be "!msi->msi_dev"

In the 3.6 kernel it's with ! the old file (which works for me) is
without the !

... very strange ...

> 
> Regards,
> Mai La.
> 
> 

Regards,

Robert

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
       [not found]     ` <1350587006.2476.12.camel__24873.815305955$1350587085$gmane$org@pasglop>
@ 2012-10-21 15:35       ` Robert Berger
  2012-10-21 20:01         ` Benjamin Herrenschmidt
       [not found]         ` <1350849666.2476.138.camel__11705.9888471433$1350849778$gmane$org@pasglop>
  2012-10-21 15:39       ` Robert Berger
  1 sibling, 2 replies; 13+ messages in thread
From: Robert Berger @ 2012-10-21 15:35 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, wd, mla

Hi,

On 10/18/2012 10:03 PM, Benjamin Herrenschmidt wrote:
> 
> Which looks correct. So this might be something specific to ELDK ?

I just tried with the ELDK 5.2.1 and have exactly the same behavior as
with ELDK 4.2, so I guess there is something not correct in
arch/powerpc/sysdev/ppc4xx_msi.c.

Just to exclude the case that I'm doing something stupid which only
affects kernel versions 3.5+ and not 3.4 can someone else give it a try
with a kilauea board or something similar?

Regards,

Robert

> 
> Cheers,
> Ben.
> 

..."Serious programming is systems programming or anything beyond
writing factorial(n) as a student exercise." -- Brian W. Kernighan

My public pgp key is available,at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x90320BF1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
       [not found]     ` <1350587006.2476.12.camel__24873.815305955$1350587085$gmane$org@pasglop>
  2012-10-21 15:35       ` Robert Berger
@ 2012-10-21 15:39       ` Robert Berger
  1 sibling, 0 replies; 13+ messages in thread
From: Robert Berger @ 2012-10-21 15:39 UTC (permalink / raw)
  To: linuxppc-dev

Hi,

On 10/18/2012 10:03 PM, Benjamin Herrenschmidt wrote:
>
> Which looks correct. So this might be something specific to ELDK ?

I just tried with the ELDK 5.2.1 and have exactly the same behavior as
with ELDK 4.2, so I guess there is something not correct in
arch/powerpc/sysdev/ppc4xx_msi.c.

Just to exclude the case that I'm doing something stupid which only
affects kernel versions 3.5+ and not 3.4 can someone else give it a try
with a kilauea board or something similar?

Regards,

Robert

>
> Cheers,
> Ben.
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
  2012-10-21 15:35       ` Robert Berger
@ 2012-10-21 20:01         ` Benjamin Herrenschmidt
       [not found]         ` <1350849666.2476.138.camel__11705.9888471433$1350849778$gmane$org@pasglop>
  1 sibling, 0 replies; 13+ messages in thread
From: Benjamin Herrenschmidt @ 2012-10-21 20:01 UTC (permalink / raw)
  To: Robert Berger; +Cc: linuxppc-dev, wd, mla

On Sun, 2012-10-21 at 18:35 +0300, Robert Berger wrote:
> Hi,
> 
> On 10/18/2012 10:03 PM, Benjamin Herrenschmidt wrote:
> > 
> > Which looks correct. So this might be something specific to ELDK ?
> 
> I just tried with the ELDK 5.2.1 and have exactly the same behavior as
> with ELDK 4.2, so I guess there is something not correct in
> arch/powerpc/sysdev/ppc4xx_msi.c.
> 
> Just to exclude the case that I'm doing something stupid which only
> affects kernel versions 3.5+ and not 3.4 can someone else give it a try
> with a kilauea board or something similar?

Remind me what is the symptom ? A specific device isn't working ? Or the
whole kernel goes toast ? My feeling is that those patches make MSIs
work (well that's what they are supposed to do) and for some reason that
doesn't agree with whatever you have connected to the PCIe slot...

Cheers,
Ben.
 
> Regards,
> 
> Robert
> 
> > 
> > Cheers,
> > Ben.
> > 
> 
> ..."Serious programming is systems programming or anything beyond
> writing factorial(n) as a student exercise." -- Brian W. Kernighan
> 
> My public pgp key is available,at:
> http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x90320BF1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
       [not found]         ` <1350849666.2476.138.camel__11705.9888471433$1350849778$gmane$org@pasglop>
@ 2012-10-24  5:45           ` Robert Berger
  2013-01-04  4:08             ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Berger @ 2012-10-24  5:45 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, rsarmah, mla

Hi Ben,
>
> Remind me what is the symptom ? A specific device isn't working ? Or the
> whole kernel goes toast ?

The whole kernel goes toast! Just reboots without saying much before;)

> My feeling is that those patches make MSIs
> work (well that's what they are supposed to do) and for some reason that
> doesn't agree with whatever you have connected to the PCIe slot...

I have nothing connected to the PCIe slot. Just a standard kilauea eval
board with a defconfig and a 3.6 kernel, so if someone has a kilauea
board it should be very easy to reproduce.

Mai, Rupjyoti do you have a kilauea bard lying around to test?

Maybe it's the kilauea fdt?

If I hard code NR_MSI_IRQS (as it used to be) at least the kernel boots
and I can work with the board. (I don't think MSI interrupts work).

23c23
< #define DEBUG
---
>
47d46
< #define NR_MSI_IRQS	4
55c54
< 	int msi_virqs[NR_MSI_IRQS];
---
> 	int *msi_virqs;
67c66
< 	err = msi_bitmap_alloc(&msi_data->bitmap, NR_MSI_IRQS,
---
> 	err = msi_bitmap_alloc(&msi_data->bitmap, msi_irqs,
88a88,92
> 	msi_data->msi_virqs = kmalloc((msi_irqs) * sizeof(int),
> 					    GFP_KERNEL);
> 	if (!msi_data->msi_virqs)
> 		return -ENOMEM;
>
192a197,198
> 	dma_free_coherent(&dev->dev, 64, msi_virt, msi_phys);
>
202c208
< 	for (i = 0; i < NR_MSI_IRQS; i++) {
---
> 	for (i = 0; i < msi_irqs; i++) {
223,224d228
< 	/*msi = &ppc4xx_msi;*//*keep the msi data for further use*/
<

Regards,

Robert

>
> Cheers,
> Ben.
>

...If it's there, and you can see it, it's real. - If it's not there,
and you can see it, it's virtual.- If it's there, and you can't see it,
it's transparent.- If it's not there, and you can't see it, you erased
it. (from some mailing list)

My public pgp key is available,at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x90320BF1

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: ELDK 4.2/kilauea/3.5+ kernel broken
  2012-10-24  5:45           ` Robert Berger
@ 2013-01-04  4:08             ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 13+ messages in thread
From: Benjamin Herrenschmidt @ 2013-01-04  4:08 UTC (permalink / raw)
  To: Robert Berger; +Cc: linuxppc-dev, rsarmah, mla

On Wed, 2012-10-24 at 08:45 +0300, Robert Berger wrote:
> Hi Ben,
> >
> > Remind me what is the symptom ? A specific device isn't working ? Or the
> > whole kernel goes toast ?
> 
> The whole kernel goes toast! Just reboots without saying much before;)
> 
> > My feeling is that those patches make MSIs
> > work (well that's what they are supposed to do) and for some reason that
> > doesn't agree with whatever you have connected to the PCIe slot...
> 
> I have nothing connected to the PCIe slot. Just a standard kilauea eval
> board with a defconfig and a 3.6 kernel, so if someone has a kilauea
> board it should be very easy to reproduce.
> 
> Mai, Rupjyoti do you have a kilauea bard lying around to test?
> 
> Maybe it's the kilauea fdt?
> 
> If I hard code NR_MSI_IRQS (as it used to be) at least the kernel boots
> and I can work with the board. (I don't think MSI interrupts work).

Mai ? Somebody else from APM ? Can you look at this ?

Ben.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* ELDK 4.2/kilauea/3.5+ kernel broken
@ 2012-10-17 18:15 Robert Berger
  0 siblings, 0 replies; 13+ messages in thread
From: Robert Berger @ 2012-10-17 18:15 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 3240 bytes --]

Hi,

The attached patch from here:
http://thread.gmane.org/gmane.linux.ports.ppc.embedded/49637/focus=49903
works as far as I can say from > 3.2 kernels until 3.4.12 and applies
happily even on 3.5.

Unfortunately the last kernel version which boots on a kilauea with ELDK
4.2 is v3.4.12 (with the attached patch applied). BTW v3.6 does not need
the patch anymore, but exposes the same behavior as described below.

A default config with PPC_EARLY_DEBUG_40x makes the board stuck instead
of rebooting, which happens from v3.5 onwards (with patch applied):

U-Boot 2012.10-classic-rber-dirty (Oct 17 2012 - 11:35:47)

CPU:   AMCC PowerPC 405EX Rev. A at 533.333 MHz (PLB=177 OPB=88 EBC=88)
       Security support
       Bootstrap Option H - Boot ROM Location I2C (Addr 0x52)
       16 kB I-Cache 16 kB D-Cache
Board: Kilauea - AMCC PPC405EX Evaluation Board (CPLD rev. 0)
I2C:   ready
DRAM:  256 MiB (ECC not enabled, 355 MHz, CL4)
Reserving 16384k for kernel logbuffer at 0fffb000
Top of RAM usable for U-Boot at: 0fffb000
Reserving 432k for U-Boot at: 0ff8e000
Reserving 1040k for malloc() at: 0fe8a000
Reserving 132 Bytes for Board Info at: 0fe89f7c
Reserving 104 Bytes for Global Data at: 0fe89f14
Stack Pointer at: 0fe89f00
New Stack Pointer is: 0fe89f00
Now running in RAM - U-Boot at: 0ff8e000
Flash: 64 MiB
NAND:  64 MiB
PCI:   Bus Dev VenId DevId Class Int
PCIE0: link is not up.
PCIE1: link is not up.
U-Boot relocated to 0ff8e000
Net:   ppc_4xx_eth0, ppc_4xx_eth1

Hit any key to stop autoboot:  0
=> run rootfs_nfs

Waiting for PHY auto negotiation to complete... done
ENET Speed is 1000 Mbps - FULL duplex connection (EMAC0)
Using ppc_4xx_eth0 device
TFTP from server 192.168.5.5; our IP address is 192.168.5.11
Filename 'kilauea/uImage'.
Load address: 0x400000
Loading: #################################################################
         ######################################################
done
Bytes transferred = 1738410 (1a86aa hex)
Using ppc_4xx_eth0 device
TFTP from server 192.168.5.5; our IP address is 192.168.5.11
Filename 'kilauea/kilauea.dtb'.
Load address: 0x800000
Loading: #
done
Bytes transferred = 8667 (21db hex)
## Booting kernel from Legacy Image at 00400000 ...
   Image Name:   Linux-3.5.0-classic-rber-dirty
   Created:      2012-10-17  16:48:39 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1738346 Bytes = 1.7 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 00800000
   Booting using the fdt blob at 0x00800000
   Uncompressing Kernel Image ... OK
   Loading Device Tree to 00ffa000, end 00fff1da ... OK


---> here the board reboots into u-boot <---

U-Boot 2012.10-classic-rber-dirty (Oct 17 2012 - 11:35:47)

CPU:   AMCC PowerPC 405EX Rev. A at 533.333 MHz (PLB=177 OPB=88 EBC=88)
       Security support
       Bootstrap Option H - Boot ROM Location I2C (Addr 0x52)
       16 kB I-Cache 16 kB D-Cache
Board: Kilauea - AMCC PPC405EX Evaluation Board (CPLD rev. 0)
...


Please advise.

Regards,

Robert

..."Teaching of beginners should be done by a master, not by a
hack." - Deming

My public pgp key is available,at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x90320BF1



[-- Attachment #2: bake-your-noodle.patch --]
[-- Type: text/x-patch, Size: 3327 bytes --]

>From e0b1ac84bfd539482bc88b943724e577e6b8dfb3 Mon Sep 17 00:00:00 2001
From: Tony Breeds <tony@bakeyournoodle.com>
Date: Mon, 2 Apr 2012 16:20:35 +1000
Subject: [PATCH] powerpc/boot: Only build board support files when required.

Currently we build all board files regardless of the final zImage
target.  This is sub-optimal (in terms on compilation) and leads to
problems in one platform needlessly causing failures for other
platforms.

Use the Kconfig variables to selectively construct this board files to
build.

Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
 arch/powerpc/boot/Makefile |   56 +++++++++++++++++++++++++++++++++----------
 1 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index e8461cb..a3c4ae0 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -69,19 +69,49 @@ src-wlib := string.S crt0.S crtsavres.S stdio.c main.c \
 		4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
 		cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \
 		fsl-soc.c mpc8xx.c pq2.c ugecon.c
-src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \
-		cuboot-ebony.c cuboot-hotfoot.c epapr.c treeboot-ebony.c \
-		prpmc2800.c \
-		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
-		cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c \
-		cuboot-bamboo.c cuboot-mpc7448hpc2.c cuboot-taishan.c \
-		fixed-head.S ep88xc.c ep405.c cuboot-c2k.c \
-		cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
-		cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
-		virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
-		cuboot-acadia.c cuboot-amigaone.c cuboot-kilauea.c \
-		gamecube-head.S gamecube.c wii-head.S wii.c treeboot-iss4xx.c \
-		treeboot-currituck.c
+src-plat := of.c
+ifeq ($(CONFIG_40x),y)
+src-plat += fixed-head.S ep405.c cuboot-hotfoot.c treeboot-walnut.c \
+		cuboot-acadia.c cuboot-kilauea.c \
+		simpleboot.c virtex405-head.S virtex.c
+endif
+ifeq ($(CONFIG_44x),y)
+src-plat  += treeboot-ebony cuboot-ebony treeboot-bamboo cuboot-bamboo \
+		cuboot-sam440ep.c cuboot-sequoia.c cuboot-rainier.c \
+		cuboot-taishan.c cuboot-katmai.c cuboot-warp.c \
+		cuboot-yosemite.c treeboot-iss4xx.c treeboot-currituck.c \
+		simpleboot.c fixed-head.S virtex.c
+endif
+ifeq ($(CONFIG_8xx),y)
+src-plat  += cuboot-8xx.c fixed-head.S ep88xc.c redboot-8xx.c
+endif
+ifeq ($(CONFIG_PPC_MPC52xx),y)
+src-plat  += cuboot-52xx.c
+endif
+ifeq ($(CONFIG_PPC_82xx),y)
+src-plat  += cuboot-pq2.c fixed-head.S ep8248e.c cuboot-824x.c
+endif
+ifeq ($(CONFIG_PPC_82xx),y)
+src-plat  += cuboot-83xx.c fixed-head.S redboot-83xx.c
+endif
+ifeq ($(CONFIG_FSL_SOC_BOOKE),y)
+src-plat  += cuboot-85xx.c cuboot-85xx-cpm2.c
+endif
+ifeq ($(CONFIG_EMBEDDED6xx),y)
+src-plat  += cuboot-pq2.c cuboot-mpc7448hpc2.c cuboot-c2k.c \
+		gamecube-head.S gamecube.c wii-head.S wii.c holly.c \
+		prpmc2800.c
+endif
+ifeq ($(CONFIG_AMIGAONE),y)
+src-plat  += cuboot-amigaone.c
+endif
+ifeq ($(CONFIG_PPC_PS3),y)
+src-plat  += ps3-head.S ps3-hvcall.S ps3.c
+endif
+ifeq ($(CONFIG_EPAPR_BOOT),y)
+src-plat  += epapr.c
+endif
+src-plat  := $(sort $(src-plat))
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
-- 1.7.7.6 

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-01-04  4:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <507EF5AD.5070203__24977.4320669987$1350497770$gmane$org@gmail.com>
2012-10-18 16:27 ` ELDK 4.2/kilauea/3.5+ kernel broken Robert Berger
2012-10-18 16:33 ` Robert Berger
     [not found] ` <50802F4C.3000309__36526.1883860969$1350578085$gmane$org@gmail.com>
2012-10-18 17:45   ` Robert Berger
2012-10-18 19:03     ` Benjamin Herrenschmidt
2012-10-18 20:05       ` Robert Berger
2012-10-19  3:16         ` Mai La
2012-10-19  6:35           ` Robert Berger
     [not found]     ` <1350587006.2476.12.camel__24873.815305955$1350587085$gmane$org@pasglop>
2012-10-21 15:35       ` Robert Berger
2012-10-21 20:01         ` Benjamin Herrenschmidt
     [not found]         ` <1350849666.2476.138.camel__11705.9888471433$1350849778$gmane$org@pasglop>
2012-10-24  5:45           ` Robert Berger
2013-01-04  4:08             ` Benjamin Herrenschmidt
2012-10-21 15:39       ` Robert Berger
2012-10-17 18:15 Robert Berger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).