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 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"Varions small fixes, all in drivers.

Some of these arrived during the merge window and got held over to
make sure of testing on the -rc tree.

The biggest change is for standards conformance in the target driver,
closely followed by a set of bug fixes in megaraid_sas"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (21 commits)
scsi: ufs: core: Fix typo in comment
scsi: mpi3mr: Select CONFIG_SCSI_SAS_ATTRS
scsi: ufs: core: Fix typo for register name in comments
scsi: pm80xx: Display proc_name in sysfs
scsi: ufs: core: Fix the error log in ufshcd_query_flag_retry()
scsi: ufs: core: Remove unneeded casts from void *
scsi: lpfc: Fix spelling mistake "unsolicted" -> "unsolicited"
scsi: qla2xxx: Use transport-defined speed mask for supported_speeds
scsi: target: iblock: Fold iblock_emulate_read_cap_with_block_size() into iblock_get_blocks()
scsi: qla2xxx: Fix serialization of DCBX TLV data request
scsi: ufs: qcom: Remove redundant dev_err() call
scsi: megaraid_sas: Move megasas_dbg_lvl init to megasas_init()
scsi: megaraid_sas: Remove unnecessary memset()
scsi: megaraid_sas: Simplify megasas_update_device_list
scsi: megaraid_sas: Correct an error message
scsi: megaraid_sas: Correct value passed to scsi_device_lookup()
scsi: target: core: UA on all LUNs after reset
scsi: target: core: New key must be used for moved PR
scsi: target: core: Abort all preempted regs if requested
scsi: target: core: Fix memory leak in preempt_and_abort
...

