LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [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

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

On Mon, Aug 30, 2010 at 10:38 AM, David Brownell <david-b@pacbell.net> wrote:
> Since I don't do OpenFirmware, let's hear from
> Grant on this one.

Looks good to me.

Acked-by: Grant Likely <grant.likely@secretlab.ca>

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



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply

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

Julia Lawall wrote:
> Add a call to of_node_put in the error handling code following a call to
> of_find_compatible_node.

Acked-by: Timur Tabi <timur@freescale.com>

Thanks, Julia.  Your work in finding these kinds of bugs is very much
appreciated.

^ permalink raw reply

* Re: [PATCH 13/26] KVM: PPC: Add feature bitmap for magic page
From: Alexander Graf @ 2010-08-31  0:56 UTC (permalink / raw)
  To: Avi Kivity; +Cc: linuxppc-dev, KVM list, kvm-ppc
In-Reply-To: <4C715382.6050809@redhat.com>


On 22.08.2010, at 18:42, Avi Kivity wrote:

> On 08/17/2010 04:57 PM, Alexander Graf wrote:
>> We will soon add SR PV support to the shared page, so we need some
>> infrastructure that allows the guest to query for features KVM =
exports.
>>=20
>> This patch adds a second return value to the magic mapping that
>> indicated to the guest which features are available.
>>=20
>=20
> You need to make that feature controllable from userspace, to allow =
new->old save/restore.

Good one :). We're still missing too much stuff to even run without =
losing interrupts yet and you're thinking about new->old save/restore. =
Who'd want to migrate onto a system that's broken anyways? Besides - =
we're missing too many register values from the kernel side to even be =
able to perform a migration.

I'm planning to add migration, probably after SMP. But that will be =
another CAP and anything before that won't be able to save/restore.


Alex

^ permalink raw reply

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


On 30.08.2010, at 17:38, Kyle Moffett wrote:

> 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>

Thanks, applied.

Alex

^ permalink raw reply

* [PATCH 3/3] PPC: Fix compilation of mpc85xx_mds.c
From: Alexander Graf @ 2010-08-31  2:15 UTC (permalink / raw)
  To: Linuxppc-dev; +Cc: Anton Vorontsov
In-Reply-To: <1283220922-20369-1-git-send-email-agraf@suse.de>

Commit 99d8238f berobbed the for_each loop of its iterator! Let's be
nice and give it back, so it compiles for us.

CC: Anton Vorontsov <avorontsov@mvista.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/platforms/85xx/mpc85xx_mds.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index da64be1..aa34cac 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -357,6 +357,7 @@ static void __init mpc85xx_mds_setup_arch(void)
 {
 #ifdef CONFIG_PCI
 	struct pci_controller *hose;
+	struct device_node *np;
 #endif
 	dma_addr_t max = 0xffffffff;
 
-- 
1.6.0.2

^ permalink raw reply related

* [PATCH 2/3] PPC: Fix compilation of fsl_rio.c
From: Alexander Graf @ 2010-08-31  2:15 UTC (permalink / raw)
  To: Linuxppc-dev; +Cc: Alexandre Bounine, Thomas Moll
In-Reply-To: <1283220922-20369-1-git-send-email-agraf@suse.de>

Commit a52c8f52 introduced machine check magic for the RapidIO chip.
Unfortunately it was so magical that it used constants that aren't even
defined!

This patch bluntly comments out the broken constant's usage. This
probably means that said functionality thus doesn't work, but at
least it makes it compile for me.

CC: Alexandre Bounine <alexandre.bounine@idt.com>
CC: Thomas Moll <thomas.moll@sysgo.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/sysdev/fsl_rio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 6425abe..dba2969 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -245,7 +245,7 @@ static int (*saved_mcheck_exception)(struct pt_regs *regs);
 static int fsl_rio_mcheck_exception(struct pt_regs *regs)
 {
 	const struct exception_table_entry *entry = NULL;
-	unsigned long reason = (mfspr(SPRN_MCSR) & MCSR_MASK);
+	unsigned long reason = (mfspr(SPRN_MCSR) /* & MCSR_MASK */);
 
 	if (reason & MCSR_BUS_RBERR) {
 		reason = in_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR));
-- 
1.6.0.2

^ permalink raw reply related

* [PATCH 0/3] MPC85xx compile fixes
From: Alexander Graf @ 2010-08-31  2:15 UTC (permalink / raw)
  To: Linuxppc-dev

While trying to compile a recent git kernel on my e500v2 box, I came
across some pretty simple compilation bugs.

Since I have no idea which tree those go through, I'm sending them to
you, but please coordinate who takes them in.

Also, it might be useful to set up a make defconfig machine that does
regression testing for booke builds. These really shouldn't be caught
by me in the kvm.git tree :).

