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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to