Re: [RFC/PATCH 15/45] usb: chipidea: udc: make use of new usb_endpoint_maxp_mult()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Peter Chen <hzpeterchen@xxxxxxxxx> writes:
> On Wed, Sep 28, 2016 at 04:05:24PM +0300, Felipe Balbi wrote:
>> We have introduced a helper to calculate multiplier
>> value from wMaxPacketSize. Start using it.
>> 
>> Cc: Peter Chen <Peter.Chen@xxxxxxx>
>> Cc: <linux-usb@xxxxxxxxxxxxxxx>
>> Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
>> ---
>>  drivers/usb/chipidea/udc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
>> index 661f43fe0f9e..2b95ca887ca4 100644
>> --- a/drivers/usb/chipidea/udc.c
>> +++ b/drivers/usb/chipidea/udc.c
>> @@ -1254,7 +1254,7 @@ static int ep_enable(struct usb_ep *ep,
>>  	hwep->type = usb_endpoint_type(desc);
>>  
>>  	hwep->ep.maxpacket = usb_endpoint_maxp(desc) & 0x07ff;
>> -	hwep->ep.mult = QH_ISO_MULT(usb_endpoint_maxp(desc));
>> +	hwep->ep.mult = usb_endpoint_maxp_mult(desc);
>>  
>>  	if (hwep->type == USB_ENDPOINT_XFER_CONTROL)
>>  		cap |= QH_IOS;
>> -- 
>
> You may need to change _ep_queue which uses hwep->ep.mult.

good catch, here's a new version:

8<------------------------------------------------------------------------------
From 576c3006a6e7bf0ea4ee150a9655e392fc0297cc Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
Date: Wed, 28 Sep 2016 13:26:18 +0300
Subject: [PATCH] usb: chipidea: udc: make use of new usb_endpoint_maxp_mult()

We have introduced a helper to calculate multiplier
value from wMaxPacketSize. Start using it.

Cc: Peter Chen <Peter.Chen@xxxxxxx>
Cc: <linux-usb@xxxxxxxxxxxxxxx>
Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx>
---
 drivers/usb/chipidea/udc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 661f43fe0f9e..7a535be3024e 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -821,7 +821,7 @@ static int _ep_queue(struct usb_ep *ep, struct usb_request *req,
 	}
 
 	if (usb_endpoint_xfer_isoc(hwep->ep.desc) &&
-	    hwreq->req.length > (1 + hwep->ep.mult) * hwep->ep.maxpacket) {
+	    hwreq->req.length > hwep->ep.mult * hwep->ep.maxpacket) {
 		dev_err(hwep->ci->dev, "request length too big for isochronous\n");
 		return -EMSGSIZE;
 	}
@@ -1254,7 +1254,7 @@ static int ep_enable(struct usb_ep *ep,
 	hwep->type = usb_endpoint_type(desc);
 
 	hwep->ep.maxpacket = usb_endpoint_maxp(desc) & 0x07ff;
-	hwep->ep.mult = QH_ISO_MULT(usb_endpoint_maxp(desc));
+	hwep->ep.mult = usb_endpoint_maxp_mult(desc);
 
 	if (hwep->type == USB_ENDPOINT_XFER_CONTROL)
 		cap |= QH_IOS;
-- 
2.10.1



-- 
balbi

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux