Skip to content

Commit 0432eed

Browse files
morimotogregkh
authored andcommitted
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: Kuninori Morimoto <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d77e3f4 commit 0432eed

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

drivers/usb/renesas_usbhs/fifo.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
7474

7575
usbhs_unlock(priv, flags);
7676
/******************** spin unlock ******************/
77+
78+
usbhs_pkt_start(pipe);
7779
}
7880

7981
static void __usbhsf_pkt_del(struct usbhs_pkt *pkt)
@@ -148,8 +150,10 @@ int __usbhs_pkt_handler(struct usbhs_pipe *pipe, int type)
148150
usbhs_unlock(priv, flags);
149151
/******************** spin unlock ******************/
150152

151-
if (is_done)
153+
if (is_done) {
152154
info->done(pkt);
155+
usbhs_pkt_start(pipe);
156+
}
153157

154158
return ret;
155159
}

drivers/usb/renesas_usbhs/mod_gadget.c

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,16 @@ static void usbhsg_queue_push(struct usbhsg_uep *uep,
125125
struct usbhs_pkt *pkt = usbhsg_ureq_to_pkt(ureq);
126126
struct usb_request *req = &ureq->req;
127127

128-
usbhs_pkt_push(pipe, pkt, uep->handler,
129-
req->buf, req->length, req->zero);
130128
req->actual = 0;
131129
req->status = -EINPROGRESS;
130+
usbhs_pkt_push(pipe, pkt, uep->handler,
131+
req->buf, req->length, req->zero);
132132

133133
dev_dbg(dev, "pipe %d : queue push (%d)\n",
134134
usbhs_pipe_number(pipe),
135135
req->length);
136136
}
137137

138-
static void usbhsg_queue_start(struct usbhsg_uep *uep)
139-
{
140-
struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep);
141-
142-
usbhs_pkt_start(pipe);
143-
}
144-
145138
static void usbhsg_queue_pop(struct usbhsg_uep *uep,
146139
struct usbhsg_request *ureq,
147140
int status)
@@ -154,10 +147,6 @@ static void usbhsg_queue_pop(struct usbhsg_uep *uep,
154147

155148
ureq->req.status = status;
156149
ureq->req.complete(&uep->ep, &ureq->req);
157-
158-
/* more request ? */
159-
if (0 == status)
160-
usbhsg_queue_start(uep);
161150
}
162151

163152
static void usbhsg_queue_done(struct usbhs_pkt *pkt)
@@ -222,6 +211,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
222211
struct usbhsg_gpriv *gpriv = usbhsg_priv_to_gpriv(priv);
223212
struct device *dev = usbhsg_gpriv_to_dev(gpriv);
224213
struct usbhsg_uep *uep;
214+
struct usbhs_pipe *pipe;
225215
int recip = ctrl->bRequestType & USB_RECIP_MASK;
226216
int nth = le16_to_cpu(ctrl->wIndex) & USB_ENDPOINT_NUMBER_MASK;
227217
int ret;
@@ -230,7 +220,8 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
230220
char *msg;
231221

232222
uep = usbhsg_gpriv_to_nth_uep(gpriv, nth);
233-
if (!usbhsg_uep_to_pipe(uep)) {
223+
pipe = usbhsg_uep_to_pipe(uep);
224+
if (!pipe) {
234225
dev_err(dev, "wrong recip request\n");
235226
ret = -EINVAL;
236227
goto usbhsg_recip_run_handle_end;
@@ -268,7 +259,7 @@ static int usbhsg_recip_run_handle(struct usbhs_priv *priv,
268259
}
269260

270261
usbhsg_recip_run_handle_end:
271-
usbhsg_queue_start(uep);
262+
usbhs_pkt_start(pipe);
272263

273264
return ret;
274265
}
@@ -470,7 +461,6 @@ static int usbhsg_ep_queue(struct usb_ep *ep, struct usb_request *req,
470461
return -ESHUTDOWN;
471462

472463
usbhsg_queue_push(uep, ureq);
473-
usbhsg_queue_start(uep);
474464

475465
return 0;
476466
}

0 commit comments

Comments
 (0)