Re: [PATCH v2 2/2] usb: gadget: f_mass_storage: Make us pass USBCVMSC Compliance tests

From: Michal Nazarewicz
Date: Mon May 09 2011 - 06:56:24 EST


On Mon, 09 May 2011 12:08:07 +0200, Roger Quadros wrote:
Defer the SET_CONFIG and SET_INTERFACE control transfer's data/status
stages till we are ready to process new CBW from the host. This way we
ensure that we don't loose any CBW during MSC compliance tests and cause
lock up.

Signed-off-by: Roger Quadros <roger.quadros@xxxxxxxxx>

Acked-by: Michal Nazarewicz <mina86@xxxxxxxxxx>

@@ -2468,7 +2469,7 @@ static int fsg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
struct fsg_dev *fsg = fsg_from_func(f);
fsg->common->new_fsg = fsg;
raise_exception(fsg->common, FSG_STATE_CONFIG_CHANGE);
- return 0;
+ return USB_GADGET_DELAYED_STATUS;
}
static void fsg_disable(struct usb_function *f)

Just a side note, an idea that came to my mind: How about instead
of creating meaning of an arbitrary return value, creating a
usb_composite_setup_pause() or usb_composite_setup_delay()
function? It would be more symmetrical that way. Just an idea,
feel free to ignore.

--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Michal "mina86" Nazarewicz (o o)
ooo +-----<email/xmpp: mnazarewicz@xxxxxxxxxx>-----ooO--(_)--Ooo--
--
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/