tree: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next head: 3196f73ff8444f6b8bfce3dce1900b4eae27c324 commit: 0cdab4c202ea0dd241ddaacf1d3a8a282590cb61 [49/82] usb: dwc3: gadget: remove unnecessary 'dwc' parameter config: x86_64-randconfig-i0-201819 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: git checkout 0cdab4c202ea0dd241ddaacf1d3a8a282590cb61 # save the attached .config to linux build tree make ARCH=x86_64
Note: the balbi-usb/next HEAD 3196f73ff8444f6b8bfce3dce1900b4eae27c324 builds
fine.
It only hurts bisectibility.
All errors (new ones prefixed by >>):
In file included from arch/x86/include/asm/bug.h:83:0,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/gfp.h:5,
from include/linux/slab.h:15,
from drivers/usb/dwc3/gadget.c:13:
drivers/usb/dwc3/gadget.c: In function
'dwc3_gadget_ep_cleanup_completed_requests':
>> drivers/usb/dwc3/gadget.c:2375:19: error: 'dwc' undeclared (first use in
>> this function); did you mean 'dwc3'?
dev_WARN_ONCE(dwc->dev,
^
include/asm-generic/bug.h:98:50: note: in definition of macro '__WARN_printf'
#define __WARN_printf(arg...) do { __warn_printk(arg); __WARN(); } while (0)
^~~
include/asm-generic/bug.h:154:3: note: in expansion of macro 'WARN'
WARN(1, format); \
^~~~
include/linux/device.h:1506:2: note: in expansion of macro 'WARN_ONCE'
WARN_ONCE(condition, "%s %s: " format, \
^~~~~~~~~
drivers/usb/dwc3/gadget.c:2375:5: note: in expansion of macro 'dev_WARN_ONCE'
dev_WARN_ONCE(dwc->dev,
^~~~~~~~~~~~~
drivers/usb/dwc3/gadget.c:2375:19: note: each undeclared identifier is
reported only once for each function it appears in
dev_WARN_ONCE(dwc->dev,
^
include/asm-generic/bug.h:98:50: note: in definition of macro '__WARN_printf'
#define __WARN_printf(arg...) do { __warn_printk(arg); __WARN(); } while (0)
^~~
include/asm-generic/bug.h:154:3: note: in expansion of macro 'WARN'
WARN(1, format); \
^~~~
include/linux/device.h:1506:2: note: in expansion of macro 'WARN_ONCE'
WARN_ONCE(condition, "%s %s: " format, \
^~~~~~~~~
drivers/usb/dwc3/gadget.c:2375:5: note: in expansion of macro 'dev_WARN_ONCE'
dev_WARN_ONCE(dwc->dev,
^~~~~~~~~~~~~
vim +2375 drivers/usb/dwc3/gadget.c
e5ba5ec833 Pratyush Anand 2013-01-14 2316
0cdab4c202 Felipe Balbi 2018-03-27 2317 static int
dwc3_gadget_ep_cleanup_completed_requests(struct dwc3_ep *dep,
0cdab4c202 Felipe Balbi 2018-03-27 2318 const struct
dwc3_event_depevt *event, int status)
e5ba5ec833 Pratyush Anand 2013-01-14 2319 {
31162af447 Felipe Balbi 2016-08-11 2320 struct dwc3_request
*req, *n;
e5ba5ec833 Pratyush Anand 2013-01-14 2321 struct dwc3_trb
*trb;
d6e10bf2ba Arnd Bergmann 2016-09-09 2322 bool
ioc = false;
e62c5bc573 Felipe Balbi 2016-10-25 2323 int
ret = 0;
e5ba5ec833 Pratyush Anand 2013-01-14 2324
31162af447 Felipe Balbi 2016-08-11 2325
list_for_each_entry_safe(req, n, &dep->started_list, list) {
1f512119a0 Felipe Balbi 2016-08-12 2326 unsigned length;
e5b36ae2f8 Felipe Balbi 2016-08-10 2327 int chain;
e5b36ae2f8 Felipe Balbi 2016-08-10 2328
1f512119a0 Felipe Balbi 2016-08-12 2329 length =
req->request.length;
1f512119a0 Felipe Balbi 2016-08-12 2330 chain =
req->num_pending_sgs > 0;
31162af447 Felipe Balbi 2016-08-11 2331 if (chain) {
1f512119a0 Felipe Balbi 2016-08-12 2332 struct
scatterlist *sg = req->sg;
31162af447 Felipe Balbi 2016-08-11 2333 struct
scatterlist *s;
1f512119a0 Felipe Balbi 2016-08-12 2334
unsigned int pending = req->num_pending_sgs;
31162af447 Felipe Balbi 2016-08-11 2335
unsigned int i;
ac7bdcc1b3 Felipe Balbi 2015-11-16 2336
1f512119a0 Felipe Balbi 2016-08-12 2337
for_each_sg(sg, s, pending, i) {
737f1ae255 Felipe Balbi 2016-08-11 2338
trb = &dep->trb_pool[dep->trb_dequeue];
c7de573471 Felipe Balbi 2016-07-29 2339
7282c4ef0b Felipe Balbi 2016-10-25 2340
if (trb->ctrl & DWC3_TRB_CTRL_HWO)
7282c4ef0b Felipe Balbi 2016-10-25 2341
break;
7282c4ef0b Felipe Balbi 2016-10-25 2342
1f512119a0 Felipe Balbi 2016-08-12 2343
req->sg = sg_next(s);
1f512119a0 Felipe Balbi 2016-08-12 2344
req->num_pending_sgs--;
c7de573471 Felipe Balbi 2016-07-29 2345
0cdab4c202 Felipe Balbi 2018-03-27 2346
ret = dwc3_gadget_ep_reclaim_completed_trb(dep,
0cdab4c202 Felipe Balbi 2018-03-27 2347
req, trb, event, status,
2b03814fc1 Felipe Balbi 2018-03-26 2348
chain);
e5ba5ec833 Pratyush Anand 2013-01-14 2349
if (ret)
e5ba5ec833 Pratyush Anand 2013-01-14 2350
break;
31162af447 Felipe Balbi 2016-08-11 2351 }
31162af447 Felipe Balbi 2016-08-11 2352 } else {
31162af447 Felipe Balbi 2016-08-11 2353 trb =
&dep->trb_pool[dep->trb_dequeue];
0cdab4c202 Felipe Balbi 2018-03-27 2354 ret =
dwc3_gadget_ep_reclaim_completed_trb(dep, req,
0cdab4c202 Felipe Balbi 2018-03-27 2355
trb, event, status, chain);
31162af447 Felipe Balbi 2016-08-11 2356 }
e5ba5ec833 Pratyush Anand 2013-01-14 2357
d6e5a549cc Felipe Balbi 2017-04-07 2358 if
(req->unaligned || req->zero) {
c6267a5163 Felipe Balbi 2017-01-05 2359 trb =
&dep->trb_pool[dep->trb_dequeue];
0cdab4c202 Felipe Balbi 2018-03-27 2360 ret =
dwc3_gadget_ep_reclaim_completed_trb(dep, req,
0cdab4c202 Felipe Balbi 2018-03-27 2361
trb, event, status, false);
c6267a5163 Felipe Balbi 2017-01-05 2362
req->unaligned = false;
d6e5a549cc Felipe Balbi 2017-04-07 2363
req->zero = false;
c6267a5163 Felipe Balbi 2017-01-05 2364 }
c6267a5163 Felipe Balbi 2017-01-05 2365
e62c5bc573 Felipe Balbi 2016-10-25 2366
req->request.actual = length - req->remaining;
1f512119a0 Felipe Balbi 2016-08-12 2367
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2368 if
(req->request.actual < length || req->num_pending_sgs) {
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2369 /*
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2370 *
There could be a scenario where the whole req can't
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2371 * be
mapped into available TRB's. In that case, we need
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2372 * to
kick transfer again if (req->num_pending_sgs > 0)
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2373 */
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2374 if
(req->num_pending_sgs) {
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 @2375
dev_WARN_ONCE(dwc->dev,
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2376
(req->request.actual == length),
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2377
"There are some pending sg's that needs to be queued again\n");
7fdca76649 Felipe Balbi 2017-09-05 2378
return __dwc3_gadget_kick_transfer(dep);
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2379 }
f9db4fce81 Anurag Kumar Vulisha 2018-03-27 2380 }
1f512119a0 Felipe Balbi 2016-08-12 2381
e5ba5ec833 Pratyush Anand 2013-01-14 2382
dwc3_gadget_giveback(dep, req, status);
e5ba5ec833 Pratyush Anand 2013-01-14 2383
d6e10bf2ba Arnd Bergmann 2016-09-09 2384 if (ret) {
d6e10bf2ba Arnd Bergmann 2016-09-09 2385 if
((event->status & DEPEVT_STATUS_IOC) &&
d6e10bf2ba Arnd Bergmann 2016-09-09 2386
(trb->ctrl & DWC3_TRB_CTRL_IOC))
d6e10bf2ba Arnd Bergmann 2016-09-09 2387
ioc = true;
d115d7050a Ville Syrjälä 2015-08-31 2388 break;
31162af447 Felipe Balbi 2016-08-11 2389 }
d6e10bf2ba Arnd Bergmann 2016-09-09 2390 }
d115d7050a Ville Syrjälä 2015-08-31 2391
4cb4221764 Felipe Balbi 2016-05-18 2392 /*
4cb4221764 Felipe Balbi 2016-05-18 2393 * Our endpoint might
get disabled by another thread during
4cb4221764 Felipe Balbi 2016-05-18 2394 *
dwc3_gadget_giveback(). If that happens, we're just gonna return 1
4cb4221764 Felipe Balbi 2016-05-18 2395 * early on so
DWC3_EP_BUSY flag gets cleared
4cb4221764 Felipe Balbi 2016-05-18 2396 */
4cb4221764 Felipe Balbi 2016-05-18 2397 if (!dep->endpoint.desc)
4cb4221764 Felipe Balbi 2016-05-18 2398 return 1;
4cb4221764 Felipe Balbi 2016-05-18 2399
cdc359dd87 Pratyush Anand 2013-01-14 2400 if
(usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
aa3342c8bb Felipe Balbi 2016-03-14 2401
list_empty(&dep->started_list)) {
aa3342c8bb Felipe Balbi 2016-03-14 2402 if
(list_empty(&dep->pending_list)) {
cdc359dd87 Pratyush Anand 2013-01-14 2403 /*
cdc359dd87 Pratyush Anand 2013-01-14 2404 * If
there is no entry in request list then do
cdc359dd87 Pratyush Anand 2013-01-14 2405 * not
issue END TRANSFER now. Just set PENDING
cdc359dd87 Pratyush Anand 2013-01-14 2406 *
flag, so that END TRANSFER is issued when an
cdc359dd87 Pratyush Anand 2013-01-14 2407 *
entry is added into request list.
cdc359dd87 Pratyush Anand 2013-01-14 2408 */
cdc359dd87 Pratyush Anand 2013-01-14 2409
dep->flags = DWC3_EP_PENDING_REQUEST;
cdc359dd87 Pratyush Anand 2013-01-14 2410 } else {
0cdab4c202 Felipe Balbi 2018-03-27 2411
dwc3_stop_active_transfer(dep, true);
cdc359dd87 Pratyush Anand 2013-01-14 2412
dep->flags = DWC3_EP_ENABLED;
cdc359dd87 Pratyush Anand 2013-01-14 2413 }
7efea86c28 Pratyush Anand 2013-01-14 2414 return 1;
7efea86c28 Pratyush Anand 2013-01-14 2415 }
7efea86c28 Pratyush Anand 2013-01-14 2416
d6e10bf2ba Arnd Bergmann 2016-09-09 2417 if
(usb_endpoint_xfer_isoc(dep->endpoint.desc) && ioc)
9cad39fe4e Konrad Leszczynski 2016-02-08 2418 return 0;
d6e10bf2ba Arnd Bergmann 2016-09-09 2419
72246da40f Felipe Balbi 2011-08-19 2420 return 1;
72246da40f Felipe Balbi 2011-08-19 2421 }
72246da40f Felipe Balbi 2011-08-19 2422
:::::: The code at line 2375 was first introduced by commit
:::::: f9db4fce81eaf0699c2d4fea890587b4de22cbb2 usb: dwc3: gadget: Correct the
logic for queuing sgs
:::::: TO: Anurag Kumar Vulisha <[email protected]>
:::::: CC: Felipe Balbi <[email protected]>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
.config.gz
Description: application/gzip
