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

Pull more SCSI updates from James Bottomley:
"This is a set of minor fixes and clean ups in the core and various
drivers.

The only core change in behaviour is the I/O retry for spinup notify,
but that shouldn't impact anything other than the failing case"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (23 commits)
scsi: virtio_scsi: Add validation for residual bytes from response
scsi: ipr: System crashes when seeing type 20 error
scsi: core: Retry I/O for Notify (Enable Spinup) Required error
scsi: mpi3mr: Fix warnings reported by smatch
scsi: qedf: Add check to synchronize abort and flush
scsi: MAINTAINERS: Add mpi3mr driver maintainers
scsi: libfc: Fix array index out of bound exception
scsi: mvsas: Use DEVICE_ATTR_RO()/RW() macro
scsi: megaraid_mbox: Use DEVICE_ATTR_ADMIN_RO() macro
scsi: qedf: Use DEVICE_ATTR_RO() macro
scsi: qedi: Use DEVICE_ATTR_RO() macro
scsi: message: mptfc: Switch from pci_ to dma_ API
scsi: be2iscsi: Fix some missing space in some messages
scsi: be2iscsi: Fix an error handling path in beiscsi_dev_probe()
scsi: ufs: Fix build warning without CONFIG_PM
scsi: bnx2fc: Remove meaningless bnx2fc_abts_cleanup() return value assignment
scsi: qla2xxx: Add heartbeat check
scsi: virtio_scsi: Do not overwrite SCSI status
scsi: libsas: Add LUN number check in .slave_alloc callback
scsi: core: Inline scsi_mq_alloc_queue()
...

