[RFC/PATCH 5/5] uas: HACK needed for UAS host.

From: Tatyana Brokhman
Date: Mon Mar 07 2011 - 11:49:06 EST


REMOVE LATER ON!
In today's UAS host driver MODE SENSE command isn't handled correctly.
Each time after power up there is a unit attention condition of
RESET_OCCURRED that needs to be cleared (= acknowledged by the
host) by the MODE SENSE command.
Due to the above this patch resets the RESET_OCCURRED unit attention.

Signed-off-by: Tatyana Brokhman <tlinder@xxxxxxxxxxxxxx>

diff --git a/drivers/usb/gadget/uasp_cmdiu.c b/drivers/usb/gadget/uasp_cmdiu.c
index 4df3d98..51eb132 100644
--- a/drivers/usb/gadget/uasp_cmdiu.c
+++ b/drivers/usb/gadget/uasp_cmdiu.c
@@ -83,6 +83,13 @@ static __u32 check_cmdiu(struct uasp_dev *udev,
curlun->lun->unit_attention_data = SS_NO_SENSE;
return ua_data;
}
+ /* HACK!!! REMOVE!!! */
+ if (curlun->lun->unit_attention_data == SS_RESET_OCCURRED &&
+ cmdiu->cdb[0] == INQUIRY) {
+ curlun->lun->unit_attention_data = SS_NO_SENSE;
+ DBG(udev->ucommon->common, "check_cmdiu() - "
+ "HACK!!! RESETTING unit attention condition\n");
+ }
}

if (curlun && !(curlun->lun->filp) && needs_medium) {
--
1.7.0.4

--
Sent by a Consultant for Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/