Alexander Graf (3):
  PPC: s/mtmsrd/MTMSR in ldstfp.S
  PPC: Fix compilation of fsl_rio.c
  PPC: Fix compilation of mpc85xx_mds.c

 arch/powerpc/lib/ldstfp.S                 |   32 ++++++++++++++--------------
 arch/powerpc/platforms/85xx/mpc85xx_mds.c |    1 +
 arch/powerpc/sysdev/fsl_rio.c             |    2 +-
 3 files changed, 18 insertions(+), 17 deletions(-)

^ permalink raw reply

* [PATCH 1/3] PPC: s/mtmsrd/MTMSR in ldstfp.S
From: Alexander Graf @ 2010-08-31  2:15 UTC (permalink / raw)
  To: Linuxppc-dev
In-Reply-To: <1283220922-20369-1-git-send-email-agraf@suse.de>

Commit 0016a4cf introduced a lot of mtmsrd's that were plainly written out.
These failed to compile on my e500v2 system, so let's better use the macro
that is around just for that purpose.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 arch/powerpc/lib/ldstfp.S |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/lib/ldstfp.S b/arch/powerpc/lib/ldstfp.S
index f644863..ce818a5 100644
--- a/arch/powerpc/lib/ldstfp.S
+++ b/arch/powerpc/lib/ldstfp.S
@@ -81,7 +81,7 @@ _GLOBAL(do_lfs)
 	mfmsr	r6
 	ori	r7,r6,MSR_FP
 	cmpwi	cr7,r3,0
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	stfd	fr0,STKFRM-16(r1)
@@ -93,7 +93,7 @@ _GLOBAL(do_lfs)
 	lfd	fr0,STKFRM-16(r1)
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -108,7 +108,7 @@ _GLOBAL(do_lfd)
 	mfmsr	r6
 	ori	r7,r6,MSR_FP
 	cmpwi	cr7,r3,0
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	stfd	fr0,STKFRM-16(r1)
@@ -120,7 +120,7 @@ _GLOBAL(do_lfd)
 	lfd	fr0,STKFRM-16(r1)
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -135,7 +135,7 @@ _GLOBAL(do_stfs)
 	mfmsr	r6
 	ori	r7,r6,MSR_FP
 	cmpwi	cr7,r3,0
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	stfd	fr0,STKFRM-16(r1)
@@ -147,7 +147,7 @@ _GLOBAL(do_stfs)
 	lfd	fr0,STKFRM-16(r1)
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -162,7 +162,7 @@ _GLOBAL(do_stfd)
 	mfmsr	r6
 	ori	r7,r6,MSR_FP
 	cmpwi	cr7,r3,0
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	stfd	fr0,STKFRM-16(r1)
@@ -174,7 +174,7 @@ _GLOBAL(do_stfd)
 	lfd	fr0,STKFRM-16(r1)
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -229,7 +229,7 @@ _GLOBAL(do_lvx)
 	oris	r7,r6,MSR_VEC@h
 	cmpwi	cr7,r3,0
 	li	r8,STKFRM-16
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	stvx	vr0,r1,r8
@@ -241,7 +241,7 @@ _GLOBAL(do_lvx)
 	lvx	vr0,r1,r8
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -257,7 +257,7 @@ _GLOBAL(do_stvx)
 	oris	r7,r6,MSR_VEC@h
 	cmpwi	cr7,r3,0
 	li	r8,STKFRM-16
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	stvx	vr0,r1,r8
@@ -269,7 +269,7 @@ _GLOBAL(do_stvx)
 	lvx	vr0,r1,r8
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -325,7 +325,7 @@ _GLOBAL(do_lxvd2x)
 	oris	r7,r6,MSR_VSX@h
 	cmpwi	cr7,r3,0
 	li	r8,STKFRM-16
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	STXVD2X(0,r1,r8)
@@ -337,7 +337,7 @@ _GLOBAL(do_lxvd2x)
 	LXVD2X(0,r1,r8)
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
@@ -353,7 +353,7 @@ _GLOBAL(do_stxvd2x)
 	oris	r7,r6,MSR_VSX@h
 	cmpwi	cr7,r3,0
 	li	r8,STKFRM-16
-	mtmsrd	r7
+	MTMSRD(r7)
 	isync
 	beq	cr7,1f
 	STXVD2X(0,r1,r8)
@@ -365,7 +365,7 @@ _GLOBAL(do_stxvd2x)
 	LXVD2X(0,r1,r8)
 4:	PPC_LL	r0,STKFRM+PPC_LR_STKOFF(r1)
 	mtlr	r0
-	mtmsrd	r6
+	MTMSRD(r6)
 	isync
 	mr	r3,r9
 	addi	r1,r1,STKFRM
-- 
1.6.0.2

^ 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