Author: mav Date: Mon Aug 12 18:57:46 2019 New Revision: 350940 URL: https://svnweb.freebsd.org/changeset/base/350940
Log: MFC r350333 (by imp): 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. Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Mon Aug 12 18:56:46 2019 (r350939) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Mon Aug 12 18:57:46 2019 (r350940) @@ -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-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"