* [U-Boot] [RESEND PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
@ 2015-04-15 11:42 Michal Simek
2015-04-24 15:46 ` Lukasz Majewski
0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2015-04-15 11:42 UTC (permalink / raw)
To: u-boot
From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Allocate request up to THOR_PACKET_SIZE not the ep0->maxpacket
as the descriptors data depend on the number of descriptors
and this 64 bytes were not enough and the buffer might overflow
which results in memalign failures later.
Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/usb/gadget/f_thor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
index 31eec36be876..5c8f6768519c 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -775,7 +775,7 @@ static int thor_func_bind(struct usb_configuration *c, struct usb_function *f)
goto fail;
}
dev->req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE,
- gadget->ep0->maxpacket);
+ THOR_PACKET_SIZE);
if (!dev->req->buf) {
status = -ENOMEM;
goto fail;
--
2.3.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [RESEND PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
2015-04-15 11:42 [U-Boot] [RESEND PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE Michal Simek
@ 2015-04-24 15:46 ` Lukasz Majewski
2015-08-12 10:36 ` Michal Simek
0 siblings, 1 reply; 5+ messages in thread
From: Lukasz Majewski @ 2015-04-24 15:46 UTC (permalink / raw)
To: u-boot
Hi Michal,
> From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
>
> Allocate request up to THOR_PACKET_SIZE not the ep0->maxpacket
> as the descriptors data depend on the number of descriptors
> and this 64 bytes were not enough and the buffer might overflow
> which results in memalign failures later.
>
> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> drivers/usb/gadget/f_thor.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
> index 31eec36be876..5c8f6768519c 100644
> --- a/drivers/usb/gadget/f_thor.c
> +++ b/drivers/usb/gadget/f_thor.c
> @@ -775,7 +775,7 @@ static int thor_func_bind(struct
> usb_configuration *c, struct usb_function *f) goto fail;
> }
> dev->req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE,
> - gadget->ep0->maxpacket);
> + THOR_PACKET_SIZE);
> if (!dev->req->buf) {
> status = -ENOMEM;
> goto fail;
Applied to u-boot-dfu. Thanks!
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [RESEND PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
2015-04-24 15:46 ` Lukasz Majewski
@ 2015-08-12 10:36 ` Michal Simek
2015-08-12 11:09 ` Lukasz Majewski
0 siblings, 1 reply; 5+ messages in thread
From: Michal Simek @ 2015-08-12 10:36 UTC (permalink / raw)
To: u-boot
Hi Lukasz,
On 04/24/2015 05:46 PM, Lukasz Majewski wrote:
> Hi Michal,
>
>> From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
>>
>> Allocate request up to THOR_PACKET_SIZE not the ep0->maxpacket
>> as the descriptors data depend on the number of descriptors
>> and this 64 bytes were not enough and the buffer might overflow
>> which results in memalign failures later.
>>
>> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> drivers/usb/gadget/f_thor.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
>> index 31eec36be876..5c8f6768519c 100644
>> --- a/drivers/usb/gadget/f_thor.c
>> +++ b/drivers/usb/gadget/f_thor.c
>> @@ -775,7 +775,7 @@ static int thor_func_bind(struct
>> usb_configuration *c, struct usb_function *f) goto fail;
>> }
>> dev->req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE,
>> - gadget->ep0->maxpacket);
>> + THOR_PACKET_SIZE);
>> if (!dev->req->buf) {
>> status = -ENOMEM;
>> goto fail;
>
> Applied to u-boot-dfu. Thanks!
>
I can't see this patch in your branch. Did you add it?
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150812/a5a79340/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [RESEND PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
2015-08-12 10:36 ` Michal Simek
@ 2015-08-12 11:09 ` Lukasz Majewski
2015-08-12 11:14 ` Michal Simek
0 siblings, 1 reply; 5+ messages in thread
From: Lukasz Majewski @ 2015-08-12 11:09 UTC (permalink / raw)
To: u-boot
Hi Michal,
> Hi Lukasz,
>
> On 04/24/2015 05:46 PM, Lukasz Majewski wrote:
> > Hi Michal,
> >
> >> From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
> >>
> >> Allocate request up to THOR_PACKET_SIZE not the ep0->maxpacket
> >> as the descriptors data depend on the number of descriptors
> >> and this 64 bytes were not enough and the buffer might overflow
> >> which results in memalign failures later.
> >>
> >> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> >> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> >> ---
> >>
> >> drivers/usb/gadget/f_thor.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/usb/gadget/f_thor.c
> >> b/drivers/usb/gadget/f_thor.c index 31eec36be876..5c8f6768519c
> >> 100644 --- a/drivers/usb/gadget/f_thor.c
> >> +++ b/drivers/usb/gadget/f_thor.c
> >> @@ -775,7 +775,7 @@ static int thor_func_bind(struct
> >> usb_configuration *c, struct usb_function *f) goto fail;
> >> }
> >> dev->req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE,
> >> - gadget->ep0->maxpacket);
> >> + THOR_PACKET_SIZE);
> >> if (!dev->req->buf) {
> >> status = -ENOMEM;
> >> goto fail;
> >
> > Applied to u-boot-dfu. Thanks!
> >
>
> I can't see this patch in your branch. Did you add it?
Please look into u-boot-dfu/testing branch.
I've placed them there for testing. Afterwards I will put them to
master branch
>
> Thanks,
> Michal
>
--
Best regards,
Lukasz Majewski
Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [RESEND PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE
2015-08-12 11:09 ` Lukasz Majewski
@ 2015-08-12 11:14 ` Michal Simek
0 siblings, 0 replies; 5+ messages in thread
From: Michal Simek @ 2015-08-12 11:14 UTC (permalink / raw)
To: u-boot
On 08/12/2015 01:09 PM, Lukasz Majewski wrote:
> Hi Michal,
>
>> Hi Lukasz,
>>
>> On 04/24/2015 05:46 PM, Lukasz Majewski wrote:
>>> Hi Michal,
>>>
>>>> From: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
>>>>
>>>> Allocate request up to THOR_PACKET_SIZE not the ep0->maxpacket
>>>> as the descriptors data depend on the number of descriptors
>>>> and this 64 bytes were not enough and the buffer might overflow
>>>> which results in memalign failures later.
>>>>
>>>> Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>> ---
>>>>
>>>> drivers/usb/gadget/f_thor.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/usb/gadget/f_thor.c
>>>> b/drivers/usb/gadget/f_thor.c index 31eec36be876..5c8f6768519c
>>>> 100644 --- a/drivers/usb/gadget/f_thor.c
>>>> +++ b/drivers/usb/gadget/f_thor.c
>>>> @@ -775,7 +775,7 @@ static int thor_func_bind(struct
>>>> usb_configuration *c, struct usb_function *f) goto fail;
>>>> }
>>>> dev->req->buf = memalign(CONFIG_SYS_CACHELINE_SIZE,
>>>> - gadget->ep0->maxpacket);
>>>> + THOR_PACKET_SIZE);
>>>> if (!dev->req->buf) {
>>>> status = -ENOMEM;
>>>> goto fail;
>>>
>>> Applied to u-boot-dfu. Thanks!
>>>
>>
>> I can't see this patch in your branch. Did you add it?
>
> Please look into u-boot-dfu/testing branch.
>
> I've placed them there for testing. Afterwards I will put them to
> master branch
Ok.
Thanks,
Michal
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-08-12 11:14 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-15 11:42 [U-Boot] [RESEND PATCH] usb: gadget: f_thor: Allocate request up to THOR_PACKET_SIZE Michal Simek
2015-04-24 15:46 ` Lukasz Majewski
2015-08-12 10:36 ` Michal Simek
2015-08-12 11:09 ` Lukasz Majewski
2015-08-12 11:14 ` Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox