LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] of: specify initrd location using 64-bit
From: Sebastian Andrzej Siewior @ 2012-09-13  6:47 UTC (permalink / raw)
  To: Rob Herring
  Cc: linux-mips, a-jacquiot, mahesh, linux, paul.gortmaker, paulus,
	hpa, m.szyprowski, jonas, linux, linux-c6x-dev, nico, x86, mingo,
	suzuki, Cyril Chemparathy, Geert Uytterhoeven, linus.walleij,
	arnd, microblaze-uclinux, devicetree-discuss, msalter,
	rob.herring, tglx, linux-arm-kernel, blogic, dhowells, monstr,
	david.daney, linux-kernel, ralf, tj, linuxppc-dev
In-Reply-To: <505107DF.5020105@gmail.com>

On 09/13/2012 12:08 AM, Rob Herring wrote:
>> Geert is right here. If it is a physical address, it should be
>> phys_addr_t.
>
> While generally true, for the DT specific code I think it should be a
> fixed u64. The size of the address is defined by the FDT, not the
> kernel. It is very likely we could have a FDT that specifies addresses
> in 64-bit values, but then we boot a kernel is compiled for !LPAE.
> phys_addr_t is currently sized based on LPAE setting.

If your kernel is 32bit without PAE and your DTB address is >32ibt than
you can't handle it. If you don't notice this in your dt code than you
remap the wrong memory ioremap().

>
> Rob
>

Sebastian

^ permalink raw reply

* Re: [PATCH] add GXT4000P and GXT6500P support to the gxt4500 driver
From: Benjamin Herrenschmidt @ 2012-09-13  7:50 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Dan Horák, linuxppc-dev, Nico Macrionitis, Giuseppe Coviello
In-Reply-To: <CAMuHMdU2vahGBej+3Q8eBpmn1c7kU3hb1Ez4hGdY1Upn1qsygQ@mail.gmail.com>

On Thu, 2012-09-13 at 07:01 +0200, Geert Uytterhoeven wrote:
> On Thu, Sep 13, 2012 at 2:01 AM, Benjamin Herrenschmidt
> <benh@kernel.crashing.org> wrote:
> > On Wed, 2012-09-12 at 14:20 +0200, Dan Horák wrote:
> >> I'm reviving an old patch from 2009 that adds support for GXT4000P and GXT6500P
> >> adapter to the gxt4500 driver.
> >
> > Who is the original author ?
> 
> Signed-off-by: Nico Macrionitis <acrux@cruxppc.org>
> Signed-off-by: Giuseppe Coviello <cjg@cruxppc.org>
> 
> It even has your ack (albeit not in canonical form ;-), cfr.

Well, the submission had no From: line matching the top S-O-B so I'm not
sure who actually wrote the patch :-)

Cheers,
Ben

> >> See threads at http://marc.info/?l=linux-fbdev-devel&m=124345080216952&w=2
> >> and https://lists.ozlabs.org/pipermail/linuxppc-dev/2009-June/072672.html
> >> for more details.
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

^ permalink raw reply

* RE: [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23
From: Huang Changming-R66093 @ 2012-09-13  7:57 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: Wood Scott-B07421, linux-mmc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20120912033811.GA1886@lizard>

DQoNCkJlc3QgUmVnYXJkcw0KSmVycnkgSHVhbmcNCg0KDQo+IC0tLS0tT3JpZ2luYWwgTWVzc2Fn
ZS0tLS0tDQo+IEZyb206IEFudG9uIFZvcm9udHNvdiBbbWFpbHRvOmNib3VhdG1haWxydUBnbWFp
bC5jb21dDQo+IFNlbnQ6IFdlZG5lc2RheSwgU2VwdGVtYmVyIDEyLCAyMDEyIDExOjM4IEFNDQo+
IFRvOiBIdWFuZyBDaGFuZ21pbmctUjY2MDkzDQo+IENjOiBXb29kIFNjb3R0LUIwNzQyMTsgbGlu
dXhwcGMtZGV2QGxpc3RzLm96bGFicy5vcmc7IGxpbnV4LQ0KPiBtbWNAdmdlci5rZXJuZWwub3Jn
DQo+IFN1YmplY3Q6IFJlOiBbUEFUQ0ggMi8zXSBwb3dlcnBjL2VzZGhjOiBhZGQgcHJvcGVydHkg
dG8gZGlzYWJsZSB0aGUgQ01EMjMNCj4gDQo+IE9uIFdlZCwgU2VwIDEyLCAyMDEyIGF0IDAzOjE5
OjE4QU0gKzAwMDAsIEh1YW5nIENoYW5nbWluZy1SNjYwOTMgd3JvdGU6DQo+IFsuLi5dDQo+ID4g
SSBkb24ndCB0aGluayBpdCBpcyB0aGUgYmVzdCB3YXkgdG8gZG8gaXQuICBGb3IgdGhlIFZWTjIu
MiBvciBvbGRlciwNCj4gPiBzb21lIHNpbGljb24gc3VwcG9ydCB0aGlzIGZlYXR1cmUgKG1wYzg1
MzYgYW5kIHAyMDIwKSwgYnV0IG90aGVyDQo+ID4gc2lsaWNvbmVzIGRvbid0IHN1cHBvcnQgaXQg
KGUuZy4gcDQwODAsIHAxMDJ4KS4gIFRob3VnaCwgdGhlIGN1cnJlbnQNCj4gPiBwNS9wNC9wMyBo
YXMgc3VwcG9ydGVkIHRoaXMgZmVhdHVyZSwgY2FuIHdlIHN1cmUgdGhlIGZ1dHVyZSBzaWxpY29u
DQo+ID4gc3VwcG9ydCBpdD8gIFNvIEkgdGhpbmsgdGhlIGJlc3Qgd2F5IGlzIHRvIHNwZWNpZnkg
aXQgaW4gZGV2aWNlIHRyZWUNCj4gPiBhcyAnc2RoY2ksYXV0by1jbWQxMicNCj4gDQo+IEluIGFk
ZGl0aW9uIHRvIHlvdXIgY3VycmVudCBwYXRjaGVzLCB5b3UgY291bGQganVzdCBhZGQgYW5vdGhl
ciBwYXRjaA0KPiB0aGF0IGJsYWNrbGlzdHMgYWZmZWN0ZWQgU09DIHJldmlzaW9ucyBiYXNlZCBv
biB0aGUgaW5mbyBmcm9tIFBWUi9TVlIuDQo+IA0KPiBGb3IgZXhhbXBsZSwgc2VlIGdmYXJfZGV0
ZWN0X2VycmF0YSgpIGluDQo+IGRyaXZlcnMvbmV0L2V0aGVybmV0L2ZyZWVzY2FsZS9naWFuZmFy
LmMuDQo+IA0KPiBUaGF0IHdheSB5b3UgY291bGQgaGVscCB1c2VycyB0aGF0IGRvbid0IGhhdmUg
dGhlIG5ld2VzdCBkZXZpY2UgdHJlZXMuDQo+IA0KSGksIEFudG9uDQpUaGFua3MuDQpCdXQsIHRo
ZXNlIHBhdGNoZXMgYXJlIGp1c3QgZm9yIGxhdGVzdCBrZXJuZWwsIGlmIHRoZSB1c2VyIGRvbid0
IGhhdmUgdGhlIGxhdGVzdCBkZXZpY2UgdHJlZSwNClRoZW4gdGhleSBkb24ndCBoYXZlIHRoZSBs
YXRlc3Qga2VybmVsLCBhbmQgdGhlc2UgcGF0Y2hlcyBjYW4ndCBiZSB1c2VkIGZvciB0aGVtIGRp
cmVjdGx5LA0KVGhvdWdoIHByb3ZpZGUgdGhlIGZ1bmN0aW9uIGxpa2UgZ2Zhcl9kZXRlY3RfZXJy
YXRhLCB0aGV5IG11c3QgbW9kaWZ5IHRoZWlyIGNvZGVzLg0KDQpBbmQgSSBkb24ndCBrbm93IGlm
IHRoZSBmdXR1cmUgc2lsaWNvbiBjYW4gc3VwcG9ydCBDTUQyMywgaWYgbm90LCB3ZSBtdXN0IG1v
ZGlmeSBzZGhjIGRyaXZlciBhZ2Fpbi4NCldoZW4gd2UgdXNlIHRoZSBkZXZpY2UgdHJlZSB0byBp
ZGVudGlmeSBpdCwgaWYgdGhlIHNpbGljb24gZG9lcyBub3Qgc3VwcG9ydCB0aGlzIGZlYXR1cmUs
DQp3ZSBqdXN0IGFkZCB0aGlzIHByb3BlcnR5IGludG8gdGhlIG5ldyBkZXZpY2UgdHJlZSwgbm90
IG5lZWQgdG8gbW9kaWZ5IFNESEMgZHJpdmVyLg0KSSB0aGluaywgdGhpcyBpcyB0aGUgYmVzdCB3
YXkuDQogDQoNCg==

^ permalink raw reply

* [PATCH] powerpc/mpc85xx:Update interrupt handling for IFC controller
From: Prabhakar Kushwaha @ 2012-09-13  8:04 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Prabhakar Kushwaha

IFC may have one or two interrupts.  If two interrupt specifiers are present,
the first is the "common" interrupt (CM_EVTER_STAT), and the second is the NAND
interrupt (NAND_EVTER_STAT).
If there is only one, that interrupt reports both types of event.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
 Based upon git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git branch next 

 arch/powerpc/sysdev/fsl_ifc.c |   20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_ifc.c b/arch/powerpc/sysdev/fsl_ifc.c
index b31f19f..097cc9d2 100644
--- a/arch/powerpc/sysdev/fsl_ifc.c
+++ b/arch/powerpc/sysdev/fsl_ifc.c
@@ -244,12 +244,6 @@ static int __devinit fsl_ifc_ctrl_probe(struct platform_device *dev)
 	/* get the nand machine irq */
 	fsl_ifc_ctrl_dev->nand_irq =
 			irq_of_parse_and_map(dev->dev.of_node, 1);
-	if (fsl_ifc_ctrl_dev->nand_irq == NO_IRQ) {
-		dev_err(&dev->dev, "failed to get irq resource "
-						"for NAND Machine\n");
-		ret = -ENODEV;
-		goto err;
-	}
 
 	fsl_ifc_ctrl_dev->dev = &dev->dev;
 
@@ -267,12 +261,14 @@ static int __devinit fsl_ifc_ctrl_probe(struct platform_device *dev)
 		goto err_irq;
 	}
 
-	ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq, 0,
-			  "fsl-ifc-nand", fsl_ifc_ctrl_dev);
-	if (ret != 0) {
-		dev_err(&dev->dev, "failed to install irq (%d)\n",
-			fsl_ifc_ctrl_dev->nand_irq);
-		goto err_nandirq;
+	if (fsl_ifc_ctrl_dev->nand_irq) {
+		ret = request_irq(fsl_ifc_ctrl_dev->nand_irq, fsl_ifc_nand_irq,
+				0, "fsl-ifc-nand", fsl_ifc_ctrl_dev);
+		if (ret != 0) {
+			dev_err(&dev->dev, "failed to install irq (%d)\n",
+				fsl_ifc_ctrl_dev->nand_irq);
+			goto err_nandirq;
+		}
 	}
 
 	return 0;
-- 
1.7.9.5

^ permalink raw reply related

* [PATCH] driver/mtd:IFC NAND:Initialise internal SRAM before any write
From: Prabhakar Kushwaha @ 2012-09-13  8:54 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev; +Cc: scottwood, Prabhakar Kushwaha, dedekind1

IFC-1.1.0 uses 28nm techenology for SRAM. This tech has known limitaion for
SRAM i.e. "byte select" is not supported. Hence Read Modify Write is
implemented in IFC for any "system side write" into sram buffer. Reading an
uninitialized memory results in ECC Error from sram wrapper.

Hence we must initialize/prefill SRAM buffer by any data before writing
anything in SRAM from system side. To initialize SRAM user can use "READID"
NAND command with read bytes equal to SRAM size. It will be a one time
activity post boot.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
 Based upon git://git.infradead.org/linux-mtd.git branch master
 The compilation of this patch depends upon following patch.
 http://patchwork.ozlabs.org/patch/177893/
 This patch is currently applied on git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git 
 branch next and status is "Awaiting Upstream"


 drivers/mtd/nand/fsl_ifc_nand.c |   56 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 1f71b54..3d15b92 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -31,6 +31,7 @@
 #include <linux/mtd/nand_ecc.h>
 #include <asm/fsl_ifc.h>
 
+#define FSL_IFC_V1_1_0	0x01010000
 #define ERR_BYTE		0xFF /* Value returned for read
 					bytes when read failed	*/
 #define IFC_TIMEOUT_MSECS	500  /* Maximum number of mSecs to wait
@@ -775,13 +776,62 @@ static int fsl_ifc_chip_init_tail(struct mtd_info *mtd)
 	return 0;
 }
 
+static void fsl_ifc_sram_init(struct fsl_ifc_mtd *priv)
+{
+	struct fsl_ifc_ctrl *ctrl = priv->ctrl;
+	struct fsl_ifc_regs __iomem *ifc = ctrl->regs;
+	uint32_t csor = 0, csor_8k = 0, csor_ext = 0;
+	uint32_t cs = priv->bank;
+
+	/* Save CSOR and CSOR_ext */
+	csor = in_be32(&ifc->csor_cs[cs].csor);
+	csor_ext = in_be32(&ifc->csor_cs[cs].csor_ext);
+
+	/* chage PageSize 8K and SpareSize 1K*/
+	csor_8k = (csor & ~(CSOR_NAND_PGS_MASK)) | 0x0018C000;
+	out_be32(&ifc->csor_cs[cs].csor, csor_8k);
+	out_be32(&ifc->csor_cs[cs].csor_ext, 0x0000400);
+
+	/* READID */
+	out_be32(&ifc->ifc_nand.nand_fir0,
+			(IFC_FIR_OP_CMD0 << IFC_NAND_FIR0_OP0_SHIFT) |
+			(IFC_FIR_OP_UA  << IFC_NAND_FIR0_OP1_SHIFT) |
+			(IFC_FIR_OP_RB << IFC_NAND_FIR0_OP2_SHIFT));
+	out_be32(&ifc->ifc_nand.nand_fcr0,
+			NAND_CMD_READID << IFC_NAND_FCR0_CMD0_SHIFT);
+	out_be32(&ifc->ifc_nand.row3, 0x0);
+
+	out_be32(&ifc->ifc_nand.nand_fbcr, 0x0);
+
+	/* Program ROW0/COL0 */
+	out_be32(&ifc->ifc_nand.row0, 0x0);
+	out_be32(&ifc->ifc_nand.col0, 0x0);
+
+	/* set the chip select for NAND Transaction */
+	out_be32(&ifc->ifc_nand.nand_csel, cs << IFC_NAND_CSEL_SHIFT);
+
+	/* start read seq */
+	out_be32(&ifc->ifc_nand.nandseq_strt, IFC_NAND_SEQ_STRT_FIR_STRT);
+
+	/* wait for command complete flag or timeout */
+	wait_event_timeout(ctrl->nand_wait, ctrl->nand_stat,
+			   IFC_TIMEOUT_MSECS * HZ/1000);
+
+	if (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC)
+		printk(KERN_ERR "fsl-ifc: Failed to Initialise SRAM\n");
+
+	/* Restore CSOR and CSOR_ext */
+	out_be32(&ifc->csor_cs[cs].csor, csor);
+	out_be32(&ifc->csor_cs[cs].csor_ext, csor_ext);
+}
+
 static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
 {
 	struct fsl_ifc_ctrl *ctrl = priv->ctrl;
 	struct fsl_ifc_regs __iomem *ifc = ctrl->regs;
 	struct nand_chip *chip = &priv->chip;
 	struct nand_ecclayout *layout;
-	u32 csor;
+	u32 csor, ver;
 
 	/* Fill in fsl_ifc_mtd structure */
 	priv->mtd.priv = chip;
@@ -875,6 +925,10 @@ static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
 		chip->ecc.mode = NAND_ECC_SOFT;
 	}
 
+	ver = in_be32(&ifc->ifc_rev);
+	if (ver == FSL_IFC_V1_1_0)
+		fsl_ifc_sram_init(priv);
+
 	return 0;
 }
 
-- 
1.7.9.5

^ permalink raw reply related

* Re: [PATCH] add GXT4000P and GXT6500P support to the gxt4500 driver
From: Dan Horák @ 2012-09-13  9:32 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linuxppc-dev, Nico Macrionitis, Geert Uytterhoeven,
	Giuseppe Coviello
In-Reply-To: <1347522605.2276.25.camel@pasglop>

Benjamin Herrenschmidt píše v Čt 13. 09. 2012 v 17:50 +1000: 
> On Thu, 2012-09-13 at 07:01 +0200, Geert Uytterhoeven wrote:
> > On Thu, Sep 13, 2012 at 2:01 AM, Benjamin Herrenschmidt
> > <benh@kernel.crashing.org> wrote:
> > > On Wed, 2012-09-12 at 14:20 +0200, Dan Horák wrote:
> > >> I'm reviving an old patch from 2009 that adds support for GXT4000P and GXT6500P
> > >> adapter to the gxt4500 driver.
> > >
> > > Who is the original author ?
> > 
> > Signed-off-by: Nico Macrionitis <acrux@cruxppc.org>
> > Signed-off-by: Giuseppe Coviello <cjg@cruxppc.org>
> > 
> > It even has your ack (albeit not in canonical form ;-), cfr.
> 
> Well, the submission had no From: line matching the top S-O-B so I'm not
> sure who actually wrote the patch :-)

it must be one of the guys in S-O-B, I have only volunteered to resubmit
it to get it finally included in mainline


Dan

> Cheers,
> Ben
> 
> > >> See threads at http://marc.info/?l=linux-fbdev-devel&m=124345080216952&w=2
> > >> and https://lists.ozlabs.org/pipermail/linuxppc-dev/2009-June/072672.html
> > >> for more details.
> > 
> > Gr{oetje,eeting}s,
> > 
> >                         Geert
> > 
> > --
> > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> > 
> > In personal conversations with technical people, I call myself a hacker. But
> > when I'm talking to journalists I just say "programmer" or something like that.
> >                                 -- Linus Torvalds
> 
> 
> 

^ permalink raw reply

* Re: [PATCH] add GXT4000P and GXT6500P support to the gxt4500 driver
From: Nik Mak @ 2012-09-13 10:27 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Dan Horák, linuxppc-dev, Nico Macrionitis,
	Geert Uytterhoeven, Giuseppe Coviello
In-Reply-To: <1347522605.2276.25.camel@pasglop>

On Thu, 13 Sep 2012 17:50:05 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> On Thu, 2012-09-13 at 07:01 +0200, Geert Uytterhoeven wrote:
> > On Thu, Sep 13, 2012 at 2:01 AM, Benjamin Herrenschmidt
> > <benh@kernel.crashing.org> wrote:
> > > On Wed, 2012-09-12 at 14:20 +0200, Dan Hor=E1k wrote:
> > >> I'm reviving an old patch from 2009 that adds support for GXT4000P a=
nd GXT6500P
> > >> adapter to the gxt4500 driver.
> > >
> > > Who is the original author ?
> >=20
> > Signed-off-by: Nico Macrionitis <acrux@cruxppc.org>
> > Signed-off-by: Giuseppe Coviello <cjg@cruxppc.org>
> >=20
> > It even has your ack (albeit not in canonical form ;-), cfr.
>=20
> Well, the submission had no From: line matching the top S-O-B so I'm not
> sure who actually wrote the patch :-)
>=20
> Cheers,
> Ben
>=20


hi Ben,
i confirm that patch has been written/tested/submitted from Giuseppe and me=
 (CRUX PPC project).

my regards,

--nico


--=20
Sent from Genesi EfikaMX Smartbook - Freescale i.MX51 based

^ permalink raw reply

* Re: [v3][PATCH 2/3] ppc/kprobe: complete kprobe and migrate exception frame
From: tiejun.chen @ 2012-09-13 10:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1347446296.2276.0.camel@pasglop>

On 09/12/2012 06:38 PM, Benjamin Herrenschmidt wrote:
> On Wed, 2012-09-12 at 16:55 +0800, tiejun.chen wrote:
>>> to worry about nor stack frame to create etc...
>>
>> If you don't like this v4, let me know and then I can go back memcpy
>> for next
>> version.
>
> Just open code the whole copy. It should be easy really. As I said, you
> have the src and dst already in registers and you know they are aligned,
> so just put the size of the frame in a register (divided by 4), do an
> mtctr and do a little load_update/store_update loop to do the copy, all
> in the asm.

