2011-03-07 16:49:02

by Tanya Brokhman

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

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 <[email protected]>

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


2011-03-07 16:52:37

by Greg KH

[permalink] [raw]
Subject: Re: [RFC/PATCH 5/5] uas: HACK needed for UAS host.

On Mon, Mar 07, 2011 at 06:48:51PM +0200, Tatyana Brokhman wrote:
> REMOVE LATER ON!

Remove what? The patch or this description?

confused,

greg k-h

2011-03-07 16:56:25

by Tanya Brokhman

[permalink] [raw]
Subject: RE: [RFC/PATCH 5/5] uas: HACK needed for UAS host.

This patch is not for submission, it's a HACK and the bug should be fixed in
another way. I've uploaded it because it's needed at the moment for working
with the UAS gadget driver and the current version of UAS host. I'm working
on resolving this issue with Sarah on another email thread. Just thought
that if someone wishes to use the driver right now this patch will be useful
to him.

Best regards,
Tanya Brokhman
Consultant for Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum


> -----Original Message-----
> From: Greg KH [mailto:[email protected]]
> Sent: Monday, March 07, 2011 6:52 PM
> To: Tatyana Brokhman
> Cc: [email protected]; [email protected]; open list:USB
> GADGET/PERIPH...; open list
> Subject: Re: [RFC/PATCH 5/5] uas: HACK needed for UAS host.
>
> On Mon, Mar 07, 2011 at 06:48:51PM +0200, Tatyana Brokhman wrote:
> > REMOVE LATER ON!
>
> Remove what? The patch or this description?
>
> confused,
>
> greg k-h