Commit 0432eed0 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Greg Kroah-Hartman

usb: renesas_usbhs: tifyup packet start timing

packet transfer timing are controlled in mod_gadget on current renesas_usbhs,
and this style will be imitated on mod_host.
But it need not be managed with host/gadget if it is general transfer.
By this patch, the packet transfer timing is managed in fifo.c
Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d77e3f4e
...@@ -74,6 +74,8 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, ...@@ -74,6 +74,8 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
usbhs_unlock(priv, flags); usbhs_unlock(priv, flags);
/******************** spin unlock ******************/ /******************** spin unlock ******************/
usbhs_pkt_start(pipe);
} }
static void __usbhsf_pkt_del(struct usbhs_pkt *pkt) static void __usbhsf_pkt_del(struct usbhs_pkt *pkt)
...@@ -148,8 +150,10 @@ int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type) ...@@ -148,8 +150,10 @@ int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type)
usbhs_unlock(priv, flags); usbhs_unlock(priv, flags);
/******************** spin unlock ******************/ /******************** spin unlock ******************/
if (is_done) if (is_done) {
info->done(pkt); info->done(pkt);
usbhs_pkt_start(pipe);
}
return ret; return ret;
} }
......
...@@ -125,23 +125,16 @@ static void usbhsg_queue_push(struct usbhsg_uep *uep, ...@@ -125,23 +125,16 @@ static void usbhsg_queue_push(struct usbhsg_uep *uep,
struct usbhs_pkt *pkt = usbhsg_ureq_to_pkt(ureq); struct usbhs_pkt *pkt = usbhsg_ureq_to_pkt(ureq);
struct usb_request *req = &ureq->req; struct usb_request *req = &ureq->req;
usbhs_pkt_push(pipe, pkt, uep->handler,
req->buf, req->length, req->zero);
req->actual = 0; req->actual = 0;
req->status = -EINPROGRESS; req->status = -EINPROGRESS;
usbhs_pkt_push(pipe, pkt, uep->handler,
req->buf, req->length, req->zero);
dev_dbg(dev, "pipe %d : queue push (%d)\n", dev_dbg(dev, "pipe %d : queue push (%d)\n",
usbhs_pipe_number(pipe), usbhs_pipe_number(pipe),
req->length); req->length);
} }
static void usbhsg_queue_start(struct usbhsg_uep *uep)
{
struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep);
usbhs_pkt_start(pipe);
}
static void usbhsg_queue_pop(struct usbhsg_uep *uep, static void usbhsg_queue_pop(struct usbhsg_uep *uep,
struct usbhsg_request *ureq, struct usbhsg_request *ureq,
int status) int status)
...@@ -154,10 +147,6 @@ static void usbhsg_queue_pop(struct usbhsg_uep *uep, ...@@ -154,10 +147,6 @@ static void usbhsg_queue_pop(struct usbhsg_uep *uep,
ureq->req.status = status; ureq->req.status = status;
ureq->req.complete(&uep->ep, &ureq->req); ureq->req.complete(&uep->ep, &ureq->req);
/* more request ? */
if (0 == status)
usbhsg_queue_start(uep);
} }
static void usbhsg_queue_done(struct usbhs_pkt *pkt) static void usbhsg_queue_done(struct usbhs_pkt *pkt)
...@@ -222,6 +211,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv, ...@@ -222,6 +211,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv); struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv);
struct device *dev = usbhsg_gpriv_to_dev(gpriv); struct device *dev = usbhsg_gpriv_to_dev(gpriv);
struct usbhsg_uep *uep; struct usbhsg_uep *uep;
struct usbhs_pipe *pipe;
int recip = ctrl->bRequestType & USB_RECIP_MASK; int recip = ctrl->bRequestType & USB_RECIP_MASK;
int nth = le16_to_cpu(ctrl->wIndex) & USB_ENDPOINT_NUMBER_MASK; int nth = le16_to_cpu(ctrl->wIndex) & USB_ENDPOINT_NUMBER_MASK;
int ret; int ret;
...@@ -230,7 +220,8 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv, ...@@ -230,7 +220,8 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
char *msg; char *msg;
uep = usbhsg_gpriv_to_nth_uep(gpriv, nth); uep = usbhsg_gpriv_to_nth_uep(gpriv, nth);
if (!usbhsg_uep_to_pipe(uep)) { pipe = usbhsg_uep_to_pipe(uep);
if (!pipe) {
dev_err(dev, "wrong recip request\n"); dev_err(dev, "wrong recip request\n");
ret = -EINVAL; ret = -EINVAL;
goto usbhsg_recip_run_handle_end; goto usbhsg_recip_run_handle_end;
...@@ -268,7 +259,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv, ...@@ -268,7 +259,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
} }
usbhsg_recip_run_handle_end: usbhsg_recip_run_handle_end:
usbhsg_queue_start(uep); usbhs_pkt_start(pipe);
return ret; return ret;
} }
...@@ -470,7 +461,6 @@ static int usbhsg_ep_queue(struct usb_ep *ep, struct usb_request *req, ...@@ -470,7 +461,6 @@ static int usbhsg_ep_queue(struct usb_ep *ep, struct usb_request *req,
return -ESHUTDOWN; return -ESHUTDOWN;
usbhsg_queue_push(uep, ureq); usbhsg_queue_push(uep, ureq);
usbhsg_queue_start(uep);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment