diff options
author | Artem Leonenko <tikkeri@gmail.com> | 2010-12-15 02:47:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-16 16:32:37 -0500 |
commit | 0a313c4d2435ed0d86cf2295514f02de34cecd88 (patch) | |
tree | 243bf1a49156fa98b1ddeb78d8780af1848e7c3f /drivers/usb | |
parent | 7c25a82684364da44643cbe3bdbd0f8835293767 (diff) |
USB: gadget: ci13xxx: don't assume that PAGE_SIZE is 4096
Page size for transaction descriptors for CI13XXX has nothing
common with page size from MM. Using platform and configuration
specific PAGE_SIZE is wrong.
Signed-off-by: Artem Leonenko <tikkeri@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/ci13xxx_udc.c | 10 | ||||
-rw-r--r-- | drivers/usb/gadget/ci13xxx_udc.h | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c index 0060eef0e923..31656a2b4ab4 100644 --- a/drivers/usb/gadget/ci13xxx_udc.c +++ b/drivers/usb/gadget/ci13xxx_udc.c | |||
@@ -1460,7 +1460,7 @@ static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq) | |||
1460 | mReq->ptr->page[0] = mReq->req.dma; | 1460 | mReq->ptr->page[0] = mReq->req.dma; |
1461 | for (i = 1; i < 5; i++) | 1461 | for (i = 1; i < 5; i++) |
1462 | mReq->ptr->page[i] = | 1462 | mReq->ptr->page[i] = |
1463 | (mReq->req.dma + i * PAGE_SIZE) & ~TD_RESERVED_MASK; | 1463 | (mReq->req.dma + i * CI13XXX_PAGE_SIZE) & ~TD_RESERVED_MASK; |
1464 | 1464 | ||
1465 | /* | 1465 | /* |
1466 | * QH configuration | 1466 | * QH configuration |
@@ -2159,8 +2159,8 @@ static int ep_queue(struct usb_ep *ep, struct usb_request *req, | |||
2159 | goto done; | 2159 | goto done; |
2160 | } | 2160 | } |
2161 | 2161 | ||
2162 | if (req->length > (4 * PAGE_SIZE)) { | 2162 | if (req->length > (4 * CI13XXX_PAGE_SIZE)) { |
2163 | req->length = (4 * PAGE_SIZE); | 2163 | req->length = (4 * CI13XXX_PAGE_SIZE); |
2164 | retval = -EMSGSIZE; | 2164 | retval = -EMSGSIZE; |
2165 | warn("request length truncated"); | 2165 | warn("request length truncated"); |
2166 | } | 2166 | } |
@@ -2410,13 +2410,13 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
2410 | /* alloc resources */ | 2410 | /* alloc resources */ |
2411 | udc->qh_pool = dma_pool_create("ci13xxx_qh", &udc->gadget.dev, | 2411 | udc->qh_pool = dma_pool_create("ci13xxx_qh", &udc->gadget.dev, |
2412 | sizeof(struct ci13xxx_qh), | 2412 | sizeof(struct ci13xxx_qh), |
2413 | 64, PAGE_SIZE); | 2413 | 64, CI13XXX_PAGE_SIZE); |
2414 | if (udc->qh_pool == NULL) | 2414 | if (udc->qh_pool == NULL) |
2415 | return -ENOMEM; | 2415 | return -ENOMEM; |
2416 | 2416 | ||
2417 | udc->td_pool = dma_pool_create("ci13xxx_td", &udc->gadget.dev, | 2417 | udc->td_pool = dma_pool_create("ci13xxx_td", &udc->gadget.dev, |
2418 | sizeof(struct ci13xxx_td), | 2418 | sizeof(struct ci13xxx_td), |
2419 | 64, PAGE_SIZE); | 2419 | 64, CI13XXX_PAGE_SIZE); |
2420 | if (udc->td_pool == NULL) { | 2420 | if (udc->td_pool == NULL) { |
2421 | dma_pool_destroy(udc->qh_pool); | 2421 | dma_pool_destroy(udc->qh_pool); |
2422 | udc->qh_pool = NULL; | 2422 | udc->qh_pool = NULL; |
diff --git a/drivers/usb/gadget/ci13xxx_udc.h b/drivers/usb/gadget/ci13xxx_udc.h index 4fd19313e238..f61fed07f76b 100644 --- a/drivers/usb/gadget/ci13xxx_udc.h +++ b/drivers/usb/gadget/ci13xxx_udc.h | |||
@@ -19,6 +19,7 @@ | |||
19 | /****************************************************************************** | 19 | /****************************************************************************** |
20 | * DEFINE | 20 | * DEFINE |
21 | *****************************************************************************/ | 21 | *****************************************************************************/ |
22 | #define CI13XXX_PAGE_SIZE 4096ul /* page size for TD's */ | ||
22 | #define ENDPT_MAX (16) | 23 | #define ENDPT_MAX (16) |
23 | #define CTRL_PAYLOAD_MAX (64) | 24 | #define CTRL_PAYLOAD_MAX (64) |
24 | #define RX (0) /* similar to USB_DIR_OUT but can be used as an index */ | 25 | #define RX (0) /* similar to USB_DIR_OUT but can be used as an index */ |