From: kernel test robot <lkp@intel.com>
To: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org
Cc: kbuild-all@lists.01.org, John Youn <John.Youn@synopsys.com>
Subject: Re: [PATCH 5/7] usb: dwc3: gadget: Account for extra TRB
Date: Fri, 7 Aug 2020 10:30:39 +0800 [thread overview]
Message-ID: <202008071005.qHssttRh%lkp@intel.com> (raw)
In-Reply-To: <cdd5ae526c65893998898cfb0734161df7048554.1596674377.git.thinhn@synopsys.com>
[-- Attachment #1: Type: text/plain, Size: 7518 bytes --]
Hi Thinh,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on e3ee0e740c3887d2293e8d54a8707218d70d86ca]
url: https://github.com/0day-ci/linux/commits/Thinh-Nguyen/usb-dwc3-gadget-Fix-TRB-preparation/20200806-084719
base: e3ee0e740c3887d2293e8d54a8707218d70d86ca
config: mips-randconfig-r005-20200807 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
drivers/usb/dwc3/gadget.c: In function 'dwc3_prepare_one_trb_sg':
drivers/usb/dwc3/gadget.c:1177:16: warning: unused variable 'rem' [-Wunused-variable]
1177 | unsigned int rem = length % maxp;
| ^~~
drivers/usb/dwc3/gadget.c: In function 'dwc3_prepare_trbs':
>> drivers/usb/dwc3/gadget.c:1306:1: warning: control reaches end of non-void function [-Wreturn-type]
1306 | }
| ^
vim +1306 drivers/usb/dwc3/gadget.c
5ee85d890f8de5c Felipe Balbi 2016-05-13 1235
5ee85d890f8de5c Felipe Balbi 2016-05-13 1236 /*
5ee85d890f8de5c Felipe Balbi 2016-05-13 1237 * dwc3_prepare_trbs - setup TRBs from requests
5ee85d890f8de5c Felipe Balbi 2016-05-13 1238 * @dep: endpoint for which requests are being prepared
5ee85d890f8de5c Felipe Balbi 2016-05-13 1239 *
5ee85d890f8de5c Felipe Balbi 2016-05-13 1240 * The function goes through the requests list and sets up TRBs for the
5ee85d890f8de5c Felipe Balbi 2016-05-13 1241 * transfers. The function returns once there are no more TRBs available or
5ee85d890f8de5c Felipe Balbi 2016-05-13 1242 * it runs out of requests.
5ee85d890f8de5c Felipe Balbi 2016-05-13 1243 */
e1a8607778079c1 Thinh Nguyen 2020-08-05 1244 static int dwc3_prepare_trbs(struct dwc3_ep *dep)
5ee85d890f8de5c Felipe Balbi 2016-05-13 1245 {
5ee85d890f8de5c Felipe Balbi 2016-05-13 1246 struct dwc3_request *req, *n;
e1a8607778079c1 Thinh Nguyen 2020-08-05 1247 int ret = 0;
5ee85d890f8de5c Felipe Balbi 2016-05-13 1248
5ee85d890f8de5c Felipe Balbi 2016-05-13 1249 BUILD_BUG_ON_NOT_POWER_OF_2(DWC3_TRB_NUM);
5ee85d890f8de5c Felipe Balbi 2016-05-13 1250
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1251 /*
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1252 * We can get in a situation where there's a request in the started list
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1253 * but there weren't enough TRBs to fully kick it in the first time
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1254 * around, so it has been waiting for more TRBs to be freed up.
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1255 *
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1256 * In that case, we should check if we have a request with pending_sgs
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1257 * in the started list and prepare TRBs for that request first,
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1258 * otherwise we will prepare TRBs completely out of order and that will
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1259 * break things.
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1260 */
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1261 list_for_each_entry(req, &dep->started_list, list) {
e1a8607778079c1 Thinh Nguyen 2020-08-05 1262 if (req->num_pending_sgs > 0) {
e1a8607778079c1 Thinh Nguyen 2020-08-05 1263 ret = dwc3_prepare_one_trb_sg(dep, req);
e1a8607778079c1 Thinh Nguyen 2020-08-05 1264 if (ret)
e1a8607778079c1 Thinh Nguyen 2020-08-05 1265 return ret;
e1a8607778079c1 Thinh Nguyen 2020-08-05 1266 }
63c7bb299fc9c43 Thinh Nguyen 2020-05-15 1267
63c7bb299fc9c43 Thinh Nguyen 2020-05-15 1268 /*
63c7bb299fc9c43 Thinh Nguyen 2020-05-15 1269 * Don't prepare beyond a transfer. In DWC_usb32, its transfer
63c7bb299fc9c43 Thinh Nguyen 2020-05-15 1270 * burst capability may try to read and use TRBs beyond the
63c7bb299fc9c43 Thinh Nguyen 2020-05-15 1271 * active transfer instead of stopping.
63c7bb299fc9c43 Thinh Nguyen 2020-05-15 1272 */
63c7bb299fc9c43 Thinh Nguyen 2020-05-15 1273 if (dep->stream_capable && req->request.is_last)
e1a8607778079c1 Thinh Nguyen 2020-08-05 1274 return 0;
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1275 }
d86c5a676e5b1ee Felipe Balbi 2016-10-25 1276
5ee85d890f8de5c Felipe Balbi 2016-05-13 1277 list_for_each_entry_safe(req, n, &dep->pending_list, list) {
cdb55b39fab82b5 Felipe Balbi 2017-05-17 1278 struct dwc3 *dwc = dep->dwc;
cdb55b39fab82b5 Felipe Balbi 2017-05-17 1279
cdb55b39fab82b5 Felipe Balbi 2017-05-17 1280 ret = usb_gadget_map_request_by_dev(dwc->sysdev, &req->request,
cdb55b39fab82b5 Felipe Balbi 2017-05-17 1281 dep->direction);
cdb55b39fab82b5 Felipe Balbi 2017-05-17 1282 if (ret)
e1a8607778079c1 Thinh Nguyen 2020-08-05 1283 return ret;
cdb55b39fab82b5 Felipe Balbi 2017-05-17 1284
cdb55b39fab82b5 Felipe Balbi 2017-05-17 1285 req->sg = req->request.sg;
a31e63b608ff78c Anurag Kumar Vulisha 2018-03-27 1286 req->start_sg = req->sg;
c96e6725db9d6a0 Anurag Kumar Vulisha 2018-03-27 1287 req->num_queued_sgs = 0;
cdb55b39fab82b5 Felipe Balbi 2017-05-17 1288 req->num_pending_sgs = req->request.num_mapped_sgs;
cdb55b39fab82b5 Felipe Balbi 2017-05-17 1289
1f512119a08c0d4 Felipe Balbi 2016-08-12 1290 if (req->num_pending_sgs > 0)
e1a8607778079c1 Thinh Nguyen 2020-08-05 1291 ret = dwc3_prepare_one_trb_sg(dep, req);
5ee85d890f8de5c Felipe Balbi 2016-05-13 1292 else
e1a8607778079c1 Thinh Nguyen 2020-08-05 1293 ret = dwc3_prepare_one_trb_linear(dep, req);
5ee85d890f8de5c Felipe Balbi 2016-05-13 1294
e1a8607778079c1 Thinh Nguyen 2020-08-05 1295 if (ret)
e1a8607778079c1 Thinh Nguyen 2020-08-05 1296 return ret;
aefe3d232b6629c Thinh Nguyen 2020-05-05 1297
aefe3d232b6629c Thinh Nguyen 2020-05-05 1298 /*
aefe3d232b6629c Thinh Nguyen 2020-05-05 1299 * Don't prepare beyond a transfer. In DWC_usb32, its transfer
aefe3d232b6629c Thinh Nguyen 2020-05-05 1300 * burst capability may try to read and use TRBs beyond the
aefe3d232b6629c Thinh Nguyen 2020-05-05 1301 * active transfer instead of stopping.
aefe3d232b6629c Thinh Nguyen 2020-05-05 1302 */
aefe3d232b6629c Thinh Nguyen 2020-05-05 1303 if (dep->stream_capable && req->request.is_last)
e1a8607778079c1 Thinh Nguyen 2020-08-05 1304 return 0;
72246da40f3719a Felipe Balbi 2011-08-19 1305 }
72246da40f3719a Felipe Balbi 2011-08-19 @1306 }
72246da40f3719a Felipe Balbi 2011-08-19 1307
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32721 bytes --]
next prev parent reply other threads:[~2020-08-07 2:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-06 0:44 [PATCH 0/7] usb: dwc3: gadget: Fix TRB preparation Thinh Nguyen
2020-08-06 0:44 ` [PATCH 1/7] usb: dwc3: gadget: Don't setup more than requested Thinh Nguyen
2020-08-06 6:58 ` Thinh Nguyen
2020-08-06 0:44 ` [PATCH 2/7] usb: dwc3: gadget: Fix handling ZLP Thinh Nguyen
2020-08-06 0:45 ` [PATCH 3/7] usb: dwc3: gadget: Handle ZLP for sg requests Thinh Nguyen
2020-08-06 0:45 ` [PATCH 4/7] usb: dwc3: gadget: Refactor preparing TRBs Thinh Nguyen
2020-08-06 0:45 ` [PATCH 5/7] usb: dwc3: gadget: Account for extra TRB Thinh Nguyen
2020-08-06 4:03 ` kernel test robot
2020-08-07 2:30 ` kernel test robot [this message]
2020-08-06 0:45 ` [PATCH 6/7] usb: dwc3: gadget: Rename misleading function names Thinh Nguyen
2020-08-06 0:45 ` [PATCH 7/7] usb: dwc3: ep0: Skip ZLP setup for OUT Thinh Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202008071005.qHssttRh%lkp@intel.com \
--to=lkp@intel.com \
--cc=John.Youn@synopsys.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).