diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog index aa2ed2db9ae9a3037b12e6d8e624a614f9c01a38..3cc7cba41e0c46df0886ebef952e08a4a3b29492 100644 --- a/smartmontools/ChangeLog +++ b/smartmontools/ChangeLog @@ -1,5 +1,13 @@ $Id$ +2019-06-17 Christian Franke <franke@computer.org> + + os_win32.cpp: Clear ProtocolDataRequestSubValue for NVMe Get Log Page + commands because newer drivers pass this value as CDW12 (LPOL) to the + drive. This fixes log page access for NVMe 1.2.1+ drives (#1201). + + Thanks to Vikram Manja for bug report and testing. + 2019-06-12 Christian Franke <franke@computer.org> os_netbsd.cpp: Fix device scan crash on empty name list. diff --git a/smartmontools/os_win32.cpp b/smartmontools/os_win32.cpp index 13b1730f6dc7dda3b945b7e9fe4cb65d4d931687..ab352620fe32e080c2d471a0c973290f663e613b 100644 --- a/smartmontools/os_win32.cpp +++ b/smartmontools/os_win32.cpp @@ -3858,18 +3858,21 @@ bool win10_nvme_device::nvme_pass_through(const nvme_cmd_in & in, nvme_cmd_out & spsq->PropertyQuery.PropertyId = win10::StorageDeviceProtocolSpecificProperty; spsq->ProtocolSpecific.DataType = win10::NVMeDataTypeIdentify; spsq->ProtocolSpecific.ProtocolDataRequestValue = in.cdw10; + spsq->ProtocolSpecific.ProtocolDataRequestSubValue = in.nsid; break; case smartmontools::nvme_admin_get_log_page: spsq->PropertyQuery.PropertyId = win10::StorageDeviceProtocolSpecificProperty; spsq->ProtocolSpecific.DataType = win10::NVMeDataTypeLogPage; spsq->ProtocolSpecific.ProtocolDataRequestValue = in.cdw10 & 0xff; // LID only ? + // Older drivers (Win10 1607) ignore SubValue + // Newer drivers (Win10 1809) pass SubValue to CDW12 (DW aligned) + spsq->ProtocolSpecific.ProtocolDataRequestSubValue = 0; // in.cdw12 (LPOL, NVMe 1.2.1+) ? break; // TODO: nvme_admin_get_features default: return set_err(ENOSYS, "NVMe admin command 0x%02x not supported", in.opcode); } - spsq->ProtocolSpecific.ProtocolDataRequestSubValue = in.nsid; // ? spsq->ProtocolSpecific.ProtocolDataOffset = sizeof(spsq->ProtocolSpecific); spsq->ProtocolSpecific.ProtocolDataLength = in.size;