Is the following Okay?

---
  arch/powerpc/kernel/entry_32.S |   55 +++++++++++++++++++++++++++++++++++-----
  arch/powerpc/kernel/entry_64.S |   45 ++++++++++++++++++++++++++++++++
  2 files changed, 94 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index ead5016..3b56bba 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -32,6 +32,7 @@
  #include <asm/unistd.h>
  #include <asm/ftrace.h>
  #include <asm/ptrace.h>
+#include <asm/cache.h>

  #undef SHOW_SYSCALLS
  #undef SHOW_SYSCALLS_TASK
@@ -831,19 +832,63 @@ restore_user:
  	bnel-	load_dbcr0
  #endif

-#ifdef CONFIG_PREEMPT
  	b	restore

  /* N.B. the only way to get here is from the beq following ret_from_except. */
  resume_kernel:
-	/* check current_thread_info->preempt_count */
+	/* check current_thread_info, _TIF_EMULATE_STACK_STORE */
  	CURRENT_THREAD_INFO(r9, r1)
+	lwz	r8,TI_FLAGS(r9)
+	andis.	r8,r8,_TIF_EMULATE_STACK_STORE@h
+	beq+	1f
+
+	addi	r8,r1,INT_FRAME_SIZE	/* Get the kprobed function entry */
+
+	lwz	r3,GPR1(r1)
+	subi	r3,r3,INT_FRAME_SIZE	/* dst: Allocate a trampoline exception frame */
+	mr	r4,r1			/* src:  current exception frame */
+	li	r5,INT_FRAME_SIZE	/* size: INT_FRAME_SIZE */
+	li	r6,0			/* start offset: 0 */
+	mr	r1,r3			/* Reroute the trampoline frame to r1 */
+
+	/* Copy from the original to the trampoline. */
+	addi	r5,r5,-4
+	addi	r6,r6,-4
+4:	li	r0,L1_CACHE_BYTES/4
+	mtctr	r0
+3:	addi	r6,r6,4			/* copy a cache line */
+	lwzx	r0,r6,r4
+	stwx	r0,r6,r3
+	bdnz	3b
+	dcbst	r6,r3			/* write it to memory */
+	sync
+	cmplw	0,r6,r5
+	blt	4b
+
+	/* Do real store operation to complete stwu */
+	lwz	r5,GPR1(r1)
+	stw	r8,0(r5)
+
+	/* Clear _TIF_EMULATE_STACK_STORE flag */
+	lis	r11,_TIF_EMULATE_STACK_STORE@h
+	addi	r5,r9,TI_FLAGS
+0:	lwarx	r8,0,r5
+	andc	r8,r8,r11
+#ifdef CONFIG_IBM405_ERR77
+	dcbt	0,r5
+#endif
+	stwcx.	r8,0,r5
+	bne-	0b
+1:
+
+#ifdef CONFIG_PREEMPT
+	/* check current_thread_info->preempt_count */
  	lwz	r0,TI_PREEMPT(r9)
  	cmpwi	0,r0,0		/* if non-zero, just restore regs and return */
  	bne	restore
-	lwz	r0,TI_FLAGS(r9)
-	andi.	r0,r0,_TIF_NEED_RESCHED
+	andi.	r8,r8,_TIF_NEED_RESCHED
  	beq+	restore
+	lwz	r3,_MSR(r1)
  	andi.	r0,r3,MSR_EE	/* interrupts off? */
  	beq	restore		/* don't schedule if so */
  #ifdef CONFIG_TRACE_IRQFLAGS
@@ -864,8 +909,6 @@ resume_kernel:
  	 */
  	bl	trace_hardirqs_on
  #endif
-#else
-resume_kernel:
  #endif /* CONFIG_PREEMPT */

  	/* interrupts are hard-disabled at this point */
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index b40e0b4..cc43b64 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -593,6 +593,51 @@ _GLOBAL(ret_from_except_lite)
  	b	.ret_from_except

  resume_kernel:
+	/* check current_thread_info, _TIF_EMULATE_STACK_STORE */
+	CURRENT_THREAD_INFO(r9, r1)
+	ld	r8,TI_FLAGS(r9)
+	andis.	r8,r8,_TIF_EMULATE_STACK_STORE@h
+	beq+	1f
+
+	addi	r8,r1,INT_FRAME_SIZE	/* Get the kprobed function entry */
+
+	lwz	r3,GPR1(r1)
+	subi	r3,r3,INT_FRAME_SIZE	/* dst: Allocate a trampoline exception frame */
+	mr	r4,r1			/* src:  current exception frame */
+	li	r5,INT_FRAME_SIZE	/* size: INT_FRAME_SIZE */
+	li	r6,0			/* start offset: 0 */
+	mr	r1,r3			/* Reroute the trampoline frame to r1 */
+
+	/* Copy from the original to the trampoline. */
+	addi	r5,r5,-8
+	addi	r6,r6,-8
+4:	li	r0,8
+	mtctr	r0	
+3:	addi	r6,r6,8			/* copy a cache line		*/
+	ldx	r0,r6,r4
+	stdx	r0,r6,r3
+	bdnz	3b
+	dcbst	r6,r3			/* write it to memory		*/
+	sync
+	cmpld	0,r6,r5
+	blt	4b
+	sync
+
+	bl	.copy_and_flush
+
+	/* Do real store operation to complete stwu */
+	lwz	r5,GPR1(r1)
+	std	r8,0(r5)
+
+	/* Clear _TIF_EMULATE_STACK_STORE flag */
+	lis	r11,_TIF_EMULATE_STACK_STORE@h
+	addi	r5,r9,TI_FLAGS
+	ldarx	r4,0,r5
+	andc	r4,r4,r11
+	stdcx.	r4,0,r5
+	bne-	0b
+1:
+
  #ifdef CONFIG_PREEMPT
  	/* Check if we need to preempt */
  	andi.	r0,r4,_TIF_NEED_RESCHED
-- 
1.7.9.5

Tiejun

^ permalink raw reply related

* [PATCH] edac/85xx: fix error handle of mpc85xx_mc_err_probe
From: Shaohui Xie @ 2012-09-13 10:55 UTC (permalink / raw)
  To: linux-edac; +Cc: Shaohui Xie, avorontsov, linux-kernel, akpm, linuxppc-dev

Error handle in case of DDR ECC off is wrong, sysfs entries have not been
created, so edac_mc_free which frees a mci instance should not be called.
Also, free mci's memory in this case.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
---
 drivers/edac/edac_core.h    |    1 +
 drivers/edac/edac_mc.c      |   53 ++++++++++++++++++++++++++++--------------
 drivers/edac/mpc85xx_edac.c |   14 +++++++----
 3 files changed, 45 insertions(+), 23 deletions(-)

diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index 23bb99f..108c4e2 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -448,6 +448,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
 				   unsigned sz_pvt);
 extern int edac_mc_add_mc(struct mem_ctl_info *mci);
 extern void edac_mc_free(struct mem_ctl_info *mci);
+extern void edac_mc_free_mem(struct mem_ctl_info *mci);
 extern struct mem_ctl_info *edac_mc_find(int idx);
 extern struct mem_ctl_info *find_mci_by_dev(struct device *dev);
 extern struct mem_ctl_info *edac_mc_del_mc(struct device *dev);
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 616d90b..a2488b2 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -199,6 +199,40 @@ void *edac_align_ptr(void **p, unsigned size, int n_elems)
 	return (void *)(((unsigned long)ptr) + align - r);
 }
 
+/*
+ * edac_mc_free_mem
+ *	'Free' a previously allocated 'mci' memory
+ * @mci: pointer to a struct mem_ctl_info structure
+ */
+void edac_mc_free_mem(struct mem_ctl_info *mci)
+{
+	int i = 0, tot_dimms, chn, tot_channels;
+	struct csrow_info *csr;
+
+	tot_dimms = mci->tot_dimms;
+	tot_channels = mci->num_cschannel;
+
+	if (mci->dimms) {
+		for (i = 0; i < tot_dimms; i++)
+			kfree(mci->dimms[i]);
+		kfree(mci->dimms);
+	}
+	if (mci->csrows) {
+		for (chn = 0; chn < tot_channels; chn++) {
+			csr = mci->csrows[chn];
+			if (csr) {
+				for (chn = 0; chn < tot_channels; chn++)
+					kfree(csr->channels[chn]);
+				kfree(csr);
+			}
+			kfree(mci->csrows[i]);
+		}
+		kfree(mci->csrows);
+	}
+	kfree(mci);
+}
+EXPORT_SYMBOL_GPL(edac_mc_free_mem);
+
 /**
  * edac_mc_alloc: Allocate and partially fill a struct mem_ctl_info structure
  * @mc_num:		Memory controller number
@@ -413,24 +447,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
 	return mci;
 
 error:
-	if (mci->dimms) {
-		for (i = 0; i < tot_dimms; i++)
-			kfree(mci->dimms[i]);
-		kfree(mci->dimms);
-	}
-	if (mci->csrows) {
-		for (chn = 0; chn < tot_channels; chn++) {
-			csr = mci->csrows[chn];
-			if (csr) {
-				for (chn = 0; chn < tot_channels; chn++)
-					kfree(csr->channels[chn]);
-				kfree(csr);
-			}
-			kfree(mci->csrows[i]);
-		}
-		kfree(mci->csrows);
-	}
-	kfree(mci);
+	edac_mc_free_mem(mci);
 
 	return NULL;
 }
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index a1e791e..402b3f5 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -1012,7 +1012,7 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
 	if (res) {
 		printk(KERN_ERR "%s: Unable to get resource for MC err regs\n",
 		       __func__);
-		goto err;
+		goto err1;
 	}
 
 	if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r),
@@ -1020,14 +1020,14 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
 		printk(KERN_ERR "%s: Error while requesting mem region\n",
 		       __func__);
 		res = -EBUSY;
-		goto err;
+		goto err1;
 	}
 
 	pdata->mc_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r));
 	if (!pdata->mc_vbase) {
 		printk(KERN_ERR "%s: Unable to setup MC err regs\n", __func__);
 		res = -ENOMEM;
-		goto err;
+		goto err1;
 	}
 
 	sdram_ctl = in_be32(pdata->mc_vbase + MPC85XX_MC_DDR_SDRAM_CFG);
@@ -1035,7 +1035,7 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
 		/* no ECC */
 		printk(KERN_WARNING "%s: No ECC DIMMs discovered\n", __func__);
 		res = -ENODEV;
