Project

General

Profile

Bug #8494 » nvme_fw_status.diff

Moinak Ghosh, 2017-07-14 04:09 PM

View differences:

usr/src/uts/common/io/nvme/nvme.c Wed Jun 14 07:19:18 2017 -0700 → usr/src/uts/common/io/nvme/nvme.c Tue Jul 11 23:15:55 2017 -0700
1156 1156
	case NVME_CQE_SC_SPC_NVM_READONLY:
1157 1157
		/* Write to Read Only Range */
1158 1158
		ASSERT(cmd->nc_sqe.sqe_opc == NVME_OPC_NVM_WRITE);
1159 1159
		atomic_inc_32(&cmd->nc_nvme->n_readonly);
1160 1160
		if (cmd->nc_xfer != NULL)
1161 1161
			bd_error(cmd->nc_xfer, BD_ERR_ILLRQ);
1162 1162
		return (EROFS);
1163 1163

  
1164
	case NVME_CQE_SC_SPC_FW_RESET:
1165
		/* Firmware needs reset. Ignore for now. */
1166
		ASSERT(cmd->nc_sqe.sqe_opc == NVME_OPC_NVM_FORMAT ||
1167
		    cmd->nc_sqe.sqe_opc == NVME_OPC_FW_ACTIVATE ||
1168
		    cmd->nc_sqe.sqe_opc == NVME_OPC_FW_IMAGE_LOAD);
1169
		dev_err(cmd->nc_nvme->n_dip, CE_WARN, "Firmware reset");
1170
		return (0);
1171

  
1164 1172
	default:
1165 1173
		return (nvme_check_unknown_cmd_status(cmd));
1166 1174
	}
1167 1175
}
1168 1176

  
1169 1177
static inline int
1170 1178
nvme_check_cmd_status(nvme_cmd_t *cmd)
1171 1179
{
    (1-1/1)