Author: imp
Date: Thu Jul 25 20:26:21 2019
New Revision: 350333
URL: https://svnweb.freebsd.org/changeset/base/350333

Log:
  Widen the type for to.
  
  The timeout field in the CAPS register is defined to be 8 bits, so its type 
was
  uint8_t. We recently started adding 1 to it to cope with rogue devices that
  listed 0 timeout time (which is impossible). However, in so doing, other 
devices
  that list 0xff (for a 2 minute timeout) were broken when adding 1
  overflowed. Widen the type to be uint32_t like its source register to avoid 
the
  issue.
  
  Reported by: bapt@

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr.c      Thu Jul 25 20:01:24 2019        
(r350332)
+++ head/sys/dev/nvme/nvme_ctrlr.c      Thu Jul 25 20:26:21 2019        
(r350333)
@@ -1227,7 +1227,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de
        struct make_dev_args    md_args;
        uint32_t        cap_lo;
        uint32_t        cap_hi;
-       uint8_t         to;
+       uint32_t        to;
        uint8_t         dstrd;
        uint8_t         mpsmin;
        int             status, timeout_period;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to