Re: [bug report] dmaengine: cppi41: Fix unpaired pm runtime when only a USB hub is connected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Dan Carpenter <dan.carpenter@xxxxxxxxxx> [161116 05:32]:
> Hello Tony Lindgren,
> 
> The patch 098de42ad670: "dmaengine: cppi41: Fix unpaired pm runtime
> when only a USB hub is connected" from Nov 9, 2016, leads to the
> following static checker warning:
> 
> 	drivers/dma/cppi41.c:322 cppi41_irq()
> 	warn: unsigned 'status' is never less than zero.
> 
> drivers/dma/cppi41.c
>    287  static irqreturn_t cppi41_irq(int irq, void *data)
>    288  {
>    289          struct cppi41_dd *cdd = data;
>    290          struct cppi41_channel *c;
>    291          u32 status;
>                 ^^^^^^^^^^
> 
>    292          int i;
>    293  
>    294          status = cppi_readl(cdd->usbss_mem + USBSS_IRQ_STATUS);
>    295          if (!(status & USBSS_IRQ_PD_COMP))
>    296                  return IRQ_NONE;
>    297          cppi_writel(status, cdd->usbss_mem + USBSS_IRQ_STATUS);
>    298  
>    299          for (i = QMGR_PENDING_SLOT_Q(FIST_COMPLETION_QUEUE); i < QMGR_NUM_PEND;
>    300                          i++) {
>    301                  u32 val;
>    302                  u32 q_num;
>    303  
>    304                  val = cppi_readl(cdd->qmgr_mem + QMGR_PEND(i));
>    305                  if (i == QMGR_PENDING_SLOT_Q(FIST_COMPLETION_QUEUE) && val) {
>    306                          u32 mask;
>    307                          /* set corresponding bit for completetion Q 93 */
>    308                          mask = 1 << QMGR_PENDING_BIT_Q(FIST_COMPLETION_QUEUE);
>    309                          /* not set all bits for queues less than Q 93 */
>    310                          mask--;
>    311                          /* now invert and keep only Q 93+ set */
>    312                          val &= ~mask;
>    313                  }
>    314  
>    315                  if (val)
>    316                          __iormb();
>    317  
>    318                  while (val) {
>    319                          u32 desc, len;
>    320  
>    321                          status = pm_runtime_get(cdd->ddev.dev);
>    322                          if (status < 0)
>                                     ^^^^^^^^^^
> Never true.

Thanks, so we need to use int there. I'll check this along with
comments from Sekhar on the pm_runtime_get error path.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux