Re: [PATCH 1/1] usb: gadget: Don't attempt to dequeue requests for a disabled USB endpoint on Freescale hardware

2012-10-26 Thread Felipe Balbi
Hi,

On Thu, Oct 25, 2012 at 02:36:24AM +0200, Laurent Pinchart wrote:
 Hi Felipe,
 
 On Monday 22 October 2012 13:56:01 Felipe Balbi wrote:
  On Mon, Oct 22, 2012 at 12:47:21PM +0200, Laurent Pinchart wrote:
   On Monday 22 October 2012 03:33:19 Li Yang-R58472 wrote:
On Saturday, October 20, 2012 1:37 AM Felipe Balbi wrote:
 On Fri, Oct 19, 2012 at 06:19:26PM +0100, Simon Haggett wrote:
  Some gadget drivers may attempt to dequeue requests for an endpoint
  that has already been disabled. For example, in the UVC gadget
  driver, uvc_function_set_alt() will call usb_ep_disable() when alt
  setting 0 is selected. When the userspace application subsequently
  issues the VIDIOC_STREAMOFF ioctl, uvc_video_enable() invokes
  usb_ep_dequeue() to ensure that all requests have been cancelled.
 
 bug is on uvc gadget, then. Laurent ?
   
   We've discussed this topic a couple of months before. I believe that's not
   a bug.
   
   http://68.183.106.108/lists/linux-usb/msg68869.html
  
  fair enough :-)
  
  That's a different case, however. At the link above we're discussing
  dequeueing a request which is already being dequeued. $SUBJECT is trying
  to fix dequeueing of a request for an endpoint which isn't even enabled.
 
 You've got a point there :-) That's a different case indeed, I'm open to (at 
 least evaluating) a fix in the UVC gadget driver if you think that's better.

I _do_ think that's better. If the endpoint isn't even enabled, why are
you trying to dequeue a request ? :-)

cheers

-- 
balbi


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: mpc5200: Add a3m071 board support

2012-10-26 Thread Stefan Roese
This patch adds the MPC5200B based a3m071 board.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Anatolij Gustschin ag...@denx.de
---
 arch/powerpc/boot/dts/a3m071.dts | 153 +++
 arch/powerpc/platforms/52xx/mpc5200_simple.c |   1 +
 2 files changed, 154 insertions(+)
 create mode 100644 arch/powerpc/boot/dts/a3m071.dts

diff --git a/arch/powerpc/boot/dts/a3m071.dts b/arch/powerpc/boot/dts/a3m071.dts
new file mode 100644
index 000..46b30f2
--- /dev/null
+++ b/arch/powerpc/boot/dts/a3m071.dts
@@ -0,0 +1,153 @@
+/*
+ * a3m071 board Device Tree Source
+ *
+ * Copyright 2012 Stefan Roese s...@denx.de
+ *
+ * Copyright (C) 2011 DENX Software Engineering GmbH
+ * Heiko Schocher h...@denx.de
+ *
+ * Copyright (C) 2007 Semihalf
+ * Marian Balakowicz m...@semihalf.com
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+/include/ mpc5200b.dtsi
+
+/ {
+   model = anonymous,a3m071;
+   compatible = anonymous,a3m071;
+
+   soc5200@f000 {
+   #address-cells = 1;
+   #size-cells = 1;
+   compatible = fsl,mpc5200b-immr;
+   ranges = 0 0xf000 0xc000;
+   reg = 0xf000 0x0100;
+   bus-frequency = 0; /* From boot loader */
+   system-frequency = 0; /* From boot loader */
+
+   cdm@200 {
+   fsl,init-ext-48mhz-en = 0x0;
+   fsl,init-fd-enable = 0x01;
+   fsl,init-fd-counters = 0x;
+   };
+
+   timer@600 {
+   fsl,has-wdt;
+   };
+
+   spi@f00 {
+   status = disabled;
+   };
+
+   usb: usb@1000 {
+   status = disabled;
+   };
+
+   psc@2000 {
+   compatible = 
fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart;
+   reg = 0x2000 0x100;
+   interrupts = 2 1 0;
+   };
+
+   psc@2200 {
+   status = disabled;
+   };
+
+   psc@2400 {
+   status = disabled;
+   };
+
+   psc@2600 {
+   status = disabled;
+   };
+
+   psc@2800 {
+   status = disabled;
+   };
+
+   psc@2c00 {  // PSC6
+   compatible = 
fsl,mpc5200b-psc-uart,fsl,mpc5200-psc-uart;
+   reg = 0x2c00 0x100;
+   interrupts = 2 4 0;
+   };
+
+   ethernet@3000 {
+   phy-handle = phy0;
+   };
+
+   mdio@3000 {
+   phy0: ethernet-phy@3 {
+   reg = 0x03;
+   };
+   };
+
+   ata@3a00 {
+   status = disabled;
+   };
+
+   i2c@3d00 {
+   status = disabled;
+   };
+
+   i2c@3d40 {
+   rtc@51 {
+   compatible = epson,pcf8563;
+   reg = 0x51;
+   };
+   };
+   };
+
+   localbus {
+   compatible = fsl,mpc5200b-lpb,simple-bus;
+   #address-cells = 2;
+   #size-cells = 1;
+   ranges = 0 0 0xfc00 0x0200
+ 3 0 0xe900 0x0008
+ 5 0 0xe800 0x0001;
+
+   flash@0,0 {
+   #address-cells = 1;
+   #size-cells = 1;
+   reg = 0 0x0 0x0200;
+   compatible = cfi-flash;
+   bank-width = 2;
+   partition@0x0 {
+   label = u-boot;
+   reg = 0x 0x0004;
+   read-only;
+   };
+   partition@0x0004 {
+   label = env;
+   reg = 0x0004 0x0002;
+   };
+   partition@0x0006 {
+   label = dtb;
+   reg = 0x0006 0x0002;
+   };
+   partition@0x0008 {
+   label = kernel;
+   reg = 0x0008 0x0050;
+   };
+   partition@0x0058 {
+   label = root;
+   reg = 0x0058 0x00A8;
+   

[PATCH RFT RESEND linux-next] powerpc: dma-mapping: support debug_dma_mapping_error

2012-10-26 Thread Shuah Khan
Add support for debug_dma_mapping_error() call to avoid warning from
debug_dma_unmap() interface when it checks for mapping error checked
status. Without this patch, device driver failed to check map error
warning is generated.

Signed-off-by: Shuah Khan shuah.k...@hp.com
---
 arch/powerpc/include/asm/dma-mapping.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/include/asm/dma-mapping.h 
b/arch/powerpc/include/asm/dma-mapping.h
index 7816087..e27e9ad 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -172,6 +172,7 @@ static inline int dma_mapping_error(struct device *dev, 
dma_addr_t dma_addr)
 {
struct dma_map_ops *dma_ops = get_dma_ops(dev);
 
+   debug_dma_mapping_error(dev, dma_addr);
if (dma_ops-mapping_error)
return dma_ops-mapping_error(dev, dma_addr);
 
-- 
1.7.9.5



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


Re: [PATCH v2] powerpc: book3e: WSP: Add Chroma as a new WSP/PowerEN platform.

2012-10-26 Thread Scott Wood
On Tue, Oct 11, 2011 at 09:47:36AM -0500, Jimi Xenidis wrote:
 On Tue Oct 4 05:02:41 EST 2011, Scott Wood wrote:
 
 Looking at your comments below, will the following be acceptable
 
  On 09/29/2011 09:27 PM, Jimi Xenidis wrote:
   diff --git a/arch/powerpc/platforms/wsp/Kconfig 
   b/arch/powerpc/platforms/wsp/Kconfig
   index ea2811c..a3eef8e 100644
   --- a/arch/powerpc/platforms/wsp/Kconfig
   +++ b/arch/powerpc/platforms/wsp/Kconfig
   @@ -1,6 +1,7 @@
config PPC_WSP
 bool
 select PPC_A2
   + select GENERIC_TBSYNC
 select PPC_ICSWX
 select PPC_SCOM
 select PPC_XICS
   @@ -8,14 +9,20 @@ config PPC_WSP
 select PCI
 select PPC_IO_WORKAROUNDS if PCI
 select PPC_INDIRECT_PIO if PCI
   + select PPC_WSP_COPRO
 default n

menu WSP platform selection
 depends on PPC_BOOK3E_64
 
 add  SMP
 

config PPC_PSR2
   - bool PSR-2 platform
   - select GENERIC_TBSYNC
   + bool PowerEN System Reference Platform 2
   + select EPAPR_BOOT
   + select PPC_WSP
   + default y
 
 Make these default n
 
 Will that address everything?
 -jx

Did a patch ever get submitted for this?

-Scott

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


Re: Power Management issues in MPC8313 processor

2012-10-26 Thread Scott Wood

On 10/25/2012 05:07:01 PM, Srivatsan Canchivaram wrote:

Hi,


I have a modem with a Freescale MPC8313E processor. I am trying to  
enable
power savings in the processor by placing it in Standby mode and  
resume

normal operation with a Wake-On-LAN magic packet.


Following the directions in the Freescale Power Management app note, I
enabled Power Management Support in the Linux kernel and device tree
configurations.


I ran the following command on the board:

echo standby  /sys/power/state


This caused the console to hang and there was no further response to
keyboard inputs. I enabled ‘no_console_suspend’ in the kernel and  
when I
loaded the new build and enabled standby mode, I observed an Oops  
trace:




RASCOM_QCU.7.0.0013 $ echo standby  /sys/power/state

6PM: Syncing fFreezing user space processes ... ilesystems ...  
7PM:

Entering standby sleep

Unable to handle kernel paging request for instruction fetch

Faulting instruction address: 0x616d6570

Oops: Kernel access of bad area, sig: 11 [#1]

MPC831x RDB

Modules linked in: dsp rcspi modem i2c_mpc thermal_sys lm92 hwmon  
[last

unloaded: modem]

NIP: 616d6570 LR: c0165224 CTR: 616d6573

REGS: cd087d30 TRAP: 0400   Not tainted  (2.6.27)

MSR: 20001032 ME,IR,DR  CR: 28002024  XER: 2000

TASK = cc312400[1196] 'echo' THREAD: cd086000

GPR00: 0002 cd087de0 cc312400 cf821800 cd087de8 0002 c06e
c06da4a0

GPR08: c06da948 616d6573 3fff c06c6308 28002022 10091248 0fffc000
100050b8

GPR16: 1008a270 10068810 100687c8 10068814  1008c284 1008c294
c0246180

GPR24: c02ab9e4 c02ab9dc c06cc4f4 0006 cd087e08 0002 c06c595c
cf821808

NIP [616d6570] 0x616d6570

LR [c0165224] platform_pm_suspend_noirq+0x84/0x88


What kernel are you using?  platform_pm_suspend_noirq was removed by  
this commit:


commit 9b39e73d0c2b265a7f8748b0e9a9f09be84079a8
Author: Rafael J. Wysocki r...@sisk.pl
Date:   Sun Dec 18 00:34:24 2011 +0100

PM / Sleep: Remove forward-only callbacks from platform bus type

The forward-only PM callbacks provided by the platform bus type are
not necessary any more, because the PM core executes driver  
callbacks

when the corresponding subsystem callbacks are not present, so drop
them.

Signed-off-by: Rafael J. Wysocki r...@sisk.pl

It seems that a driver's pm ops are getting corrupted -- maybe used  
after freeing?  Have you tried enabling slab/slub debug?


Can you instrument the code to see if there are any fields in the  
device struct that aren't corrupt, that could point out which device  
this is?



I found another thread that dealt with Power Management issues on the
Freescale MPC8313 processor:

https://lists.ozlabs.org/pipermail/linuxppc-dev/2012-January/095240.html

The resolution of this issue seems to be related to the JTAG TRST pin  
being

disabled. This is not relevant in my case as the TRST on my board is
already inactive.


If you were seeing that, you'd see a hang rather than an oops.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc/esdhc: enable the card insert/remove interrupt

2012-10-26 Thread Anton Vorontsov
Hello Huang,

On Fri, Oct 26, 2012 at 02:42:36AM +, Huang Changming-R66093 wrote:
 For the current polling mode, driver will send CMD13 to poll the card status 
 periodically , which will cause too many interrupts.
 Once I sent patches to detect the card when using polling mode last year: 
 read the state register, instead of send CMD13. But, these patches were not 
 accepted. Now I attach them for you.

Was there any specific reason why the patches didn't get accepted?

I very briefly looked at them, and they seem to be OK (there are a few
cosmetic details I'd comment on, tho -- but please send them in a normal
way (i.e. not as attachments).

Thanks,
Anton.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/1] powerpc/book3e: store critical/machine/debug exception thread info

2012-10-26 Thread Tiejun Chen
We need to store thread info to these exception thread info like something
we already did for PPC32.

Signed-off-by: Tiejun Chen tiejun.c...@windriver.com
---
This patch is followed on my three patches I send recently:

[PATCH 1/3] powerpc/book3e: load critical/machine/debug exception stack
[PATCH 2/3] powerpc/book3e: support kgdb for kernel space
[PATCH 3/3] kgdb/kgdbts: support ppc64

Tiejun

 arch/powerpc/kernel/exceptions-64e.S |   20 
 1 file changed, 20 insertions(+)

diff --git a/arch/powerpc/kernel/exceptions-64e.S 
b/arch/powerpc/kernel/exceptions-64e.S
index c5564d4..4e7083e 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -91,10 +91,28 @@
 #define SPRN_GDBELL_SRR0   SPRN_GSRR0
 #define SPRN_GDBELL_SRR1   SPRN_GSRR1
 
+/* Store something to exception thread info */
+#defineBOOK3E_STORE_EXC_LEVEL_THEAD_INFO(type) 
\
+   std r14,PACA_EX##type+EX_R14(r13);  
\
+   std r15,PACA_EX##type+EX_R15(r13);  
\
+   ld  r14,PACA_EX##type+EX_R1(r13);   
\
+   clrrdi  r14,r14,THREAD_SHIFT;   
\
+   clrrdi  r15,r1,THREAD_SHIFT;
\
+   ld  r10,TI_FLAGS(r14);  
\
+   std r10,TI_FLAGS(r15);  
\
+   ld  r10,TI_PREEMPT(r14);
\
+   std r10,TI_PREEMPT(r1); 
\
+   ld  r10,TI_TASK(r14);   
\
+   std r10,TI_TASK(r1);
\
+   ld  r14,PACA_EX##type+EX_R14(r13);  
\
+   ld  r15,PACA_EX##type+EX_R15(r13);  
\
+1:
+
 #define CRIT_SET_KSTACK
\
BOOK3E_LOAD_EXC_LEVEL_STACK(CRIT);  
\
ld  r1,PACA_CRIT_STACK(r13);\
subir1,r1,SPECIAL_EXC_FRAME_SIZE;
+   BOOK3E_STORE_EXC_LEVEL_THEAD_INFO(CRIT);
 #define SPRN_CRIT_SRR0 SPRN_CSRR0
 #define SPRN_CRIT_SRR1 SPRN_CSRR1
 
@@ -102,6 +120,7 @@
BOOK3E_LOAD_EXC_LEVEL_STACK(DBG);   
\
ld  r1,PACA_DBG_STACK(r13); \
subir1,r1,SPECIAL_EXC_FRAME_SIZE;
+   BOOK3E_STORE_EXC_LEVEL_THEAD_INFO(DBG);
 #define SPRN_DBG_SRR0  SPRN_DSRR0
 #define SPRN_DBG_SRR1  SPRN_DSRR1
 
@@ -109,6 +128,7 @@
BOOK3E_LOAD_EXC_LEVEL_STACK(MC);
\
ld  r1,PACA_MC_STACK(r13);  \
subir1,r1,SPECIAL_EXC_FRAME_SIZE;
+   BOOK3E_STORE_EXC_LEVEL_THEAD_INFO(MC);
 #define SPRN_MC_SRR0   SPRN_MCSRR0
 #define SPRN_MC_SRR1   SPRN_MCSRR1
 
-- 
1.7.9.5

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