Print this page
9446 some NVMe controllers get upset about NS ID of 0 when checking "Error Recovery" feature

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/nvme/nvme.c
          +++ new/usr/src/uts/common/io/nvme/nvme.c
↓ open down ↓ 1858 lines elided ↑ open up ↑
1859 1859           * For some of the optional features there doesn't seem to be a method
1860 1860           * of detecting whether it is supported other than using it.  This will
1861 1861           * cause "Invalid Field in Command" error, which is normally considered
1862 1862           * a programming error.  Set the nc_dontpanic flag to override the panic
1863 1863           * in nvme_check_generic_cmd_status().
1864 1864           */
1865 1865          switch (feature) {
1866 1866          case NVME_FEAT_ARBITRATION:
1867 1867          case NVME_FEAT_POWER_MGMT:
1868 1868          case NVME_FEAT_TEMPERATURE:
1869      -        case NVME_FEAT_ERROR:
1870 1869          case NVME_FEAT_NQUEUES:
1871 1870          case NVME_FEAT_INTR_COAL:
1872 1871          case NVME_FEAT_INTR_VECT:
1873 1872          case NVME_FEAT_WRITE_ATOM:
1874 1873          case NVME_FEAT_ASYNC_EVENT:
1875 1874                  break;
1876 1875  
     1876 +        case NVME_FEAT_ERROR:
     1877 +                /*
     1878 +                 * Some controllers (e.g. INTEL SSDPE2KX010T7) get upset if
     1879 +                 * namespace ID of 0 is specified.  As we don't currently report
     1880 +                 * the "Deallocated or Unwritten Logical Block Error Enable",
     1881 +                 * simply set the NS ID to 1.
     1882 +                 */
     1883 +                cmd->nc_sqe.sqe_nsid = 1;
     1884 +                break;
     1885 +
1877 1886          case NVME_FEAT_WRITE_CACHE:
1878 1887                  if (!nvme->n_write_cache_present)
1879 1888                          goto fail;
1880 1889                  break;
1881 1890  
1882 1891          case NVME_FEAT_LBA_RANGE:
1883 1892                  if (!nvme->n_lba_range_supported)
1884 1893                          goto fail;
1885 1894  
1886 1895                  cmd->nc_dontpanic = B_TRUE;
↓ open down ↓ 2073 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX