Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'block-5.9-2020-09-25' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:
"NVMe pull request from Christoph, and removal of a dead define.

- fix error during controller probe that cause double free irqs
(Keith Busch)

- FC connection establishment fix (James Smart)

- properly handle completions for invalid tags (Xianting Tian)

- pass the correct nsid to the command effects and supported log
(Chaitanya Kulkarni)"

* tag 'block-5.9-2020-09-25' of git://git.kernel.dk/linux-block:
block: remove unused BLK_QC_T_EAGAIN flag
nvme-core: don't use NVME_NSID_ALL for command effects and supported log
nvme-fc: fail new connections to a deleted host or remote port
nvme-pci: fix NULL req in completion handler
nvme: return errors for hwmon init

+29 -24
+6 -3
drivers/nvme/host/core.c
··· 3041 3041 if (!cel) 3042 3042 return -ENOMEM; 3043 3043 3044 - ret = nvme_get_log(ctrl, NVME_NSID_ALL, NVME_LOG_CMD_EFFECTS, 0, csi, 3044 + ret = nvme_get_log(ctrl, 0x00, NVME_LOG_CMD_EFFECTS, 0, csi, 3045 3045 &cel->log, sizeof(cel->log), 0); 3046 3046 if (ret) { 3047 3047 kfree(cel); ··· 3236 3236 if (ret < 0) 3237 3237 return ret; 3238 3238 3239 - if (!ctrl->identified) 3240 - nvme_hwmon_init(ctrl); 3239 + if (!ctrl->identified) { 3240 + ret = nvme_hwmon_init(ctrl); 3241 + if (ret < 0) 3242 + return ret; 3243 + } 3241 3244 3242 3245 ctrl->identified = true; 3243 3246
+4 -2
drivers/nvme/host/fc.c
··· 3671 3671 spin_lock_irqsave(&nvme_fc_lock, flags); 3672 3672 list_for_each_entry(lport, &nvme_fc_lport_list, port_list) { 3673 3673 if (lport->localport.node_name != laddr.nn || 3674 - lport->localport.port_name != laddr.pn) 3674 + lport->localport.port_name != laddr.pn || 3675 + lport->localport.port_state != FC_OBJSTATE_ONLINE) 3675 3676 continue; 3676 3677 3677 3678 list_for_each_entry(rport, &lport->endp_list, endp_list) { 3678 3679 if (rport->remoteport.node_name != raddr.nn || 3679 - rport->remoteport.port_name != raddr.pn) 3680 + rport->remoteport.port_name != raddr.pn || 3681 + rport->remoteport.port_state != FC_OBJSTATE_ONLINE) 3680 3682 continue; 3681 3683 3682 3684 /* if fail to get reference fall through. Will error */
+6 -8
drivers/nvme/host/hwmon.c
··· 59 59 60 60 static int nvme_hwmon_get_smart_log(struct nvme_hwmon_data *data) 61 61 { 62 - int ret; 63 - 64 - ret = nvme_get_log(data->ctrl, NVME_NSID_ALL, NVME_LOG_SMART, 0, 62 + return nvme_get_log(data->ctrl, NVME_NSID_ALL, NVME_LOG_SMART, 0, 65 63 NVME_CSI_NVM, &data->log, sizeof(data->log), 0); 66 - 67 - return ret <= 0 ? ret : -EIO; 68 64 } 69 65 70 66 static int nvme_hwmon_read(struct device *dev, enum hwmon_sensor_types type, ··· 221 225 .info = nvme_hwmon_info, 222 226 }; 223 227 224 - void nvme_hwmon_init(struct nvme_ctrl *ctrl) 228 + int nvme_hwmon_init(struct nvme_ctrl *ctrl) 225 229 { 226 230 struct device *dev = ctrl->dev; 227 231 struct nvme_hwmon_data *data; ··· 230 234 231 235 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); 232 236 if (!data) 233 - return; 237 + return 0; 234 238 235 239 data->ctrl = ctrl; 236 240 mutex_init(&data->read_lock); ··· 240 244 dev_warn(ctrl->device, 241 245 "Failed to read smart log (error %d)\n", err); 242 246 devm_kfree(dev, data); 243 - return; 247 + return err; 244 248 } 245 249 246 250 hwmon = devm_hwmon_device_register_with_info(dev, "nvme", data, ··· 250 254 dev_warn(dev, "Failed to instantiate hwmon device\n"); 251 255 devm_kfree(dev, data); 252 256 } 257 + 258 + return 0; 253 259 }
+5 -2
drivers/nvme/host/nvme.h
··· 827 827 } 828 828 829 829 #ifdef CONFIG_NVME_HWMON 830 - void nvme_hwmon_init(struct nvme_ctrl *ctrl); 830 + int nvme_hwmon_init(struct nvme_ctrl *ctrl); 831 831 #else 832 - static inline void nvme_hwmon_init(struct nvme_ctrl *ctrl) { } 832 + static inline int nvme_hwmon_init(struct nvme_ctrl *ctrl) 833 + { 834 + return 0; 835 + } 833 836 #endif 834 837 835 838 u32 nvme_command_effects(struct nvme_ctrl *ctrl, struct nvme_ns *ns,
+7 -7
drivers/nvme/host/pci.c
··· 940 940 struct nvme_completion *cqe = &nvmeq->cqes[idx]; 941 941 struct request *req; 942 942 943 - if (unlikely(cqe->command_id >= nvmeq->q_depth)) { 944 - dev_warn(nvmeq->dev->ctrl.device, 945 - "invalid id %d completed on queue %d\n", 946 - cqe->command_id, le16_to_cpu(cqe->sq_id)); 947 - return; 948 - } 949 - 950 943 /* 951 944 * AEN requests are special as they don't time out and can 952 945 * survive any kind of queue freeze and often don't respond to ··· 953 960 } 954 961 955 962 req = blk_mq_tag_to_rq(nvme_queue_tagset(nvmeq), cqe->command_id); 963 + if (unlikely(!req)) { 964 + dev_warn(nvmeq->dev->ctrl.device, 965 + "invalid id %d completed on queue %d\n", 966 + cqe->command_id, le16_to_cpu(cqe->sq_id)); 967 + return; 968 + } 969 + 956 970 trace_nvme_sq(req, cqe->sq_head, nvmeq->sq_tail); 957 971 if (!nvme_try_complete_req(req, cqe->status, cqe->result)) 958 972 nvme_pci_complete_rq(req);
+1 -2
include/linux/blk_types.h
··· 497 497 498 498 typedef unsigned int blk_qc_t; 499 499 #define BLK_QC_T_NONE -1U 500 - #define BLK_QC_T_EAGAIN -2U 501 500 #define BLK_QC_T_SHIFT 16 502 501 #define BLK_QC_T_INTERNAL (1U << 31) 503 502 504 503 static inline bool blk_qc_t_valid(blk_qc_t cookie) 505 504 { 506 - return cookie != BLK_QC_T_NONE && cookie != BLK_QC_T_EAGAIN; 505 + return cookie != BLK_QC_T_NONE; 507 506 } 508 507 509 508 static inline unsigned int blk_qc_t_to_queue_num(blk_qc_t cookie)