Date: Mon, 12 Aug 2019 18:51:36 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350931 - stable/12/sys/dev/nvme Message-ID: <201908121851.x7CIpaZ0061116@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Mon Aug 12 18:51:35 2019 New Revision: 350931 URL: https://svnweb.freebsd.org/changeset/base/350931 Log: MFC r350068 (by imp): Assume that the timeout value from the capacity is 1-based Neither the 1.3 or 1.4 standards say this number is 1's based, but adding 1 costs little and copes with those NVMe drives that report '0' in this field cheaply. This is consistent with what the Linux driver does as well. 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:50:57 2019 (r350930) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Mon Aug 12 18:51:35 2019 (r350931) @@ -1255,7 +1255,7 @@ nvme_ctrlr_construct(struct nvme_controller *ctrlr, de /* Get ready timeout value from controller, in units of 500ms. */ cap_lo = nvme_mmio_read_4(ctrlr, cap_lo); - to = (cap_lo >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK; + to = ((cap_lo >> NVME_CAP_LO_REG_TO_SHIFT) & NVME_CAP_LO_REG_TO_MASK) + 1; ctrlr->ready_timeout_in_ms = to * 500; timeout_period = NVME_DEFAULT_TIMEOUT_PERIOD;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201908121851.x7CIpaZ0061116>