-		goto err;
+		goto err1;
 	}
 
 	edac_dbg(3, "init mci\n");
@@ -1065,7 +1065,7 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
 
 	if (edac_mc_add_mc(mci)) {
 		edac_dbg(3, "failed edac_mc_add_mc()\n");
-		goto err;
+		goto err1;
 	}
 
 	if (mpc85xx_create_sysfs_attributes(mci)) {
@@ -1115,6 +1115,10 @@ err:
 	devres_release_group(&op->dev, mpc85xx_mc_err_probe);
 	edac_mc_free(mci);
 	return res;
+err1:
+	devres_release_group(&op->dev, mpc85xx_mc_err_probe);
+	edac_mc_free_mem(mci);
+	return res;
 }
 
 static int mpc85xx_mc_err_remove(struct platform_device *op)
-- 
1.6.4

^ permalink raw reply related

* Re: [PATCH] pseries: double NR_CPUS in defconfig
From: Stephen Rothwell @ 2012-09-13 12:37 UTC (permalink / raw)
  To: Nishanth Aravamudan; +Cc: linuxppc-dev, Anton Blanchard, Paul Mackerras
In-Reply-To: <20120912174706.GE9269@linux.vnet.ibm.com>

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

Hi,

On Wed, 12 Sep 2012 10:47:07 -0700 Nishanth Aravamudan <nacc@linux.vnet.ibm.com> wrote:
>
> Anticipating growth in coming years, we should ensure we are getting a
> good lead on testing.

Most changes to pseries_defconfig are copied into ppc64_defconfig.
Should this one be as well?

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply

* Re: [PATCH 2/3] powerpc/esdhc: add property to disable the CMD23
From: Kumar Gala @ 2012-09-13 12:47 UTC (permalink / raw)
  To: Huang Changming-R66093
  Cc: linux-mmc@vger.kernel.org, Chris Ball,
	linuxppc-dev@lists.ozlabs.org list, Anton Vorontsov
In-Reply-To: <110EED8CC96DFC488B7E717A2027A27C1785D0@039-SN1MPN1-002.039d.mgd.msft.net>


On Sep 12, 2012, at 9:02 PM, Huang Changming-R66093 wrote:

>>>=20
>>>> -----Original Message-----
>>>> From: Chris Ball [mailto:cjb@laptop.org]
>>>> Sent: Wednesday, September 12, 2012 4:59 AM
>>>> To: Kumar Gala
>>>> Cc: Huang Changming-R66093; linuxppc-dev@lists.ozlabs.org list;
>>>> linux- mmc@vger.kernel.org; Anton Vorontsov
>>>> Subject: Re: [PATCH 2/3] powerpc/esdhc: add property to disable the
>>>> CMD23
>>>>=20
>>>> Hi,
>>>>=20
>>>> On Tue, Sep 11 2012, Kumar Gala wrote:
>>>>> thanks for the info.  Do you know what's required on controller =
side
>>>>> to handle cards that support CMD23?
>>>>>=20
>>>>> I'm trying to figure out if older controller's on FSL SoCs are
>>>>> missing some feature to allow CMD23 to work (vs Auto-CMD23).
>>>>=20
>>>> It seems plausible that it's just not implemented on these =
controllers.
>>>> It's a little strange, since the command's been specified for so =
long
>>>> and we haven't seen any other controllers with problems.  The patch
>>>> would be correct if this is true.
>>>>=20
>>>=20
>>> I didn't find any description about it, but after testing on FSL
>> silicones, I got this result:
>>> Some silicones support this command, and some silicones don't =
support
>> it, which will cause I/O error.
>>=20
>> Can you list out which SoCs support it and which don't.  Having this =
list
>> will be useful in understanding which controller versions supported =
it.
>>=20
> P1020, p1021, p1022, p1024, p1015 and p4080 can't support it.
> Mpc8536, p2020, and the other current DPAA silicon (e.g. p5020, p3041) =
support it.

Based on this, why don't we use the HOSTVER register to detect instead =
of device tree:


#define FSL_SDHC_VER_1_0	0x00
#define FSL_SDHC_VER_1_1	0x01
#define FSL_SDHC_VER_2_0	0x10
#define FSL_SDHC_VER_2_1	0x11
#define FSL_SDHC_VER_2_2	0x12
#define FSL_SDHC_VER_2_3	0x13

unsigned int vendor_version;

vendor_version =3D sdhci_readw(host, SDHCI_HOST_VERSION);
vendor_version =3D (vendor_version & SDHCI_VENDOR_VER_MASK) >> =
SDHCI_VENDOR_VER_SHIFT;

if ((vendor_version =3D=3D FSL_SDHC_VER_1_1) || (vendor_version =3D=3D =
FSL_SDHC_VER_2_2))
	host->quirks2 |=3D SDHCI_QUIRK2_HOST_NO_CMD23;

- k

^ permalink raw reply

* RE: [PATCH] KVM: PPC: bookehv: Allow duplicate calls of DO_KVM macro
From: Caraman Mihai Claudiu-B02008 @ 2012-09-13 12:50 UTC (permalink / raw)
  To: Wood Scott-B07421, Alexander Graf
  Cc: <linuxppc-dev@lists.ozlabs.org>,
	<kvm@vger.kernel.org>, <kvm-ppc@vger.kernel.org>
In-Reply-To: <5051048D.3080309@freescale.com>

PiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBXb29kIFNjb3R0LUIwNzQyMQ0K
PiBTZW50OiBUaHVyc2RheSwgU2VwdGVtYmVyIDEzLCAyMDEyIDEyOjU0IEFNDQo+IFRvOiBBbGV4
YW5kZXIgR3JhZg0KPiBDYzogQ2FyYW1hbiBNaWhhaSBDbGF1ZGl1LUIwMjAwODsgPGt2bS1wcGNA
dmdlci5rZXJuZWwub3JnPjsgPGxpbnV4cHBjLQ0KPiBkZXZAbGlzdHMub3psYWJzLm9yZz47IDxr
dm1Admdlci5rZXJuZWwub3JnPg0KPiBTdWJqZWN0OiBSZTogW1BBVENIXSBLVk06IFBQQzogYm9v
a2VodjogQWxsb3cgZHVwbGljYXRlIGNhbGxzIG9mIERPX0tWTQ0KPiBtYWNybw0KPiANCj4gT24g
MDkvMTIvMjAxMiAwNDo0NSBQTSwgQWxleGFuZGVyIEdyYWYgd3JvdGU6DQo+ID4NCj4gPg0KPiA+
IE9uIDEyLjA5LjIwMTIsIGF0IDIzOjM4LCBTY290dCBXb29kIDxzY290dHdvb2RAZnJlZXNjYWxl
LmNvbT4gd3JvdGU6DQo+ID4NCj4gPj4gT24gMDkvMTIvMjAxMiAwMTo1NiBQTSwgQWxleGFuZGVy
IEdyYWYgd3JvdGU6DQo+ID4+Pg0KPiA+Pj4NCj4gPj4+IE9uIDEyLjA5LjIwMTIsIGF0IDE1OjE4
LCBNaWhhaSBDYXJhbWFuIDxtaWhhaS5jYXJhbWFuQGZyZWVzY2FsZS5jb20+DQo+IHdyb3RlOg0K
PiA+Pj4NCj4gPj4+PiBUaGUgY3VycmVudCBmb3JtIG9mIERPX0tWTSBtYWNybyByZXN0cmljdHMg
aXRzIHVzZSB0byBvbmUgY2FsbCBwZXINCj4gaW5wdXQNCj4gPj4+PiBwYXJhbWV0ZXIgc2V0LiBU
aGlzIGlzIGNhdXNlZCBieSBrdm1wcGNfcmVzdW1lX1xpbnRub1woKV9cc3JyMQ0KPiBzeW1ib2wN
Cj4gPj4+PiBkZWZpbml0aW9uLg0KPiA+Pj4+IER1cGxpY2F0ZSBjYWxscyBvZiBET19LVk0gYXJl
IHJlcXVpcmVkIGJ5IGRpc3RpbmN0IGltcGxlbWVudGF0aW9ucw0KPiBvZg0KPiA+Pj4+IGV4ZXB0
aW9uIGhhbmRsZXJzIHdoaWNoIGFyZSBkZWxlZ2F0ZWQgYXQgcnVudGltZS4NCj4gPj4+DQo+ID4+
PiBOb3Qgc3VyZSBJIHVuZGVyc3RhbmQgd2hhdCB5b3UncmUgdHJ5aW5nIHRvIGFjaGlldmUgaGVy
ZS4gUGxlYXNlDQo+IGVsYWJvcmF0ZSA7KQ0KPiA+Pg0KPiA+PiBPbiA2NC1iaXQgYm9vazNlIHdl
IGNvbXBpbGUgbXVsdGlwbGUgdmVyc2lvbnMgb2YgdGhlIFRMQiBtaXNzDQo+IGhhbmRsZXJzLA0K
PiA+PiBhbmQgY2hvb3NlIGZyb20gdGhlbSBhdCBydW50aW1lLg0KDQpUaGUgZXhjZXB0aW9uIGhh
bmRsZXIgcGF0Y2hpbmcgaXMgYWN0aXZlIGluIF9fZWFybHlfaW5pdF9tbXUoKSBmdW5jdGlvbg0K
cG93ZXJwYy9tbS90bGJfbm9oYXNoLmMgZm9yIHF1aXRlIGEgZmV3IHllYXJzLiBGb3IgdGxiIG1p
c3MgZXhjZXB0aW9ucw0KdGhlcmUgYXJlIHRocmVlIGhhbmRsZXIgdmVyc2lvbnM6IHN0YW5kYXJk
LCBIVyB0YWJsZXdhbGsgYW5kIGJvbHRlZC4NCg0KPiBJIHBvc3RlZCBhIHBhdGNoIHRvIGFkZCBh
bm90aGVyIHZhcmlhbnQsIGZvciBlNjUwMC1zdHlsZSBoYXJkd2FyZQ0KPiB0YWJsZXdhbGssIHdo
aWNoIHNoYXJlcyB0aGUgYm9sdGVkIHByb2xvZy9lcGlsb2cgKGJlc2lkZXMgcHJvbG9nL2VwaWxv
Zw0KPiBwZXJmb3JtYW5jZSwgZTY1MDAgaXMgaW5jb21wYXRpYmxlIHdpdGggdGhlIElCTSB0YWJs
ZXdhbGsgY29kZSBmb3INCj4gdmFyaW91cyByZWFzb25zKS4gIFRoYXQgY2F1c2VkIHVzIHRvIGhh
dmUgdHdvIERPX0tWTXMgZm9yIHRoZSBzYW1lDQo+IGV4Y2VwdGlvbiB0eXBlLg0KDQpTb3JyeSwg
SSBtaXNzZWQgdG8gY2Mga3ZtLXBwYyBtYWlsaXN0IHdoZW4gSSByZXBsYXllZCB0byB0aGF0IGRp
c2N1c3Npb24NCnRocmVhZC4NCg0KLU1pa2UNCg==

