usb: renesas_usbhs: use transfer counter if IN direction bulk pipe
received data will break if it was bulk pipe and large data size, because pipe kept BUF PID even though it doesn't have enough buffer. To avoid this issue, renesas_usbhs can use transfer counter. Pipe PID will be NAK if it didn't have enough buffer by this patch. renesas_usbhs has strange address mapping. Thus, it is difficult to calculate transfer counter setting address. This patch use fixed table for it. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:

zatwierdzone przez
Felipe Balbi

rodzic
7b332e5fef
commit
1c90ee0b3e
@@ -488,6 +488,8 @@ static int usbhsf_pio_try_push(struct usbhs_pkt *pkt, int *is_done)
|
||||
usbhs_pipe_data_sequence(pipe, pkt->sequence);
|
||||
pkt->sequence = -1; /* -1 sequence will be ignored */
|
||||
|
||||
usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length);
|
||||
|
||||
ret = usbhsf_fifo_select(pipe, fifo, 1);
|
||||
if (ret < 0)
|
||||
return 0;
|
||||
@@ -594,6 +596,7 @@ static int usbhsf_prepare_pop(struct usbhs_pkt *pkt, int *is_done)
|
||||
usbhs_pipe_data_sequence(pipe, pkt->sequence);
|
||||
pkt->sequence = -1; /* -1 sequence will be ignored */
|
||||
|
||||
usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->length);
|
||||
usbhs_pipe_enable(pipe);
|
||||
usbhsf_rx_irq_ctrl(pipe, 1);
|
||||
|
||||
@@ -795,6 +798,7 @@ static void xfer_work(struct work_struct *work)
|
||||
dev_dbg(dev, " %s %d (%d/ %d)\n",
|
||||
fifo->name, usbhs_pipe_number(pipe), pkt->length, pkt->zero);
|
||||
|
||||
usbhs_pipe_set_trans_count_if_bulk(pipe, pkt->trans);
|
||||
usbhsf_dma_start(pipe, fifo);
|
||||
dma_async_issue_pending(chan);
|
||||
}
|
||||
|
Reference in New Issue
Block a user