From: kbuild test robot <lkp@intel.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: kbuild-all@01.org, linux-usb@vger.kernel.org,
Greg KH <greg@kroah.com>, Joel Stanley <joel.stanley@au1.ibm.com>,
Andrew Jeffery <andrew@aj.id.au>, Felipe Balbi <balbi@kernel.org>
Subject: [v3,2/2] usb/gadget: Add driver for Aspeed SoC virtual hub
Date: Wed, 24 Jan 2018 15:40:12 +0800 [thread overview]
Message-ID: <201801241534.ZV0PM6DR%fengguang.wu@intel.com> (raw)
Hi Benjamin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on balbi-usb/next]
[also build test WARNING on v4.15-rc9 next-20180119]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Benjamin-Herrenschmidt/usb-gadget-Add-an-EP-dispose-callback-for-EP-lifetime-tracking/20180124-065635
base: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git next
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
>> drivers/usb/gadget/udc/aspeed-vhub/epn.c:270:23: sparse: restricted __le32 degrades to integer
---
>> drivers/usb/gadget/udc/aspeed-vhub/dev.c:269:9: sparse: context imbalance in 'ast_vhub_udc_wakeup' - different lock contexts for basic block
vim +270 drivers/usb/gadget/udc/aspeed-vhub/epn.c
236
237 static void ast_vhub_epn_handle_ack_desc(struct ast_vhub_ep *ep)
238 {
239 struct ast_vhub_req *req;
240 unsigned int len, d_last;
241 u32 stat, stat1;
242
243 /* Read EP status, workaround HW race */
244 do {
245 stat = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS);
246 stat1 = readl(ep->epn.regs + AST_VHUB_EP_DESC_STATUS);
247 } while(stat != stat1);
248
249 /* Extract RPTR */
250 d_last = VHUB_EP_DMA_RPTR(stat);
251
252 /* Grab current request if any */
253 req = list_first_entry_or_null(&ep->queue, struct ast_vhub_req, queue);
254
255 EPVDBG(ep, "ACK status=%08x is_in=%d ep->d_last=%d..%d\n",
256 stat, ep->epn.is_in, ep->epn.d_last, d_last);
257
258 /* Check all completed descriptors */
259 while (ep->epn.d_last != d_last) {
260 struct ast_vhub_desc *desc;
261 unsigned int d_num;
262 bool is_last_desc;
263
264 /* Grab next completed descriptor */
265 d_num = ep->epn.d_last;
266 desc = &ep->epn.descs[d_num];
267 ep->epn.d_last = (d_num + 1) & (AST_VHUB_DESCS_COUNT - 1);
268
269 /* Grab len out of descriptor */
> 270 len = VHUB_DSC1_IN_LEN(desc->w1);
271
272 EPVDBG(ep, " desc %d len=%d req=%p (act=%d)\n",
273 d_num, len, req, req ? req->active : 0);
274
275 /* If no active request pending, move on */
276 if (!req || !req->active)
277 continue;
278
279 /* Adjust size */
280 req->req.actual += len;
281
282 /* Is that the last chunk ? */
283 is_last_desc = req->last_desc == d_num;
284 CHECK(ep, is_last_desc == (len < ep->ep.maxpacket ||
285 (req->req.actual >= req->req.length &&
286 !req->req.zero)),
287 "Last packet discrepancy: last_desc=%d len=%d r.act=%d "
288 "r.len=%d r.zero=%d mp=%d\n",
289 is_last_desc, len, req->req.actual, req->req.length,
290 req->req.zero, ep->ep.maxpacket);
291
292 if (is_last_desc) {
293 /*
294 * Because we can only have one request at a time
295 * in our descriptor list in this implementation,
296 * d_last and ep->d_last should now be equal
297 */
298 CHECK(ep, d_last == ep->epn.d_last,
299 "DMA read ptr mismatch %d vs %d\n",
300 d_last, ep->epn.d_last);
301
302 /* Note: done will drop and re-acquire the lock */
303 ast_vhub_done(ep, req, 0);
304 req = list_first_entry_or_null(&ep->queue,
305 struct ast_vhub_req,
306 queue);
307 break;
308 }
309 }
310
311 /* More work ? */
312 if (req)
313 ast_vhub_epn_kick_desc(ep, req);
314 }
315
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2018-01-24 7:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 7:40 kbuild test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-01-27 11:07 [v3,2/2] usb/gadget: Add driver for Aspeed SoC virtual hub Benjamin Herrenschmidt
2018-01-26 4:55 kbuild test robot
2018-01-25 23:58 Benjamin Herrenschmidt
2018-01-24 3:30 kbuild test robot
2018-01-24 2:27 Benjamin Herrenschmidt
2018-01-24 1:50 kbuild test robot
2018-01-22 22:27 Benjamin Herrenschmidt
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=201801241534.ZV0PM6DR%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=andrew@aj.id.au \
--cc=balbi@kernel.org \
--cc=benh@kernel.crashing.org \
--cc=greg@kroah.com \
--cc=joel.stanley@au1.ibm.com \
--cc=kbuild-all@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).