aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs/fifo.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/renesas_usbhs/fifo.c')
-rw-r--r--drivers/usb/renesas_usbhs/fifo.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 72339bd6fcab..3648c82a17fe 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -23,6 +23,7 @@
23#define usbhsf_get_cfifo(p) (&((p)->fifo_info.cfifo)) 23#define usbhsf_get_cfifo(p) (&((p)->fifo_info.cfifo))
24#define usbhsf_get_d0fifo(p) (&((p)->fifo_info.d0fifo)) 24#define usbhsf_get_d0fifo(p) (&((p)->fifo_info.d0fifo))
25#define usbhsf_get_d1fifo(p) (&((p)->fifo_info.d1fifo)) 25#define usbhsf_get_d1fifo(p) (&((p)->fifo_info.d1fifo))
26#define usbhsf_is_cfifo(p, f) (usbhsf_get_cfifo(p) == f)
26 27
27#define usbhsf_fifo_is_busy(f) ((f)->pipe) /* see usbhs_pipe_select_fifo */ 28#define usbhsf_fifo_is_busy(f) ((f)->pipe) /* see usbhs_pipe_select_fifo */
28 29
@@ -75,8 +76,7 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
75 pipe->handler = &usbhsf_null_handler; 76 pipe->handler = &usbhsf_null_handler;
76 } 77 }
77 78
78 list_del_init(&pkt->node); 79 list_move_tail(&pkt->node, &pipe->list);
79 list_add_tail(&pkt->node, &pipe->list);
80 80
81 /* 81 /*
82 * each pkt must hold own handler. 82 * each pkt must hold own handler.
@@ -106,7 +106,7 @@ static struct usbhs_pkt *__usbhsf_pkt_get(struct usbhs_pipe *pipe)
106 if (list_empty(&pipe->list)) 106 if (list_empty(&pipe->list))
107 return NULL; 107 return NULL;
108 108
109 return list_entry(pipe->list.next, struct usbhs_pkt, node); 109 return list_first_entry(&pipe->list, struct usbhs_pkt, node);
110} 110}
111 111
112struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt) 112struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt)
@@ -305,7 +305,10 @@ static int usbhsf_fifo_select(struct usbhs_pipe *pipe,
305 } 305 }
306 306
307 /* "base" will be used below */ 307 /* "base" will be used below */
308 usbhs_write(priv, fifo->sel, base | MBW_32); 308 if (usbhs_get_dparam(priv, has_sudmac) && !usbhsf_is_cfifo(priv, fifo))
309 usbhs_write(priv, fifo->sel, base);
310 else
311 usbhs_write(priv, fifo->sel, base | MBW_32);
309 312
310 /* check ISEL and CURPIPE value */ 313 /* check ISEL and CURPIPE value */
311 while (timeout--) { 314 while (timeout--) {
@@ -762,9 +765,9 @@ static int __usbhsf_dma_map_ctrl(struct usbhs_pkt *pkt, int map)
762} 765}
763 766
764static void usbhsf_dma_complete(void *arg); 767static void usbhsf_dma_complete(void *arg);
765static void usbhsf_dma_prepare_tasklet(unsigned long data) 768static void xfer_work(struct work_struct *work)
766{ 769{
767 struct usbhs_pkt *pkt = (struct usbhs_pkt *)data; 770 struct usbhs_pkt *pkt = container_of(work, struct usbhs_pkt, work);
768 struct usbhs_pipe *pipe = pkt->pipe; 771 struct usbhs_pipe *pipe = pkt->pipe;
769 struct usbhs_fifo *fifo = usbhs_pipe_to_fifo(pipe); 772 struct usbhs_fifo *fifo = usbhs_pipe_to_fifo(pipe);
770 struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); 773 struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
@@ -844,11 +847,8 @@ static int usbhsf_dma_prepare_push(struct usbhs_pkt *pkt, int *is_done)
844 847
845 pkt->trans = len; 848 pkt->trans = len;
846 849
847 tasklet_init(&fifo->tasklet, 850 INIT_WORK(&pkt->work, xfer_work);
848 usbhsf_dma_prepare_tasklet, 851 schedule_work(&pkt->work);
849 (unsigned long)pkt);
850
851 tasklet_schedule(&fifo->tasklet);
852 852
853 return 0; 853 return 0;
854 854
@@ -938,11 +938,8 @@ static int usbhsf_dma_try_pop(struct usbhs_pkt *pkt, int *is_done)
938 938
939 pkt->trans = len; 939 pkt->trans = len;
940 940
941 tasklet_init(&fifo->tasklet, 941 INIT_WORK(&pkt->work, xfer_work);
942 usbhsf_dma_prepare_tasklet, 942 schedule_work(&pkt->work);
943 (unsigned long)pkt);
944
945 tasklet_schedule(&fifo->tasklet);
946 943
947 return 0; 944 return 0;
948 945