|
感谢提供思路,我的硬盘是梵想S790 4TB,主控也是MAP1602,同样报 kernel: nvme nvme0: Device not ready; aborting initialisation, CSTS=0x0 错误,之前说的iommu=soft参数验证后发现无效,是偶然情况,我这里设备是联想的Y9000X 2022,bios里没法关闭ASPM来测试,昨天和朋友改的drivers/nvme/host/core.c 经过多次验证没有问题
- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
- index 3ec38e2b9173..ab2583cb42aa 100644
- --- a/drivers/nvme/host/core.c
- +++ b/drivers/nvme/host/core.c
- @@ -2408,6 +2408,7 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl)
- } else {
- timeout = NVME_CAP_TIMEOUT(ctrl->cap);
- }
- + dev_info(ctrl->device, "[PATCH] nvme core got timeout %u\n",timeout);
-
- ctrl->ctrl_config |= (NVME_CTRL_PAGE_SHIFT - 12) << NVME_CC_MPS_SHIFT;
- ctrl->ctrl_config |= NVME_CC_AMS_RR | NVME_CC_SHN_NONE;
- @@ -2425,8 +2426,9 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl)
- ret = ctrl->ops->reg_write32(ctrl, NVME_REG_CC, ctrl->ctrl_config);
- if (ret)
- return ret;
- + dev_info(ctrl->device, "[PATCH] nvme_wait_ready now wait for %u, previously %u\n",(timeout + 1) * 2, (timeout + 1)/2);
- return nvme_wait_ready(ctrl, NVME_CSTS_RDY, NVME_CSTS_RDY,
- - (timeout + 1) / 2, "initialisation");
- + (timeout + 1) * 2, "initialisation");
- }
- EXPORT_SYMBOL_GPL(nvme_enable_ctrl);
-
复制代码
直接暴力把timeout除以2改成乘2了hhh,应该是硬盘固件问题?也联系硬盘官方了,他们也在复现问题,修改后内核的dmesg信息如下
感觉在楼主的修改位置,.driver_data后加入NVME_QUIRK_DELAY_BEFORE_CHK_RDY也可能会生效?之后我验证一下
楼上的marswjf和huyz兄弟可以试一下 |
评分
-
查看全部评分
|