diff mbox

[1/1] Ubuntu: SAUCE: Workaround for SATA drive failure on Ubuntu installation

Message ID 1260955272-6659-2-git-send-email-bryan.wu@canonical.com
State Superseded
Headers show

Commit Message

Bryan Wu Dec. 16, 2009, 9:21 a.m. UTC
From: Dinh Nguyen <r00091@freescale.com>

BugLink: http://bugs.launchpad.net/bugs/431963

Original patch was from Dinh Nguyen. That one find the root cause
of this SATA drive failure issue. The USB2SATA chip GL830 can not
accept the ATA PASS THROUGH command.

This patch will skip the ATA PASS THROUGH command only for GL830
USB device. So it will not effect other USB devices.

Signed-off-by: Dinh Nguyen <r00091@freescale.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
---
 drivers/usb/storage/usb.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

Comments

Stefan Bader Dec. 16, 2009, 10:36 a.m. UTC | #1
Ok, at least this really really only affects imx51. Just
remember this if you ever get a board in imx51 with a different
controller. ;-)


Bryan Wu wrote:
> From: Dinh Nguyen <r00091@freescale.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/431963
> 
> Original patch was from Dinh Nguyen. That one find the root cause
> of this SATA drive failure issue. The USB2SATA chip GL830 can not
> accept the ATA PASS THROUGH command.
> 
> This patch will skip the ATA PASS THROUGH command only for GL830
> USB device. So it will not effect other USB devices.
> 
> Signed-off-by: Dinh Nguyen <r00091@freescale.com>
> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/usb/storage/usb.c |   17 +++++++++++++++--
>  1 files changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
> index 8060b85..d538511 100644
> --- a/drivers/usb/storage/usb.c
> +++ b/drivers/usb/storage/usb.c
> @@ -329,8 +329,21 @@ static int usb_stor_control_thread(void * __us)
>  
>  		/* we've got a command, let's do it! */
>  		else {
> -			US_DEBUG(usb_stor_show_command(us->srb));
> -			us->proto_handler(us->srb, us);
> +#ifdef CONFIG_MACH_MX51_BABBAGE
> +			u16 vid =
> +				le16_to_cpu(us->pusb_dev->descriptor.idVendor);
> +			u16 pid =
> +				le16_to_cpu(us->pusb_dev->descriptor.idProduct);
> +#endif
> +			US_DEBUGP(usb_stor_show_command(us->srb));
> +#ifdef CONFIG_MACH_MX51_BABBAGE
> +			if ((us->srb->cmnd[0] == 0x85) &&
> +				(vid == 0x05e3) &&
> +				(pid == 0x0718))
> +				US_DEBUGP("Skip ATA PASS-THROUGH command\n");
> +			else
> +#endif
> +				us->proto_handler(us->srb, us);
>  		}
>  
>  		/* lock access to the state */
diff mbox

Patch

diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 8060b85..d538511 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -329,8 +329,21 @@  static int usb_stor_control_thread(void * __us)
 
 		/* we've got a command, let's do it! */
 		else {
-			US_DEBUG(usb_stor_show_command(us->srb));
-			us->proto_handler(us->srb, us);
+#ifdef CONFIG_MACH_MX51_BABBAGE
+			u16 vid =
+				le16_to_cpu(us->pusb_dev->descriptor.idVendor);
+			u16 pid =
+				le16_to_cpu(us->pusb_dev->descriptor.idProduct);
+#endif
+			US_DEBUGP(usb_stor_show_command(us->srb));
+#ifdef CONFIG_MACH_MX51_BABBAGE
+			if ((us->srb->cmnd[0] == 0x85) &&
+				(vid == 0x05e3) &&
+				(pid == 0x0718))
+				US_DEBUGP("Skip ATA PASS-THROUGH command\n");
+			else
+#endif
+				us->proto_handler(us->srb, us);
 		}
 
 		/* lock access to the state */