[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <8d991a09-4931-ca21-2128-b167719fa605@felipetonello.com>
Date: Thu, 11 Aug 2016 09:37:45 +0100
From: Felipe Ferreri Tonello <eu@...ipetonello.com>
To: Felipe Balbi <balbi@...nel.org>,
Baolin Wang <baolin.wang@...aro.org>
Cc: USB <linux-usb@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/4] usb: gadget: f_midi: fixed endianness when using
wMaxPacketSize
Hi Balbi,
On 10/08/16 12:24, Felipe Balbi wrote:
>
> Hi,
>
> Baolin Wang <baolin.wang@...aro.org> writes:
>> On 26 July 2016 at 07:15, Felipe F. Tonello <eu@...ipetonello.com> wrote:
>>> USB spec specifies wMaxPacketSize to be little endian (as other properties),
>>> so when using this variable in the driver we should convert to the current
>>> CPU endianness if necessary.
>>>
>>> Signed-off-by: Felipe F. Tonello <eu@...ipetonello.com>
>>> ---
>>> drivers/usb/gadget/function/f_midi.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
>>> index 58fc199a18ec..a83d852b1da5 100644
>>> --- a/drivers/usb/gadget/function/f_midi.c
>>> +++ b/drivers/usb/gadget/function/f_midi.c
>>> @@ -362,7 +362,7 @@ static int f_midi_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
>>> struct usb_request *req =
>>> midi_alloc_ep_req(midi->out_ep,
>>> max_t(unsigned, midi->buflen,
>>> - bulk_out_desc.wMaxPacketSize));
>>> + le16_to_cpu(bulk_out_desc.wMaxPacketSize)));
>>
>> I think here we should use usb_ep_align_maybe() function instead of
>> max_t() to handle 'quirk_ep_out_aligned_size' quirk, please see the
>> patch I've send out: https://lkml.org/lkml/2016/7/12/106
>
> agree, if usb_ep_align_maybe() has a bug with endianness, let's fix it
> since there are other gadgets using usb_ep_align_maybe()
>
Can you take a look at v4 of this patchset, please? It's the latest
stuff I have sent.
--
Felipe
Download attachment "0x92698E6A.asc" of type "application/pgp-keys" (7196 bytes)
Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)
Powered by blists - more mailing lists