+96 -55
+2 -2
drivers/scsi/lpfc/lpfc_bsg.c
··· 2582 2582 * 2583 2583 * This function obtains the transmit and receive ids required to send 2584 2584 * an unsolicited ct command with a payload. A special lpfc FsType and CmdRsp 2585 - * flags are used to the unsolicted response handler is able to process 2585 + * flags are used to the unsolicited response handler is able to process 2586 2586 * the ct command sent on the same port. 2587 2587 **/ 2588 2588 static int lpfcdiag_loop_get_xri(struct lpfc_hba *phba, uint16_t rpi, ··· 2874 2874 * @len: Number of data bytes 2875 2875 * 2876 2876 * This function allocates and posts a data buffer of sufficient size to receive 2877 - * an unsolicted CT command. 2877 + * an unsolicited CT command. 2878 2878 **/ 2879 2879 static int lpfcdiag_sli3_loop_post_rxbufs(struct lpfc_hba *phba, uint16_t rxxri, 2880 2880 size_t len)
+1 -1
drivers/scsi/lpfc/lpfc_ct.c
··· 90 90 get_job_ulpstatus(phba, piocbq)); 91 91 } 92 92 lpfc_printf_log(phba, KERN_INFO, LOG_ELS, 93 - "0145 Ignoring unsolicted CT HBQ Size:%d " 93 + "0145 Ignoring unsolicited CT HBQ Size:%d " 94 94 "status = x%x\n", 95 95 size, get_job_ulpstatus(phba, piocbq)); 96 96 }
+8 -19
drivers/scsi/megaraid/megaraid_sas_base.c
··· 5874 5874 static 5875 5875 int megasas_get_device_list(struct megasas_instance *instance) 5876 5876 { 5877 - memset(instance->pd_list, 0, 5878 - (MEGASAS_MAX_PD * sizeof(struct megasas_pd_list))); 5879 - memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS); 5880 - 5881 5877 if (instance->enable_fw_dev_list) { 5882 5878 if (megasas_host_device_list_query(instance, true)) 5883 5879 return FAILED; ··· 7216 7220 7217 7221 if (!fusion->ioc_init_request) { 7218 7222 dev_err(&pdev->dev, 7219 - "Failed to allocate PD list buffer\n"); 7223 + "Failed to allocate ioc init request\n"); 7220 7224 return -ENOMEM; 7221 7225 } 7222 7226 ··· 7435 7439 (instance->pdev->device == PCI_DEVICE_ID_LSI_SAS0071SKINNY)) 7436 7440 instance->flag_ieee = 1; 7437 7441 7438 - megasas_dbg_lvl = 0; 7439 7442 instance->flag = 0; 7440 7443 instance->unload = 1; 7441 7444 instance->last_time = 0; ··· 8757 8762 int megasas_update_device_list(struct megasas_instance *instance, 8758 8763 int event_type) 8759 8764 { 8760 - int dcmd_ret = DCMD_SUCCESS; 8765 + int dcmd_ret; 8761 8766 8762 8767 if (instance->enable_fw_dev_list) { 8763 - dcmd_ret = megasas_host_device_list_query(instance, false); 8764 - if (dcmd_ret != DCMD_SUCCESS) 8765 - goto out; 8768 + return megasas_host_device_list_query(instance, false); 8766 8769 } else { 8767 8770 if (event_type & SCAN_PD_CHANNEL) { 8768 8771 dcmd_ret = megasas_get_pd_list(instance); 8769 - 8770 8772 if (dcmd_ret != DCMD_SUCCESS) 8771 - goto out; 8773 + return dcmd_ret; 8772 8774 } 8773 8775 8774 8776 if (event_type & SCAN_VD_CHANNEL) { 8775 8777 if (!instance->requestorId || 8776 8778 megasas_get_ld_vf_affiliation(instance, 0)) { 8777 - dcmd_ret = megasas_ld_list_query(instance, 8779 + return megasas_ld_list_query(instance, 8778 8780 MR_LD_QUERY_TYPE_EXPOSED_TO_HOST); 8779 - if (dcmd_ret != DCMD_SUCCESS) 8780 - goto out; 8781 8781 } 8782 8782 } 8783 8783 } 8784 - 8785 - out: 8786 - return dcmd_ret; 8784 + return DCMD_SUCCESS; 8787 8785 } 8788 8786 8789 8787 /** ··· 8906 8918 sdev1 = scsi_device_lookup(instance->host, 8907 8919 MEGASAS_MAX_PD_CHANNELS + 8908 8920 (ld_target_id / MEGASAS_MAX_DEV_PER_CHANNEL), 8909 - (ld_target_id - MEGASAS_MAX_DEV_PER_CHANNEL), 8921 + (ld_target_id % MEGASAS_MAX_DEV_PER_CHANNEL), 8910 8922 0); 8911 8923 if (sdev1) 8912 8924 megasas_remove_scsi_device(sdev1); ··· 9004 9016 */ 9005 9017 pr_info("megasas: %s\n", MEGASAS_VERSION); 9006 9018 9019 + megasas_dbg_lvl = 0; 9007 9020 support_poll_for_event = 2; 9008 9021 support_device_change = 1; 9009 9022 support_nvme_encapsulation = true;
+1
drivers/scsi/mpi3mr/Kconfig
··· 4 4 tristate "Broadcom MPI3 Storage Controller Device Driver" 5 5 depends on PCI && SCSI 6 6 select BLK_DEV_BSGLIB 7 + select SCSI_SAS_ATTRS 7 8 help 8 9 MPI3 based Storage & RAID Controllers Driver.
+1
drivers/scsi/pm8001/pm8001_init.c
··· 99 99 static struct scsi_host_template pm8001_sht = { 100 100 .module = THIS_MODULE, 101 101 .name = DRV_NAME, 102 + .proc_name = DRV_NAME, 102 103 .queuecommand = sas_queuecommand, 103 104 .dma_need_drain = ata_scsi_dma_need_drain, 104 105 .target_alloc = sas_target_alloc,
+27 -3
drivers/scsi/qla2xxx/qla_attr.c
··· 951 951 if (!capable(CAP_SYS_ADMIN) || off != 0 || count > DCBX_TLV_DATA_SIZE) 952 952 return 0; 953 953 954 + mutex_lock(&vha->hw->optrom_mutex); 954 955 if (ha->dcbx_tlv) 955 956 goto do_read; 956 - mutex_lock(&vha->hw->optrom_mutex); 957 957 if (qla2x00_chip_is_down(vha)) { 958 958 mutex_unlock(&vha->hw->optrom_mutex); 959 959 return 0; ··· 3330 3330 .bsg_timeout = qla24xx_bsg_timeout, 3331 3331 }; 3332 3332 3333 + static uint 3334 + qla2x00_get_host_supported_speeds(scsi_qla_host_t *vha, uint speeds) 3335 + { 3336 + uint supported_speeds = FC_PORTSPEED_UNKNOWN; 3337 + 3338 + if (speeds & FDMI_PORT_SPEED_64GB) 3339 + supported_speeds |= FC_PORTSPEED_64GBIT; 3340 + if (speeds & FDMI_PORT_SPEED_32GB) 3341 + supported_speeds |= FC_PORTSPEED_32GBIT; 3342 + if (speeds & FDMI_PORT_SPEED_16GB) 3343 + supported_speeds |= FC_PORTSPEED_16GBIT; 3344 + if (speeds & FDMI_PORT_SPEED_8GB) 3345 + supported_speeds |= FC_PORTSPEED_8GBIT; 3346 + if (speeds & FDMI_PORT_SPEED_4GB) 3347 + supported_speeds |= FC_PORTSPEED_4GBIT; 3348 + if (speeds & FDMI_PORT_SPEED_2GB) 3349 + supported_speeds |= FC_PORTSPEED_2GBIT; 3350 + if (speeds & FDMI_PORT_SPEED_1GB) 3351 + supported_speeds |= FC_PORTSPEED_1GBIT; 3352 + 3353 + return supported_speeds; 3354 + } 3355 + 3333 3356 void 3334 3357 qla2x00_init_host_attr(scsi_qla_host_t *vha) 3335 3358 { 3336 3359 struct qla_hw_data *ha = vha->hw; 3337 - u32 speeds = FC_PORTSPEED_UNKNOWN; 3360 + u32 speeds = 0, fdmi_speed = 0; 3338 3361 3339 3362 fc_host_dev_loss_tmo(vha->host) = ha->port_down_retry_count; 3340 3363 fc_host_node_name(vha->host) = wwn_to_u64(vha->node_name); ··· 3367 3344 fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; 3368 3345 fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; 3369 3346 3370 - speeds = qla25xx_fdmi_port_speed_capability(ha); 3347 + fdmi_speed = qla25xx_fdmi_port_speed_capability(ha); 3348 + speeds = qla2x00_get_host_supported_speeds(vha, fdmi_speed); 3371 3349 3372 3350 fc_host_supported_speeds(vha->host) = speeds; 3373 3351 }
+19
drivers/target/target_core_device.c
··· 284 284 complete(&deve->pr_comp); 285 285 } 286 286 287 + /* 288 + * Establish UA condition on SCSI device - all LUNs 289 + */ 290 + void target_dev_ua_allocate(struct se_device *dev, u8 asc, u8 ascq) 291 + { 292 + struct se_dev_entry *se_deve; 293 + struct se_lun *lun; 294 + 295 + spin_lock(&dev->se_port_lock); 296 + list_for_each_entry(lun, &dev->dev_sep_list, lun_dev_link) { 297 + 298 + spin_lock(&lun->lun_deve_lock); 299 + list_for_each_entry(se_deve, &lun->lun_deve_list, lun_link) 300 + core_scsi3_ua_allocate(se_deve, asc, ascq); 301 + spin_unlock(&lun->lun_deve_lock); 302 + } 303 + spin_unlock(&dev->se_port_lock); 304 + } 305 + 287 306 static void 288 307 target_luns_data_has_changed(struct se_node_acl *nacl, struct se_dev_entry *new, 289 308 bool skip_new)
+4 -15
drivers/target/target_core_iblock.c
··· 230 230 clear_bit(IBD_PLUGF_PLUGGED, &ib_dev_plug->flags); 231 231 } 232 232 233 - static unsigned long long iblock_emulate_read_cap_with_block_size( 234 - struct se_device *dev, 235 - struct block_device *bd, 236 - struct request_queue *q) 233 + static sector_t iblock_get_blocks(struct se_device *dev) 237 234 { 238 - u32 block_size = bdev_logical_block_size(bd); 235 + struct iblock_dev *ib_dev = IBLOCK_DEV(dev); 236 + u32 block_size = bdev_logical_block_size(ib_dev->ibd_bd); 239 237 unsigned long long blocks_long = 240 - div_u64(bdev_nr_bytes(bd), block_size) - 1; 238 + div_u64(bdev_nr_bytes(ib_dev->ibd_bd), block_size) - 1; 241 239 242 240 if (block_size == dev->dev_attrib.block_size) 243 241 return blocks_long; ··· 825 827 kfree(ibr); 826 828 fail: 827 829 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; 828 - } 829 - 830 - static sector_t iblock_get_blocks(struct se_device *dev) 831 - { 832 - struct iblock_dev *ib_dev = IBLOCK_DEV(dev); 833 - struct block_device *bd = ib_dev->ibd_bd; 834 - struct request_queue *q = bdev_get_queue(bd); 835 - 836 - return iblock_emulate_read_cap_with_block_size(dev, bd, q); 837 830 } 838 831 839 832 static sector_t iblock_get_alignment_offset_lbas(struct se_device *dev)
+1
drivers/target/target_core_internal.h
··· 89 89 void target_free_device(struct se_device *); 90 90 int target_for_each_device(int (*fn)(struct se_device *dev, void *data), 91 91 void *data); 92 + void target_dev_ua_allocate(struct se_device *dev, u8 asc, u8 ascq); 92 93 93 94 /* target_core_configfs.c */ 94 95 extern struct configfs_item_operations target_core_dev_item_ops;
+26 -7
drivers/target/target_core_pr.c
··· 2956 2956 __core_scsi3_complete_pro_preempt(dev, pr_reg_n, 2957 2957 (preempt_type == PREEMPT_AND_ABORT) ? &preempt_and_abort_list : NULL, 2958 2958 type, scope, preempt_type); 2959 - 2960 - if (preempt_type == PREEMPT_AND_ABORT) 2961 - core_scsi3_release_preempt_and_abort( 2962 - &preempt_and_abort_list, pr_reg_n); 2963 2959 } 2960 + 2964 2961 spin_unlock(&dev->dev_reservation_lock); 2962 + 2963 + /* 2964 + * SPC-4 5.12.11.2.6 Preempting and aborting 2965 + * The actions described in this subclause shall be performed 2966 + * for all I_T nexuses that are registered with the non-zero 2967 + * SERVICE ACTION RESERVATION KEY value, without regard for 2968 + * whether the preempted I_T nexuses hold the persistent 2969 + * reservation. If the SERVICE ACTION RESERVATION KEY field is 2970 + * set to zero and an all registrants persistent reservation is 2971 + * present, the device server shall abort all commands for all 2972 + * registered I_T nexuses. 2973 + */ 2974 + if (preempt_type == PREEMPT_AND_ABORT) { 2975 + core_tmr_lun_reset(dev, NULL, &preempt_and_abort_list, 2976 + cmd); 2977 + core_scsi3_release_preempt_and_abort( 2978 + &preempt_and_abort_list, pr_reg_n); 2979 + } 2965 2980 2966 2981 if (pr_tmpl->pr_aptpl_active) 2967 2982 core_scsi3_update_and_write_aptpl(cmd->se_dev, true); ··· 3037 3022 if (calling_it_nexus) 3038 3023 continue; 3039 3024 3040 - if (pr_reg->pr_res_key != sa_res_key) 3025 + if (sa_res_key && pr_reg->pr_res_key != sa_res_key) 3041 3026 continue; 3042 3027 3043 3028 pr_reg_nacl = pr_reg->pr_reg_nacl; ··· 3440 3425 * transport protocols where port names are not required; 3441 3426 * d) Register the reservation key specified in the SERVICE ACTION 3442 3427 * RESERVATION KEY field; 3443 - * e) Retain the reservation key specified in the SERVICE ACTION 3444 - * RESERVATION KEY field and associated information; 3445 3428 * 3446 3429 * Also, It is not an error for a REGISTER AND MOVE service action to 3447 3430 * register an I_T nexus that is already registered with the same ··· 3461 3448 dest_pr_reg = __core_scsi3_locate_pr_reg(dev, dest_node_acl, 3462 3449 iport_ptr); 3463 3450 new_reg = 1; 3451 + } else { 3452 + /* 3453 + * e) Retain the reservation key specified in the SERVICE ACTION 3454 + * RESERVATION KEY field and associated information; 3455 + */ 3456 + dest_pr_reg->pr_res_key = sa_res_key; 3464 3457 } 3465 3458 /* 3466 3459 * f) Release the persistent reservation for the persistent reservation
+1 -2
drivers/target/target_core_transport.c
··· 3531 3531 tmr->response = (!ret) ? TMR_FUNCTION_COMPLETE : 3532 3532 TMR_FUNCTION_REJECTED; 3533 3533 if (tmr->response == TMR_FUNCTION_COMPLETE) { 3534 - target_ua_allocate_lun(cmd->se_sess->se_node_acl, 3535 - cmd->orig_fe_lun, 0x29, 3534 + target_dev_ua_allocate(dev, 0x29, 3536 3535 ASCQ_29H_BUS_DEVICE_RESET_FUNCTION_OCCURRED); 3537 3536 } 3538 3537 break;
+2 -2
drivers/ufs/core/ufshcd.c
··· 772 772 } 773 773 774 774 /** 775 - * ufshcd_utmrl_clear - Clear a bit in UTRMLCLR register 775 + * ufshcd_utmrl_clear - Clear a bit in UTMRLCLR register 776 776 * @hba: per adapter instance 777 777 * @pos: position of the bit to be cleared 778 778 */ ··· 3098 3098 3099 3099 if (ret) 3100 3100 dev_err(hba->dev, 3101 - "%s: query attribute, opcode %d, idn %d, failed with error %d after %d retries\n", 3101 + "%s: query flag, opcode %d, idn %d, failed with error %d after %d retries\n", 3102 3102 __func__, opcode, idn, ret, retries); 3103 3103 return ret; 3104 3104 }
+3 -3
drivers/ufs/core/ufshpb.c
··· 383 383 rgn = hpb->rgn_tbl + rgn_idx; 384 384 srgn = rgn->srgn_tbl + srgn_idx; 385 385 386 - /* If command type is WRITE or DISCARD, set bitmap as drity */ 386 + /* If command type is WRITE or DISCARD, set bitmap as dirty */ 387 387 if (ufshpb_is_write_or_discard(cmd)) { 388 388 ufshpb_iterate_rgn(hpb, rgn_idx, srgn_idx, srgn_offset, 389 389 transfer_len, true); ··· 616 616 static enum rq_end_io_ret ufshpb_umap_req_compl_fn(struct request *req, 617 617 blk_status_t error) 618 618 { 619 - struct ufshpb_req *umap_req = (struct ufshpb_req *)req->end_io_data; 619 + struct ufshpb_req *umap_req = req->end_io_data; 620 620 621 621 ufshpb_put_req(umap_req->hpb, umap_req); 622 622 return RQ_END_IO_NONE; ··· 625 625 static enum rq_end_io_ret ufshpb_map_req_compl_fn(struct request *req, 626 626 blk_status_t error) 627 627 { 628 - struct ufshpb_req *map_req = (struct ufshpb_req *) req->end_io_data; 628 + struct ufshpb_req *map_req = req->end_io_data; 629 629 struct ufshpb_lu *hpb = map_req->hpb; 630 630 struct ufshpb_subregion *srgn; 631 631 unsigned long flags;
-1
drivers/ufs/host/ufs-qcom-ice.c
··· 118 118 host->ice_mmio = devm_ioremap_resource(dev, res); 119 119 if (IS_ERR(host->ice_mmio)) { 120 120 err = PTR_ERR(host->ice_mmio); 121 - dev_err(dev, "Failed to map ICE registers; err=%d\n", err); 122 121 return err; 123 122 } 124 123