+287 -162
+11
MAINTAINERS
··· 3781 3781 F: Documentation/devicetree/bindings/gpio/brcm,kona-gpio.txt 3782 3782 F: drivers/gpio/gpio-bcm-kona.c 3783 3783 3784 + BROADCOM MPI3 STORAGE CONTROLLER DRIVER 3785 + M: Sathya Prakash Veerichetty <sathya.prakash@broadcom.com> 3786 + M: Kashyap Desai <kashyap.desai@broadcom.com> 3787 + M: Sumit Saxena <sumit.saxena@broadcom.com> 3788 + M: Sreekanth Reddy <sreekanth.reddy@broadcom.com> 3789 + L: mpi3mr-linuxdrv.pdl@broadcom.com 3790 + L: linux-scsi@vger.kernel.org 3791 + S: Supported 3792 + W: https://www.broadcom.com/support/storage 3793 + F: drivers/scsi/mpi3mr/ 3794 + 3784 3795 BROADCOM NETXTREME-E ROCE DRIVER 3785 3796 M: Selvin Xavier <selvin.xavier@broadcom.com> 3786 3797 M: Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>
+18 -17
drivers/message/fusion/mptfc.c
··· 331 331 break; 332 332 333 333 data_sz = hdr.PageLength * 4; 334 - ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, 335 - &page0_dma); 334 + ppage0_alloc = dma_alloc_coherent(&ioc->pcidev->dev, data_sz, 335 + &page0_dma, GFP_KERNEL); 336 336 rc = -ENOMEM; 337 337 if (!ppage0_alloc) 338 338 break; ··· 367 367 *p_p0 = *ppage0_alloc; /* save data */ 368 368 *p_pp0++ = p_p0++; /* save addr */ 369 369 } 370 - pci_free_consistent(ioc->pcidev, data_sz, 371 - (u8 *) ppage0_alloc, page0_dma); 370 + dma_free_coherent(&ioc->pcidev->dev, data_sz, 371 + ppage0_alloc, page0_dma); 372 372 if (rc != 0) 373 373 break; 374 374 ··· 763 763 764 764 data_sz = hdr.PageLength * 4; 765 765 rc = -ENOMEM; 766 - ppage0_alloc = pci_alloc_consistent(ioc->pcidev, data_sz, &page0_dma); 766 + ppage0_alloc = dma_alloc_coherent(&ioc->pcidev->dev, data_sz, 767 + &page0_dma, GFP_KERNEL); 767 768 if (ppage0_alloc) { 768 769 769 770 try_again: ··· 818 817 mptfc_display_port_link_speed(ioc, portnum, pp0dest); 819 818 } 820 819 821 - pci_free_consistent(ioc->pcidev, data_sz, (u8 *) ppage0_alloc, page0_dma); 820 + dma_free_coherent(&ioc->pcidev->dev, data_sz, ppage0_alloc, 821 + page0_dma); 822 822 } 823 823 824 824 return rc; ··· 906 904 if (data_sz < sizeof(FCPortPage1_t)) 907 905 data_sz = sizeof(FCPortPage1_t); 908 906 909 - page1_alloc = pci_alloc_consistent(ioc->pcidev, 910 - data_sz, 911 - &page1_dma); 907 + page1_alloc = dma_alloc_coherent(&ioc->pcidev->dev, data_sz, 908 + &page1_dma, GFP_KERNEL); 912 909 if (!page1_alloc) 913 910 return -ENOMEM; 914 911 } ··· 917 916 data_sz = ioc->fc_data.fc_port_page1[portnum].pg_sz; 918 917 if (hdr.PageLength * 4 > data_sz) { 919 918 ioc->fc_data.fc_port_page1[portnum].data = NULL; 920 - pci_free_consistent(ioc->pcidev, data_sz, (u8 *) 921 - page1_alloc, page1_dma); 919 + dma_free_coherent(&ioc->pcidev->dev, data_sz, 920 + page1_alloc, page1_dma); 922 921 goto start_over; 923 922 } 924 923 } ··· 933 932 } 934 933 else { 935 934 ioc->fc_data.fc_port_page1[portnum].data = NULL; 936 - pci_free_consistent(ioc->pcidev, data_sz, (u8 *) 937 - page1_alloc, page1_dma); 935 + dma_free_coherent(&ioc->pcidev->dev, data_sz, page1_alloc, 936 + page1_dma); 938 937 } 939 938 940 939 return rc; ··· 1515 1514 1516 1515 for (ii=0; ii<ioc->facts.NumberOfPorts; ii++) { 1517 1516 if (ioc->fc_data.fc_port_page1[ii].data) { 1518 - pci_free_consistent(ioc->pcidev, 1519 - ioc->fc_data.fc_port_page1[ii].pg_sz, 1520 - (u8 *) ioc->fc_data.fc_port_page1[ii].data, 1521 - ioc->fc_data.fc_port_page1[ii].dma); 1517 + dma_free_coherent(&ioc->pcidev->dev, 1518 + ioc->fc_data.fc_port_page1[ii].pg_sz, 1519 + ioc->fc_data.fc_port_page1[ii].data, 1520 + ioc->fc_data.fc_port_page1[ii].dma); 1522 1521 ioc->fc_data.fc_port_page1[ii].data = NULL; 1523 1522 } 1524 1523 }
+1 -1
drivers/scsi/aic7xxx/aic7xxx_core.c
··· 493 493 return ((ahc_inb(ahc, port)) 494 494 | (ahc_inb(ahc, port+1) << 8) 495 495 | (ahc_inb(ahc, port+2) << 16) 496 - | (ahc_inb(ahc, port+3) << 24) 496 + | (((uint64_t)ahc_inb(ahc, port+3)) << 24) 497 497 | (((uint64_t)ahc_inb(ahc, port+4)) << 32) 498 498 | (((uint64_t)ahc_inb(ahc, port+5)) << 40) 499 499 | (((uint64_t)ahc_inb(ahc, port+6)) << 48)
+1
drivers/scsi/aic94xx/aic94xx_init.c
··· 53 53 .max_sectors = SCSI_DEFAULT_MAX_SECTORS, 54 54 .eh_device_reset_handler = sas_eh_device_reset_handler, 55 55 .eh_target_reset_handler = sas_eh_target_reset_handler, 56 + .slave_alloc = sas_slave_alloc, 56 57 .target_destroy = sas_target_destroy, 57 58 .ioctl = sas_ioctl, 58 59 #ifdef CONFIG_COMPAT
+39 -64
drivers/scsi/be2iscsi/be_main.c
··· 143 143 beiscsi_##_name##_disp, beiscsi_##_name##_store) 144 144 145 145 /* 146 - * When new log level added update the 147 - * the MAX allowed value for log_enable 146 + * When new log level added update MAX allowed value for log_enable 148 147 */ 149 148 BEISCSI_RW_ATTR(log_enable, 0x00, 150 149 0xFF, 0x00, "Enable logging Bit Mask\n" ··· 824 825 &phwi_context->be_eq[i]); 825 826 if (ret) { 826 827 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 827 - "BM_%d : beiscsi_init_irqs-Failed to" 828 - "register msix for i = %d\n", 829 - i); 828 + "BM_%d : %s-Failed to register msix for i = %d\n", 829 + __func__, i); 830 830 kfree(phba->msi_name[i]); 831 831 goto free_msix_irqs; 832 832 } ··· 839 841 ret = request_irq(pci_irq_vector(pcidev, i), be_isr_mcc, 0, 840 842 phba->msi_name[i], &phwi_context->be_eq[i]); 841 843 if (ret) { 842 - beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT , 843 - "BM_%d : beiscsi_init_irqs-" 844 - "Failed to register beiscsi_msix_mcc\n"); 844 + beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 845 + "BM_%d : %s-Failed to register beiscsi_msix_mcc\n", 846 + __func__); 845 847 kfree(phba->msi_name[i]); 846 848 goto free_msix_irqs; 847 849 } ··· 851 853 "beiscsi", phba); 852 854 if (ret) { 853 855 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 854 - "BM_%d : beiscsi_init_irqs-" 855 - "Failed to register irq\\n"); 856 + "BM_%d : %s-Failed to register irq\n", 857 + __func__); 856 858 return ret; 857 859 } 858 860 } ··· 1028 1030 phba->params.wrbs_per_cxn); 1029 1031 beiscsi_log(phba, KERN_INFO, 1030 1032 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 1031 - "BM_%d : FREE WRB: pwrb_handle=%p free_index=0x%x" 1033 + "BM_%d : FREE WRB: pwrb_handle=%p free_index=0x%x " 1032 1034 "wrb_handles_available=%d\n", 1033 1035 pwrb_handle, pwrb_context->free_index, 1034 1036 pwrb_context->wrb_handles_available); ··· 1372 1374 beiscsi_log(phba, KERN_ERR, 1373 1375 BEISCSI_LOG_CONFIG | BEISCSI_LOG_IO, 1374 1376 "BM_%d :\t\t No HWH_TYPE_LOGIN Expected in" 1375 - " hwi_complete_cmd- Solicited path\n"); 1377 + " %s- Solicited path\n", __func__); 1376 1378 break; 1377 1379 1378 1380 case HWH_TYPE_NOP: ··· 1382 1384 default: 1383 1385 beiscsi_log(phba, KERN_WARNING, 1384 1386 BEISCSI_LOG_CONFIG | BEISCSI_LOG_IO, 1385 - "BM_%d : In hwi_complete_cmd, unknown type = %d" 1386 - "wrb_index 0x%x CID 0x%x\n", type, 1387 + "BM_%d : In %s, unknown type = %d " 1388 + "wrb_index 0x%x CID 0x%x\n", __func__, type, 1387 1389 csol_cqe.wrb_index, 1388 1390 csol_cqe.cid); 1389 1391 break; ··· 1881 1883 cid = AMAP_GET_BITS( 1882 1884 struct amap_i_t_dpdu_cqe_v2, 1883 1885 cid, sol); 1884 - else 1885 - cid = AMAP_GET_BITS(struct amap_sol_cqe_v2, 1886 - cid, sol); 1886 + else 1887 + cid = AMAP_GET_BITS(struct amap_sol_cqe_v2, 1888 + cid, sol); 1887 1889 } 1888 1890 1889 1891 cri_index = BE_GET_CRI_FROM_CID(cid); ··· 2008 2010 default: 2009 2011 beiscsi_log(phba, KERN_ERR, 2010 2012 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 2011 - "BM_%d : Invalid CQE Event Received Code : %d" 2012 - "CID 0x%x...\n", 2013 + "BM_%d : Invalid CQE Event Received Code : %d CID 0x%x...\n", 2013 2014 code, cid); 2014 2015 break; 2015 2016 } ··· 2998 3001 void *eq_vaddress; 2999 3002 dma_addr_t paddr; 3000 3003 3001 - num_eq_pages = PAGES_REQUIRED(phba->params.num_eq_entries * \ 3004 + num_eq_pages = PAGES_REQUIRED(phba->params.num_eq_entries * 3002 3005 sizeof(struct be_eq_entry)); 3003 3006 3004 3007 if (phba->pcidev->msix_enabled) ··· 3031 3034 BEISCSI_EQ_DELAY_DEF); 3032 3035 if (ret) { 3033 3036 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 3034 - "BM_%d : beiscsi_cmd_eq_create" 3035 - "Failed for EQ\n"); 3037 + "BM_%d : beiscsi_cmd_eq_create Failed for EQ\n"); 3036 3038 goto create_eq_error; 3037 3039 } 3038 3040 ··· 3064 3068 int ret = -ENOMEM; 3065 3069 dma_addr_t paddr; 3066 3070 3067 - num_cq_pages = PAGES_REQUIRED(phba->params.num_cq_entries * \ 3071 + num_cq_pages = PAGES_REQUIRED(phba->params.num_cq_entries * 3068 3072 sizeof(struct sol_cqe)); 3069 3073 3070 3074 for (i = 0; i < phba->num_cpus; i++) { ··· 3086 3090 sizeof(struct sol_cqe), cq_vaddress); 3087 3091 if (ret) { 3088 3092 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 3089 - "BM_%d : be_fill_queue Failed " 3090 - "for ISCSI CQ\n"); 3093 + "BM_%d : be_fill_queue Failed for ISCSI CQ\n"); 3091 3094 goto create_cq_error; 3092 3095 } 3093 3096 ··· 3095 3100 false, 0); 3096 3101 if (ret) { 3097 3102 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 3098 - "BM_%d : beiscsi_cmd_eq_create" 3099 - "Failed for ISCSI CQ\n"); 3103 + "BM_%d : beiscsi_cmd_eq_create Failed for ISCSI CQ\n"); 3100 3104 goto create_cq_error; 3101 3105 } 3102 3106 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, ··· 3220 3226 phwi_context->be_def_dataq[ulp_num].id); 3221 3227 3222 3228 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, 3223 - "BM_%d : DEFAULT PDU DATA RING CREATED" 3224 - "on ULP : %d\n", ulp_num); 3229 + "BM_%d : DEFAULT PDU DATA RING CREATED on ULP : %d\n", 3230 + ulp_num); 3225 3231 return 0; 3226 3232 } 3227 3233 ··· 3247 3253 3248 3254 if (status != 0) { 3249 3255 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 3250 - "BM_%d : Post Template HDR Failed for" 3256 + "BM_%d : Post Template HDR Failed for " 3251 3257 "ULP_%d\n", ulp_num); 3252 3258 return status; 3253 3259 } 3254 3260 3255 3261 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, 3256 - "BM_%d : Template HDR Pages Posted for" 3262 + "BM_%d : Template HDR Pages Posted for " 3257 3263 "ULP_%d\n", ulp_num); 3258 3264 } 3259 3265 } ··· 3368 3374 } else { 3369 3375 idx++; 3370 3376 wrb_vaddr = mem_descr->mem_array[idx].virtual_address; 3371 - pa_addr_lo = mem_descr->mem_array[idx].\ 3377 + pa_addr_lo = mem_descr->mem_array[idx]. 3372 3378 bus_address.u.a64.address; 3373 3379 num_wrb_rings = mem_descr->mem_array[idx].size / 3374 3380 (phba->params.wrbs_per_cxn * 3375 3381 sizeof(struct iscsi_wrb)); 3376 3382 pwrb_arr[num].virtual_address = wrb_vaddr; 3377 - pwrb_arr[num].bus_address.u.a64.address\ 3378 - = pa_addr_lo; 3383 + pwrb_arr[num].bus_address.u.a64.address = pa_addr_lo; 3379 3384 pwrb_arr[num].size = phba->params.wrbs_per_cxn * 3380 3385 sizeof(struct iscsi_wrb); 3381 3386 wrb_vaddr += pwrb_arr[num].size; 3382 - pa_addr_lo += pwrb_arr[num].size; 3387 + pa_addr_lo += pwrb_arr[num].size; 3383 3388 num_wrb_rings--; 3384 3389 } 3385 3390 } ··· 3930 3937 idx++; 3931 3938 } 3932 3939 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, 3933 - "BM_%d : phba->io_sgl_hndl_avbl=%d" 3940 + "BM_%d : phba->io_sgl_hndl_avbl=%d " 3934 3941 "phba->eh_sgl_hndl_avbl=%d\n", 3935 3942 phba->io_sgl_hndl_avbl, 3936 3943 phba->eh_sgl_hndl_avbl); ··· 3988 3995 GFP_KERNEL); 3989 3996 3990 3997 if (!ptr_cid_info) { 3991 - beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 3992 - "BM_%d : Failed to allocate memory" 3993 - "for ULP_CID_INFO for ULP : %d\n", 3994 - ulp_num); 3995 3998 ret = -ENOMEM; 3996 3999 goto free_memory; 3997 - 3998 4000 } 3999 4001 4000 4002 /* Allocate memory for CID array */ ··· 3998 4010 sizeof(*ptr_cid_info->cid_array), 3999 4011 GFP_KERNEL); 4000 4012 if (!ptr_cid_info->cid_array) { 4001 - beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 4002 - "BM_%d : Failed to allocate memory" 4003 - "for CID_ARRAY for ULP : %d\n", 4004 - ulp_num); 4005 4013 kfree(ptr_cid_info); 4006 4014 ptr_cid_info = NULL; 4007 4015 ret = -ENOMEM; ··· 4015 4031 sizeof(struct iscsi_endpoint *), 4016 4032 GFP_KERNEL); 4017 4033 if (!phba->ep_array) { 4018 - beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 4019 - "BM_%d : Failed to allocate memory in " 4020 - "hba_setup_cid_tbls\n"); 4021 4034 ret = -ENOMEM; 4022 4035 4023 4036 goto free_memory; ··· 4024 4043 sizeof(struct beiscsi_conn *), 4025 4044 GFP_KERNEL); 4026 4045 if (!phba->conn_table) { 4027 - beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, 4028 - "BM_%d : Failed to allocate memory in" 4029 - "hba_setup_cid_tbls\n"); 4030 - 4031 4046 kfree(phba->ep_array); 4032 4047 phba->ep_array = NULL; 4033 4048 ret = -ENOMEM; ··· 4376 4399 if (!io_task->psgl_handle) { 4377 4400 beiscsi_log(phba, KERN_ERR, 4378 4401 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 4379 - "BM_%d : Alloc of IO_SGL_ICD Failed" 4402 + "BM_%d : Alloc of IO_SGL_ICD Failed " 4380 4403 "for the CID : %d\n", 4381 4404 beiscsi_conn->beiscsi_conn_cid); 4382 4405 goto free_hndls; ··· 4387 4410 if (!io_task->pwrb_handle) { 4388 4411 beiscsi_log(phba, KERN_ERR, 4389 4412 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 4390 - "BM_%d : Alloc of WRB_HANDLE Failed" 4413 + "BM_%d : Alloc of WRB_HANDLE Failed " 4391 4414 "for the CID : %d\n", 4392 4415 beiscsi_conn->beiscsi_conn_cid); 4393 4416 goto free_io_hndls; ··· 4403 4426 beiscsi_log(phba, KERN_ERR, 4404 4427 BEISCSI_LOG_IO | 4405 4428 BEISCSI_LOG_CONFIG, 4406 - "BM_%d : Alloc of MGMT_SGL_ICD Failed" 4429 + "BM_%d : Alloc of MGMT_SGL_ICD Failed " 4407 4430 "for the CID : %d\n", 4408 - beiscsi_conn-> 4409 - beiscsi_conn_cid); 4431 + beiscsi_conn->beiscsi_conn_cid); 4410 4432 goto free_hndls; 4411 4433 } 4412 4434 ··· 4420 4444 beiscsi_log(phba, KERN_ERR, 4421 4445 BEISCSI_LOG_IO | 4422 4446 BEISCSI_LOG_CONFIG, 4423 - "BM_%d : Alloc of WRB_HANDLE Failed" 4447 + "BM_%d : Alloc of WRB_HANDLE Failed " 4424 4448 "for the CID : %d\n", 4425 - beiscsi_conn-> 4426 - beiscsi_conn_cid); 4449 + beiscsi_conn->beiscsi_conn_cid); 4427 4450 goto free_mgmt_hndls; 4428 4451 } 4429 4452 beiscsi_conn->plogin_wrb_handle = ··· 4440 4465 beiscsi_log(phba, KERN_ERR, 4441 4466 BEISCSI_LOG_IO | 4442 4467 BEISCSI_LOG_CONFIG, 4443 - "BM_%d : Alloc of MGMT_SGL_ICD Failed" 4468 + "BM_%d : Alloc of MGMT_SGL_ICD Failed " 4444 4469 "for the CID : %d\n", 4445 - beiscsi_conn-> 4446 - beiscsi_conn_cid); 4470 + beiscsi_conn->beiscsi_conn_cid); 4447 4471 goto free_hndls; 4448 4472 } 4449 4473 io_task->pwrb_handle = ··· 4452 4478 if (!io_task->pwrb_handle) { 4453 4479 beiscsi_log(phba, KERN_ERR, 4454 4480 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 4455 - "BM_%d : Alloc of WRB_HANDLE Failed" 4481 + "BM_%d : Alloc of WRB_HANDLE Failed " 4456 4482 "for the CID : %d\n", 4457 4483 beiscsi_conn->beiscsi_conn_cid); 4458 4484 goto free_mgmt_hndls; ··· 5717 5743 pci_disable_msix(phba->pcidev); 5718 5744 pci_dev_put(phba->pcidev); 5719 5745 iscsi_host_free(phba->shost); 5746 + pci_disable_pcie_error_reporting(pcidev); 5720 5747 pci_set_drvdata(pcidev, NULL); 5721 5748 disable_pci: 5722 5749 pci_release_regions(pcidev);
+1 -1
drivers/scsi/bnx2fc/bnx2fc_io.c
··· 1213 1213 * cleanup the command and return that I/O was successfully 1214 1214 * aborted. 1215 1215 */ 1216 - rc = bnx2fc_abts_cleanup(io_req); 1216 + bnx2fc_abts_cleanup(io_req); 1217 1217 /* This only occurs when an task abort was requested while ABTS 1218 1218 is in progress. Setting the IO_CLEANUP flag will skip the 1219 1219 RRQ process in the case when the fw generated SCSI_CMD cmpl
+4 -4
drivers/scsi/elx/efct/efct_lio.c
··· 832 832 } 833 833 834 834 vport_list->lio_vport = lio_vport; 835 - spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); 836 - INIT_LIST_HEAD(&vport_list->list_entry); 837 - list_add_tail(&vport_list->list_entry, &efct->tgt_efct.vport_list); 838 - spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); 839 835 840 836 memset(&vport_id, 0, sizeof(vport_id)); 841 837 vport_id.port_name = npiv_wwpn; ··· 849 853 } 850 854 851 855 lio_vport->fc_vport = new_fc_vport; 856 + spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags); 857 + INIT_LIST_HEAD(&vport_list->list_entry); 858 + list_add_tail(&vport_list->list_entry, &efct->tgt_efct.vport_list); 859 + spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags); 852 860 853 861 return &lio_vport->vport_wwn; 854 862 }
-2
drivers/scsi/elx/libefc_sli/sli4.c
··· 2381 2381 2382 2382 els->ox_id = cpu_to_le16(params->ox_id); 2383 2383 2384 - els->flags2 |= SLI4_ELS_IOD & SLI4_ELS_REQUEST64_DIR_WRITE; 2385 - 2386 2384 els->flags2 |= SLI4_ELS_QOSD; 2387 2385 2388 2386 els->cmd_type_wqec = SLI4_ELS_REQUEST64_CMD_GEN;
+1
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c
··· 1771 1771 .max_sectors = SCSI_DEFAULT_MAX_SECTORS, 1772 1772 .eh_device_reset_handler = sas_eh_device_reset_handler, 1773 1773 .eh_target_reset_handler = sas_eh_target_reset_handler, 1774 + .slave_alloc = sas_slave_alloc, 1774 1775 .target_destroy = sas_target_destroy, 1775 1776 .ioctl = sas_ioctl, 1776 1777 #ifdef CONFIG_COMPAT
+1
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
··· 3584 3584 .max_sectors = SCSI_DEFAULT_MAX_SECTORS, 3585 3585 .eh_device_reset_handler = sas_eh_device_reset_handler, 3586 3586 .eh_target_reset_handler = sas_eh_target_reset_handler, 3587 + .slave_alloc = sas_slave_alloc, 3587 3588 .target_destroy = sas_target_destroy, 3588 3589 .ioctl = sas_ioctl, 3589 3590 #ifdef CONFIG_COMPAT
+1
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
··· 3155 3155 .max_sectors = SCSI_DEFAULT_MAX_SECTORS, 3156 3156 .eh_device_reset_handler = sas_eh_device_reset_handler, 3157 3157 .eh_target_reset_handler = sas_eh_target_reset_handler, 3158 + .slave_alloc = sas_slave_alloc, 3158 3159 .target_destroy = sas_target_destroy, 3159 3160 .ioctl = sas_ioctl, 3160 3161 #ifdef CONFIG_COMPAT
+2 -2
drivers/scsi/ipr.c
··· 1300 1300 1301 1301 *p = '\0'; 1302 1302 p += scnprintf(p, buffer + len - p, "%02X", res_path[0]); 1303 - for (i = 1; res_path[i] != 0xff && ((i * 3) < len); i++) 1303 + for (i = 1; res_path[i] != 0xff && i < IPR_RES_PATH_BYTES; i++) 1304 1304 p += scnprintf(p, buffer + len - p, "-%02X", res_path[i]); 1305 1305 1306 1306 return buffer; ··· 1323 1323 1324 1324 *p = '\0'; 1325 1325 p += scnprintf(p, buffer + len - p, "%d/", ioa_cfg->host->host_no); 1326 - __ipr_format_res_path(res_path, p, len - (buffer - p)); 1326 + __ipr_format_res_path(res_path, p, len - (p - buffer)); 1327 1327 return buffer; 1328 1328 } 1329 1329
+1
drivers/scsi/ipr.h
··· 428 428 __be64 lun; 429 429 __be64 lun_wwn[2]; 430 430 #define IPR_MAX_RES_PATH_LENGTH 48 431 + #define IPR_RES_PATH_BYTES 8 431 432 __be64 res_path; 432 433 struct ipr_std_inq_data std_inq_data; 433 434 u8 reserved2[4];
+1
drivers/scsi/isci/init.c
··· 167 167 .eh_abort_handler = sas_eh_abort_handler, 168 168 .eh_device_reset_handler = sas_eh_device_reset_handler, 169 169 .eh_target_reset_handler = sas_eh_target_reset_handler, 170 + .slave_alloc = sas_slave_alloc, 170 171 .target_destroy = sas_target_destroy, 171 172 .ioctl = sas_ioctl, 172 173 #ifdef CONFIG_COMPAT
+8 -5
drivers/scsi/libfc/fc_rport.c
··· 1162 1162 resp_code = (pp->spp.spp_flags & FC_SPP_RESP_MASK); 1163 1163 FC_RPORT_DBG(rdata, "PRLI spp_flags = 0x%x spp_type 0x%x\n", 1164 1164 pp->spp.spp_flags, pp->spp.spp_type); 1165 + 1165 1166 rdata->spp_type = pp->spp.spp_type; 1166 1167 if (resp_code != FC_SPP_RESP_ACK) { 1167 1168 if (resp_code == FC_SPP_RESP_CONF) ··· 1185 1184 /* 1186 1185 * Call prli provider if we should act as a target 1187 1186 */ 1188 - prov = fc_passive_prov[rdata->spp_type]; 1189 - if (prov) { 1190 - memset(&temp_spp, 0, sizeof(temp_spp)); 1191 - prov->prli(rdata, pp->prli.prli_spp_len, 1192 - &pp->spp, &temp_spp); 1187 + if (rdata->spp_type < FC_FC4_PROV_SIZE) { 1188 + prov = fc_passive_prov[rdata->spp_type]; 1189 + if (prov) { 1190 + memset(&temp_spp, 0, sizeof(temp_spp)); 1191 + prov->prli(rdata, pp->prli.prli_spp_len, 1192 + &pp->spp, &temp_spp); 1193 + } 1193 1194 } 1194 1195 /* 1195 1196 * Check if the image pair could be established
+9
drivers/scsi/libsas/sas_scsi_host.c
··· 911 911 blk_abort_request(sc->request); 912 912 } 913 913 914 + int sas_slave_alloc(struct scsi_device *sdev) 915 + { 916 + if (dev_is_sata(sdev_to_domain_dev(sdev)) && sdev->lun) 917 + return -ENXIO; 918 + 919 + return 0; 920 + } 921 + 914 922 void sas_target_destroy(struct scsi_target *starget) 915 923 { 916 924 struct domain_device *found_dev = starget->hostdata; ··· 965 957 EXPORT_SYMBOL_GPL(sas_phy_reset); 966 958 EXPORT_SYMBOL_GPL(sas_eh_device_reset_handler); 967 959 EXPORT_SYMBOL_GPL(sas_eh_target_reset_handler); 960 + EXPORT_SYMBOL_GPL(sas_slave_alloc); 968 961 EXPORT_SYMBOL_GPL(sas_target_destroy); 969 962 EXPORT_SYMBOL_GPL(sas_ioctl);
+8 -10
drivers/scsi/megaraid/megaraid_mbox.c
··· 121 121 122 122 static void megaraid_mbox_dpc(unsigned long); 123 123 124 - static ssize_t megaraid_sysfs_show_app_hndl(struct device *, struct device_attribute *attr, char *); 125 - static ssize_t megaraid_sysfs_show_ldnum(struct device *, struct device_attribute *attr, char *); 124 + static ssize_t megaraid_mbox_app_hndl_show(struct device *, struct device_attribute *attr, char *); 125 + static ssize_t megaraid_mbox_ld_show(struct device *, struct device_attribute *attr, char *); 126 126 127 127 static int megaraid_cmm_register(adapter_t *); 128 128 static int megaraid_cmm_unregister(adapter_t *); ··· 302 302 // definitions for the device attributes for exporting logical drive number 303 303 // for a scsi address (Host, Channel, Id, Lun) 304 304 305 - static DEVICE_ATTR(megaraid_mbox_app_hndl, S_IRUSR, megaraid_sysfs_show_app_hndl, 306 - NULL); 305 + static DEVICE_ATTR_ADMIN_RO(megaraid_mbox_app_hndl); 307 306 308 307 // Host template initializer for megaraid mbox sysfs device attributes 309 308 static struct device_attribute *megaraid_shost_attrs[] = { ··· 311 312 }; 312 313 313 314 314 - static DEVICE_ATTR(megaraid_mbox_ld, S_IRUSR, megaraid_sysfs_show_ldnum, NULL); 315 + static DEVICE_ATTR_ADMIN_RO(megaraid_mbox_ld); 315 316 316 317 // Host template initializer for megaraid mbox sysfs device attributes 317 318 static struct device_attribute *megaraid_sdev_attrs[] = { ··· 3960 3961 3961 3962 3962 3963 /** 3963 - * megaraid_sysfs_show_app_hndl - display application handle for this adapter 3964 + * megaraid_mbox_app_hndl_show - display application handle for this adapter 3964 3965 * @dev : class device object representation for the host 3965 3966 * @attr : device attribute (unused) 3966 3967 * @buf : buffer to send data to ··· 3970 3971 * handle, since we do not interface with applications directly. 3971 3972 */ 3972 3973 static ssize_t 3973 - megaraid_sysfs_show_app_hndl(struct device *dev, struct device_attribute *attr, 3974 - char *buf) 3974 + megaraid_mbox_app_hndl_show(struct device *dev, struct device_attribute *attr, char *buf) 3975 3975 { 3976 3976 struct Scsi_Host *shost = class_to_shost(dev); 3977 3977 adapter_t *adapter = (adapter_t *)SCSIHOST2ADAP(shost); ··· 3983 3985 3984 3986 3985 3987 /** 3986 - * megaraid_sysfs_show_ldnum - display the logical drive number for this device 3988 + * megaraid_mbox_ld_show - display the logical drive number for this device 3987 3989 * @dev : device object representation for the scsi device 3988 3990 * @attr : device attribute to show 3989 3991 * @buf : buffer to send data to ··· 3998 4000 * <int> <int> <int> <int> 3999 4001 */ 4000 4002 static ssize_t 4001 - megaraid_sysfs_show_ldnum(struct device *dev, struct device_attribute *attr, char *buf) 4003 + megaraid_mbox_ld_show(struct device *dev, struct device_attribute *attr, char *buf) 4002 4004 { 4003 4005 struct scsi_device *sdev = to_scsi_device(dev); 4004 4006 adapter_t *adapter = (adapter_t *)SCSIHOST2ADAP(sdev->host);
+3 -2
drivers/scsi/mpi3mr/mpi3mr_os.c
··· 867 867 if ((dev_info & MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_MASK) != 868 868 MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_NVME_DEVICE) 869 869 tgtdev->is_hidden = 1; 870 - if (mrioc->shost) 871 - prot_mask = scsi_host_get_prot(mrioc->shost); 870 + if (!mrioc->shost) 871 + break; 872 + prot_mask = scsi_host_get_prot(mrioc->shost); 872 873 if (prot_mask & SHOST_DIX_TYPE0_PROTECTION) { 873 874 scsi_host_set_prot(mrioc->shost, prot_mask & 0x77); 874 875 ioc_info(mrioc,
+10 -17
drivers/scsi/mvsas/mv_init.c
··· 46 46 .max_sectors = SCSI_DEFAULT_MAX_SECTORS, 47 47 .eh_device_reset_handler = sas_eh_device_reset_handler, 48 48 .eh_target_reset_handler = sas_eh_target_reset_handler, 49 + .slave_alloc = sas_slave_alloc, 49 50 .target_destroy = sas_target_destroy, 50 51 .ioctl = sas_ioctl, 51 52 #ifdef CONFIG_COMPAT ··· 693 692 .remove = mvs_pci_remove, 694 693 }; 695 694 696 - static ssize_t 697 - mvs_show_driver_version(struct device *cdev, 698 - struct device_attribute *attr, char *buffer) 695 + static ssize_t driver_version_show(struct device *cdev, 696 + struct device_attribute *attr, char *buffer) 699 697 { 700 698 return snprintf(buffer, PAGE_SIZE, "%s\n", DRV_VERSION); 701 699 } 702 700 703 - static DEVICE_ATTR(driver_version, 704 - S_IRUGO, 705 - mvs_show_driver_version, 706 - NULL); 701 + static DEVICE_ATTR_RO(driver_version); 707 702 708 - static ssize_t 709 - mvs_store_interrupt_coalescing(struct device *cdev, 710 - struct device_attribute *attr, 711 - const char *buffer, size_t size) 703 + static ssize_t interrupt_coalescing_store(struct device *cdev, 704 + struct device_attribute *attr, 705 + const char *buffer, size_t size) 712 706 { 713 707 unsigned int val = 0; 714 708 struct mvs_info *mvi = NULL; ··· 741 745 return strlen(buffer); 742 746 } 743 747 744 - static ssize_t mvs_show_interrupt_coalescing(struct device *cdev, 745 - struct device_attribute *attr, char *buffer) 748 + static ssize_t interrupt_coalescing_show(struct device *cdev, 749 + struct device_attribute *attr, char *buffer) 746 750 { 747 751 return snprintf(buffer, PAGE_SIZE, "%d\n", interrupt_coalescing); 748 752 } 749 753 750 - static DEVICE_ATTR(interrupt_coalescing, 751 - S_IRUGO|S_IWUSR, 752 - mvs_show_interrupt_coalescing, 753 - mvs_store_interrupt_coalescing); 754 + static DEVICE_ATTR_RW(interrupt_coalescing); 754 755 755 756 static int __init mvs_init(void) 756 757 {
+1
drivers/scsi/pm8001/pm8001_init.c
··· 101 101 .max_sectors = SCSI_DEFAULT_MAX_SECTORS, 102 102 .eh_device_reset_handler = sas_eh_device_reset_handler, 103 103 .eh_target_reset_handler = sas_eh_target_reset_handler, 104 + .slave_alloc = sas_slave_alloc, 104 105 .target_destroy = sas_target_destroy, 105 106 .ioctl = sas_ioctl, 106 107 #ifdef CONFIG_COMPAT
+6 -8
drivers/scsi/qedf/qedf_attr.c
··· 24 24 return lport_priv(base_lport); 25 25 } 26 26 27 - static ssize_t 28 - qedf_fcoe_mac_show(struct device *dev, 29 - struct device_attribute *attr, char *buf) 27 + static ssize_t fcoe_mac_show(struct device *dev, 28 + struct device_attribute *attr, char *buf) 30 29 { 31 30 struct fc_lport *lport = shost_priv(class_to_shost(dev)); 32 31 u32 port_id; ··· 41 42 return scnprintf(buf, PAGE_SIZE, "%pM\n", fcoe_mac); 42 43 } 43 44 44 - static ssize_t 45 - qedf_fka_period_show(struct device *dev, 46 - struct device_attribute *attr, char *buf) 45 + static ssize_t fka_period_show(struct device *dev, 46 + struct device_attribute *attr, char *buf) 47 47 { 48 48 struct fc_lport *lport = shost_priv(class_to_shost(dev)); 49 49 struct qedf_ctx *qedf = lport_priv(lport); ··· 57 59 return scnprintf(buf, PAGE_SIZE, "%d\n", fka_period); 58 60 } 59 61 60 - static DEVICE_ATTR(fcoe_mac, S_IRUGO, qedf_fcoe_mac_show, NULL); 61 - static DEVICE_ATTR(fka_period, S_IRUGO, qedf_fka_period_show, NULL); 62 + static DEVICE_ATTR_RO(fcoe_mac); 63 + static DEVICE_ATTR_RO(fka_period); 62 64 63 65 struct device_attribute *qedf_host_attrs[] = { 64 66 &dev_attr_fcoe_mac,
+21 -1
drivers/scsi/qedf/qedf_io.c
··· 1515 1515 { 1516 1516 int rval; 1517 1517 1518 + if (io_req == NULL) { 1519 + QEDF_INFO(NULL, QEDF_LOG_IO, "io_req is NULL.\n"); 1520 + return; 1521 + } 1522 + 1523 + if (io_req->fcport == NULL) { 1524 + QEDF_INFO(NULL, QEDF_LOG_IO, "fcport is NULL.\n"); 1525 + return; 1526 + } 1527 + 1518 1528 if (!cqe) { 1519 1529 QEDF_INFO(&qedf->dbg_ctx, QEDF_LOG_IO, 1520 - "cqe is NULL for io_req %p\n", io_req); 1530 + "cqe is NULL for io_req %p\n", io_req); 1521 1531 return; 1522 1532 } 1523 1533 ··· 1542 1532 le32_to_cpu(cqe->cqe_info.err_info.tx_buf_off), 1543 1533 le32_to_cpu(cqe->cqe_info.err_info.rx_buf_off), 1544 1534 le32_to_cpu(cqe->cqe_info.err_info.rx_id)); 1535 + 1536 + /* When flush is active, let the cmds be flushed out from the cleanup context */ 1537 + if (test_bit(QEDF_RPORT_IN_TARGET_RESET, &io_req->fcport->flags) || 1538 + (test_bit(QEDF_RPORT_IN_LUN_RESET, &io_req->fcport->flags) && 1539 + io_req->sc_cmd->device->lun == (u64)io_req->fcport->lun_reset_lun)) { 1540 + QEDF_ERR(&qedf->dbg_ctx, 1541 + "Dropping EQE for xid=0x%x as fcport is flushing", 1542 + io_req->xid); 1543 + return; 1544 + } 1545 1545 1546 1546 if (qedf->stop_io_on_error) { 1547 1547 qedf_stop_all_io(qedf);
+7 -7
drivers/scsi/qedi/qedi_sysfs.c
··· 16 16 return iscsi_host_priv(shost); 17 17 } 18 18 19 - static ssize_t qedi_show_port_state(struct device *dev, 20 - struct device_attribute *attr, 21 - char *buf) 19 + static ssize_t port_state_show(struct device *dev, 20 + struct device_attribute *attr, 21 + char *buf) 22 22 { 23 23 struct qedi_ctx *qedi = qedi_dev_to_hba(dev); 24 24 ··· 28 28 return sprintf(buf, "Linkdown\n"); 29 29 } 30 30 31 - static ssize_t qedi_show_speed(struct device *dev, 32 - struct device_attribute *attr, char *buf) 31 + static ssize_t speed_show(struct device *dev, 32 + struct device_attribute *attr, char *buf) 33 33 { 34 34 struct qedi_ctx *qedi = qedi_dev_to_hba(dev); 35 35 struct qed_link_output if_link; ··· 39 39 return sprintf(buf, "%d Gbit\n", if_link.speed / 1000); 40 40 } 41 41 42 - static DEVICE_ATTR(port_state, 0444, qedi_show_port_state, NULL); 43 - static DEVICE_ATTR(speed, 0444, qedi_show_speed, NULL); 42 + static DEVICE_ATTR_RO(port_state); 43 + static DEVICE_ATTR_RO(speed); 44 44 45 45 struct device_attribute *qedi_shost_attrs[] = { 46 46 &dev_attr_port_state,
+4
drivers/scsi/qla2xxx/qla_def.h
··· 3660 3660 struct qla_tgt_counters tgt_counters; 3661 3661 uint16_t cpuid; 3662 3662 struct qla_fw_resources fwres ____cacheline_aligned; 3663 + u32 cmd_cnt; 3664 + u32 cmd_completion_cnt; 3663 3665 }; 3664 3666 3665 3667 /* Place holder for FW buffer parameters */ ··· 4618 4616 4619 4617 struct qla_hw_data_stat stat; 4620 4618 pci_error_state_t pci_error_state; 4619 + u64 prev_cmd_cnt; 4621 4620 }; 4622 4621 4623 4622 struct active_regions { ··· 4746 4743 #define SET_ZIO_THRESHOLD_NEEDED 32 4747 4744 #define ISP_ABORT_TO_ROM 33 4748 4745 #define VPORT_DELETE 34 4746 + #define HEARTBEAT_CHK 38 4749 4747 4750 4748 #define PROCESS_PUREX_IOCB 63 4751 4749
+1
drivers/scsi/qla2xxx/qla_gbl.h
··· 549 549 uint32_t *); 550 550 extern int qla2xxx_write_remote_register(scsi_qla_host_t *, uint32_t, 551 551 uint32_t); 552 + void qla_no_op_mb(struct scsi_qla_host *vha); 552 553 553 554 /* 554 555 * Global Function Prototypes in qla_isr.c source file.
+5 -1
drivers/scsi/qla2xxx/qla_init.c
··· 6870 6870 ha->flags.fw_init_done = 0; 6871 6871 ha->chip_reset++; 6872 6872 ha->base_qpair->chip_reset = ha->chip_reset; 6873 + ha->base_qpair->cmd_cnt = ha->base_qpair->cmd_completion_cnt = 0; 6873 6874 for (i = 0; i < ha->max_qpairs; i++) { 6874 - if (ha->queue_pair_map[i]) 6875 + if (ha->queue_pair_map[i]) { 6875 6876 ha->queue_pair_map[i]->chip_reset = 6876 6877 ha->base_qpair->chip_reset; 6878 + ha->queue_pair_map[i]->cmd_cnt = 6879 + ha->queue_pair_map[i]->cmd_completion_cnt = 0; 6880 + } 6877 6881 } 6878 6882 6879 6883 /* purge MBox commands */
+4
drivers/scsi/qla2xxx/qla_iocb.c
··· 1710 1710 } else 1711 1711 req->ring_ptr++; 1712 1712 1713 + sp->qpair->cmd_cnt++; 1713 1714 sp->flags |= SRB_DMA_VALID; 1714 1715 1715 1716 /* Set chip new ring index. */ ··· 1913 1912 } else 1914 1913 req->ring_ptr++; 1915 1914 1915 + sp->qpair->cmd_cnt++; 1916 1916 /* Set chip new ring index. */ 1917 1917 wrt_reg_dword(req->req_q_in, req->ring_index); 1918 1918 ··· 2070 2068 } else 2071 2069 req->ring_ptr++; 2072 2070 2071 + sp->qpair->cmd_cnt++; 2073 2072 sp->flags |= SRB_DMA_VALID; 2074 2073 2075 2074 /* Set chip new ring index. */ ··· 2287 2284 } else 2288 2285 req->ring_ptr++; 2289 2286 2287 + sp->qpair->cmd_cnt++; 2290 2288 /* Set chip new ring index. */ 2291 2289 wrt_reg_dword(req->req_q_in, req->ring_index); 2292 2290
+4
drivers/scsi/qla2xxx/qla_isr.c
··· 2322 2322 2323 2323 if (unlikely(iocb->u.nvme.aen_op)) 2324 2324 atomic_dec(&sp->vha->hw->nvme_active_aen_cnt); 2325 + else 2326 + sp->qpair->cmd_completion_cnt++; 2325 2327 2326 2328 if (unlikely(comp_status != CS_COMPLETE)) 2327 2329 logit = 1; ··· 2968 2966 qla24xx_tm_iocb_entry(vha, req, pkt); 2969 2967 return; 2970 2968 } 2969 + 2970 + sp->qpair->cmd_completion_cnt++; 2971 2971 2972 2972 /* Fast path completion. */ 2973 2973 if (comp_status == CS_COMPLETE && scsi_status == 0) {
+27
drivers/scsi/qla2xxx/qla_mbx.c
··· 6939 6939 6940 6940 return rval; 6941 6941 } 6942 + 6943 + /** 6944 + * qla_no_op_mb(): This MB is used to check if FW is still alive and 6945 + * able to generate an interrupt. Otherwise, a timeout will trigger 6946 + * FW dump + reset 6947 + * @vha: host adapter pointer 6948 + * Return: None 6949 + */ 6950 + void qla_no_op_mb(struct scsi_qla_host *vha) 6951 + { 6952 + mbx_cmd_t mc; 6953 + mbx_cmd_t *mcp = &mc; 6954 + int rval; 6955 + 6956 + memset(&mc, 0, sizeof(mc)); 6957 + mcp->mb[0] = 0; // noop cmd= 0 6958 + mcp->out_mb = MBX_0; 6959 + mcp->in_mb = MBX_0; 6960 + mcp->tov = 5; 6961 + mcp->flags = 0; 6962 + rval = qla2x00_mailbox_command(vha, mcp); 6963 + 6964 + if (rval) { 6965 + ql_dbg(ql_dbg_async, vha, 0x7071, 6966 + "Failed %s %x\n", __func__, rval); 6967 + } 6968 + }
+4
drivers/scsi/qla2xxx/qla_nvme.c
··· 536 536 req->ring_ptr++; 537 537 } 538 538 539 + /* ignore nvme async cmd due to long timeout */ 540 + if (!nvme->u.nvme.aen_op) 541 + sp->qpair->cmd_cnt++; 542 + 539 543 /* Set chip new ring index. */ 540 544 wrt_reg_dword(req->req_q_in, req->ring_index); 541 545
+68
drivers/scsi/qla2xxx/qla_os.c
··· 6969 6969 qla2x00_lip_reset(base_vha); 6970 6970 } 6971 6971 6972 + if (test_bit(HEARTBEAT_CHK, &base_vha->dpc_flags)) { 6973 + /* 6974 + * if there is a mb in progress then that's 6975 + * enough of a check to see if fw is still ticking. 6976 + */ 6977 + if (!ha->flags.mbox_busy && base_vha->flags.init_done) 6978 + qla_no_op_mb(base_vha); 6979 + 6980 + clear_bit(HEARTBEAT_CHK, &base_vha->dpc_flags); 6981 + } 6982 + 6972 6983 ha->dpc_active = 0; 6973 6984 end_loop: 6974 6985 set_current_state(TASK_INTERRUPTIBLE); ··· 7033 7022 vha->marker_needed = 1; 7034 7023 } while (!atomic_read(&vha->loop_down_timer) && 7035 7024 (test_bit(RESET_MARKER_NEEDED, &vha->dpc_flags))); 7025 + } 7026 + } 7027 + 7028 + static bool qla_do_heartbeat(struct scsi_qla_host *vha) 7029 + { 7030 + u64 cmd_cnt, prev_cmd_cnt; 7031 + bool do_hb = false; 7032 + struct qla_hw_data *ha = vha->hw; 7033 + int i; 7034 + 7035 + /* if cmds are still pending down in fw, then do hb */ 7036 + if (ha->base_qpair->cmd_cnt != ha->base_qpair->cmd_completion_cnt) { 7037 + do_hb = true; 7038 + goto skip; 7039 + } 7040 + 7041 + for (i = 0; i < ha->max_qpairs; i++) { 7042 + if (ha->queue_pair_map[i] && 7043 + ha->queue_pair_map[i]->cmd_cnt != 7044 + ha->queue_pair_map[i]->cmd_completion_cnt) { 7045 + do_hb = true; 7046 + break; 7047 + } 7048 + } 7049 + 7050 + skip: 7051 + prev_cmd_cnt = ha->prev_cmd_cnt; 7052 + cmd_cnt = ha->base_qpair->cmd_cnt; 7053 + for (i = 0; i < ha->max_qpairs; i++) { 7054 + if (ha->queue_pair_map[i]) 7055 + cmd_cnt += ha->queue_pair_map[i]->cmd_cnt; 7056 + } 7057 + ha->prev_cmd_cnt = cmd_cnt; 7058 + 7059 + if (!do_hb && ((cmd_cnt - prev_cmd_cnt) > 50)) 7060 + /* 7061 + * IOs are completing before periodic hb check. 7062 + * IOs seems to be running, do hb for sanity check. 7063 + */ 7064 + do_hb = true; 7065 + 7066 + return do_hb; 7067 + } 7068 + 7069 + static void qla_heart_beat(struct scsi_qla_host *vha) 7070 + { 7071 + if (vha->vp_idx) 7072 + return; 7073 + 7074 + if (vha->hw->flags.eeh_busy || qla2x00_chip_is_down(vha)) 7075 + return; 7076 + 7077 + if (qla_do_heartbeat(vha)) { 7078 + set_bit(HEARTBEAT_CHK, &vha->dpc_flags); 7079 + qla2xxx_wake_dpc(vha); 7036 7080 } 7037 7081 } 7038 7082 ··· 7308 7242 test_bit(PROCESS_PUREX_IOCB, &vha->dpc_flags)); 7309 7243 qla2xxx_wake_dpc(vha); 7310 7244 } 7245 + 7246 + qla_heart_beat(vha); 7311 7247 7312 7248 qla2x00_restart_timer(vha, WATCH_INTERVAL); 7313 7249 }
+1 -12
drivers/scsi/scsi_lib.c
··· 726 726 case 0x07: /* operation in progress */ 727 727 case 0x08: /* Long write in progress */ 728 728 case 0x09: /* self test in progress */ 729 + case 0x11: /* notify (enable spinup) required */ 729 730 case 0x14: /* space allocation in progress */ 730 731 case 0x1a: /* start stop unit in progress */ 731 732 case 0x1b: /* sanitize in progress */ ··· 1897 1896 .set_rq_budget_token = scsi_mq_set_rq_budget_token, 1898 1897 .get_rq_budget_token = scsi_mq_get_rq_budget_token, 1899 1898 }; 1900 - 1901 - struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev) 1902 - { 1903 - sdev->request_queue = blk_mq_init_queue(&sdev->host->tag_set); 1904 - if (IS_ERR(sdev->request_queue)) 1905 - return NULL; 1906 - 1907 - sdev->request_queue->queuedata = sdev; 1908 - __scsi_init_queue(sdev->host, sdev->request_queue); 1909 - blk_queue_flag_set(QUEUE_FLAG_SCSI_PASSTHROUGH, sdev->request_queue); 1910 - return sdev->request_queue; 1911 - } 1912 1899 1913 1900 int scsi_mq_setup_tags(struct Scsi_Host *shost) 1914 1901 {
-1
drivers/scsi/scsi_priv.h
··· 91 91 extern void scsi_io_completion(struct scsi_cmnd *, unsigned int); 92 92 extern void scsi_run_host_queues(struct Scsi_Host *shost); 93 93 extern void scsi_requeue_run_queue(struct work_struct *work); 94 - extern struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev); 95 94 extern void scsi_start_queue(struct scsi_device *sdev); 96 95 extern int scsi_mq_setup_tags(struct Scsi_Host *shost); 97 96 extern void scsi_mq_destroy_tags(struct Scsi_Host *shost);
+8 -4
drivers/scsi/scsi_scan.c
··· 217 217 { 218 218 unsigned int depth; 219 219 struct scsi_device *sdev; 220 + struct request_queue *q; 220 221 int display_failure_msg = 1, ret; 221 222 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); 222 223 ··· 267 266 */ 268 267 sdev->borken = 1; 269 268 270 - sdev->request_queue = scsi_mq_alloc_queue(sdev); 271 - if (!sdev->request_queue) { 269 + q = blk_mq_init_queue(&sdev->host->tag_set); 270 + if (IS_ERR(q)) { 272 271 /* release fn is set up in scsi_sysfs_device_initialise, so 273 272 * have to free and put manually here */ 274 273 put_device(&starget->dev); 275 274 kfree(sdev); 276 275 goto out; 277 276 } 278 - WARN_ON_ONCE(!blk_get_queue(sdev->request_queue)); 279 - sdev->request_queue->queuedata = sdev; 277 + sdev->request_queue = q; 278 + q->queuedata = sdev; 279 + __scsi_init_queue(sdev->host, q); 280 + blk_queue_flag_set(QUEUE_FLAG_SCSI_PASSTHROUGH, q); 281 + WARN_ON_ONCE(!blk_get_queue(q)); 280 282 281 283 depth = sdev->host->cmd_per_lun ?: 1; 282 284
+4
drivers/scsi/ufs/ufshcd.c
··· 8926 8926 return ret; 8927 8927 } 8928 8928 8929 + #ifdef CONFIG_PM 8929 8930 static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) 8930 8931 { 8931 8932 int ret; ··· 9053 9052 9054 9053 return ret; 9055 9054 } 9055 + #endif 9056 9056 9057 9057 #ifdef CONFIG_PM_SLEEP 9058 9058 static int ufshcd_wl_suspend(struct device *dev) ··· 9768 9766 return ret; 9769 9767 } 9770 9768 9769 + #ifdef CONFIG_PM 9771 9770 static int ufshcd_rpmb_resume(struct device *dev) 9772 9771 { 9773 9772 struct ufs_hba *hba = wlun_dev_to_hba(dev); ··· 9777 9774 ufshcd_clear_rpmb_uac(hba); 9778 9775 return 0; 9779 9776 } 9777 + #endif 9780 9778 9781 9779 static const struct dev_pm_ops ufs_rpmb_pm_ops = { 9782 9780 SET_RUNTIME_PM_OPS(NULL, ufshcd_rpmb_resume, NULL)
+2 -3
drivers/scsi/virtio_scsi.c
··· 97 97 static void virtscsi_compute_resid(struct scsi_cmnd *sc, u32 resid) 98 98 { 99 99 if (resid) 100 - scsi_set_resid(sc, resid); 100 + scsi_set_resid(sc, min(resid, scsi_bufflen(sc))); 101 101 } 102 102 103 103 /* ··· 156 156 157 157 WARN_ON(virtio32_to_cpu(vscsi->vdev, resp->sense_len) > 158 158 VIRTIO_SCSI_SENSE_SIZE); 159 - if (sc->sense_buffer) { 159 + if (resp->sense_len) { 160 160 memcpy(sc->sense_buffer, resp->sense, 161 161 min_t(u32, 162 162 virtio32_to_cpu(vscsi->vdev, resp->sense_len), 163 163 VIRTIO_SCSI_SENSE_SIZE)); 164 - set_status_byte(sc, SAM_STAT_CHECK_CONDITION); 165 164 } 166 165 167 166 sc->scsi_done(sc);