Re: [PATCH] usb: gadget: s3c-hsotg: fix kernel panic

2012-03-21 Thread Felipe Balbi
Hi,
On Mon, Mar 19, 2012 at 05:52:08PM +0100, Lukasz Majewski wrote:
 On Fri, 16 Mar 2012 13:35:20 +
 Sangwook Lee sangwook@linaro.org wrote:
 
  Fix kernel panic from s3c_hsotg_udc_stop.
  if udc_is_newstyle is true, s3c_hsotg_udc_stop should not
  call disconnect, unbind.
  
  As running rmmod g_mass_storage, kernel panic happens.
  
  (composite_unbind+0x14/0x164 [g_mass_storage])
  from [c023e950] (s3c_hsotg_udc_stop)
  
  This patch is based on Lukasz Majewski's patches:
  [PATCH 0/9] USB: s3c-hsotg: USB S3C-HSOTG driver fixes and code cleanu
  
  in order to test g_mass_storage in Origen board:
  
  Signed-off-by: Sangwook Lee sangwook@linaro.org
  ---
   drivers/usb/gadget/s3c-hsotg.c |   12 ++--
   1 files changed, 6 insertions(+), 6 deletions(-)
  
 
 Hi Sangwook,
 
 Test HW: GONI S5PV210 
 module: g_ether.ko
 
 Yes, this patch works. Thanks for spotting the error.
 
 Tested-by: Lukasz Majewski l.majew...@samsung.com

I don't seem to have the patch in my inbox, can someone re-send with
Lukasz Tested-by line already in place ?

-- 
balbi


signature.asc
Description: Digital signature
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] usb: gadget: s3c-hsotg: fix kernel panic

2012-03-21 Thread Lukasz Majewski
On Wed, 21 Mar 2012 11:56:23 +0200
Felipe Balbi ba...@ti.com wrote:

Hi Felipe,

   This patch is based on Lukasz Majewski's patches:
   [PATCH 0/9] USB: s3c-hsotg: USB S3C-HSOTG driver fixes and code
   cleanu
   
This patch shall be placed on top of the above patch series.
Unfortunately those patches aren't yet applied to any of branches:

git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb

 
 I don't seem to have the patch in my inbox, can someone re-send with
 Lukasz Tested-by line already in place ?
 

I've already squashed this patch with one of the above patch series
with adding 
Signed-of-by: Sangwook Lee sangwook@linaro.org

I will resend those patches asap on the linux-usb mailing list.


-- 
Best regards,

Lukasz Majewski

Samsung Poland RD Center
Platform Group

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] usb: gadget: s3c-hsotg: fix kernel panic

2012-03-19 Thread Lukasz Majewski
On Fri, 16 Mar 2012 13:35:20 +
Sangwook Lee sangwook@linaro.org wrote:

 Fix kernel panic from s3c_hsotg_udc_stop.
 if udc_is_newstyle is true, s3c_hsotg_udc_stop should not
 call disconnect, unbind.
 
 As running rmmod g_mass_storage, kernel panic happens.
 
 (composite_unbind+0x14/0x164 [g_mass_storage])
 from [c023e950] (s3c_hsotg_udc_stop)
 
 This patch is based on Lukasz Majewski's patches:
 [PATCH 0/9] USB: s3c-hsotg: USB S3C-HSOTG driver fixes and code cleanu
 
 in order to test g_mass_storage in Origen board:
 
 Signed-off-by: Sangwook Lee sangwook@linaro.org
 ---
  drivers/usb/gadget/s3c-hsotg.c |   12 ++--
  1 files changed, 6 insertions(+), 6 deletions(-)
 

Hi Sangwook,

Test HW: GONI S5PV210 
module: g_ether.ko

Yes, this patch works. Thanks for spotting the error.

Tested-by: Lukasz Majewski l.majew...@samsung.com


-- 
Best regards,

Lukasz Majewski

Samsung Poland RD Center
Platform Group

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


[PATCH] usb: gadget: s3c-hsotg: fix kernel panic

2012-03-16 Thread Sangwook Lee
Fix kernel panic from s3c_hsotg_udc_stop.
if udc_is_newstyle is true, s3c_hsotg_udc_stop should not
call disconnect, unbind.

As running rmmod g_mass_storage, kernel panic happens.

(composite_unbind+0x14/0x164 [g_mass_storage])
from [c023e950] (s3c_hsotg_udc_stop)

This patch is based on Lukasz Majewski's patches:
[PATCH 0/9] USB: s3c-hsotg: USB S3C-HSOTG driver fixes and code cleanu

in order to test g_mass_storage in Origen board:

Signed-off-by: Sangwook Lee sangwook@linaro.org
---
 drivers/usb/gadget/s3c-hsotg.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 4262df8..9925661 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
@@ -2883,16 +2883,12 @@ static int s3c_hsotg_udc_stop(struct usb_gadget *gadget,
for (ep = 0; ep  hsotg-num_of_eps; ep++)
s3c_hsotg_ep_disable(hsotg-eps[ep].ep);
 
-   call_gadget(hsotg, disconnect);
-
-   driver-unbind(hsotg-gadget);
s3c_hsotg_phy_disable(hsotg);
regulator_bulk_disable(ARRAY_SIZE(hsotg-supplies), hsotg-supplies);
 
hsotg-driver = NULL;
hsotg-gadget.speed = USB_SPEED_UNKNOWN;
-
-   device_del(hsotg-gadget.dev);
+   hsotg-gadget.dev.driver = NULL;
 
dev_info(hsotg-dev, unregistered gadget driver '%s'\n,
 driver-driver.name);
@@ -3526,7 +3522,10 @@ static int __devexit s3c_hsotg_remove(struct 
platform_device *pdev)
 
s3c_hsotg_delete_debug(hsotg);
 
-   usb_gadget_unregister_driver(hsotg-driver);
+   if (hsotg-driver) {
+   /* should have been done already by driver model core */
+   usb_gadget_unregister_driver(hsotg-driver);
+   }
 
free_irq(hsotg-irq, hsotg);
iounmap(hsotg-regs);
@@ -3540,6 +3539,7 @@ static int __devexit s3c_hsotg_remove(struct 
platform_device *pdev)
clk_disable(hsotg-clk);
clk_put(hsotg-clk);
 
+   device_unregister(hsotg-gadget.dev);
kfree(hsotg);
return 0;
 }
-- 
1.7.4.1


___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev