LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] drivers/macintosh/via-pmu-led.c: Add of_node_put to avoid memory leak
From: Julia Lawall @ 2010-08-29  9:52 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linuxppc-dev, devicetree-discuss, kernel-janitors, linux-kernel
In-Reply-To: <1283075566-27441-1-git-send-email-julia@diku.dk>

Add a call to of_node_put in the error handling code following a call to
of_find_node_by_path.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E,E1;
statement S;
@@

*x = 
(of_find_node_by_path
|of_find_node_by_name
|of_find_node_by_phandle
|of_get_parent
|of_get_next_parent
|of_get_next_child
|of_find_compatible_node
|of_match_node
)(...);
...
if (x == NULL) S
<... when != x = E
*if (...) {
  ... when != of_node_put(x)
      when != if (...) { ... of_node_put(x); ... }
(
  return <+...x...+>;
|
*  return ...;
)
}
...>
of_node_put(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/macintosh/via-pmu-led.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/macintosh/via-pmu-led.c b/drivers/macintosh/via-pmu-led.c
index d242976..19c3718 100644
--- a/drivers/macintosh/via-pmu-led.c
+++ b/drivers/macintosh/via-pmu-led.c
@@ -92,8 +92,10 @@ static int __init via_pmu_led_init(void)
 	if (dt == NULL)
 		return -ENODEV;
 	model = of_get_property(dt, "model", NULL);
-	if (model == NULL)
+	if (model == NULL) {
+		of_node_put(dt);
 		return -ENODEV;
+	}
 	if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 &&
 	    strncmp(model, "iBook", strlen("iBook")) != 0 &&
 	    strcmp(model, "PowerMac7,2") != 0 &&

^ permalink raw reply related

* [PATCH 6/7] arch/powerpc/platforms/maple/setup.c: Add of_node_put to avoid memory leak
From: Julia Lawall @ 2010-08-29  9:52 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: devicetree-discuss, kernel-janitors, linux-kernel, Paul Mackerras,
	linuxppc-dev
In-Reply-To: <1283075566-27441-1-git-send-email-julia@diku.dk>

Add a call to of_node_put in the error handling code following a call to
of_find_node_by_path.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E,E1;
statement S;
@@

*x = 
(of_find_node_by_path
|of_find_node_by_name
|of_find_node_by_phandle
|of_get_parent
|of_get_next_parent
|of_get_next_child
|of_find_compatible_node
|of_match_node
)(...);
...
if (x == NULL) S
<... when != x = E
*if (...) {
  ... when != of_node_put(x)
      when != if (...) { ... of_node_put(x); ... }
(
  return <+...x...+>;
|
*  return ...;
)
}
...>
of_node_put(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 arch/powerpc/platforms/maple/setup.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 3fff8d9..fe34c3d 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -358,6 +358,7 @@ static int __init maple_cpc925_edac_setup(void)
 	model = (const unsigned char *)of_get_property(np, "model", NULL);
 	if (!model) {
 		printk(KERN_ERR "%s: Unabel to get model info\n", __func__);
+		of_node_put(np);
 		return -ENODEV;
 	}
 

^ permalink raw reply related

* [PATCH 5/7] arch/powerpc/sysdev/qe_lib/qe.c: Add of_node_put to avoid memory leak
From: Julia Lawall @ 2010-08-29  9:52 UTC (permalink / raw)
  To: Timur Tabi
  Cc: devicetree-discuss, kernel-janitors, linux-kernel, Paul Mackerras,
	linuxppc-dev
In-Reply-To: <1283075566-27441-1-git-send-email-julia@diku.dk>

Add a call to of_node_put in the error handling code following a call to
of_find_compatible_node.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E,E1;
statement S;
@@

*x = 
(of_find_node_by_path
|of_find_node_by_name
|of_find_node_by_phandle
|of_get_parent
|of_get_next_parent
|of_get_next_child
|of_find_compatible_node
|of_match_node
)(...);
...
if (x == NULL) S
<... when != x = E
*if (...) {
  ... when != of_node_put(x)
      when != if (...) { ... of_node_put(x); ... }
(
  return <+...x...+>;
|
*  return ...;
)
}
...>
of_node_put(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 arch/powerpc/sysdev/qe_lib/qe.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 3da8014..90020de 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -640,6 +640,7 @@ unsigned int qe_get_num_of_snums(void)
 		if ((num_of_snums < 28) || (num_of_snums > QE_NUM_OF_SNUM)) {
 			/* No QE ever has fewer than 28 SNUMs */
 			pr_err("QE: number of snum is invalid\n");
+			of_node_put(qe);
 			return -EINVAL;
 		}
 	}

^ permalink raw reply related

* [PATCH 4/7] arch/powerpc/platforms/powermac/pfunc_core.c: Add of_node_put to avoid memory leak
From: Julia Lawall @ 2010-08-29  9:52 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: devicetree-discuss, kernel-janitors, linux-kernel, Paul Mackerras,
	linuxppc-dev
In-Reply-To: <1283075566-27441-1-git-send-email-julia@diku.dk>

Add a call to of_node_put in the error handling code following a call to
of_find_node_by_phandle.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E,E1;
statement S;
@@

*x = 
(of_find_node_by_path
|of_find_node_by_name
|of_find_node_by_phandle
|of_get_parent
|of_get_next_parent
|of_get_next_child
|of_find_compatible_node
|of_match_node
)(...);
...
if (x == NULL) S
<... when != x = E
*if (...) {
  ... when != of_node_put(x)
      when != if (...) { ... of_node_put(x); ... }
(
  return <+...x...+>;
|
*  return ...;
)
}
...>
of_node_put(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 arch/powerpc/platforms/powermac/pfunc_core.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/powermac/pfunc_core.c b/arch/powerpc/platforms/powermac/pfunc_core.c
index cec6359..b0c3777 100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
@@ -837,8 +837,10 @@ struct pmf_function *__pmf_find_function(struct device_node *target,
 		return NULL;
  find_it:
 	dev = pmf_find_device(actor);
-	if (dev == NULL)
-		return NULL;
+	if (dev == NULL) {
+		result = NULL;
+		goto out;
+	}
 
 	list_for_each_entry(func, &dev->functions, link) {
 		if (name && strcmp(name, func->name))
@@ -850,8 +852,9 @@ struct pmf_function *__pmf_find_function(struct device_node *target,
 		result = func;
 		break;
 	}
-	of_node_put(actor);
 	pmf_put_device(dev);
+out:
+	of_node_put(actor);
 	return result;
 }
 

^ permalink raw reply related

* RE: [PATCH 1/3][MTD] P4080/eLBC: Make Freescale elbc interrupt common to elbc devices
From: Artem Bityutskiy @ 2010-08-29 11:06 UTC (permalink / raw)
  To: Zang Roy-R61911
  Cc: Lan Chunhe-B25806, linuxppc-dev, akpm, linux-mtd,
	Gala Kumar-B11780
In-Reply-To: <3850A844E6A3854C827AC5C0BEC7B60A03E044@zch01exm23.fsl.freescale.net>

On Mon, 2010-08-09 at 15:33 +0800, Zang Roy-R61911 wrote:
> Any comment about this serial patches?
> If none, I'd ask Andrew to merge to his mm tree.

Could you please separate out MTD stuff, to the extent it is possible to
do?
-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)

^ permalink raw reply

* Re: [PATCH 1/5] ptp: Added a brand new class driver for ptp clocks.
From: Christian Riesch @ 2010-08-29 13:32 UTC (permalink / raw)
  To: Alan Cox
  Cc: Rodolfo Giometti, Arnd Bergmann, john stultz, Richard Cochran,
	linux-kernel, Christian Riesch, netdev, linuxppc-dev,
	devicetree-discuss, linux-arm-kernel, Krzysztof Halasa
In-Reply-To: <20100827134154.50eef56c@lxorguk.ukuu.org.uk>

Alan Cox wrote:
>> The master node in a PTP network probably takes its time from a
>> precise external time source, like GPS. The GPS provides a 1 PPS
>> directly to the PTP clock hardware, which latches the PTP hardware
>> clock time on the PPS edge. This provides one sample as input to a
>> clock servo (in the PTPd) that, in turn, regulates the PTP clock
>> hardware.
> 
> A PTP clock is TAI, Unix time is UTC.

Not necessarily. AFAIK, the time distributed by IEEE1588v2 can either be 
based on the "PTP epoch" (timePropertiesDS.ptpTimescale=TRUE) and thus 
represent TAI or be based on an implementation specific arbitrary epoch 
(timePropertiesDS.ptpTimescale=FALSE) and represent time on some 
arbitrary time scale.

Christian

^ permalink raw reply

* Re: [PATCH 2/7] drivers/serial/mpc52xx_uart.c: Add of_node_put to avoid memory leak
From: Wolfram Sang @ 2010-08-29 15:42 UTC (permalink / raw)
  To: Julia Lawall; +Cc: linuxppc-dev, kernel-janitors, linux-kernel
In-Reply-To: <1283075566-27441-3-git-send-email-julia@diku.dk>

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

On Sun, Aug 29, 2010 at 11:52:41AM +0200, Julia Lawall wrote:
> Add a call to of_node_put in the error handling code following a call to
> of_find_compatible_node.
> 
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @r exists@
> local idexpression x;
> expression E,E1;
> statement S;
> @@
> 
> *x = 
> (of_find_node_by_path
> |of_find_node_by_name
> |of_find_node_by_phandle
> |of_get_parent
> |of_get_next_parent
> |of_get_next_child
> |of_find_compatible_node
> |of_match_node
> )(...);
> ...
> if (x == NULL) S
> <... when != x = E
> *if (...) {
>   ... when != of_node_put(x)
>       when != if (...) { ... of_node_put(x); ... }
> (
>   return <+...x...+>;
> |
> *  return ...;
> )
> }
> ...>
> of_node_put(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>

Acked-by: Wolfram Sang <w.sang@pengutronix.de>

adding ppc-list to CC.

> 
> ---
>  drivers/serial/mpc52xx_uart.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
> index 8dedb26..c4399e2 100644
> --- a/drivers/serial/mpc52xx_uart.c
> +++ b/drivers/serial/mpc52xx_uart.c
> @@ -500,6 +500,7 @@ static int __init mpc512x_psc_fifoc_init(void)
>  	psc_fifoc = of_iomap(np, 0);
>  	if (!psc_fifoc) {
>  		pr_err("%s: Can't map FIFOC\n", __func__);
> +		of_node_put(np);
>  		return -ENODEV;
>  	}
>  
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

^ permalink raw reply

* Re: [PATCH 3/7] drivers/mtd/nand/mpc5121_nfc.c: Add of_node_put to avoid memory leak
From: Wolfram Sang @ 2010-08-29 15:47 UTC (permalink / raw)
  To: Julia Lawall
  Cc: David Woodhouse, devicetree-discuss, kernel-janitors,
	linux-kernel, linux-mtd, linuxppc-dev
In-Reply-To: <1283075566-27441-4-git-send-email-julia@diku.dk>

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

On Sun, Aug 29, 2010 at 11:52:42AM +0200, Julia Lawall wrote:
> Add a call to of_node_put in the error handling code following a call to
> of_find_compatible_node.
> 
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @r exists@
> local idexpression x;
> expression E,E1;
> statement S;
> @@
> 
> *x = 
> (of_find_node_by_path
> |of_find_node_by_name
> |of_find_node_by_phandle
> |of_get_parent
> |of_get_next_parent
> |of_get_next_child
> |of_find_compatible_node
> |of_match_node
> )(...);
> ...
> if (x == NULL) S
> <... when != x = E
> *if (...) {
>   ... when != of_node_put(x)
>       when != if (...) { ... of_node_put(x); ... }
> (
>   return <+...x...+>;
> |
> *  return ...;
> )
> }
> ...>
> of_node_put(x);
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>

Acked-by: Wolfram Sang <w.sang@pengutronix.de>

adding ppc-list to cc.

> 
> ---
>  drivers/mtd/nand/mpc5121_nfc.c |    7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
> index df0c1da..f4610bc 100644
> --- a/drivers/mtd/nand/mpc5121_nfc.c
> +++ b/drivers/mtd/nand/mpc5121_nfc.c
> @@ -568,6 +568,7 @@ static int mpc5121_nfc_read_hw_config(struct mtd_info *mtd)
>  	uint rcw_width;
>  	uint rcwh;
>  	uint romloc, ps;
> +	int ret = 0;
>  
>  	rmnode = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-reset");
>  	if (!rmnode) {
> @@ -579,7 +580,8 @@ static int mpc5121_nfc_read_hw_config(struct mtd_info *mtd)
>  	rm = of_iomap(rmnode, 0);
>  	if (!rm) {
>  		dev_err(prv->dev, "Error mapping reset module node!\n");
> -		return -EBUSY;
> +		ret = -EBUSY;
> +		goto out;
>  	}
>  
>  	rcwh = in_be32(&rm->rcwhr);
> @@ -628,8 +630,9 @@ static int mpc5121_nfc_read_hw_config(struct mtd_info *mtd)
>  				rcw_width * 8, rcw_pagesize,
>  				rcw_sparesize);
>  	iounmap(rm);
> +out:
>  	of_node_put(rmnode);
> -	return 0;
> +	return ret;
>  }
>  
>  /* Free driver resources */
> 
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

^ permalink raw reply

* [PATCH] arch/powerpc/platforms/83xx/mpc837x_mds.c: Add missing iounmap
From: Julia Lawall @ 2010-08-29 19:47 UTC (permalink / raw)
  To: Kumar Gala
  Cc: devicetree-discuss, kernel-janitors, linux-kernel, Paul Mackerras,
	linuxppc-dev

The function of_iomap returns the result of calling ioremap, so iounmap
should be called on the result in the error handling code, as done in the
normal exit of the function.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E,E1;
identifier l;
statement S;
@@

*x = of_iomap(...);
...  when != iounmap(x)
     when != if (...) { ... iounmap(x); ... }
     when != E = x
     when any
(
if (x == NULL) S
|
if (...) {
  ... when != iounmap(x)
      when != if (...) { ... iounmap(x); ... }
(
  return <+...x...+>;
|
*  return ...;
)
}
)
... when != x = E1
    when any
iounmap(x);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 arch/powerpc/platforms/83xx/mpc837x_mds.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index f9751c8..8306832 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -48,8 +48,10 @@ static int mpc837xmds_usb_cfg(void)
 		return -1;
 
 	np = of_find_node_by_name(NULL, "usb");
-	if (!np)
-		return -ENODEV;
+	if (!np) {
+		ret = -ENODEV;
+		goto out;
+	}
 	phy_type = of_get_property(np, "phy_type", NULL);
 	if (phy_type && !strcmp(phy_type, "ulpi")) {
 		clrbits8(bcsr_regs + 12, BCSR12_USB_SER_PIN);
@@ -65,8 +67,9 @@ static int mpc837xmds_usb_cfg(void)
 	}
 
 	of_node_put(np);
+out:
 	iounmap(bcsr_regs);
-	return 0;
+	return ret;
 }
 
 /* ************************************************************************

^ permalink raw reply related

* Re: [PATCH] powerpc: Check end of stack canary at oops time
From: Benjamin Herrenschmidt @ 2010-08-30  0:18 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: linuxppc-dev
In-Reply-To: <20100824231528.GC28360@kryten>

On Wed, 2010-08-25 at 09:15 +1000, Anton Blanchard wrote:

>  	/* Are we prepared to handle this fault?  */
>  	if ((entry = search_exception_tables(regs->nip)) != NULL) {
> @@ -413,5 +415,9 @@ void bad_page_fault(struct pt_regs *regs
>  	printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n",
>  		regs->nip);
>  
> +	stackend = end_of_stack(current);
> +	if (current != &init_task && *stackend != STACK_END_MAGIC)
> +		printk(KERN_ALERT "Thread overran stack, or stack corrupted\n");
> +
>  	die("Kernel access of bad area", regs, sig);
>  }

Is it worth making it a __get_user or similar just in case ? I suppose
if the stack is really busted we wouldn't even have reached that
code ...

Cheers,
Ben.

^ permalink raw reply

* MPC85xx - accessing external interrupt
From: deebul nair @ 2010-08-30  6:02 UTC (permalink / raw)
  To: linuxppc-dev

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

Hi all

I am trying to use the external interrupts on the Powerpc architecture
MPC8542 .

My  problem is that my driver is trying to request the external
interrupt IRQ1, and I dont know what number use in INTR_NUM:

request_irq(INTR_NUM, , , , )

As per the MPC85xx documentation
Documentation/powerpc/dts-bindings/fsl/mpic.txt
about the implementation of interrupts virtual numbers
the external interrupt virtual irq number for IRQ1 should be 1

but when i try to give INTR_NUM ins request_irq as 1 it gives error .

When i use irq_create_mapping() it gives me output as 16.. and it registers
.. but the problem is it is not fixed
neither it gives interrupts .
when i remove and add it registers to some other addresses

i even tried irq_of_parse_map()

for_each_node_by_type(np,"interrupt-controller"){
    if(of_device_is_compatible(np,"chrp,open-pic")){
           found=np;
           break;
}
}

virq = irq_of_parse_and_map(found, irq);

this always returns 0
whatever may be the irq value..
as a result the driver gives error for irq 0



-- 
Cheeers

Deebul !!!!!!

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

^ permalink raw reply

* Re: Power machines fail to boot after build being successful
From: divya @ 2010-08-30  6:13 UTC (permalink / raw)
  To: LKML; +Cc: linuxppc-dev, mikey, linux-next
In-Reply-To: <20100827120144.1736a2f6.sfr@canb.auug.org.au>

On Friday 27 August 2010 07:31 AM, Stephen Rothwell wrote:
> Hi Mikey,
>
> On Fri, 27 Aug 2010 11:15:46 +1000 Michael Neuling<mikey@neuling.org>  wrote:
>    
>>      
>>> After successfully building the kernel version
>>> 2.6.36-rc2-git4(commitid d4348c678977c) with the config file
>>> attached(used make oldconfig), P5 and P6 power machines fails to
>>> reboot with the following logs
>>>
>>> Logs collected while rebooting into today next, same occurs with the
>>> upstream kernel too.
>>>        
>> This will fix your problem:
>> http://patchwork.ozlabs.org/patch/62757/
>>      
> I have seen something similar in my linux-next boot tests, so I will add
> this patch to linux-next for today.
>    
Hi,

The same problem occurs on the linux-tree , now that since the patch is integrated into linux-next,
im not able to find the problem with linux-next-20100827.

When will the patch be integrated with the linux-tree.

Thanks
Divya

^ permalink raw reply

* Re: Power machines fail to boot after build being successful
From: Michael Neuling @ 2010-08-30  6:49 UTC (permalink / raw)
  To: divya; +Cc: linuxppc-dev, linux-next, LKML
In-Reply-To: <4C7B4C1F.7010003@linux.vnet.ibm.com>

In message <4C7B4C1F.7010003@linux.vnet.ibm.com> you wrote:
> On Friday 27 August 2010 07:31 AM, Stephen Rothwell wrote:
> > Hi Mikey,
> >
> > On Fri, 27 Aug 2010 11:15:46 +1000 Michael Neuling<mikey@neuling.org>  wrot
e:
> >    
> >>      
> >>> After successfully building the kernel version
> >>> 2.6.36-rc2-git4(commitid d4348c678977c) with the config file
> >>> attached(used make oldconfig), P5 and P6 power machines fails to
> >>> reboot with the following logs
> >>>
> >>> Logs collected while rebooting into today next, same occurs with the
> >>> upstream kernel too.
> >>>        
> >> This will fix your problem:
> >> http://patchwork.ozlabs.org/patch/62757/
> >>      
> > I have seen something similar in my linux-next boot tests, so I will add
> > this patch to linux-next for today.
> >    
> Hi,
> 
> The same problem occurs on the linux-tree , now that since the patch
> is integrated into linux-next, im not able to find the problem with
> linux-next-20100827.
> 
> When will the patch be integrated with the linux-tree.

By "the linux-tree" do you mean Linus' tree?

If so, benh is likely to ask Linus to pull the fix in the next few days.

Mikey

^ permalink raw reply

* Re: Power machines fail to boot after build being successful
From: divya @ 2010-08-30  7:35 UTC (permalink / raw)
  To: Michael Neuling; +Cc: linuxppc-dev, linux-next, LKML
In-Reply-To: <21473.1283150987@neuling.org>

On Monday 30 August 2010 12:19 PM, Michael Neuling wrote:
> In message<4C7B4C1F.7010003@linux.vnet.ibm.com>  you wrote:
>    
>> On Friday 27 August 2010 07:31 AM, Stephen Rothwell wrote:
>>      
>>> Hi Mikey,
>>>
>>> On Fri, 27 Aug 2010 11:15:46 +1000 Michael Neuling<mikey@neuling.org>   wrot
>>>        
> e:
>    
>>>
>>>        
>>>>
>>>>          
>>>>> After successfully building the kernel version
>>>>> 2.6.36-rc2-git4(commitid d4348c678977c) with the config file
>>>>> attached(used make oldconfig), P5 and P6 power machines fails to
>>>>> reboot with the following logs
>>>>>
>>>>> Logs collected while rebooting into today next, same occurs with the
>>>>> upstream kernel too.
>>>>>
>>>>>            
>>>> This will fix your problem:
>>>> http://patchwork.ozlabs.org/patch/62757/
>>>>
>>>>          
>>> I have seen something similar in my linux-next boot tests, so I will add
>>> this patch to linux-next for today.
>>>
>>>        
>> Hi,
>>
>> The same problem occurs on the linux-tree , now that since the patch
>> is integrated into linux-next, im not able to find the problem with
>> linux-next-20100827.
>>
>> When will the patch be integrated with the linux-tree.
>>      
> By "the linux-tree" do you mean Linus' tree?
>
> If so, benh is likely to ask Linus to pull the fix in the next few days.
>
> Mikey
>    
Yes i mean to say Linus' tree.ccing benh.

Divya

^ permalink raw reply

* [PATCH] KVM: PPC: Fix CONFIG_KVM_GUEST && !CONFIG_KVM case
From: Alexander Graf @ 2010-08-30 10:01 UTC (permalink / raw)
  To: kvm-ppc; +Cc: linuxppc-dev, KVM list

When CONFIG_KVM_GUEST is selected, but CONFIG_KVM is not, we were missing
some defines in asm-offsets.c and included too many headers at other places.

This patch makes above configuration work.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/kernel/asm-offsets.c |    6 +++---
 arch/powerpc/kernel/kvm.c         |    1 -
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 5e54d0f..893ba35 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -48,11 +48,11 @@
 #ifdef CONFIG_PPC_ISERIES
 #include <asm/iseries/alpaca.h>
 #endif
-#ifdef CONFIG_KVM
+#if defined(CONFIG_KVM) || defined(CONFIG_KVM_GUEST)
 #include <linux/kvm_host.h>
-#ifndef CONFIG_BOOKE
-#include <asm/kvm_book3s.h>
 #endif
+#if defined(CONFIG_KVM) && defined(CONFIG_PPC_BOOK3S)
+#include <asm/kvm_book3s.h>
 #endif
 
 #ifdef CONFIG_PPC32
diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
index 293765a..428d0e5 100644
--- a/arch/powerpc/kernel/kvm.c
+++ b/arch/powerpc/kernel/kvm.c
@@ -25,7 +25,6 @@
 #include <linux/of.h>
 
 #include <asm/reg.h>
-#include <asm/kvm_ppc.h>
 #include <asm/sections.h>
 #include <asm/cacheflush.h>
 #include <asm/disassemble.h>
-- 
1.6.0.2

^ permalink raw reply related

* Re: [PATCH] KVM: PPC: Fix CONFIG_KVM_GUEST && !CONFIG_KVM case
From: Avi Kivity @ 2010-08-30 10:55 UTC (permalink / raw)
  To: Alexander Graf; +Cc: linuxppc-dev, KVM list, kvm-ppc
In-Reply-To: <1283162516-29879-1-git-send-email-agraf@suse.de>

  On 08/30/2010 01:01 PM, Alexander Graf wrote:
> When CONFIG_KVM_GUEST is selected, but CONFIG_KVM is not, we were missing
> some defines in asm-offsets.c and included too many headers at other places.
>
> This patch makes above configuration work.

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply

* Re: MPC85xx - accessing external interrupt
From: tiejun.chen @ 2010-08-30  7:36 UTC (permalink / raw)
  To: deebul nair; +Cc: linuxppc-dev
In-Reply-To: <AANLkTim5FXeRvx2TiPMGSkwqdbOeei6bL5PebK7+toLZ@mail.gmail.com>

deebul nair wrote:
> Hi all
> 
> I am trying to use the external interrupts on the Powerpc architecture
> MPC8542 .
> 
> My  problem is that my driver is trying to request the external
> interrupt IRQ1, and I dont know what number use in INTR_NUM:
> 
> request_irq(INTR_NUM, , , , )
> 
> As per the MPC85xx documentation
> Documentation/powerpc/dts-bindings/fsl/mpic.txt
> about the implementation of interrupts virtual numbers
> the external interrupt virtual irq number for IRQ1 should be 1
> 
> but when i try to give INTR_NUM ins request_irq as 1 it gives error .
> 
> When i use irq_create_mapping() it gives me output as 16.. and it registers
> .. but the problem is it is not fixed
> neither it gives interrupts .
> when i remove and add it registers to some other addresses
> 
> i even tried irq_of_parse_map()
> 
> for_each_node_by_type(np,"interrupt-controller"){
>     if(of_device_is_compatible(np,"chrp,open-pic")){
>            found=np;
>            break;
> }
> }
> 
> virq = irq_of_parse_and_map(found, irq);
> 
> this always returns 0
> whatever may be the irq value..
> as a result the driver gives error for irq 0

Anyway the following path should be the correct path:

request_irq(virq)
	      |
	      + virq = irq_of_parse_and_map(hw_irq)
					      |
					      + We get this from the dts file.

So you should define the appropriate node for your device. Then convert your
hw_irq to vir_irq via irq_of_parse_and_map() to pass that to reuest_irq() on
your device driver. Sometime this process is wrapped by some functions so I
recommend you refer to the files on the directory, arch/powerpc/sysdev/.

But I think the root cause to your problem is that you cannot pass the proper
arguments to irq_of_parse_and_map().
------
unsigned int irq_of_parse_and_map(struct device_node *dev, int index)

You should do this like the following:
------
	struct device_node *np;
	unsigned int virq;

	np = of_find_compatible_node(NULL, NULL, "<the compatible property of your
device node on dts>");
	if (np) {
		irq_of_parse_and_map(np, 0);
	}

	request_irq(virq,......);

Here I assume you have only one irq property so set 'index' as '0' on the
function, irq_of_parse_and_map().

Cheers
Tiejun
		
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

^ permalink raw reply

* [PATCH] of_mmc_spi: add card detect irq support
From: Esben Haabendal @ 2010-08-30 12:04 UTC (permalink / raw)
  To: linuxppc-dev

Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
---
 drivers/mmc/host/of_mmc_spi.c |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
index 1247e5d..e872b61 100644
--- a/drivers/mmc/host/of_mmc_spi.c
+++ b/drivers/mmc/host/of_mmc_spi.c
@@ -34,6 +34,7 @@ enum {
 struct of_mmc_spi {
        int gpios[NUM_GPIOS];
        bool alow_gpios[NUM_GPIOS];
+       int detect_irq;
        struct mmc_spi_platform_data pdata;
 };

@@ -61,6 +62,20 @@ static int of_mmc_spi_get_ro(struct device *dev)
        return of_mmc_spi_read_gpio(dev, WP_GPIO);
 }

+static int of_mmc_spi_init(struct device *dev,
+                          irqreturn_t (*irqhandler)(int, void *), void *mm=
c)
+{
+       struct of_mmc_spi *oms =3D to_of_mmc_spi(dev);
+       return request_threaded_irq(
+               oms->detect_irq, NULL, irqhandler, 0, dev_name(dev), mmc);
+}
+
+static void of_mmc_spi_exit(struct device *dev, void *mmc)
+{
+       struct of_mmc_spi *oms =3D to_of_mmc_spi(dev);
+       free_irq(oms->detect_irq, mmc);
+}
+
 struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
 {
        struct device *dev =3D &spi->dev;
@@ -121,8 +136,14 @@ struct mmc_spi_platform_data
*mmc_spi_get_pdata(struct spi_device *spi)
        if (gpio_is_valid(oms->gpios[WP_GPIO]))
                oms->pdata.get_ro =3D of_mmc_spi_get_ro;

-       /* We don't support interrupts yet, let's poll. */
-       oms->pdata.caps |=3D MMC_CAP_NEEDS_POLL;
+       oms->detect_irq =3D irq_of_parse_and_map(np, 0);
+       if (oms->detect_irq !=3D NO_IRQ) {
+               oms->pdata.init =3D of_mmc_spi_init;
+               oms->pdata.exit =3D of_mmc_spi_exit;
+       }
+       else {
+               oms->pdata.caps |=3D MMC_CAP_NEEDS_POLL;
+       }

        dev->platform_data =3D &oms->pdata;
        return dev->platform_data;
--=20
1.7.1.1

--=20
Esben Haabendal, Senior Software Consultant
Dor=E9Development ApS, Ved Stranden 1, 9560 Hadsund, DK-Denmark
Phone: +45 51 92 53 93, E-mail: eha@doredevelopment.dk
WWW: http://www.doredevelopment.dk

^ permalink raw reply related

* Re: [PATCH] of_mmc_spi: add card detect irq support
From: Anton Vorontsov @ 2010-08-30 13:29 UTC (permalink / raw)
  To: Esben Haabendal; +Cc: linuxppc-dev
In-Reply-To: <AANLkTikH+H6+sXN_hcfm_guvUwgM-NKQ83nCwgAk-23G@mail.gmail.com>

Hello,

The patch looks mostly good. A few cosmetic issues down below.

On Mon, Aug 30, 2010 at 02:04:59PM +0200, Esben Haabendal wrote:

Please add some change log, a couple of sentences would work.

> Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
> ---

>  drivers/mmc/host/of_mmc_spi.c |   25 +++++++++++++++++++++++--
>  1 files changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
> index 1247e5d..e872b61 100644
> --- a/drivers/mmc/host/of_mmc_spi.c
> +++ b/drivers/mmc/host/of_mmc_spi.c
> @@ -34,6 +34,7 @@ enum {
>  struct of_mmc_spi {
>         int gpios[NUM_GPIOS];
>         bool alow_gpios[NUM_GPIOS];
> +       int detect_irq;
>         struct mmc_spi_platform_data pdata;
>  };
> 
> @@ -61,6 +62,20 @@ static int of_mmc_spi_get_ro(struct device *dev)
>         return of_mmc_spi_read_gpio(dev, WP_GPIO);
>  }
> 
> +static int of_mmc_spi_init(struct device *dev,
> +                          irqreturn_t (*irqhandler)(int, void *), void *mmc)
> +{
> +       struct of_mmc_spi *oms = to_of_mmc_spi(dev);

Please add an empty line here.

> +       return request_threaded_irq(
> +               oms->detect_irq, NULL, irqhandler, 0, dev_name(dev), mmc);

I'd write it this way:

return request_threaded_irq(oms->detect_irq, NULL, irqhandler,
			    0, dev_name(dev), mmc);

But that's a matter of taste.

> +}
> +
> +static void of_mmc_spi_exit(struct device *dev, void *mmc)
> +{
> +       struct of_mmc_spi *oms = to_of_mmc_spi(dev);

Empty line.

> +       free_irq(oms->detect_irq, mmc);
> +}
> +
>  struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
>  {
>         struct device *dev = &spi->dev;
> @@ -121,8 +136,14 @@ struct mmc_spi_platform_data
> *mmc_spi_get_pdata(struct spi_device *spi)
>         if (gpio_is_valid(oms->gpios[WP_GPIO]))
>                 oms->pdata.get_ro = of_mmc_spi_get_ro;
> 
> -       /* We don't support interrupts yet, let's poll. */
> -       oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
> +       oms->detect_irq = irq_of_parse_and_map(np, 0);
> +       if (oms->detect_irq != NO_IRQ) {

I'd write "if (oms->detect_irq)", which is a bit more natural
(and still correct, 0 is the only invalid VIRQ number).

> +               oms->pdata.init = of_mmc_spi_init;
> +               oms->pdata.exit = of_mmc_spi_exit;
> +       }
> +       else {

} else {


Plus, please add an appropriate interrupts = <> bindings into
Documentation/powerpc/dts-bindings/mmc-spi-slot.txt.

And on the next resend, be sure to add Andrew Morton
<akpm@linux-foundation.org>, David Brownell
<dbrownell@users.sourceforge.net>, and linux-mmc@vger.kernel.org
the Cc list.

Thanks!

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* [PATCH] powerpc/kvm/e500_tlb: Fix a minor copy-paste tracing bug
From: Kyle Moffett @ 2010-08-30 15:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: linuxppc-dev, Kyle Moffett, Liu Yu, Kyle Moffett, kvm-ppc
In-Reply-To: <1282936005-17078-1-git-send-email-Kyle.D.Moffett@boeing.com>

The kvmppc_e500_stlbe_invalidate() function was trying to pass too many
parameters to trace_kvm_stlb_inval().  This appears to be a bad
copy-paste from a call to trace_kvm_stlb_write().

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>

---
Alex,

This is the rebased patch to re-enable the tracepoint.

I also pushed a tree with this patch on top of kvm-ppc-next out to:
  git://opensource.exmeritus.com/hww-1u-1a/linux.git kvm-ppc-patches
  http://opensource.exmeritus.com/git/hww-1u-1a/linux.git/kvm-ppc-patches

Thanks again!

Cheers,
Kyle Moffett

---
 arch/powerpc/kvm/e500_tlb.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index 66845a5..a413883 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -226,11 +226,7 @@ static void kvmppc_e500_stlbe_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
 
 	kvmppc_e500_shadow_release(vcpu_e500, tlbsel, esel);
 	stlbe->mas1 = 0;
-	/* XXX doesn't compile */
-#if 0
-	trace_kvm_stlb_inval(index_of(tlbsel, esel), stlbe->mas1, stlbe->mas2,
-			     stlbe->mas3, stlbe->mas7);
-#endif
+	trace_kvm_stlb_inval(index_of(tlbsel, esel));
 }
 
 static void kvmppc_e500_tlb1_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH] of_mmc_spi: add card detect irq support
From: Esben Haabendal @ 2010-08-30 16:04 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linux-mmc, Andrew Morton, David Brownell, linuxppc-dev
In-Reply-To: <20100830132914.GA32266@oksana.dev.rtsoft.ru>

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

Hi

Comments below, and updated patch attached.

On Mon, Aug 30, 2010 at 3:29 PM, Anton Vorontsov <cbouatmailru@gmail.com> wrote:
>>> +static int of_mmc_spi_init(struct device *dev,
>> +                          irqreturn_t (*irqhandler)(int, void *), void *mmc)
>> +{
>> +       struct of_mmc_spi *oms = to_of_mmc_spi(dev);
>
> Please add an empty line here.

Ok.

>> +       return request_threaded_irq(
>> +               oms->detect_irq, NULL, irqhandler, 0, dev_name(dev), mmc);
>
> I'd write it this way:
>
> return request_threaded_irq(oms->detect_irq, NULL, irqhandler,
>                            0, dev_name(dev), mmc);
>
> But that's a matter of taste.

Fine with me.

>> +}
>> +
>> +static void of_mmc_spi_exit(struct device *dev, void *mmc)
>> +{
>> +       struct of_mmc_spi *oms = to_of_mmc_spi(dev);
>
> Empty line.

Ok.

>> +       free_irq(oms->detect_irq, mmc);
>> +}
>> +
>>  struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
>>  {
>>         struct device *dev = &spi->dev;
>> @@ -121,8 +136,14 @@ struct mmc_spi_platform_data
>> *mmc_spi_get_pdata(struct spi_device *spi)
>>         if (gpio_is_valid(oms->gpios[WP_GPIO]))
>>                 oms->pdata.get_ro = of_mmc_spi_get_ro;
>>
>> -       /* We don't support interrupts yet, let's poll. */
>> -       oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
>> +       oms->detect_irq = irq_of_parse_and_map(np, 0);
>> +       if (oms->detect_irq != NO_IRQ) {
>
> I'd write "if (oms->detect_irq)", which is a bit more natural
> (and still correct, 0 is the only invalid VIRQ number).

Most other architectures has NO_IRQ defined to -1, so I will stick
with the NO_IRQ comparsion.
Hopefully, arm users will soon enjoy this driver/wrapper soon also.

>> +               oms->pdata.init = of_mmc_spi_init;
>> +               oms->pdata.exit = of_mmc_spi_exit;
>> +       }
>> +       else {
>
> } else {

Done.

> Plus, please add an appropriate interrupts = <> bindings into
> Documentation/powerpc/dts-bindings/mmc-spi-slot.txt.

Done.

> And on the next resend, be sure to add Andrew Morton
> <akpm@linux-foundation.org>, David Brownell
> <dbrownell@users.sourceforge.net>, and linux-mmc@vger.kernel.org
> the Cc list.

Should be there now.

/Esben

[-- Attachment #2: 0001-of_mmc_spi-add-card-detect-irq-support.patch --]
[-- Type: text/x-patch, Size: 2869 bytes --]

of_mmc_spi: add card detect irq support

Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
---
 .../powerpc/dts-bindings/mmc-spi-slot.txt          |    9 ++++++-
 drivers/mmc/host/of_mmc_spi.c                      |   26 ++++++++++++++++++-
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt b/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
index c39ac28..89a0084 100644
--- a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
+++ b/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
@@ -7,8 +7,13 @@ Required properties:
 - voltage-ranges : two cells are required, first cell specifies minimum
   slot voltage (mV), second cell specifies maximum slot voltage (mV).
   Several ranges could be specified.
-- gpios : (optional) may specify GPIOs in this order: Card-Detect GPIO,
+
+Optional properties:
+- gpios : may specify GPIOs in this order: Card-Detect GPIO,
   Write-Protect GPIO.
+- interrupts : the interrupt of a card detect interrupt.
+- interrupt-parent : the phandle for the interrupt controller that
+  services interrupts for this device.
 
 Example:
 
@@ -20,4 +25,6 @@ Example:
 			 &qe_pio_d 15 0>;
 		voltage-ranges = <3300 3300>;
 		spi-max-frequency = <50000000>;
+		interrupts = <42>;
+		interrupt-parent = <&PIC>;
 	};
diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
index 1247e5d..5530def 100644
--- a/drivers/mmc/host/of_mmc_spi.c
+++ b/drivers/mmc/host/of_mmc_spi.c
@@ -34,6 +34,7 @@ enum {
 struct of_mmc_spi {
 	int gpios[NUM_GPIOS];
 	bool alow_gpios[NUM_GPIOS];
+	int detect_irq;
 	struct mmc_spi_platform_data pdata;
 };
 
@@ -61,6 +62,22 @@ static int of_mmc_spi_get_ro(struct device *dev)
 	return of_mmc_spi_read_gpio(dev, WP_GPIO);
 }
 
+static int of_mmc_spi_init(struct device *dev,
+			   irqreturn_t (*irqhandler)(int, void *), void *mmc)
+{
+	struct of_mmc_spi *oms = to_of_mmc_spi(dev);
+
+	return request_threaded_irq(oms->detect_irq, NULL, irqhandler, 0,
+				    dev_name(dev), mmc);
+}
+
+static void of_mmc_spi_exit(struct device *dev, void *mmc)
+{
+	struct of_mmc_spi *oms = to_of_mmc_spi(dev);
+
+	free_irq(oms->detect_irq, mmc);
+}
+
 struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
 {
 	struct device *dev = &spi->dev;
@@ -121,8 +138,13 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
 	if (gpio_is_valid(oms->gpios[WP_GPIO]))
 		oms->pdata.get_ro = of_mmc_spi_get_ro;
 
-	/* We don't support interrupts yet, let's poll. */
-	oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
+	oms->detect_irq = irq_of_parse_and_map(np, 0);
+	if (oms->detect_irq != NO_IRQ) {
+		oms->pdata.init = of_mmc_spi_init;
+		oms->pdata.exit = of_mmc_spi_exit;
+	} else {
+		oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
+	}
 
 	dev->platform_data = &oms->pdata;
 	return dev->platform_data;
-- 
1.7.1.1


^ permalink raw reply related

* [PATCH] ucc_geth: fix ethtool set ring param bug
From: Liang Li @ 2010-08-30 14:47 UTC (permalink / raw)
  To: leoli, davem, avorontsov, netdev, linuxppc-dev

It's common sense that when we should do change to driver ring
desc/buffer etc only after 'stop/shutdown' the device. When we
do change while devices/driver is running, kernel oops occur:

[
root@fsl_8569mds:/root> ethtool -G eth0 tx 256
root@fsl_8569mds:/root> Oops: Kernel access of bad area, sig: 11 [#1]
MPC8569 MDS
last sysfs file: /sys/kernel/uevent_seqnum
Modules linked in:
NIP: 00000000 LR: c0072fbc CTR: 00000000
REGS: effefef0 TRAP: 0400   Not tainted  (2.6.36-rc3-00002-g6c3b118-dirty)
MSR: 00021000 <ME,CE>  CR: 24442048  XER: 00000000
TASK = c0518350[0] 'swapper' THREAD: c0544000
GPR00: 00000000 effeffa0 c0518350 00000020 ef0be000 ef005000 80000000 00000200
GPR08: c03b5d00 00000000 f1010080 ef08d458 000dda96 00000000 3ffb2900 00000000
GPR16: 00000000 3ffa8948 3fff1314 3ffac3f8 00000000 00000000 00000000 00000000
GPR24: 00000000 00000000 00000000 c0530000 00000000 00000000 00000020 ef3709c0
NIP [00000000] (null)
LR [c0072fbc] handle_IRQ_event+0x4c/0x12c
Call Trace:
[effeffa0] [c0019414] qe_ic_mask_irq+0x1c/0x90 (unreliable)
[effeffc0] [c0075b74] handle_level_irq+0x88/0x128
[effeffd0] [c001ca44] qe_ic_cascade_muxed_mpic+0x50/0x88
[effefff0] [c000d5fc] call_handle_irq+0x18/0x28
[c0545ea0] [c0004f3c] do_IRQ+0xa8/0x140
[c0545ed0] [c000e2bc] ret_from_except+0x0/0x18
-- Exception: 501 at cpu_idle+0x9c/0xdc
    LR = cpu_idle+0x9c/0xdc
[c0545f90] [c0008318] cpu_idle+0x54/0xdc (unreliable)
[c0545fb0] [c000231c] rest_init+0x68/0x7c
[c0545fc0] [c04e686c] start_kernel+0x230/0x2b0
[c0545ff0] [c000039c] skpinv+0x2b4/0x2f0
Instruction dump:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
Kernel panic - not syncing: Fatal exception in interrupt
Rebooting in 180 seconds..
]

Then the natural solution would be 'stop driver/device then adjust
ring buffer parameter then reactivate driver/device'.

Signed-off-by: Liang Li <liang.li@windriver.com>
---
 drivers/net/ucc_geth.c         |    4 ++--
 drivers/net/ucc_geth.h         |    2 ++
 drivers/net/ucc_geth_ethtool.c |   17 +++++++++++------
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 1b0aef3..9779185 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3485,7 +3485,7 @@ err:
 
 /* Called when something needs to use the ethernet device */
 /* Returns 0 for success. */
-static int ucc_geth_open(struct net_device *dev)
+int ucc_geth_open(struct net_device *dev)
 {
 	struct ucc_geth_private *ugeth = netdev_priv(dev);
 	int err;
@@ -3542,7 +3542,7 @@ err:
 }
 
 /* Stops the kernel queue, and halts the controller */
-static int ucc_geth_close(struct net_device *dev)
+int ucc_geth_close(struct net_device *dev)
 {
 	struct ucc_geth_private *ugeth = netdev_priv(dev);
 
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
index ef1fbeb..f5cb874 100644
--- a/drivers/net/ucc_geth.h
+++ b/drivers/net/ucc_geth.h
@@ -1235,5 +1235,7 @@ int init_flow_control_params(u32 automatic_flow_control_mode,
 		u32 __iomem *upsmr_register, u32 __iomem *uempr_register,
 		u32 __iomem *maccfg1_register);
 
+extern int ucc_geth_open(struct net_device *);
+extern int ucc_geth_close(struct net_device *);
 
 #endif				/* __UCC_GETH_H__ */
diff --git a/drivers/net/ucc_geth_ethtool.c b/drivers/net/ucc_geth_ethtool.c
index 6f92e48..1b37aaa 100644
--- a/drivers/net/ucc_geth_ethtool.c
+++ b/drivers/net/ucc_geth_ethtool.c
@@ -255,13 +255,18 @@ uec_set_ringparam(struct net_device *netdev,
 		return -EINVAL;
 	}
 
-	ug_info->bdRingLenRx[queue] = ring->rx_pending;
-	ug_info->bdRingLenTx[queue] = ring->tx_pending;
-
 	if (netif_running(netdev)) {
-		/* FIXME: restart automatically */
-		printk(KERN_INFO
-			"Please re-open the interface.\n");
+		printk(KERN_INFO "Stopping interface %s.\n", netdev->name);
+		ucc_geth_close(netdev);
+
+		ug_info->bdRingLenRx[queue] = ring->rx_pending;
+		ug_info->bdRingLenTx[queue] = ring->tx_pending;
+
+		printk(KERN_INFO "Reactivating interface %s.\n", netdev->name);
+		ucc_geth_open(netdev);
+	} else {
+		ug_info->bdRingLenRx[queue] = ring->rx_pending;
+		ug_info->bdRingLenTx[queue] = ring->tx_pending;
 	}
 
 	return ret;
-- 
1.7.2

^ permalink raw reply related

* Re: [PATCH] of_mmc_spi: add card detect irq support
From: Anton Vorontsov @ 2010-08-30 16:11 UTC (permalink / raw)
  To: Esben Haabendal; +Cc: linux-mmc, Andrew Morton, David Brownell, linuxppc-dev
In-Reply-To: <AANLkTik3rNpFCYDR7dxiFN_3dvxZmsSjt8PsoC415JM-@mail.gmail.com>

> of_mmc_spi: add card detect irq support
> 
> Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>

Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>

Thanks!

> ---
>  .../powerpc/dts-bindings/mmc-spi-slot.txt          |    9 ++++++-
>  drivers/mmc/host/of_mmc_spi.c                      |   26 ++++++++++++++++++-
>  2 files changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt b/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
> index c39ac28..89a0084 100644
> --- a/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
> +++ b/Documentation/powerpc/dts-bindings/mmc-spi-slot.txt
> @@ -7,8 +7,13 @@ Required properties:
>  - voltage-ranges : two cells are required, first cell specifies minimum
>    slot voltage (mV), second cell specifies maximum slot voltage (mV).
>    Several ranges could be specified.
> -- gpios : (optional) may specify GPIOs in this order: Card-Detect GPIO,
> +
> +Optional properties:
> +- gpios : may specify GPIOs in this order: Card-Detect GPIO,
>    Write-Protect GPIO.
> +- interrupts : the interrupt of a card detect interrupt.
> +- interrupt-parent : the phandle for the interrupt controller that
> +  services interrupts for this device.
>  
>  Example:
>  
> @@ -20,4 +25,6 @@ Example:
>  			 &qe_pio_d 15 0>;
>  		voltage-ranges = <3300 3300>;
>  		spi-max-frequency = <50000000>;
> +		interrupts = <42>;
> +		interrupt-parent = <&PIC>;
>  	};
> diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
> index 1247e5d..5530def 100644
> --- a/drivers/mmc/host/of_mmc_spi.c
> +++ b/drivers/mmc/host/of_mmc_spi.c
> @@ -34,6 +34,7 @@ enum {
>  struct of_mmc_spi {
>  	int gpios[NUM_GPIOS];
>  	bool alow_gpios[NUM_GPIOS];
> +	int detect_irq;
>  	struct mmc_spi_platform_data pdata;
>  };
>  
> @@ -61,6 +62,22 @@ static int of_mmc_spi_get_ro(struct device *dev)
>  	return of_mmc_spi_read_gpio(dev, WP_GPIO);
>  }
>  
> +static int of_mmc_spi_init(struct device *dev,
> +			   irqreturn_t (*irqhandler)(int, void *), void *mmc)
> +{
> +	struct of_mmc_spi *oms = to_of_mmc_spi(dev);
> +
> +	return request_threaded_irq(oms->detect_irq, NULL, irqhandler, 0,
> +				    dev_name(dev), mmc);
> +}
> +
> +static void of_mmc_spi_exit(struct device *dev, void *mmc)
> +{
> +	struct of_mmc_spi *oms = to_of_mmc_spi(dev);
> +
> +	free_irq(oms->detect_irq, mmc);
> +}
> +
>  struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
>  {
>  	struct device *dev = &spi->dev;
> @@ -121,8 +138,13 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
>  	if (gpio_is_valid(oms->gpios[WP_GPIO]))
>  		oms->pdata.get_ro = of_mmc_spi_get_ro;
>  
> -	/* We don't support interrupts yet, let's poll. */
> -	oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
> +	oms->detect_irq = irq_of_parse_and_map(np, 0);
> +	if (oms->detect_irq != NO_IRQ) {
> +		oms->pdata.init = of_mmc_spi_init;
> +		oms->pdata.exit = of_mmc_spi_exit;
> +	} else {
> +		oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
> +	}
>  
>  	dev->platform_data = &oms->pdata;
>  	return dev->platform_data;
> -- 
> 1.7.1.1


-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* Re: [PATCH] of_mmc_spi: add card detect irq support
From: David Brownell @ 2010-08-30 16:38 UTC (permalink / raw)
  To: Esben Haabendal, Anton Vorontsov
  Cc: linux-mmc, Andrew Morton, David Brownell, linuxppc-dev
In-Reply-To: <20100830161102.GA20413@oksana.dev.rtsoft.ru>

Since I don't do OpenFirmware, let's hear from
Grant on this one.

^ permalink raw reply

* Re: [PATCH] of_mmc_spi: add card detect irq support
From: Grant Likely @ 2010-08-30 17:46 UTC (permalink / raw)
  To: Esben Haabendal; +Cc: linuxppc-dev, Andrew Morton, David Brownell, linux-mmc
In-Reply-To: <AANLkTik3rNpFCYDR7dxiFN_3dvxZmsSjt8PsoC415JM-@mail.gmail.com>

On Mon, Aug 30, 2010 at 10:04 AM, Esben Haabendal
<esbenhaabendal@gmail.com> wrote:
> On Mon, Aug 30, 2010 at 3:29 PM, Anton Vorontsov <cbouatmailru@gmail.com>=
 wrote:
>>> @@ -121,8 +136,14 @@ struct mmc_spi_platform_data
>>> *mmc_spi_get_pdata(struct spi_device *spi)
>>> =A0 =A0 =A0 =A0 if (gpio_is_valid(oms->gpios[WP_GPIO]))
>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 oms->pdata.get_ro =3D of_mmc_spi_get_ro=
;
>>>
>>> - =A0 =A0 =A0 /* We don't support interrupts yet, let's poll. */
>>> - =A0 =A0 =A0 oms->pdata.caps |=3D MMC_CAP_NEEDS_POLL;
>>> + =A0 =A0 =A0 oms->detect_irq =3D irq_of_parse_and_map(np, 0);
>>> + =A0 =A0 =A0 if (oms->detect_irq !=3D NO_IRQ) {
>>
>> I'd write "if (oms->detect_irq)", which is a bit more natural
>> (and still correct, 0 is the only invalid VIRQ number).
>
> Most other architectures has NO_IRQ defined to -1, so I will stick
> with the NO_IRQ comparsion.

Not true.  NO_IRQ is only defined as -1 on ARM, microblaze, mn10300
and parisc, and I've got a patch pending to remove microblaze from
that list.  ARM just happens to be a really big user.

$ git grep NO_IRQ arch/*/include  (I've trimmed the irrelevant matches)
arch/arm/include/asm/irq.h:#ifndef NO_IRQ
arch/arm/include/asm/irq.h:#define NO_IRQ       ((unsigned int)(-1))
arch/microblaze/include/asm/irq.h:#define NO_IRQ (-1)
arch/mn10300/include/asm/irq.h:#define NO_IRQ           INT_MAX
arch/parisc/include/asm/irq.h:#define NO_IRQ            (-1)
arch/powerpc/include/asm/irq.h:#define NO_IRQ                   (0)

> Hopefully, arm users will soon enjoy this driver/wrapper soon also.

My hope is that even on ARM when the device tree is used I'll be able
eliminate IRQs mapped to 0 (but I need to do a lot more research on
how best to do that though).  Are you actually using this on ARM?

I'm okay with you keeping the NO_IRQ test for the short term though.

g.

^ permalink raw reply


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