From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Subject: Re: [PATCH v12 4/8] usb:gadget: Add SuperSpeed support to the Gadget Framework Date: Tue, 24 May 2011 01:14:38 -0400 Message-ID: References: <1306132882-9668-1-git-send-email-tlinder@codeaurora.org> <1306132882-9668-5-git-send-email-tlinder@codeaurora.org> <20110523123135.GA10785@linutronix.de> <00eb01cc19d0$e526a9b0$af73fd10$@org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:43387 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751010Ab1EXFO7 convert rfc822-to-8bit (ORCPT ); Tue, 24 May 2011 01:14:59 -0400 In-Reply-To: <00eb01cc19d0$e526a9b0$af73fd10$@org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Tanya Brokhman Cc: Sebastian Andrzej Siewior , greg@kroah.com, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, balbi@ti.com, ablay@codeaurora.org, open list On Tue, May 24, 2011 at 01:10, Tanya Brokhman wrote: >> >+ =C2=A0 =C2=A0case USB_REQ_GET_STATUS: >> >+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (!gadget_is_superspee= d(gadget)) >> >+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0goto unknown; >> >+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ctrl->bRequestType != =3D (USB_DIR_IN | USB_RECIP_INTERFACE)) >> >+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0goto unknown; >> >+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0value =3D 2; =C2=A0 =C2=A0= =C2=A0/* This is the length of the get_status >> >+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*((__le16 *)req->buf) =3D= 0; >> >> Mike please correct me if I'm wrong bug this looks like a case for >> put_unaligned_le16(). >> Is someone actually using gadget support on blackfin? I'm asking >> because >> config_buf() (same file, upstream) is using req->buf to build the >> descriptors in place and one element is le16 which should be affecte= d. > > Mike answered that you're right in your observation. I'm not familiar= with > blackfin. Could you please elaborate on this? I understand that I nee= d to > use put_unaligned_le16(), will do, but I would like to better underst= and why > and if there is a way to test this so that blackfin won't be broken. not all arches support unaligned accesses. or they do, but it's done via (non-trivial) exception processing in software. req->buf is of type void* and so presumably is not guaranteed to be aligned on a 2 byte boundary. -mike