~ubuntu-branches/ubuntu/precise/linux-lowlatency/precise

« back to all changes in this revision

Viewing changes to drivers/usb/gadget/fsl_udc_core.c

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich, Luke Yelavich, Upstream Kernel Changes
  • Date: 2012-04-04 18:49:36 UTC
  • Revision ID: package-import@ubuntu.com-20120404184936-tqu735914muv4wpg
Tags: 3.2.0-22.30
[ Luke Yelavich ]

* [Config] Update configs after rebase against Ubuntu-3.2.0-22.35

[ Upstream Kernel Changes ]

* Low-latency: Rebase against Ubuntu-3.2.0-22.35

Show diffs side-by-side

added added

removed removed

Lines of Context:
768
768
 * @is_last: return flag if it is the last dTD of the request
769
769
 * return: pointer to the built dTD */
770
770
static struct ep_td_struct *fsl_build_dtd(struct fsl_req *req, unsigned *length,
771
 
                dma_addr_t *dma, int *is_last)
 
771
                dma_addr_t *dma, int *is_last, gfp_t gfp_flags)
772
772
{
773
773
        u32 swap_temp;
774
774
        struct ep_td_struct *dtd;
777
777
        *length = min(req->req.length - req->req.actual,
778
778
                        (unsigned)EP_MAX_LENGTH_TRANSFER);
779
779
 
780
 
        dtd = dma_pool_alloc(udc_controller->td_pool, GFP_KERNEL, dma);
 
780
        dtd = dma_pool_alloc(udc_controller->td_pool, gfp_flags, dma);
781
781
        if (dtd == NULL)
782
782
                return dtd;
783
783
 
827
827
}
828
828
 
829
829
/* Generate dtd chain for a request */
830
 
static int fsl_req_to_dtd(struct fsl_req *req)
 
830
static int fsl_req_to_dtd(struct fsl_req *req, gfp_t gfp_flags)
831
831
{
832
832
        unsigned        count;
833
833
        int             is_last;
836
836
        dma_addr_t dma;
837
837
 
838
838
        do {
839
 
                dtd = fsl_build_dtd(req, &count, &dma, &is_last);
 
839
                dtd = fsl_build_dtd(req, &count, &dma, &is_last, gfp_flags);
840
840
                if (dtd == NULL)
841
841
                        return -ENOMEM;
842
842
 
910
910
        req->req.actual = 0;
911
911
        req->dtd_count = 0;
912
912
 
913
 
        spin_lock_irqsave(&udc->lock, flags);
914
 
 
915
913
        /* build dtds and push them to device queue */
916
 
        if (!fsl_req_to_dtd(req)) {
 
914
        if (!fsl_req_to_dtd(req, gfp_flags)) {
 
915
                spin_lock_irqsave(&udc->lock, flags);
917
916
                fsl_queue_td(ep, req);
918
917
        } else {
919
 
                spin_unlock_irqrestore(&udc->lock, flags);
920
918
                return -ENOMEM;
921
919
        }
922
920
 
1295
1293
                        ep_is_in(ep) ? DMA_TO_DEVICE : DMA_FROM_DEVICE);
1296
1294
        req->mapped = 1;
1297
1295
 
1298
 
        if (fsl_req_to_dtd(req) == 0)
 
1296
        if (fsl_req_to_dtd(req, GFP_ATOMIC) == 0)
1299
1297
                fsl_queue_td(ep, req);
1300
1298
        else
1301
1299
                return -ENOMEM;
1379
1377
        req->mapped = 1;
1380
1378
 
1381
1379
        /* prime the data phase */
1382
 
        if ((fsl_req_to_dtd(req) == 0))
 
1380
        if ((fsl_req_to_dtd(req, GFP_ATOMIC) == 0))
1383
1381
                fsl_queue_td(ep, req);
1384
1382
        else                    /* no mem */
1385
1383
                goto stall;