mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging/keucr: fix keucr lost disconnect in transport
@ 2010-09-24 10:50 Al Cho
  0 siblings, 0 replies; 2+ messages in thread
From: Al Cho @ 2010-09-24 10:50 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, devel, yiyingc, jlee, acho

The other part of keucr lost usb disconnect.
Unplug SDcard after thread scan,the wrong rule in usb_stor_port_reset,
so the driver still fail in stress test.

Signed-off-by: Al Cho <acho@novell.com>
---
 drivers/staging/keucr/transport.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/keucr/transport.c b/drivers/staging/keucr/transport.c
index 7215429..445a62c 100644
--- a/drivers/staging/keucr/transport.c
+++ b/drivers/staging/keucr/transport.c
@@ -763,24 +763,19 @@ int usb_stor_port_reset(struct us_data *us)
 	int result, rc_lock;
 
 	//printk("transport --- usb_stor_port_reset\n");
-	result = rc_lock = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf);
+	result = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf);
 	if (result < 0)
 		printk("unable to lock device for reset: %d\n", result);
-	else
-	{
+	else {
 		/* Were we disconnected while waiting for the lock? */
-		if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags))
-		{
+		if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) {
 			result = -EIO;
 			//printk("No reset during disconnect\n");
-		}
-		else
-		{
+		} else {
 			result = usb_reset_device(us->pusb_dev);
 			//printk("usb_reset_composite_device returns %d\n", result);
 		}
-		if (rc_lock)
-			usb_unlock_device(us->pusb_dev);
+		usb_unlock_device(us->pusb_dev);
 	}
 	return result;
 }
-- 
1.7.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] staging/keucr: fix keucr lost disconnect in transport
@ 2010-10-19  7:31 Joey Lee
  0 siblings, 0 replies; 2+ messages in thread
From: Joey Lee @ 2010-10-19  7:31 UTC (permalink / raw)
  To: Al Cho; +Cc: devel, yiyingc, gregkh, linux-kernel

Hi Al, 

於 五,2010-09-24 於 18:50 +0800,Al Cho 提到:
> The other part of keucr lost usb disconnect.
> Unplug SDcard after thread scan,the wrong rule in usb_stor_port_reset,
> so the driver still fail in stress test.
> 
> Signed-off-by: Al Cho <acho@novell.com>
> ---
>  drivers/staging/keucr/transport.c |   15 +++++----------
>  1 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/keucr/transport.c b/drivers/staging/keucr/transport.c
> index 7215429..445a62c 100644
> --- a/drivers/staging/keucr/transport.c
> +++ b/drivers/staging/keucr/transport.c
> @@ -763,24 +763,19 @@ int usb_stor_port_reset(struct us_data *us)
>  	int result, rc_lock;
>  
>  	//printk("transport --- usb_stor_port_reset\n");
> -	result = rc_lock = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf);
> +	result = usb_lock_device_for_reset(us->pusb_dev, us->pusb_intf);
>  	if (result < 0)
>  		printk("unable to lock device for reset: %d\n", result);
> -	else
> -	{
> +	else {
>  		/* Were we disconnected while waiting for the lock? */
> -		if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags))
> -		{
> +		if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) {
>  			result = -EIO;
>  			//printk("No reset during disconnect\n");
> -		}
> -		else
> -		{
> +		} else {
>  			result = usb_reset_device(us->pusb_dev);
>  			//printk("usb_reset_composite_device returns %d\n", result);
>  		}
> -		if (rc_lock)
> -			usb_unlock_device(us->pusb_dev);
> +		usb_unlock_device(us->pusb_dev);
>  	}
>  	return result;
>  }

This patch works to me on MSI netbook.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>


Thank's
Joey Lee


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-10-19  7:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-24 10:50 [PATCH] staging/keucr: fix keucr lost disconnect in transport Al Cho
2010-10-19  7:31 Joey Lee

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

all inboxes | Powered by JetHome®