nvmet: set ctrl pi_support cap before initializing cap reg
[linux-2.6-block.git] / drivers / nvme / target / core.c
index 8658e9c08534df50c466314c6c70d18d79525324..5d50f731c326aad8ab4354cc1f6d257bd493e49b 100644 (file)
@@ -1411,6 +1411,7 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn,
 
        kref_init(&ctrl->ref);
        ctrl->subsys = subsys;
+       ctrl->pi_support = ctrl->port->pi_enable && ctrl->subsys->pi_support;
        nvmet_init_cap(ctrl);
        WRITE_ONCE(ctrl->aen_enabled, NVMET_AEN_CFG_OPTIONAL);