public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters
@ 2017-10-25  8:42 Dan Carpenter
  2017-10-25  8:59 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2017-10-25  8:42 UTC (permalink / raw)
  To: ralph.campbell-h88ZbnxC6KDQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hello Ralph Campbell,

The patch f931551bafe1: "IB/qib: Add new qib driver for QLogic PCIe
InfiniBand adapters" from May 23, 2010, leads to the following static
checker warning:

	drivers/infiniband/hw/qib/qib_iba6120.c:1108 handle_6120_errors()
	warn: was expecting a 64 bit value instead of '0'

drivers/infiniband/hw/qib/qib_iba6120.c
  1100          /*
  1101           * If there were hdrq or egrfull errors, wake up any processes
  1102           * waiting in poll.  We used to try to check which contexts had
  1103           * the overflow, but given the cost of that and the chip reads
  1104           * to support it, it's better to just wake everybody up if we
  1105           * get an overflow; waiters can poll again if it's not them.
  1106           */
  1107          if (errs & (ERR_MASK(RcvEgrFullErr) | ERR_MASK(RcvHdrFullErr))) {
  1108                  qib_handle_urcv(dd, ~0U);
                                            ^^^
qib_handle_urcv() takes a u64 so we would sort of expect that we want
to pass U64_MAX here instead of U32_MAX.  If it's intentional, then it's
pretty subtle.

  1109                  if (errs & ERR_MASK(RcvEgrFullErr))
  1110                          qib_stats.sps_buffull++;
  1111                  else
  1112                          qib_stats.sps_hdrfull++;
  1113          }
  1114  done:
  1115          return;


regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [bug report] IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters
  2017-10-25  8:42 [bug report] IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters Dan Carpenter
@ 2017-10-25  8:59 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-10-25  8:59 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

This is really old so Ralph's email bounces.  Anyway over half the
qib_handle_urcv() callers use ~0U.

regards,
dan carpenter

On Wed, Oct 25, 2017 at 11:42:19AM +0300, Dan Carpenter wrote:
> Hello Ralph Campbell,
> 
> The patch f931551bafe1: "IB/qib: Add new qib driver for QLogic PCIe
> InfiniBand adapters" from May 23, 2010, leads to the following static
> checker warning:
> 
> 	drivers/infiniband/hw/qib/qib_iba6120.c:1108 handle_6120_errors()
> 	warn: was expecting a 64 bit value instead of '0'
> 
> drivers/infiniband/hw/qib/qib_iba6120.c
>   1100          /*
>   1101           * If there were hdrq or egrfull errors, wake up any processes
>   1102           * waiting in poll.  We used to try to check which contexts had
>   1103           * the overflow, but given the cost of that and the chip reads
>   1104           * to support it, it's better to just wake everybody up if we
>   1105           * get an overflow; waiters can poll again if it's not them.
>   1106           */
>   1107          if (errs & (ERR_MASK(RcvEgrFullErr) | ERR_MASK(RcvHdrFullErr))) {
>   1108                  qib_handle_urcv(dd, ~0U);
>                                             ^^^
> qib_handle_urcv() takes a u64 so we would sort of expect that we want
> to pass U64_MAX here instead of U32_MAX.  If it's intentional, then it's
> pretty subtle.
> 
>   1109                  if (errs & ERR_MASK(RcvEgrFullErr))
>   1110                          qib_stats.sps_buffull++;
>   1111                  else
>   1112                          qib_stats.sps_hdrfull++;
>   1113          }
>   1114  done:
>   1115          return;
> 
> 
> regards,
> dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug report] IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters
@ 2017-11-22  9:32 Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-11-22  9:32 UTC (permalink / raw)
  To: ralph.campbell-h88ZbnxC6KDQT0dZR+AlfA; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hello Ralph Campbell,

The patch f931551bafe1: "IB/qib: Add new qib driver for QLogic PCIe
InfiniBand adapters" from May 23, 2010, leads to the following static
checker warning:

	drivers/infiniband/hw/qib/qib_iba7322.c:5700 gpio_7322_mod()
	warn: was expecting a 64 bit value instead of '~mask'

drivers/infiniband/hw/qib/qib_iba7322.c
  5688  static int gpio_7322_mod(struct qib_devdata *dd, u32 out, u32 dir, u32 mask)
  5689  {
  5690          u64 read_val, new_out;
  5691          unsigned long flags;
  5692  
  5693          if (mask) {
  5694                  /* some bits being written, lock access to GPIO */
  5695                  dir &= mask;
  5696                  out &= mask;
  5697                  spin_lock_irqsave(&dd->cspec->gpio_lock, flags);
  5698                  dd->cspec->extctrl &= ~((u64)mask << SYM_LSB(EXTCtrl, GPIOOe));
  5699                  dd->cspec->extctrl |= ((u64) dir << SYM_LSB(EXTCtrl, GPIOOe));
  5700                  new_out = (dd->cspec->gpio_out & ~mask) | out;
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We never use the high 32 bits of ->gpio_out so it could probably be
declared as a u32 the same as "out".

  5701  
  5702                  qib_write_kreg(dd, kr_extctrl, dd->cspec->extctrl);
  5703                  qib_write_kreg(dd, kr_gpio_out, new_out);
  5704                  dd->cspec->gpio_out = new_out;
  5705                  spin_unlock_irqrestore(&dd->cspec->gpio_lock, flags);
  5706          }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-22  9:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-25  8:42 [bug report] IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters Dan Carpenter
2017-10-25  8:59 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2017-11-22  9:32 Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox