Patchwork UBUNTU: SAUCE: IMX51: skip ATA PASS THROUGH command for USB storage disk from JMicron

login
register
mail settings
Submitter Bryan Wu
Date Feb. 24, 2010, 8:20 a.m.
Message ID <1266999611-5872-1-git-send-email-bryan.wu@canonical.com>
Download mbox | patch
Permalink /patch/46114/
State Accepted
Delegated to: Andy Whitcroft
Headers show

Comments

Bryan Wu - Feb. 24, 2010, 8:20 a.m.
BugLink: http://bugs.launchpad.net/bugs/499881

This issue is the same as LP431963, which was fixed in commit
a60f8dfc868778889c180a50a13032fa93384115. The USB storage disk from JMircon
uses the same USB-TO-SATA controller as our Babbage board. But it use different
USB VID and PID.

Add JMircon USB VIP and PID to the checking list.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/usb/storage/usb.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
Andy Whitcroft - Feb. 27, 2010, 9:45 p.m.
I applied this in a slightly modified form as below.  If you could check
it is semantically the same.  I'll be posting test kernels soon.

Applied to Lucid.

-apw
Bryan Wu - Feb. 28, 2010, 6:51 a.m.
Andy Whitcroft 写道:
> I applied this in a slightly modified form as below.  If you could check
> it is semantically the same.  I'll be posting test kernels soon.
> 
> Applied to Lucid.
> 
> -apw
> 

I tested the kernel from our lucid git repo. It works fine with the JMircon USB 
storage disk. But we finally find this is not a specific fsl-imx51 issue. It is 
a Lucid issue.

I tried the JMircon USB disk on my Lucid laptop. It does not work at all as well 
as my Babbage board. But this USB disk works on fine on Karmic Laptop and Karmic 
Babbage board.

I also tried Karmic .31 kernel on my Lucid Babbage board. So I suspect some user 
space applications changes introduced a regression.

Please see the bug here: https://bugs.launchpad.net/bugs/515023

Cheers,

Patch

diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index b8355ca..3836bd4 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -333,11 +333,15 @@  static int usb_stor_control_thread(void * __us)
 			US_DEBUG(usb_stor_show_command(us->srb));
 #ifdef CONFIG_MACH_MX51_BABBAGE
 			if ((us->srb->cmnd[0] == 0x85) &&
-			    (le16_to_cpu(us->pusb_dev->descriptor.idVendor)
+			    (((le16_to_cpu(us->pusb_dev->descriptor.idVendor)
 								== 0x05e3) &&
 			    (le16_to_cpu(us->pusb_dev->descriptor.idProduct)
-								== 0x0718))
-				US_DEBUGP("Skip ATA PASS-THROUGH command\n");
+								== 0x0718)) ||
+			    ((le16_to_cpu(us->pusb_dev->descriptor.idVendor)
+								== 0x152d) &&
+			    (le16_to_cpu(us->pusb_dev->descriptor.idProduct)
+								== 0x2329))))
+					US_DEBUGP("Skip ATA PASS-THROUGH command\n");
 			else
 #endif
 			us->proto_handler(us->srb, us);