^ permalink raw reply

* Re: [PATCH] driver/mtd:IFC NAND:Initialise internal SRAM before any write
From: Kumar Gala @ 2012-09-13 12:53 UTC (permalink / raw)
  To: Prabhakar Kushwaha; +Cc: scottwood, linuxppc-dev, linux-mtd, dedekind1
In-Reply-To: <1347526489-20186-1-git-send-email-prabhakar@freescale.com>


On Sep 13, 2012, at 3:54 AM, Prabhakar Kushwaha wrote:

> IFC-1.1.0 uses 28nm techenology for SRAM. This tech has known =
limitaion for
> SRAM i.e. "byte select" is not supported. Hence Read Modify Write is
> implemented in IFC for any "system side write" into sram buffer. =
Reading an
> uninitialized memory results in ECC Error from sram wrapper.
>=20
> Hence we must initialize/prefill SRAM buffer by any data before =
writing
> anything in SRAM from system side. To initialize SRAM user can use =
"READID"
> NAND command with read bytes equal to SRAM size. It will be a one time
> activity post boot.
>=20
> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> ---
> Based upon git://git.infradead.org/linux-mtd.git branch master
> The compilation of this patch depends upon following patch.
> http://patchwork.ozlabs.org/patch/177893/
> This patch is currently applied on =
git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git=20
> branch next and status is "Awaiting Upstream"
>=20
>=20
> drivers/mtd/nand/fsl_ifc_nand.c |   56 =
++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 55 insertions(+), 1 deletion(-)

If MTD maintainers ack, I'm happy to pull this in via PPC tree.

- k=

^ permalink raw reply

* Re: [PATCH] KVM: PPC: bookehv: Allow duplicate calls of DO_KVM macro
From: Alexander Graf @ 2012-09-13 15:02 UTC (permalink / raw)
  To: Mihai Caraman; +Cc: linuxppc-dev, kvm, kvm-ppc
In-Reply-To: <1347455894-30044-1-git-send-email-mihai.caraman@freescale.com>

On 09/12/2012 03:18 PM, Mihai Caraman wrote:
> The current form of DO_KVM macro restricts its use to one call per input
> parameter set. This is caused by kvmppc_resume_\intno\()_\srr1 symbol
> definition.
> Duplicate calls of DO_KVM are required by distinct implementations of
> exeption handlers which are delegated at runtime. Use a rare label number
> to avoid conflicts with the calling contexts.
>
> Signed-off-by: Mihai Caraman <mihai.caraman@freescale.com>

Thanks, applied to kvm-ppc-next.


Alex

^ permalink raw reply

* Re: [PATCH] pseries: double NR_CPUS in defconfig
From: Nishanth Aravamudan @ 2012-09-13 18:00 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Anton Blanchard, Paul Mackerras
In-Reply-To: <20120913223739.48f27d7fbacca32b013777fc@canb.auug.org.au>

Hi Stephen,

On 13.09.2012 [22:37:39 +1000], Stephen Rothwell wrote:
> Hi,
> 
> On Wed, 12 Sep 2012 10:47:07 -0700 Nishanth Aravamudan <nacc@linux.vnet.ibm.com> wrote:
> >
> > Anticipating growth in coming years, we should ensure we are getting
> > a good lead on testing.
> 
> Most changes to pseries_defconfig are copied into ppc64_defconfig.
> Should this one be as well?

Ah, I didn't realize that was the case, sorry. Yes, it probably does
make sense to do this change. Should I just send a follow-on patch?

Thanks,
Nish

^ permalink raw reply

* Re: [PATCH] pseries: double NR_CPUS in defconfig
From: Nishanth Aravamudan @ 2012-09-13 18:03 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Anton Blanchard, Paul Mackerras
In-Reply-To: <20120913180011.GG9269@linux.vnet.ibm.com>

On 13.09.2012 [11:00:11 -0700], Nishanth Aravamudan wrote:
> Hi Stephen,
> 
> On 13.09.2012 [22:37:39 +1000], Stephen Rothwell wrote:
> > Hi,
> > 
> > On Wed, 12 Sep 2012 10:47:07 -0700 Nishanth Aravamudan <nacc@linux.vnet.ibm.com> wrote:
> > >
> > > Anticipating growth in coming years, we should ensure we are getting
> > > a good lead on testing.
> > 
> > Most changes to pseries_defconfig are copied into ppc64_defconfig.
> > Should this one be as well?
> 
> Ah, I didn't realize that was the case, sorry. Yes, it probably does
> make sense to do this change. Should I just send a follow-on patch?

Actually, ppc64_defconfig doesn't currently define CONFIG_NR_CPUS.
NR_CPUS' powerpc Kconfig allows 2-8192 already, so given the current
state, I'm not sure any further patch is necessary?

Thanks,
Nish

^ permalink raw reply

* Re: [PATCH] powerpc/smp: Do not disable IPI interrupts during suspend
From: Kumar Gala @ 2012-09-13 18:16 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linuxppc-dev@lists.ozlabs.org list, Zhao Chenhui,
	linux-kernel@vger.kernel.org list
In-Reply-To: <1C2FF4B5-3F3C-4A9D-941D-A4BC4F5C95DE@kernel.crashing.org>


On Aug 10, 2012, at 7:40 AM, Kumar Gala wrote:

>=20
> On Aug 2, 2012, at 5:04 AM, Zhao Chenhui wrote:
>=20
>> On Sat, Jul 28, 2012 at 08:20:31AM +1000, Benjamin Herrenschmidt =
wrote:
>>> On Fri, 2012-07-27 at 16:58 -0500, Kumar Gala wrote:
>>>> On Jul 20, 2012, at 7:47 AM, Zhao Chenhui wrote:
>>>>=20
>>>>> During suspend, all interrupts including IPI will be disabled. In =
this case,
>>>>> the suspend process will hang in SMP. To prevent this, pass the =
flag
>>>>> IRQF_NO_SUSPEND when requesting IPI irq.
>>>>>=20
>>>>> Signed-off-by: Zhao Chenhui <chenhui.zhao@freescale.com>
>>>>> Signed-off-by: Li Yang <leoli@freescale.com>
>>>>> ---
>>>>> arch/powerpc/kernel/smp.c |    2 +-
>>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>=20
>>>> BenH,
>>>>=20
>>>> Can you ack?
>>>=20
>>> No I'll merge it but not until it's been in next for a bit unless =
you
>>> have some strong emergency there, it's on my mental list of things =
to
>>> shovel into next after rc1.
>>>=20
>>> Curiosity: didn't we use to disable all non-boot CPUs on suspend ?
>>>=20
>>> Cheers,
>>> Ben.
>>=20
>> Yes, we disabled all non-boot CPUs on suspend by calling =
disable_nonboot_cpus().
>> The disable_nonboot_cpus() needs IPIs to work. But prior to
>> calling disable_nonboot_cpus(), the IPIs are disabled in =
dpm_suspend_noirq().
>>=20
>> -Chenhui
>=20
> Benh, Ack?

Ben?

- k=

^ permalink raw reply

* [git pull] Please pull powerpc.git next branch
From: Kumar Gala @ 2012-09-13 18:21 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev

The following changes since commit 6b5e7229bbd59f0cfce7015fd46736fc93d8c8c3:

  powerpc/mm: Match variable types to API (2012-09-10 14:37:31 +1000)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git next

for you to fetch changes up to 905e75c46dba5f3061049277e4eb7110beedba43:

  powerpc/fsl-pci: Unify pci/pcie initialization code (2012-09-12 14:57:12 -0500)

----------------------------------------------------------------
Jia Hongtao (3):
      powerpc/swiotlb: Enable at early stage and disable if not necessary
      powerpc: add adt7461 thermal monitor support to applicable boards
      powerpc/fsl-pci: Unify pci/pcie initialization code

Kim Phillips (1):
      powerpc/85xx: add Freescale P5040 SOC and SEC v5.2 device trees

Olivia Yin (3):
      powerpc/e500v2: Add Power ISA properties to comply with ePAPR 1.1
      powerpc/e500mc: Add Power ISA properties to comply with ePAPR 1.1
      powerpc/e5500: Add Power ISA properties to comply with ePAPR 1.1

Prabhakar Kushwaha (2):
      powerpc: Update Integrated Flash controller device tree bindings
      powerpc/mpc85xx: Add new ext fields to Integrated FLash Controller

Roy Zang (2):
      powerpc/pci: Add IP revision register define for Freescale PCIe controller
      powerpc/pci: Use PCIe IP block revision register instead of compatible

Shaohui Xie (1):
      powerpc/p5040: fix dtb build warning of p5040ds.dtb

Tang Yuantian (1):
      powerpc/85xx: L2sram - Add compatible string to the device id list

Timur Tabi (4):
      powerpc/85xx: remove P1020RDB and P2020RDB CAMP device trees
      powerpc/fsl-pci: add fsl,qoriq-pcie-v2.4 compatible string
      powerpc/85xx: Add support for P5040DS board
      powerpc/85xx: introduce support for the Freescale / iVeia P1022RDK

Varun Sethi (6):
      powerpc/mpic: finish supporting timer group B on Freescale chips
      powepc/booke: Separate out E.HV check and ivor setup code.
      powerpc/booke: Merge the 32 bit e5500/e500mc cpu setup code.
      powerpc/booke: Separate out restore_e5500/setup_e5500 routines.
      powerpc/booke: Add CPU_FTR_EMB_HV check for e5500.
      powerpc/mpic: FSL MPIC error interrupt support.

Wang Dongsheng (1):
      powerpc/8544ds: add partition table for norflash

Zhao Chenhui (4):
      powerpc/85xx: Replace epapr spin table macros/defines with a struct
      powerpc/smp: add generic_set_cpu_up() to set cpu_state as CPU_UP_PREPARE
      powerpc/85xx: implement hardware timebase sync
      powerpc/85xx: add HOTPLUG_CPU support

 .../devicetree/bindings/powerpc/fsl/ifc.txt        |    9 +-
 arch/powerpc/Kconfig                               |    6 +-
 arch/powerpc/boot/dts/fsl/e500mc_power_isa.dtsi    |   58 ++++
 arch/powerpc/boot/dts/fsl/e500v2_power_isa.dtsi    |   52 ++++
 arch/powerpc/boot/dts/fsl/e5500_power_isa.dtsi     |   59 ++++
 arch/powerpc/boot/dts/fsl/mpc8536si-pre.dtsi       |    3 +
 arch/powerpc/boot/dts/fsl/mpc8544si-pre.dtsi       |    3 +
 arch/powerpc/boot/dts/fsl/mpc8548si-pre.dtsi       |    3 +
 arch/powerpc/boot/dts/fsl/mpc8568si-pre.dtsi       |    3 +
 arch/powerpc/boot/dts/fsl/mpc8569si-pre.dtsi       |    3 +
 arch/powerpc/boot/dts/fsl/mpc8572si-pre.dtsi       |    3 +
 arch/powerpc/boot/dts/fsl/p1010si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p1020si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p1021si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p1022si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p1023si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p2020si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p2041si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p3041si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p4080si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi         |    3 +
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi        |  320 ++++++++++++++++++++
 arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi         |  114 +++++++
 arch/powerpc/boot/dts/fsl/qoriq-sec5.2-0.dtsi      |  118 ++++++++
 arch/powerpc/boot/dts/mpc8536ds.dtsi               |    4 +
 arch/powerpc/boot/dts/mpc8540ads.dts               |    2 +
 arch/powerpc/boot/dts/mpc8541cds.dts               |    2 +
 arch/powerpc/boot/dts/mpc8544ds.dts                |    4 +-
 arch/powerpc/boot/dts/mpc8544ds.dtsi               |   39 +++
 arch/powerpc/boot/dts/mpc8555cds.dts               |    2 +
 arch/powerpc/boot/dts/mpc8560ads.dts               |    2 +
 arch/powerpc/boot/dts/p1020rdb_camp_core0.dts      |   63 ----
 arch/powerpc/boot/dts/p1020rdb_camp_core1.dts      |  141 ---------
 arch/powerpc/boot/dts/p1022ds.dtsi                 |    4 +
 arch/powerpc/boot/dts/p1022rdk.dts                 |  188 ++++++++++++
 arch/powerpc/boot/dts/p2020rdb_camp_core0.dts      |   67 ----
 arch/powerpc/boot/dts/p2020rdb_camp_core1.dts      |  125 --------
 arch/powerpc/boot/dts/p2041rdb.dts                 |    4 +
 arch/powerpc/boot/dts/p3041ds.dts                  |    4 +
 arch/powerpc/boot/dts/p4080ds.dts                  |    4 +
 arch/powerpc/boot/dts/p5020ds.dts                  |    4 +
 arch/powerpc/boot/dts/p5040ds.dts                  |  207 +++++++++++++
 arch/powerpc/configs/corenet32_smp_defconfig       |    1 +
 arch/powerpc/configs/corenet64_smp_defconfig       |    1 +
 arch/powerpc/configs/mpc85xx_defconfig             |    1 +
 arch/powerpc/configs/mpc85xx_smp_defconfig         |    1 +
 arch/powerpc/include/asm/cacheflush.h              |    2 +
 arch/powerpc/include/asm/fsl_guts.h                |    2 +
 arch/powerpc/include/asm/fsl_ifc.h                 |   14 +-
 arch/powerpc/include/asm/mpic.h                    |   19 ++
 arch/powerpc/include/asm/smp.h                     |    2 +
 arch/powerpc/include/asm/swiotlb.h                 |    6 +
 arch/powerpc/kernel/cpu_setup_fsl_booke.S          |   74 ++++-
 arch/powerpc/kernel/cputable.c                     |    4 +
 arch/powerpc/kernel/dma-swiotlb.c                  |   20 ++
 arch/powerpc/kernel/exceptions-64e.S               |   18 +-
 arch/powerpc/kernel/head_fsl_booke.S               |   46 ++-
 arch/powerpc/kernel/smp.c                          |   12 +-
 arch/powerpc/mm/mem.c                              |    3 +-
 arch/powerpc/platforms/44x/currituck.c             |   10 +-
 arch/powerpc/platforms/85xx/Kconfig                |   21 ++
 arch/powerpc/platforms/85xx/Makefile               |    2 +
 arch/powerpc/platforms/85xx/common.c               |   10 +
 arch/powerpc/platforms/85xx/corenet_ds.c           |   38 +--
 arch/powerpc/platforms/85xx/ge_imp3a.c             |   62 ++--
 arch/powerpc/platforms/85xx/mpc8536_ds.c           |   36 +--
 arch/powerpc/platforms/85xx/mpc85xx_ads.c          |   11 +-
 arch/powerpc/platforms/85xx/mpc85xx_cds.c          |   44 ++-
 arch/powerpc/platforms/85xx/mpc85xx_ds.c           |   15 +-
 arch/powerpc/platforms/85xx/mpc85xx_mds.c          |   40 +--
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c          |   30 +-
 arch/powerpc/platforms/85xx/p1010rdb.c             |   14 +-
 arch/powerpc/platforms/85xx/p1022_ds.c             |   36 +--
 arch/powerpc/platforms/85xx/p1022_rdk.c            |  167 ++++++++++
 arch/powerpc/platforms/85xx/p1023_rds.c            |    9 +-
 arch/powerpc/platforms/85xx/p2041_rdb.c            |    2 +-
 arch/powerpc/platforms/85xx/p3041_ds.c             |    2 +-
 arch/powerpc/platforms/85xx/p4080_ds.c             |    2 +-
 arch/powerpc/platforms/85xx/p5020_ds.c             |    2 +-
 arch/powerpc/platforms/85xx/p5040_ds.c             |   89 ++++++
 arch/powerpc/platforms/85xx/qemu_e500.c            |    5 +-
 arch/powerpc/platforms/85xx/sbc8548.c              |   21 +-
 arch/powerpc/platforms/85xx/smp.c                  |  220 +++++++++++---
 arch/powerpc/platforms/85xx/socrates.c             |   11 +-
 arch/powerpc/platforms/85xx/stx_gp3.c              |   13 +-
 arch/powerpc/platforms/85xx/tqm85xx.c              |   21 +-
 arch/powerpc/platforms/85xx/xes_mpc85xx.c          |   56 +---
 arch/powerpc/platforms/86xx/gef_ppc9a.c            |   12 +-
 arch/powerpc/platforms/86xx/gef_sbc310.c           |   13 +-
 arch/powerpc/platforms/86xx/gef_sbc610.c           |   12 +-
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c         |   21 +-
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c         |   42 +--
 arch/powerpc/platforms/86xx/sbc8641d.c             |   14 +-
 arch/powerpc/sysdev/Makefile                       |    2 +-
 arch/powerpc/sysdev/fsl_85xx_l2ctlr.c              |   10 +
 arch/powerpc/sysdev/fsl_mpic_err.c                 |  149 +++++++++
 arch/powerpc/sysdev/fsl_pci.c                      |  118 +++++---
 arch/powerpc/sysdev/fsl_pci.h                      |   20 +-
 arch/powerpc/sysdev/mpic.c                         |  102 +++++--
 arch/powerpc/sysdev/mpic.h                         |   22 ++
 drivers/edac/mpc85xx_edac.c                        |   43 +--
 101 files changed, 2421 insertions(+), 1024 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/fsl/e500mc_power_isa.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/e500v2_power_isa.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/e5500_power_isa.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/p5040si-pre.dtsi
 create mode 100644 arch/powerpc/boot/dts/fsl/qoriq-sec5.2-0.dtsi
 delete mode 100644 arch/powerpc/boot/dts/p1020rdb_camp_core0.dts
 delete mode 100644 arch/powerpc/boot/dts/p1020rdb_camp_core1.dts
 create mode 100644 arch/powerpc/boot/dts/p1022rdk.dts
 delete mode 100644 arch/powerpc/boot/dts/p2020rdb_camp_core0.dts
 delete mode 100644 arch/powerpc/boot/dts/p2020rdb_camp_core1.dts
 create mode 100644 arch/powerpc/boot/dts/p5040ds.dts
 create mode 100644 arch/powerpc/platforms/85xx/p1022_rdk.c
 create mode 100644 arch/powerpc/platforms/85xx/p5040_ds.c
 create mode 100644 arch/powerpc/sysdev/fsl_mpic_err.c

^ permalink raw reply

* Re: [PATCH] of: specify initrd location using 64-bit
From: Rob Herring @ 2012-09-13 21:02 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-mips, a-jacquiot, mahesh, linux, paul.gortmaker, paulus,
	hpa, m.szyprowski, jonas, linux, linux-c6x-dev, nico, x86, mingo,
	suzuki, Cyril Chemparathy, Geert Uytterhoeven, linus.walleij,
	arnd, microblaze-uclinux, devicetree-discuss, msalter,
	rob.herring, tglx, linux-arm-kernel, blogic, dhowells, monstr,
	david.daney, linux-kernel, ralf, tj, linuxppc-dev
In-Reply-To: <5051816A.3050705@linutronix.de>

On 09/13/2012 01:47 AM, Sebastian Andrzej Siewior wrote:
> On 09/13/2012 12:08 AM, Rob Herring wrote:
>>> Geert is right here. If it is a physical address, it should be
>>> phys_addr_t.
>>
>> While generally true, for the DT specific code I think it should be a
>> fixed u64. The size of the address is defined by the FDT, not the
>> kernel. It is very likely we could have a FDT that specifies addresses
>> in 64-bit values, but then we boot a kernel is compiled for !LPAE.
>> phys_addr_t is currently sized based on LPAE setting.
> 
> If your kernel is 32bit without PAE and your DTB address is >32ibt than
> you can't handle it. If you don't notice this in your dt code than you
> remap the wrong memory ioremap().

The size of the initrd fields are set by #address-cells properties and
determined when you create the dtb. The address to load the initrd is
decided by the bootloader/user and set at that point later in time. The
dtb should not be tied to the kernel you are booting. Obviously, if you
want to boot a non-PAE kernel, everything has to be placed at <4GB.

I can boot i386 and i386-pae kernels on an i386-pae machines. I expect
to generally be able to do that on ARM. Perhaps some SOCs like this one
will not allow that, it is not always true.

Rob

^ permalink raw reply

* Re: [v3][PATCH 2/3] ppc/kprobe: complete kprobe and migrate exception frame
From: Benjamin Herrenschmidt @ 2012-09-13 21:42 UTC (permalink / raw)
  To: tiejun.chen; +Cc: linuxppc-dev
In-Reply-To: <5051B749.5040606@windriver.com>

On Thu, 2012-09-13 at 18:36 +0800, tiejun.chen wrote:
> On 09/12/2012 06:38 PM, Benjamin Herrenschmidt wrote:
> > On Wed, 2012-09-12 at 16:55 +0800, tiejun.chen wrote:
> >>> to worry about nor stack frame to create etc...
> >>
> >> If you don't like this v4, let me know and then I can go back memcpy
> >> for next
> >> version.
> >
> > Just open code the whole copy. It should be easy really. As I said, you
> > have the src and dst already in registers and you know they are aligned,
> > so just put the size of the frame in a register (divided by 4), do an
> > mtctr and do a little load_update/store_update loop to do the copy, all
> > in the asm.
> 
> Is the following Okay?

Well, why did you bother with the flushes ? One of the main reason I
wasn't too happy with hijacking copy_and_flush is that ... you really
don't need to bother about flushing the cache :-) The flush in that
routine is about copying kernel code around and making sure the I/D
caches stay in sync.

Cheers,
Ben.

> ---
>   arch/powerpc/kernel/entry_32.S |   55 +++++++++++++++++++++++++++++++++++-----
>   arch/powerpc/kernel/entry_64.S |   45 ++++++++++++++++++++++++++++++++
>   2 files changed, 94 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
> index ead5016..3b56bba 100644
> --- a/arch/powerpc/kernel/entry_32.S
> +++ b/arch/powerpc/kernel/entry_32.S
> @@ -32,6 +32,7 @@
>   #include <asm/unistd.h>
>   #include <asm/ftrace.h>
>   #include <asm/ptrace.h>
> +#include <asm/cache.h>
> 
>   #undef SHOW_SYSCALLS
>   #undef SHOW_SYSCALLS_TASK
> @@ -831,19 +832,63 @@ restore_user:
>   	bnel-	load_dbcr0
>   #endif
> 
> -#ifdef CONFIG_PREEMPT
>   	b	restore
> 
>   /* N.B. the only way to get here is from the beq following ret_from_except. */
>   resume_kernel:
> -	/* check current_thread_info->preempt_count */
> +	/* check current_thread_info, _TIF_EMULATE_STACK_STORE */
>   	CURRENT_THREAD_INFO(r9, r1)
> +	lwz	r8,TI_FLAGS(r9)
> +	andis.	r8,r8,_TIF_EMULATE_STACK_STORE@h
> +	beq+	1f
> +
> +	addi	r8,r1,INT_FRAME_SIZE	/* Get the kprobed function entry */
> +
> +	lwz	r3,GPR1(r1)
> +	subi	r3,r3,INT_FRAME_SIZE	/* dst: Allocate a trampoline exception frame */
> +	mr	r4,r1			/* src:  current exception frame */
> +	li	r5,INT_FRAME_SIZE	/* size: INT_FRAME_SIZE */
> +	li	r6,0			/* start offset: 0 */
> +	mr	r1,r3			/* Reroute the trampoline frame to r1 */
> +
> +	/* Copy from the original to the trampoline. */
> +	addi	r5,r5,-4
> +	addi	r6,r6,-4
> +4:	li	r0,L1_CACHE_BYTES/4
> +	mtctr	r0
> +3:	addi	r6,r6,4			/* copy a cache line */
> +	lwzx	r0,r6,r4
> +	stwx	r0,r6,r3
> +	bdnz	3b
> +	dcbst	r6,r3			/* write it to memory */
> +	sync
> +	cmplw	0,r6,r5
> +	blt	4b
> +
> +	/* Do real store operation to complete stwu */
> +	lwz	r5,GPR1(r1)
> +	stw	r8,0(r5)
> +
> +	/* Clear _TIF_EMULATE_STACK_STORE flag */
> +	lis	r11,_TIF_EMULATE_STACK_STORE@h
> +	addi	r5,r9,TI_FLAGS
> +0:	lwarx	r8,0,r5
> +	andc	r8,r8,r11
> +#ifdef CONFIG_IBM405_ERR77
> +	dcbt	0,r5
> +#endif
> +	stwcx.	r8,0,r5
> +	bne-	0b
> +1:
> +
> +#ifdef CONFIG_PREEMPT
> +	/* check current_thread_info->preempt_count */
>   	lwz	r0,TI_PREEMPT(r9)
>   	cmpwi	0,r0,0		/* if non-zero, just restore regs and return */
>   	bne	restore
> -	lwz	r0,TI_FLAGS(r9)
> -	andi.	r0,r0,_TIF_NEED_RESCHED
> +	andi.	r8,r8,_TIF_NEED_RESCHED
>   	beq+	restore
> +	lwz	r3,_MSR(r1)
>   	andi.	r0,r3,MSR_EE	/* interrupts off? */
>   	beq	restore		/* don't schedule if so */
>   #ifdef CONFIG_TRACE_IRQFLAGS
> @@ -864,8 +909,6 @@ resume_kernel:
>   	 */
>   	bl	trace_hardirqs_on
>   #endif
> -#else
> -resume_kernel:
>   #endif /* CONFIG_PREEMPT */
> 
>   	/* interrupts are hard-disabled at this point */
> diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
> index b40e0b4..cc43b64 100644
> --- a/arch/powerpc/kernel/entry_64.S
> +++ b/arch/powerpc/kernel/entry_64.S
> @@ -593,6 +593,51 @@ _GLOBAL(ret_from_except_lite)
>   	b	.ret_from_except
> 
>   resume_kernel:
> +	/* check current_thread_info, _TIF_EMULATE_STACK_STORE */
> +	CURRENT_THREAD_INFO(r9, r1)
> +	ld	r8,TI_FLAGS(r9)
> +	andis.	r8,r8,_TIF_EMULATE_STACK_STORE@h
> +	beq+	1f
> +
> +	addi	r8,r1,INT_FRAME_SIZE	/* Get the kprobed function entry */
> +
> +	lwz	r3,GPR1(r1)
> +	subi	r3,r3,INT_FRAME_SIZE	/* dst: Allocate a trampoline exception frame */
> +	mr	r4,r1			/* src:  current exception frame */
> +	li	r5,INT_FRAME_SIZE	/* size: INT_FRAME_SIZE */
> +	li	r6,0			/* start offset: 0 */
> +	mr	r1,r3			/* Reroute the trampoline frame to r1 */
> +
> +	/* Copy from the original to the trampoline. */
> +	addi	r5,r5,-8
> +	addi	r6,r6,-8
> +4:	li	r0,8
> +	mtctr	r0	
> +3:	addi	r6,r6,8			/* copy a cache line		*/
> +	ldx	r0,r6,r4
> +	stdx	r0,r6,r3
> +	bdnz	3b
> +	dcbst	r6,r3			/* write it to memory		*/
> +	sync
> +	cmpld	0,r6,r5
> +	blt	4b
> +	sync
> +
> +	bl	.copy_and_flush
> +
> +	/* Do real store operation to complete stwu */
> +	lwz	r5,GPR1(r1)
> +	std	r8,0(r5)
> +
> +	/* Clear _TIF_EMULATE_STACK_STORE flag */
> +	lis	r11,_TIF_EMULATE_STACK_STORE@h
> +	addi	r5,r9,TI_FLAGS
> +	ldarx	r4,0,r5
> +	andc	r4,r4,r11
> +	stdcx.	r4,0,r5
> +	bne-	0b
> +1:
> +
>   #ifdef CONFIG_PREEMPT
>   	/* Check if we need to preempt */
>   	andi.	r0,r4,_TIF_NEED_RESCHED

^ permalink raw reply

* [PATCH 1/7] powerpc/52xx: define FSL_SOC
From: Eric Millbrandt @ 2012-09-13 21:43 UTC (permalink / raw)
  To: Grant Likely, Liam Girdwood, Mark Brown, Anatolij Gustschin
  Cc: alsa-devel, linuxppc-dev, Eric Millbrandt
In-Reply-To: <1347572596-37540-1-git-send-email-emillbrandt@dekaresearch.com>

mpc52xx socs need to have FSL_SOC defined to build their drivers (i2c-mpc, ASoC)

Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>

diff --git a/arch/powerpc/platforms/52xx/Kconfig b/arch/powerpc/platforms/52xx/Kconfig
index 90f4496..fb35944 100644
--- a/arch/powerpc/platforms/52xx/Kconfig
+++ b/arch/powerpc/platforms/52xx/Kconfig
@@ -1,6 +1,7 @@
 config PPC_MPC52xx
 	bool "52xx-based boards"
 	depends on 6xx
+	select FSL_SOC
 	select PPC_CLOCK
 	select PPC_PCI_CHOICE
 
-- 
1.7.2.5

^ permalink raw reply related

* [PATCH 3/7] ASoC: fsl: mpc5200 add missing information to snd_soc_dai_driver
From: Eric Millbrandt @ 2012-09-13 21:43 UTC (permalink / raw)
  To: Grant Likely, Liam Girdwood, Mark Brown, Anatolij Gustschin
  Cc: alsa-devel, linuxppc-dev, Eric Millbrandt
In-Reply-To: <1347572596-37540-1-git-send-email-emillbrandt@dekaresearch.com>

Add missing dai_driver information to avoid these runtime errors

[   16.433788] asoc: error - multiple DAI f0002c00.i2s registered with no name
[   16.453551] Failed to register DAI
[   16.461222] mpc5200-psc-i2s: probe of f0002c00.i2s failed with error -22
[   16.475242] asoc: error - multiple DAI f0002000.ac97 registered with no name
[   16.488087] mpc5200-psc-ac97 f0002000.ac97: Failed to register DAI
[   16.502222] mpc5200-psc-ac97: probe of f0002000.ac97 failed with error -22

Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>

diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c
index 9a09453..a313c0a 100644
--- a/sound/soc/fsl/mpc5200_psc_ac97.c
+++ b/sound/soc/fsl/mpc5200_psc_ac97.c
@@ -237,15 +237,18 @@ static const struct snd_soc_dai_ops psc_ac97_digital_ops = {
 
 static struct snd_soc_dai_driver psc_ac97_dai[] = {
 {
+	.name = "mpc5200-psc-ac97.0",
 	.ac97_control = 1,
 	.probe	= psc_ac97_probe,
 	.playback = {
+		.stream_name	= "AC97 Playback",
 		.channels_min   = 1,
 		.channels_max   = 6,
 		.rates          = SNDRV_PCM_RATE_8000_48000,
 		.formats = SNDRV_PCM_FMTBIT_S32_BE,
 	},
 	.capture = {
+		.stream_name	= "AC97 Capture",
 		.channels_min   = 1,
 		.channels_max   = 2,
 		.rates          = SNDRV_PCM_RATE_8000_48000,
@@ -254,8 +257,10 @@ static struct snd_soc_dai_driver psc_ac97_dai[] = {
 	.ops = &psc_ac97_analog_ops,
 },
 {
+	.name = "mpc5200-psc-ac97.1",
 	.ac97_control = 1,
 	.playback = {
+		.stream_name	= "AC97 SPDIF",
 		.channels_min   = 1,
 		.channels_max   = 2,
 		.rates          = SNDRV_PCM_RATE_32000 | \
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c
index c0b7a23..ba1f0a6 100644
--- a/sound/soc/fsl/mpc5200_psc_i2s.c
+++ b/sound/soc/fsl/mpc5200_psc_i2s.c
@@ -130,13 +130,16 @@ static const struct snd_soc_dai_ops psc_i2s_dai_ops = {
 };
 
 static struct snd_soc_dai_driver psc_i2s_dai[] = {{
+	.name = "mpc5200-psc-i2s.0",
 	.playback = {
+		.stream_name = "I2S Playback",
 		.channels_min = 2,
 		.channels_max = 2,
 		.rates = PSC_I2S_RATES,
 		.formats = PSC_I2S_FORMATS,
 	},
 	.capture = {
+		.stream_name = "I2S Capture",
 		.channels_min = 2,
 		.channels_max = 2,
 		.rates = PSC_I2S_RATES,
-- 
1.7.2.5

^ permalink raw reply related

* [RFC 0/7] mpc5200 ASoC and pcm030 board fixes
From: Eric Millbrandt @ 2012-09-13 21:43 UTC (permalink / raw)
  To: Grant Likely, Liam Girdwood, Mark Brown, Anatolij Gustschin
  Cc: alsa-devel, linuxppc-dev, Eric Millbrandt

This series is a respin of "mpc5200 ASoC fixups"

The mpc5200 ASoC and pcm030 board code compiled, but did not run after the
multi-codec patches.  This series add the missing pieces into the mpc5200 ASoC
drivers and updates the pcm030 board to the current api.

Eric Millbrandt (7):
  powerpc/52xx: define FSL_SOC
  ASoC: fsl: mpc5200 combine psc_dma platform data
  ASoC: fsl: mpc5200 add missing information to snd_soc_dai_driver
  ASoC: fsl: cleanup headers in pcm030-audio-fabric
  ASoC: fsl: convert pcm030-audio-fabric to a platform-driver
  ASoC: fsl: convert pcm030-audio-fabric to use snd_soc_register_card
  ASoC: fsl: register the wm9712-codec

 arch/powerpc/platforms/52xx/Kconfig |    1 +
 sound/soc/fsl/mpc5200_dma.c         |   24 ++-------
 sound/soc/fsl/mpc5200_dma.h         |    3 +
 sound/soc/fsl/mpc5200_psc_ac97.c    |   10 ++++
 sound/soc/fsl/mpc5200_psc_i2s.c     |    8 +++
 sound/soc/fsl/pcm030-audio-fabric.c |  100 +++++++++++++++++++++++++---------
 6 files changed, 99 insertions(+), 47 deletions(-)

-- 
1.7.2.5

^ permalink raw reply

* [PATCH 4/7] ASoC: fsl: cleanup headers in pcm030-audio-fabric
From: Eric Millbrandt @ 2012-09-13 21:43 UTC (permalink / raw)
  To: Grant Likely, Liam Girdwood, Mark Brown, Anatolij Gustschin
  Cc: alsa-devel, linuxppc-dev, Eric Millbrandt
In-Reply-To: <1347572596-37540-1-git-send-email-emillbrandt@dekaresearch.com>

Remove unreferenced header files.

Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>

diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c
index b3af55d..1353e8f 100644
--- a/sound/soc/fsl/pcm030-audio-fabric.c
+++ b/sound/soc/fsl/pcm030-audio-fabric.c
@@ -12,22 +12,13 @@
 
 #include <linux/init.h>
 #include <linux/module.h>
-#include <linux/interrupt.h>
 #include <linux/device.h>
-#include <linux/delay.h>
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
-#include <linux/dma-mapping.h>
 
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/initval.h>
 #include <sound/soc.h>
 
 #include "mpc5200_dma.h"
-#include "mpc5200_psc_ac97.h"
-#include "../codecs/wm9712.h"
 
 #define DRV_NAME "pcm030-audio-fabric"
 
-- 
1.7.2.5

^ permalink raw reply related

* [PATCH 2/7] ASoC: fsl: mpc5200 combine psc_dma platform data
From: Eric Millbrandt @ 2012-09-13 21:43 UTC (permalink / raw)
  To: Grant Likely, Liam Girdwood, Mark Brown, Anatolij Gustschin
  Cc: alsa-devel, linuxppc-dev, Eric Millbrandt
In-Reply-To: <1347572596-37540-1-git-send-email-emillbrandt@dekaresearch.com>

The mpc5200_psc_ac97 and mpc5200_psc_i2s modules rely on shared platform data
with mpc5200_dma.

Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com>

diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c
index 9a3f7c5..9997c03 100644
--- a/sound/soc/fsl/mpc5200_dma.c
+++ b/sound/soc/fsl/mpc5200_dma.c
@@ -370,7 +370,7 @@ static struct snd_soc_platform_driver mpc5200_audio_dma_platform = {
 	.pcm_free	= &psc_dma_free,
 };
 
-static int mpc5200_hpcd_probe(struct platform_device *op)
+int mpc5200_audio_dma_create(struct platform_device *op)
 {
 	phys_addr_t fifo;
 	struct psc_dma *psc_dma;
@@ -487,8 +487,9 @@ out_unmap:
 	iounmap(regs);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(mpc5200_audio_dma_create);
 
-static int mpc5200_hpcd_remove(struct platform_device *op)
+int mpc5200_audio_dma_destroy(struct platform_device *op)
 {
 	struct psc_dma *psc_dma = dev_get_drvdata(&op->dev);
 
@@ -510,24 +511,7 @@ static int mpc5200_hpcd_remove(struct platform_device *op)
 
 	return 0;
 }
-
-static struct of_device_id mpc5200_hpcd_match[] = {
-	{ .compatible = "fsl,mpc5200-pcm", },
-	{}
-};
-MODULE_DEVICE_TABLE(of, mpc5200_hpcd_match);
-
-static struct platform_driver mpc5200_hpcd_of_driver = {
-	.probe		= mpc5200_hpcd_probe,
-	.remove		= mpc5200_hpcd_remove,
-	.driver = {
-		.owner		= THIS_MODULE,
-		.name		= "mpc5200-pcm-audio",
-		.of_match_table    = mpc5200_hpcd_match,
-	}
-};
-
-module_platform_driver(mpc5200_hpcd_of_driver);
+EXPORT_SYMBOL_GPL(mpc5200_audio_dma_destroy);
 
 MODULE_AUTHOR("Grant Likely <grant.likely@secretlab.ca>");
 MODULE_DESCRIPTION("Freescale MPC5200 PSC in DMA mode ASoC Driver");
diff --git a/sound/soc/fsl/mpc5200_dma.h b/sound/soc/fsl/mpc5200_dma.h
index a3c0cd5..dff253f 100644
--- a/sound/soc/fsl/mpc5200_dma.h
+++ b/sound/soc/fsl/mpc5200_dma.h
@@ -81,4 +81,7 @@ to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma)
 	return &psc_dma->playback;
 }
 
+int mpc5200_audio_dma_create(struct platform_device *op);
+int mpc5200_audio_dma_destroy(struct platform_device *op);
+
 #endif /* __SOUND_SOC_FSL_MPC5200_DMA_H__ */
diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c
index ffa00a2..9a09453 100644
--- a/sound/soc/fsl/mpc5200_psc_ac97.c
+++ b/sound/soc/fsl/mpc5200_psc_ac97.c
@@ -278,6 +278,10 @@ static int __devinit psc_ac97_of_probe(struct platform_device *op)
 	struct snd_ac97 ac97;
 	struct mpc52xx_psc __iomem *regs;
 
+	rc = mpc5200_audio_dma_create(op);
+	if (rc != 0)
+		return rc;
+
 	rc = snd_soc_register_dais(&op->dev, psc_ac97_dai, ARRAY_SIZE(psc_ac97_dai));
 	if (rc != 0) {
 		dev_err(&op->dev, "Failed to register DAI\n");
@@ -303,6 +307,7 @@ static int __devinit psc_ac97_of_probe(struct platform_device *op)
 
 static int __devexit psc_ac97_of_remove(struct platform_device *op)
 {
+	mpc5200_audio_dma_destroy(op);
 	snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_ac97_dai));
 	return 0;
 }
diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c
index 7b53032..c0b7a23 100644
--- a/sound/soc/fsl/mpc5200_psc_i2s.c
+++ b/sound/soc/fsl/mpc5200_psc_i2s.c
@@ -156,6 +156,10 @@ static int __devinit psc_i2s_of_probe(struct platform_device *op)
 	struct psc_dma *psc_dma;
 	struct mpc52xx_psc __iomem *regs;
 
+	rc = mpc5200_audio_dma_create(op);
+	if (rc != 0)
+		return rc;
+
 	rc = snd_soc_register_dais(&op->dev, psc_i2s_dai, ARRAY_SIZE(psc_i2s_dai));
 	if (rc != 0) {
 		pr_err("Failed to register DAI\n");
@@ -200,6 +204,7 @@ static int __devinit psc_i2s_of_probe(struct platform_device *op)
 
 static int __devexit psc_i2s_of_remove(struct platform_device *op)
 {
+	mpc5200_audio_dma_destroy(op);
 	snd_soc_unregister_dais(&op->dev, ARRAY_SIZE(psc_i2s_dai));
 	return 0;
 }
-- 
1.7.2.5

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox