History

Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI updates from James Bottomley: "This consists of the usual driver updates (ufs, qla2xxx, tcmu, lpfc, hpsa, zfcp, scsi_debug) and minor bug fixes. We also have a huge docbook fix update like most other subsystems and no major update to the core (the few non trivial updates are either minor fixes or removing an unused feature [scsi_sdb_cache])" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (307 commits) scsi: scsi_transport_srp: Sanitize scsi_target_block/unblock sequences scsi: ufs-mediatek: Apply DELAY_AFTER_LPM quirk to Micron devices scsi: ufs: Introduce device quirk "DELAY_AFTER_LPM" scsi: virtio-scsi: Correctly handle the case where all LUNs are unplugged scsi: scsi_debug: Implement tur_ms_to_ready parameter scsi: scsi_debug: Fix request sense scsi: lpfc: Fix typo in comment for ULP scsi: ufs-mediatek: Prevent LPM operation on undeclared VCC scsi: iscsi: Do not put host in iscsi_set_flashnode_param() scsi: hpsa: Correct ctrl queue depth scsi: target: tcmu: Make TMR notification optional scsi: target: tcmu: Implement tmr_notify callback scsi: target: tcmu: Fix and simplify timeout handling scsi: target: tcmu: Factor out new helper ring_insert_padding scsi: target: tcmu: Do not queue aborted commands scsi: target: tcmu: Use priv pointer in se_cmd scsi: target: Add tmr_notify backend function scsi: target: Modify core_tmr_abort_task() scsi: target: iscsi: Fix inconsistent debug message scsi: target: iscsi: Fix login error when receiving ...

Linus Torvalds committed 6 years ago

Commit dfdf16e2 parents d7806bb bf1a28f221 files · +7777 −3384Browse files

Unified · Split

221 files
  1. Documentation/ABI/testing/sysfs-driver-ufs +136 −0
  2. Documentation/scsi/advansys.rst +1 −1
  3. Documentation/scsi/scsi-parameters.rst +1 −1
  4. MAINTAINERS +1 −1
  5. block/blk-pm.c +22 −19
  6. drivers/firmware/qcom_scm.c +101 −0
  7. drivers/firmware/qcom_scm.h +4 −0
  8. drivers/s390/scsi/zfcp_ccw.c +3 −4
  9. drivers/s390/scsi/zfcp_erp.c +1 −1
  10. drivers/s390/scsi/zfcp_fc.c +1 −1
  11. drivers/s390/scsi/zfcp_qdio.c +5 −2
  12. drivers/scsi/Kconfig +11 −5
  13. drivers/scsi/aacraid/aachba.c +6 −16
  14. drivers/scsi/aacraid/commctrl.c +6 −8
  15. drivers/scsi/aacraid/commsup.c +6 −6
  16. drivers/scsi/aacraid/dpcsup.c +8 −7
  17. drivers/scsi/aacraid/linit.c +3 −3
  18. drivers/scsi/aacraid/nark.c +1 −0
  19. drivers/scsi/aacraid/rkt.c +3 −2
  20. drivers/scsi/aacraid/rx.c +11 −1
  21. drivers/scsi/aacraid/sa.c +14 −5
  22. drivers/scsi/aacraid/src.c +12 −1
  23. drivers/scsi/aha152x.c +1 −2
  24. drivers/scsi/aic7xxx/aic79xx_core.c +3 −17
  25. drivers/scsi/aic7xxx/aic79xx_osm.c +10 −23
  26. drivers/scsi/aic7xxx/aic7xxx_osm.c +2 −11
  27. drivers/scsi/aic94xx/aic94xx_dev.c +2 −2
  28. drivers/scsi/aic94xx/aic94xx_hwi.c +1 −2
  29. drivers/scsi/aic94xx/aic94xx_init.c +1 −1
  30. drivers/scsi/aic94xx/aic94xx_scb.c +3 −3
  31. drivers/scsi/aic94xx/aic94xx_seq.c +5 −1
  32. drivers/scsi/aic94xx/aic94xx_tmf.c +1 −1
  33. drivers/scsi/arcmsr/arcmsr_hba.c +5 −13
  34. drivers/scsi/arm/cumana_2.c +1 −1
  35. drivers/scsi/arm/eesox.c +1 −1
  36. drivers/scsi/arm/powertec.c +1 −1
  37. drivers/scsi/be2iscsi/be_iscsi.c +7 −4
  38. drivers/scsi/be2iscsi/be_main.c +2 −2
  39. drivers/scsi/be2iscsi/be_mgmt.c +2 −1
  40. drivers/scsi/bfa/bfa_core.c +1 −1
  41. drivers/scsi/bfa/bfa_fcpim.c +2 −8
  42. drivers/scsi/bfa/bfa_fcs_rport.c +0 −3
  43. drivers/scsi/bfa/bfa_ioc.c +25 −32
  44. drivers/scsi/bfa/bfa_ioc_ct.c +3 −3
  45. drivers/scsi/bfa/bfa_port.c +2 −2
  46. drivers/scsi/bfa/bfa_svc.c +2 −2
  47. drivers/scsi/bfa/bfad_bsg.c +111 −111
  48. drivers/scsi/bnx2fc/bnx2fc_fcoe.c +8 −10
  49. drivers/scsi/bnx2fc/bnx2fc_hwi.c +4 −18
  50. drivers/scsi/bnx2fc/bnx2fc_tgt.c +3 −4
  51. drivers/scsi/bnx2i/bnx2i_hwi.c +27 −26
  52. drivers/scsi/bnx2i/bnx2i_init.c +1 −1
  53. drivers/scsi/bnx2i/bnx2i_iscsi.c +9 −10
  54. drivers/scsi/bnx2i/bnx2i_sysfs.c +4 −0
  55. drivers/scsi/csiostor/csio_hw.c +1 −1
  56. drivers/scsi/csiostor/csio_hw_t5.c +2 −4
  57. drivers/scsi/csiostor/csio_init.c +1 −1
  58. drivers/scsi/csiostor/csio_lnode.c +1 −2
  59. drivers/scsi/csiostor/csio_rnode.c +1 −1
  60. drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +7 −10
  61. drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +184 −58
  62. drivers/scsi/cxgbi/libcxgbi.c +502 −170
  63. drivers/scsi/cxgbi/libcxgbi.h +42 −4
  64. drivers/scsi/dpt_i2o.c +0 −4
  65. drivers/scsi/esas2r/esas2r.h +2 −1
  66. drivers/scsi/esas2r/esas2r_log.c +5 −5
  67. drivers/scsi/fcoe/fcoe.c +4 −6
  68. drivers/scsi/fcoe/fcoe_ctlr.c +15 −15
  69. drivers/scsi/fcoe/fcoe_transport.c +3 −1
  70. drivers/scsi/fdomain.h +1 −1
  71. drivers/scsi/fnic/fnic_scsi.c +2 −1
  72. drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +3 −1
  73. drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +4 −2
  74. drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +3 −1
  75. drivers/scsi/hosts.c +5 −3
  76. drivers/scsi/hpsa.c +27 −8
  77. drivers/scsi/hpsa.h +1 −1
  78. drivers/scsi/ibmvscsi/ibmvfc.c +1 −1
  79. drivers/scsi/ibmvscsi/ibmvscsi.c +1 −1
  80. drivers/scsi/imm.c +0 −3
  81. drivers/scsi/ipr.c +57 −33
  82. drivers/scsi/ipr.h +2 −2
  83. drivers/scsi/ips.c +13 −21
  84. drivers/scsi/isci/request.c +1 −1
  85. drivers/scsi/libfc/fc_disc.c +3 −3
  86. drivers/scsi/libfc/fc_exch.c +6 −1
  87. drivers/scsi/libfc/fc_fcp.c +7 −4
  88. drivers/scsi/libfc/fc_lport.c +5 −2
  89. drivers/scsi/libfc/fc_rport.c +2 −2
  90. drivers/scsi/libsas/sas_ata.c +15 −2
  91. drivers/scsi/libsas/sas_expander.c +1 −1
  92. drivers/scsi/lpfc/lpfc.h +15 −0
  93. drivers/scsi/lpfc/lpfc_bsg.c +17 −18
  94. drivers/scsi/lpfc/lpfc_bsg.h +14 −0
  95. drivers/scsi/lpfc/lpfc_crtn.h +1 −1
  96. drivers/scsi/lpfc/lpfc_ct.c +13 −13
  97. drivers/scsi/lpfc/lpfc_els.c +75 −68
  98. drivers/scsi/lpfc/lpfc_hbadisc.c +122 −109
  99. drivers/scsi/lpfc/lpfc_hw4.h +4 −1
  100. drivers/scsi/lpfc/lpfc_init.c +468 −271
  101. drivers/scsi/lpfc/lpfc_logmsg.h +19 −5
  102. drivers/scsi/lpfc/lpfc_mbox.c +7 −5
  103. drivers/scsi/lpfc/lpfc_mem.c +3 −1
  104. drivers/scsi/lpfc/lpfc_nportdisc.c +38 −30
  105. drivers/scsi/lpfc/lpfc_nvme.c +51 −59
  106. drivers/scsi/lpfc/lpfc_nvmet.c +47 −49
  107. drivers/scsi/lpfc/lpfc_scsi.c +64 −61
  108. drivers/scsi/lpfc/lpfc_sli.c +425 −258
  109. drivers/scsi/lpfc/lpfc_sli4.h +18 −0
  110. drivers/scsi/lpfc/lpfc_version.h +1 −1
  111. drivers/scsi/lpfc/lpfc_vport.c +39 −47
  112. drivers/scsi/megaraid.c +109 −113
  113. drivers/scsi/megaraid/megaraid_mbox.c +2 −2
  114. drivers/scsi/megaraid/megaraid_mm.c +0 −1
  115. drivers/scsi/megaraid/megaraid_sas.h +20 −0
  116. drivers/scsi/megaraid/megaraid_sas_base.c +105 −79
  117. drivers/scsi/megaraid/megaraid_sas_fp.c +5 −6
  118. drivers/scsi/megaraid/megaraid_sas_fusion.c +48 −45
  119. drivers/scsi/mesh.c +7 −1
  120. drivers/scsi/mpt3sas/mpt3sas_base.c +8 −6
  121. drivers/scsi/mpt3sas/mpt3sas_base.h +1 −1
  122. drivers/scsi/mpt3sas/mpt3sas_config.c +3 −4
  123. drivers/scsi/mpt3sas/mpt3sas_ctl.c +10 −6
  124. drivers/scsi/mpt3sas/mpt3sas_trigger_diag.h +1 −1
  125. drivers/scsi/mvsas/mv_init.c +4 −4
  126. drivers/scsi/myrs.c +17 −17
  127. drivers/scsi/pcmcia/nsp_cs.c +3 −2
  128. drivers/scsi/pm8001/pm8001_ctl.c +22 −1
  129. drivers/scsi/pm8001/pm8001_hwi.c +14 −13
  130. drivers/scsi/pm8001/pm8001_init.c +15 −15
  131. drivers/scsi/pm8001/pm8001_sas.c +5 −4
  132. drivers/scsi/pm8001/pm80xx_hwi.c +12 −11
  133. drivers/scsi/ppa.c +0 −3
  134. drivers/scsi/qedf/qedf_debugfs.c +8 −10
  135. drivers/scsi/qedf/qedf_io.c +4 −26
  136. drivers/scsi/qedf/qedf_main.c +4 −6
  137. drivers/scsi/qedi/qedi_fw.c +2 −3
  138. drivers/scsi/qedi/qedi_iscsi.c +1 −1
  139. drivers/scsi/qedi/qedi_main.c +3 −6
  140. drivers/scsi/qla2xxx/qla_bsg.c +1 −2
  141. drivers/scsi/qla2xxx/qla_dbg.c +36 −75
  142. drivers/scsi/qla2xxx/qla_dbg.h +1 −0
  143. drivers/scsi/qla2xxx/qla_def.h +62 −2
  144. drivers/scsi/qla2xxx/qla_fw.h +6 −2
  145. drivers/scsi/qla2xxx/qla_gbl.h +3 −1
  146. drivers/scsi/qla2xxx/qla_init.c +29 −19
  147. drivers/scsi/qla2xxx/qla_inline.h +1 −1
  148. drivers/scsi/qla2xxx/qla_iocb.c +5 −5
  149. drivers/scsi/qla2xxx/qla_isr.c +249 −41
  150. drivers/scsi/qla2xxx/qla_mbx.c +57 −7
  151. drivers/scsi/qla2xxx/qla_nx.c +8 −12
  152. drivers/scsi/qla2xxx/qla_os.c +33 −4
  153. drivers/scsi/qla2xxx/qla_target.h +2 −2
  154. drivers/scsi/qla2xxx/tcm_qla2xxx.c +1 −0
  155. drivers/scsi/qla4xxx/ql4_83xx.c +12 −22
  156. drivers/scsi/qla4xxx/ql4_83xx.h +0 −17
  157. drivers/scsi/qla4xxx/ql4_bsg.c +2 −2
  158. drivers/scsi/qla4xxx/ql4_init.c +8 −5
  159. drivers/scsi/qla4xxx/ql4_iocb.c +1 −1
  160. drivers/scsi/qla4xxx/ql4_isr.c +4 −2
  161. drivers/scsi/qla4xxx/ql4_mbx.c +3 −4
  162. drivers/scsi/qla4xxx/ql4_nx.c +8 −10
  163. drivers/scsi/qla4xxx/ql4_nx.h +0 −17
  164. drivers/scsi/qla4xxx/ql4_os.c +42 −16
  165. drivers/scsi/scsi.c +0 −3
  166. drivers/scsi/scsi_debug.c +303 −197
  167. drivers/scsi/scsi_lib.c +24 −38
  168. drivers/scsi/scsi_logging.c +2 −6
  169. drivers/scsi/scsi_pm.c +2 −8
  170. drivers/scsi/scsi_priv.h +0 −1
  171. drivers/scsi/scsi_transport_iscsi.c +16 −15
  172. drivers/scsi/scsi_transport_sas.c +1 −1
  173. drivers/scsi/scsi_transport_srp.c +5 −7
  174. drivers/scsi/sd.c +1 −1
  175. drivers/scsi/sd.h +0 −6
  176. drivers/scsi/sd_zbc.c +1 −2
  177. drivers/scsi/storvsc_drv.c +12 −1
  178. drivers/scsi/sym53c8xx_2/sym_glue.c +1 −0
  179. drivers/scsi/sym53c8xx_2/sym_hipd.c +8 −0
  180. drivers/scsi/ufs/Kconfig +22 −0
  181. drivers/scsi/ufs/Makefile +5 −1
  182. drivers/scsi/ufs/ufs-exynos.c +1297 −0
  183. drivers/scsi/ufs/ufs-exynos.h +287 −0
  184. drivers/scsi/ufs/ufs-mediatek.c +112 −28
  185. drivers/scsi/ufs/ufs-mediatek.h +3 −1
  186. drivers/scsi/ufs/ufs-qcom-ice.c +245 −0
  187. drivers/scsi/ufs/ufs-qcom.c +16 −5
  188. drivers/scsi/ufs/ufs-qcom.h +27 −0
  189. drivers/scsi/ufs/ufs.h +2 −36
  190. drivers/scsi/ufs/ufs_bsg.c +2 −3
  191. drivers/scsi/ufs/ufs_quirks.h +9 −1
  192. drivers/scsi/ufs/ufshcd-crypto.c +245 −0
  193. drivers/scsi/ufs/ufshcd-crypto.h +77 −0
  194. drivers/scsi/ufs/ufshcd-pci.c +1 −24
  195. drivers/scsi/ufs/ufshcd-pltfrm.c +1 −26
  196. drivers/scsi/ufs/ufshcd.c +290 −251
  197. drivers/scsi/ufs/ufshcd.h +61 −44
  198. drivers/scsi/ufs/ufshci.h +66 −28
  199. drivers/scsi/ufs/unipro.h +33 −0
  200. drivers/scsi/virtio_scsi.c +13 −9
  201. drivers/target/iscsi/cxgbit/cxgbit.h +0 −1
  202. drivers/target/iscsi/cxgbit/cxgbit_cm.c +24 −10
  203. drivers/target/iscsi/cxgbit/cxgbit_target.c +4 −20
  204. drivers/target/iscsi/iscsi_target_nego.c +31 −5
  205. drivers/target/target_core_fabric_lib.c +50 −55
  206. drivers/target/target_core_internal.h +1 −0
  207. drivers/target/target_core_pr.c +34 −27
  208. drivers/target/target_core_tmr.c +28 −8
  209. drivers/target/target_core_transport.c +7 −1
  210. drivers/target/target_core_user.c +325 −72
  211. drivers/target/target_core_xcopy.c +9 −2
  212. include/linux/qcom_scm.h +19 −0
  213. include/scsi/fc/fc_ms.h +2 −2
  214. include/scsi/scsi_tcq.h +1 −1
  215. include/scsi/scsi_transport_iscsi.h +1 −1
  216. include/target/iscsi/iscsi_target_core.h +5 −4
  217. include/target/target_core_backend.h +2 −0
  218. include/target/target_core_base.h +1 −0
  219. include/trace/events/ufs.h +31 −0
  220. include/uapi/linux/target_core_user.h +25 −0
  221. include/uapi/scsi/fc/fc_els.h +2 −0
Documentation/ABI/testing/sysfs-driver-ufs+136−0
@@ -883,3 +883,139 @@ Contact: Subhash Jadavani <subhashj@codeaurora.org> · 882 unmodified lines
883883 Description: This entry shows the target state of an UFS UIC link
884884 for the chosen system power management level.
885885 The file is read only.
886+
887+What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_presv_us_en
888+Date: June 2020
889+Contact: Asutosh Das <asutoshd@codeaurora.org>
890+Description: This entry shows if preserve user-space was configured
891+ The file is read only.
892+
893+What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_shared_alloc_units
894+Date: June 2020
895+Contact: Asutosh Das <asutoshd@codeaurora.org>
896+Description: This entry shows the shared allocated units of WB buffer
897+ The file is read only.
898+
899+What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_type
900+Date: June 2020
901+Contact: Asutosh Das <asutoshd@codeaurora.org>
902+Description: This entry shows the configured WB type.
903+ 0x1 for shared buffer mode. 0x0 for dedicated buffer mode.
904+ The file is read only.
905+
906+What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_buff_cap_adj
907+Date: June 2020
908+Contact: Asutosh Das <asutoshd@codeaurora.org>
909+Description: This entry shows the total user-space decrease in shared
910+ buffer mode.
911+ The value of this parameter is 3 for TLC NAND when SLC mode
912+ is used as WriteBooster Buffer. 2 for MLC NAND.
913+ The file is read only.
914+
915+What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_max_alloc_units
916+Date: June 2020
917+Contact: Asutosh Das <asutoshd@codeaurora.org>
918+Description: This entry shows the Maximum total WriteBooster Buffer size
919+ which is supported by the entire device.
920+ The file is read only.
921+
922+What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_max_wb_luns
923+Date: June 2020
924+Contact: Asutosh Das <asutoshd@codeaurora.org>
925+Description: This entry shows the maximum number of luns that can support
926+ WriteBooster.
927+ The file is read only.
928+
929+What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_sup_red_type
930+Date: June 2020
931+Contact: Asutosh Das <asutoshd@codeaurora.org>
932+Description: The supportability of user space reduction mode
933+ and preserve user space mode.
934+ 00h: WriteBooster Buffer can be configured only in
935+ user space reduction type.
936+ 01h: WriteBooster Buffer can be configured only in
937+ preserve user space type.
938+ 02h: Device can be configured in either user space
939+ reduction type or preserve user space type.
940+ The file is read only.
941+
942+What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_sup_wb_type
943+Date: June 2020
944+Contact: Asutosh Das <asutoshd@codeaurora.org>
945+Description: The supportability of WriteBooster Buffer type.
946+ 00h: LU based WriteBooster Buffer configuration
947+ 01h: Single shared WriteBooster Buffer
948+ configuration
949+ 02h: Supporting both LU based WriteBooster
950+ Buffer and Single shared WriteBooster Buffer
951+ configuration
952+ The file is read only.
953+
954+What: /sys/bus/platform/drivers/ufshcd/*/flags/wb_enable
955+Date: June 2020
956+Contact: Asutosh Das <asutoshd@codeaurora.org>
957+Description: This entry shows the status of WriteBooster.
958+ 0: WriteBooster is not enabled.
959+ 1: WriteBooster is enabled
960+ The file is read only.
961+
962+What: /sys/bus/platform/drivers/ufshcd/*/flags/wb_flush_en
963+Date: June 2020
964+Contact: Asutosh Das <asutoshd@codeaurora.org>
965+Description: This entry shows if flush is enabled.
966+ 0: Flush operation is not performed.
967+ 1: Flush operation is performed.
968+ The file is read only.
969+
970+What: /sys/bus/platform/drivers/ufshcd/*/flags/wb_flush_during_h8
971+Date: June 2020
972+Contact: Asutosh Das <asutoshd@codeaurora.org>
973+Description: Flush WriteBooster Buffer during hibernate state.
974+ 0: Device is not allowed to flush the
975+ WriteBooster Buffer during link hibernate
976+ state.
977+ 1: Device is allowed to flush the
978+ WriteBooster Buffer during link hibernate
979+ state
980+ The file is read only.
981+
982+What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_avail_buf
983+Date: June 2020
984+Contact: Asutosh Das <asutoshd@codeaurora.org>
985+Description: This entry shows the amount of unused WriteBooster buffer
986+ available.
987+ The file is read only.
988+
989+What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_cur_buf
990+Date: June 2020
991+Contact: Asutosh Das <asutoshd@codeaurora.org>
992+Description: This entry shows the amount of unused current buffer.
993+ The file is read only.
994+
995+What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_flush_status
996+Date: June 2020
997+Contact: Asutosh Das <asutoshd@codeaurora.org>
998+Description: This entry shows the flush operation status.
999+ 00h: idle
1000+ 01h: Flush operation in progress
1001+ 02h: Flush operation stopped prematurely.
1002+ 03h: Flush operation completed successfully
1003+ 04h: Flush operation general failure
1004+ The file is read only.
1005+
1006+What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_life_time_est
1007+Date: June 2020
1008+Contact: Asutosh Das <asutoshd@codeaurora.org>
1009+Description: This entry shows an indication of the WriteBooster Buffer
1010+ lifetime based on the amount of performed program/erase cycles
1011+ 01h: 0% - 10% WriteBooster Buffer life time used
1012+ ...
1013+ 0Ah: 90% - 100% WriteBooster Buffer life time used
1014+ The file is read only.
1015+
1016+What: /sys/class/scsi_device/*/device/unit_descriptor/wb_buf_alloc_units
1017+Date: June 2020
1018+Contact: Asutosh Das <asutoshd@codeaurora.org>
1019+Description: This entry shows the configured size of WriteBooster buffer.
1020+ 0400h corresponds to 4GB.
1021+ The file is read only.
Documentation/scsi/advansys.rst+1−1
@@ -125,7 +125,7 @@ The following constants can be defined in the source file. · 124 unmodified lines
125125 c. klogd is started with the appropriate -c parameter
126126 (e.g. klogd -c 8)
127127
128− This will cause printk() messages to be be displayed on the
128+ This will cause printk() messages to be displayed on the
129129 current console. Refer to the klogd(8) and syslogd(8) man pages
130130 for details.
131131
Documentation/scsi/scsi-parameters.rst+1−1
@@ -94,7 +94,7 @@ parameters may be changed at runtime by the command · 93 unmodified lines
9494 (/proc/sys/dev/scsi/logging_level).
9595 There is also a nice 'scsi_logging_level' script in the
9696 S390-tools package, available for download at
97− http://www-128.ibm.com/developerworks/linux/linux390/s390-tools-1.5.4.html
97+ https://github.com/ibm-s390-tools/s390-tools/blob/master/scripts/scsi_logging_level
9898
9999 scsi_mod.scan= [SCSI] sync (default) scans SCSI busses as they are
100100 discovered. async scans them in kernel threads,
MAINTAINERS+1−1
@@ -2309,7 +2309,7 @@ F: drivers/pci/controller/dwc/pcie-qcom.c · 2308 unmodified lines
23092309 F: drivers/phy/qualcomm/
23102310 F: drivers/power/*/msm*
23112311 F: drivers/reset/reset-qcom-*
2312−F: drivers/scsi/ufs/ufs-qcom.*
2312+F: drivers/scsi/ufs/ufs-qcom*
23132313 F: drivers/spi/spi-geni-qcom.c
23142314 F: drivers/spi/spi-qcom-qspi.c
23152315 F: drivers/spi/spi-qup.c
block/blk-pm.c+22−19
@@ -164,9 +164,8 @@ EXPORT_SYMBOL(blk_pre_runtime_resume); · 163 unmodified lines
164164 *
165165 * Description:
166166 * Update the queue's runtime status according to the return value of the
167− * device's runtime_resume function. If it is successfully resumed, process
168− * the requests that are queued into the device's queue when it is resuming
169− * and then mark last busy and initiate autosuspend for it.
167+ * device's runtime_resume function. If the resume was successful, call
168+ * blk_set_runtime_active() to do the real work of restarting the queue.
170169 *
171170 * This function should be called near the end of the device's
172171 * runtime_resume callback.
@@ -175,19 +174,13 @@ void blk_post_runtime_resume(struct request_queue *q, int err) · 2 unmodified lines
175174 {
176175 if (!q->dev)
177176 return;
178−
179− spin_lock_irq(&q->queue_lock);
180177 if (!err) {
181− q->rpm_status = RPM_ACTIVE;
182− pm_runtime_mark_last_busy(q->dev);
183− pm_request_autosuspend(q->dev);
178+ blk_set_runtime_active(q);
184179 } else {
180+ spin_lock_irq(&q->queue_lock);
185181 q->rpm_status = RPM_SUSPENDED;
182+ spin_unlock_irq(&q->queue_lock);
186183 }
187− spin_unlock_irq(&q->queue_lock);
188−
189− if (!err)
190− blk_clear_pm_only(q);
191184 }
192185 EXPORT_SYMBOL(blk_post_runtime_resume);
193186
@@ -204,15 +197,25 @@ EXPORT_SYMBOL(blk_post_runtime_resume); · 10 unmodified lines
204197 * This function can be used in driver's resume hook to correct queue
205198 * runtime PM status and re-enable peeking requests from the queue. It
206199 * should be called before first request is added to the queue.
200+ *
201+ * This function is also called by blk_post_runtime_resume() for successful
202+ * runtime resumes. It does everything necessary to restart the queue.
207203 */
208204 void blk_set_runtime_active(struct request_queue *q)
209205 {
210− if (q->dev) {
211− spin_lock_irq(&q->queue_lock);
212− q->rpm_status = RPM_ACTIVE;
213− pm_runtime_mark_last_busy(q->dev);
214− pm_request_autosuspend(q->dev);
215− spin_unlock_irq(&q->queue_lock);
216− }
206+ int old_status;
207+
208+ if (!q->dev)
209+ return;
210+
211+ spin_lock_irq(&q->queue_lock);
212+ old_status = q->rpm_status;
213+ q->rpm_status = RPM_ACTIVE;
214+ pm_runtime_mark_last_busy(q->dev);
215+ pm_request_autosuspend(q->dev);
216+ spin_unlock_irq(&q->queue_lock);
217+
218+ if (old_status != RPM_ACTIVE)
219+ blk_clear_pm_only(q);
217220 }
218221 EXPORT_SYMBOL(blk_set_runtime_active);
drivers/firmware/qcom_scm.c+101−0
@@ -922,6 +922,107 @@ int qcom_scm_ocmem_unlock(enum qcom_scm_ocmem_client id, u32 offset, u32 size) · 921 unmodified lines
922922 }
923923 EXPORT_SYMBOL(qcom_scm_ocmem_unlock);
924924
925+/**
926+ * qcom_scm_ice_available() - Is the ICE key programming interface available?
927+ *
928+ * Return: true iff the SCM calls wrapped by qcom_scm_ice_invalidate_key() and
929+ * qcom_scm_ice_set_key() are available.
930+ */
931+bool qcom_scm_ice_available(void)
932+{
933+ return __qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_ES,
934+ QCOM_SCM_ES_INVALIDATE_ICE_KEY) &&
935+ __qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_ES,
936+ QCOM_SCM_ES_CONFIG_SET_ICE_KEY);
937+}
938+EXPORT_SYMBOL(qcom_scm_ice_available);
939+
940+/**
941+ * qcom_scm_ice_invalidate_key() - Invalidate an inline encryption key
942+ * @index: the keyslot to invalidate
943+ *
944+ * The UFSHCI standard defines a standard way to do this, but it doesn't work on
945+ * these SoCs; only this SCM call does.
946+ *
947+ * Return: 0 on success; -errno on failure.
948+ */
949+int qcom_scm_ice_invalidate_key(u32 index)
950+{
951+ struct qcom_scm_desc desc = {
952+ .svc = QCOM_SCM_SVC_ES,
953+ .cmd = QCOM_SCM_ES_INVALIDATE_ICE_KEY,
954+ .arginfo = QCOM_SCM_ARGS(1),
955+ .args[0] = index,
956+ .owner = ARM_SMCCC_OWNER_SIP,
957+ };
958+
959+ return qcom_scm_call(__scm->dev, &desc, NULL);
960+}
961+EXPORT_SYMBOL(qcom_scm_ice_invalidate_key);
962+
963+/**
964+ * qcom_scm_ice_set_key() - Set an inline encryption key
965+ * @index: the keyslot into which to set the key
966+ * @key: the key to program
967+ * @key_size: the size of the key in bytes
968+ * @cipher: the encryption algorithm the key is for
969+ * @data_unit_size: the encryption data unit size, i.e. the size of each
970+ * individual plaintext and ciphertext. Given in 512-byte
971+ * units, e.g. 1 = 512 bytes, 8 = 4096 bytes, etc.
972+ *
973+ * Program a key into a keyslot of Qualcomm ICE (Inline Crypto Engine), where it
974+ * can then be used to encrypt/decrypt UFS I/O requests inline.
975+ *
976+ * The UFSHCI standard defines a standard way to do this, but it doesn't work on
977+ * these SoCs; only this SCM call does.
978+ *
979+ * Return: 0 on success; -errno on failure.
980+ */
981+int qcom_scm_ice_set_key(u32 index, const u8 *key, u32 key_size,
982+ enum qcom_scm_ice_cipher cipher, u32 data_unit_size)
983+{
984+ struct qcom_scm_desc desc = {
985+ .svc = QCOM_SCM_SVC_ES,
986+ .cmd = QCOM_SCM_ES_CONFIG_SET_ICE_KEY,
987+ .arginfo = QCOM_SCM_ARGS(5, QCOM_SCM_VAL, QCOM_SCM_RW,
988+ QCOM_SCM_VAL, QCOM_SCM_VAL,
989+ QCOM_SCM_VAL),
990+ .args[0] = index,
991+ .args[2] = key_size,
992+ .args[3] = cipher,
993+ .args[4] = data_unit_size,
994+ .owner = ARM_SMCCC_OWNER_SIP,
995+ };
996+ void *keybuf;
997+ dma_addr_t key_phys;
998+ int ret;
999+
1000+ /*
1001+ * 'key' may point to vmalloc()'ed memory, but we need to pass a
1002+ * physical address that's been properly flushed. The sanctioned way to
1003+ * do this is by using the DMA API. But as is best practice for crypto
1004+ * keys, we also must wipe the key after use. This makes kmemdup() +
1005+ * dma_map_single() not clearly correct, since the DMA API can use
1006+ * bounce buffers. Instead, just use dma_alloc_coherent(). Programming
1007+ * keys is normally rare and thus not performance-critical.
1008+ */
1009+
1010+ keybuf = dma_alloc_coherent(__scm->dev, key_size, &key_phys,
1011+ GFP_KERNEL);
1012+ if (!keybuf)
1013+ return -ENOMEM;
1014+ memcpy(keybuf, key, key_size);
1015+ desc.args[1] = key_phys;
1016+
1017+ ret = qcom_scm_call(__scm->dev, &desc, NULL);
1018+
1019+ memzero_explicit(keybuf, key_size);
1020+
1021+ dma_free_coherent(__scm->dev, key_size, keybuf, key_phys);
1022+ return ret;
1023+}
1024+EXPORT_SYMBOL(qcom_scm_ice_set_key);
1025+
9251026 /**
9261027 * qcom_scm_hdcp_available() - Check if secure environment supports HDCP.
9271028 *
drivers/firmware/qcom_scm.h+4−0
@@ -103,6 +103,10 @@ extern int scm_legacy_call(struct device *dev, const struct qcom_scm_desc *desc, · 102 unmodified lines
103103 #define QCOM_SCM_OCMEM_LOCK_CMD 0x01
104104 #define QCOM_SCM_OCMEM_UNLOCK_CMD 0x02
105105
106+#define QCOM_SCM_SVC_ES 0x10 /* Enterprise Security */
107+#define QCOM_SCM_ES_INVALIDATE_ICE_KEY 0x03
108+#define QCOM_SCM_ES_CONFIG_SET_ICE_KEY 0x04
109+
106110 #define QCOM_SCM_SVC_HDCP 0x11
107111 #define QCOM_SCM_HDCP_INVOKE 0x01
108112
drivers/s390/scsi/zfcp_ccw.c+3−4
@@ -124,13 +124,12 @@ static void zfcp_ccw_remove(struct ccw_device *cdev) · 123 unmodified lines
124124 return;
125125
126126 write_lock_irq(&adapter->port_list_lock);
127− list_for_each_entry_safe(port, p, &adapter->port_list, list) {
127+ list_for_each_entry(port, &adapter->port_list, list) {
128128 write_lock(&port->unit_list_lock);
129− list_for_each_entry_safe(unit, u, &port->unit_list, list)
130− list_move(&unit->list, &unit_remove_lh);
129+ list_splice_init(&port->unit_list, &unit_remove_lh);
131130 write_unlock(&port->unit_list_lock);
132− list_move(&port->list, &port_remove_lh);
133131 }
132+ list_splice_init(&adapter->port_list, &port_remove_lh);
134133 write_unlock_irq(&adapter->port_list_lock);
135134 zfcp_ccw_adapter_put(adapter); /* put from zfcp_ccw_adapter_by_cdev */
136135
drivers/s390/scsi/zfcp_erp.c+1−1
@@ -68,7 +68,7 @@ static void zfcp_erp_action_ready(struct zfcp_erp_action *act) · 67 unmodified lines
6868 {
6969 struct zfcp_adapter *adapter = act->adapter;
7070
71− list_move(&act->list, &act->adapter->erp_ready_head);
71+ list_move(&act->list, &adapter->erp_ready_head);
7272 zfcp_dbf_rec_run("erardy1", act);
7373 wake_up(&adapter->erp_ready_wq);
7474 zfcp_dbf_rec_run("erardy2", act);
drivers/s390/scsi/zfcp_fc.c+1−1
@@ -48,7 +48,7 @@ unsigned int zfcp_fc_port_scan_backoff(void) · 47 unmodified lines
4848 {
4949 if (!port_scan_backoff)
5050 return 0;
51− return get_random_int() % port_scan_backoff;
51+ return prandom_u32_max(port_scan_backoff);
5252 }
5353
5454 static void zfcp_fc_port_scan_time(struct zfcp_adapter *adapter)
drivers/s390/scsi/zfcp_qdio.c+5−2
@@ -246,7 +246,7 @@ int zfcp_qdio_sbal_get(struct zfcp_qdio *qdio) · 245 unmodified lines
246246 }
247247
248248 /**
249− * zfcp_qdio_send - set PCI flag in first SBALE and send req to QDIO
249+ * zfcp_qdio_send - send req to QDIO
250250 * @qdio: pointer to struct zfcp_qdio
251251 * @q_req: pointer to struct zfcp_qdio_req
252252 * Returns: 0 on success, error otherwise
@@ -260,17 +260,20 @@ int zfcp_qdio_send(struct zfcp_qdio *qdio, struct zfcp_qdio_req *q_req) · 7 unmodified lines
260260 zfcp_qdio_account(qdio);
261261 spin_unlock(&qdio->stat_lock);
262262
263+ atomic_sub(sbal_number, &qdio->req_q_free);
264+
263265 retval = do_QDIO(qdio->adapter->ccw_device, QDIO_FLAG_SYNC_OUTPUT, 0,
264266 q_req->sbal_first, sbal_number);
265267
266268 if (unlikely(retval)) {
269+ /* Failed to submit the IO, roll back our modifications. */
270+ atomic_add(sbal_number, &qdio->req_q_free);
267271 zfcp_qdio_zero_sbals(qdio->req_q, q_req->sbal_first,
268272 sbal_number);
269273 return retval;
270274 }
271275
272276 /* account for transferred buffers */
273− atomic_sub(sbal_number, &qdio->req_q_free);
274277 qdio->req_q_idx += sbal_number;
275278 qdio->req_q_idx %= QDIO_MAX_BUFFERS_PER_Q;
276279
drivers/scsi/Kconfig+11−5
@@ -1154,6 +1154,7 @@ source "drivers/scsi/qedf/Kconfig" · 1153 unmodified lines
11541154 config SCSI_LPFC
11551155 tristate "Emulex LightPulse Fibre Channel Support"
11561156 depends on PCI && SCSI
1157+ depends on CPU_FREQ
11571158 depends on SCSI_FC_ATTRS
11581159 depends on NVME_TARGET_FC || NVME_TARGET_FC=n
11591160 depends on NVME_FC || NVME_FC=n
@@ -1469,14 +1470,19 @@ config SCSI_SUNESP · 309 unmodified lines
14691470 module will be called sun_esp.
14701471
14711472 config ZFCP
1472− tristate "FCP host bus adapter driver for IBM eServer zSeries"
1473+ tristate "FCP host bus adapter driver for IBM mainframes"
14731474 depends on S390 && QDIO && SCSI
14741475 depends on SCSI_FC_ATTRS
14751476 help
1476− If you want to access SCSI devices attached to your IBM eServer
1477− zSeries by means of Fibre Channel interfaces say Y.
1478− For details please refer to the documentation provided by IBM at
1479− <http://oss.software.ibm.com/developerworks/opensource/linux390>
1477+ If you want to access SCSI devices attached to your IBM mainframe by
1478+ means of Fibre Channel Protocol host bus adapters say Y.
1479+
1480+ Supported HBAs include different models of the FICON Express and FCP
1481+ Express I/O cards.
1482+
1483+ For a more complete list, and for more details about setup and
1484+ operation refer to the IBM publication "Device Drivers, Features, and
1485+ Commands", SC33-8411.
14801486
14811487 This driver is also available as a module. This module will be
14821488 called zfcp. If you want to compile it as a module, say M here
drivers/scsi/aacraid/aachba.c+6−16
@@ -350,7 +350,8 @@ static inline int aac_valid_context(struct scsi_cmnd *scsicmd, · 349 unmodified lines
350350
351351 /**
352352 * aac_get_config_status - check the adapter configuration
353− * @common: adapter to query
353+ * @dev: aac driver data
354+ * @commit_flag: force sending CT_COMMIT_CONFIG
354355 *
355356 * Query config status, and commit the configuration if needed.
356357 */
@@ -442,7 +443,7 @@ static void aac_expose_phy_device(struct scsi_cmnd *scsicmd) · 85 unmodified lines
442443
443444 /**
444445 * aac_get_containers - list containers
445− * @common: adapter to probe
446+ * @dev: aac driver data
446447 *
447448 * Make a list of all containers on this controller
448449 */
@@ -561,7 +562,7 @@ static void get_container_name_callback(void *context, struct fib * fibptr) · 112 unmodified lines
561562 scsicmd->scsi_done(scsicmd);
562563 }
563564
564−/**
565+/*
565566 * aac_get_container_name - get container name, none blocking.
566567 */
567568 static int aac_get_container_name(struct scsi_cmnd * scsicmd)
@@ -786,8 +787,7 @@ static int _aac_probe_container(struct scsi_cmnd * scsicmd, int (*callback)(stru · 218 unmodified lines
786787
787788 /**
788789 * aac_probe_container - query a logical volume
789− * @dev: device to query
790− * @cid: container identifier
790+ * @scsicmd: the scsi command block
791791 *
792792 * Queries the controller about the given volume. The volume information
793793 * is updated in the struct fsa_dev_info structure rather than returned.
@@ -1098,7 +1098,7 @@ static void get_container_serial_callback(void *context, struct fib * fibptr) · 304 unmodified lines
10981098 scsicmd->scsi_done(scsicmd);
10991099 }
11001100
1101−/**
1101+/*
11021102 * aac_get_container_serial - get container serial, none blocking.
11031103 */
11041104 static int aac_get_container_serial(struct scsi_cmnd * scsicmd)
@@ -1952,8 +1952,6 @@ free_identify_resp: · 847 unmodified lines
19521952 /**
19531953 * aac_set_safw_attr_all_targets- update current hba map with data from FW
19541954 * @dev: aac_dev structure
1955− * @phys_luns: FW information from report phys luns
1956− * @rescan: Indicates scan type
19571955 *
19581956 * Update our hba map with the information gathered from the FW
19591957 */
@@ -3391,15 +3389,12 @@ int aac_dev_ioctl(struct aac_dev *dev, unsigned int cmd, void __user *arg) · 1431 unmodified lines
33913389 }
33923390
33933391 /**
3394− *
33953392 * aac_srb_callback
33963393 * @context: the context set in the fib - here it is scsi cmd
33973394 * @fibptr: pointer to the fib
33983395 *
33993396 * Handles the completion of a scsi command to a non dasd device
3400− *
34013397 */
3402−
34033398 static void aac_srb_callback(void *context, struct fib * fibptr)
34043399 {
34053400 struct aac_srb_reply *srbreply;
@@ -3684,13 +3679,11 @@ static void hba_resp_task_failure(struct aac_dev *dev, · 278 unmodified lines
36843679 }
36853680
36863681 /**
3687− *
36883682 * aac_hba_callback
36893683 * @context: the context set in the fib - here it is scsi cmd
36903684 * @fibptr: pointer to the fib
36913685 *
36923686 * Handles the completion of a native HBA scsi command
3693− *
36943687 */
36953688 void aac_hba_callback(void *context, struct fib *fibptr)
36963689 {
@@ -3749,14 +3742,12 @@ out: · 52 unmodified lines
37493742 }
37503743
37513744 /**
3752− *
37533745 * aac_send_srb_fib
37543746 * @scsicmd: the scsi command block
37553747 *
37563748 * This routine will form a FIB and fill in the aac_srb from the
37573749 * scsicmd passed in.
37583750 */
3759−
37603751 static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
37613752 {
37623753 struct fib* cmd_fibcontext;
@@ -3792,7 +3783,6 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd) · 29 unmodified lines
37923783 }
37933784
37943785 /**
3795− *
37963786 * aac_send_hba_fib
37973787 * @scsicmd: the scsi command block
37983788 *
drivers/scsi/aacraid/commctrl.c+6−8
@@ -32,6 +32,8 @@ · 31 unmodified lines
3232
3333 #include "aacraid.h"
3434
35+# define AAC_DEBUG_PREAMBLE KERN_INFO
36+# define AAC_DEBUG_POSTAMBLE
3537 /**
3638 * ioctl_send_fib - send a FIB from userspace
3739 * @dev: adapter is being processed
@@ -40,9 +42,6 @@ · 2 unmodified lines
4042 * This routine sends a fib to the adapter on behalf of a user level
4143 * program.
4244 */
43−# define AAC_DEBUG_PREAMBLE KERN_INFO
44−# define AAC_DEBUG_POSTAMBLE
45−
4645 static int ioctl_send_fib(struct aac_dev * dev, void __user *arg)
4746 {
4847 struct hw_fib * kfib;
@@ -158,11 +157,12 @@ cleanup: · 109 unmodified lines
158157
159158 /**
160159 * open_getadapter_fib - Get the next fib
160+ * @dev: adapter is being processed
161+ * @arg: arguments to the open call
161162 *
162163 * This routine will get the next Fib, if available, from the AdapterFibContext
163164 * passed in from the user.
164165 */
165−
166166 static int open_getadapter_fib(struct aac_dev * dev, void __user *arg)
167167 {
168168 struct aac_fib_context * fibctx;
@@ -234,7 +234,6 @@ static int open_getadapter_fib(struct aac_dev * dev, void __user *arg) · 65 unmodified lines
234234 * This routine will get the next Fib, if available, from the AdapterFibContext
235235 * passed in from the user.
236236 */
237−
238237 static int next_getadapter_fib(struct aac_dev * dev, void __user *arg)
239238 {
240239 struct fib_ioctl f;
@@ -455,11 +454,10 @@ static int check_revision(struct aac_dev *dev, void __user *arg) · 214 unmodified lines
455454
456455
457456 /**
458− *
459457 * aac_send_raw_scb
460− *
458+ * @dev: adapter is being processed
459+ * @arg: arguments to the send call
461460 */
462−
463461 static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
464462 {
465463 struct fib* srbfib;
drivers/scsi/aacraid/commsup.c+6−6
@@ -214,6 +214,7 @@ int aac_fib_setup(struct aac_dev * dev) · 213 unmodified lines
214214 /**
215215 * aac_fib_alloc_tag-allocate a fib using tags
216216 * @dev: Adapter to allocate the fib for
217+ * @scmd: SCSI command
217218 *
218219 * Allocate a fib from the adapter fib pool using tags
219220 * from the blk layer.
@@ -405,8 +406,8 @@ static int aac_get_entry (struct aac_dev * dev, u32 qid, struct aac_entry **entr · 185 unmodified lines
405406 * aac_queue_get - get the next free QE
406407 * @dev: Adapter
407408 * @index: Returned index
408− * @priority: Priority of fib
409− * @fib: Fib to associate with the queue entry
409+ * @qid: Queue number
410+ * @hw_fib: Fib to associate with the queue entry
410411 * @wait: Wait if queue full
411412 * @fibptr: Driver fib object to go with fib
412413 * @nonotify: Don't notify the adapter
@@ -934,7 +935,7 @@ int aac_fib_adapter_complete(struct fib *fibptr, unsigned short size) · 521 unmodified lines
934935
935936 /**
936937 * aac_fib_complete - fib completion handler
937− * @fib: FIB to complete
938+ * @fibptr: FIB to complete
938939 *
939940 * Will do all necessary work to complete a FIB.
940941 */
@@ -1049,6 +1050,7 @@ static void aac_handle_aif_bu(struct aac_dev *dev, struct aac_aifcmd *aifcmd) · 108 unmodified lines
10491050 }
10501051 }
10511052
1053+#define AIF_SNIFF_TIMEOUT (500*HZ)
10521054 /**
10531055 * aac_handle_aif - Handle a message from the firmware
10541056 * @dev: Which adapter this fib is from
@@ -1057,8 +1059,6 @@ static void aac_handle_aif_bu(struct aac_dev *dev, struct aac_aifcmd *aifcmd) · 2 unmodified lines
10571059 * This routine handles a driver notify fib from the adapter and
10581060 * dispatches it to the appropriate routine for handling.
10591061 */
1060−
1061−#define AIF_SNIFF_TIMEOUT (500*HZ)
10621062 static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
10631063 {
10641064 struct hw_fib * hw_fib = fibptr->hw_fib_va;
@@ -2416,7 +2416,7 @@ out: · 1351 unmodified lines
24162416
24172417 /**
24182418 * aac_command_thread - command processing thread
2419− * @dev: Adapter to monitor
2419+ * @data: Adapter to monitor
24202420 *
24212421 * Waits on the commandready event in it's queue. When the event gets set
24222422 * it will pull FIBs off it's queue. It will continue to pull FIBs off
drivers/scsi/aacraid/dpcsup.c+8−7
@@ -99,10 +99,11 @@ unsigned int aac_response_normal(struct aac_queue * q) · 98 unmodified lines
9999 }
100100 if (hwfib->header.XferState & cpu_to_le32(NoResponseExpected | Async))
101101 {
102− if (hwfib->header.XferState & cpu_to_le32(NoResponseExpected))
102+ if (hwfib->header.XferState & cpu_to_le32(NoResponseExpected)) {
103103 FIB_COUNTER_INCREMENT(aac_config.NoResponseRecved);
104− else
104+ } else {
105105 FIB_COUNTER_INCREMENT(aac_config.AsyncRecved);
106+ }
106107 /*
107108 * NOTE: we cannot touch the fib after this
108109 * call, because it may have been deallocated.
@@ -229,7 +230,6 @@ static void aac_aif_callback(void *context, struct fib * fibptr) · 120 unmodified lines
229230 struct fib *fibctx;
230231 struct aac_dev *dev;
231232 struct aac_aifcmd *cmd;
232− int status;
233233
234234 fibctx = (struct fib *)context;
235235 BUG_ON(fibptr == NULL);
@@ -249,7 +249,7 @@ static void aac_aif_callback(void *context, struct fib * fibptr) · 13 unmodified lines
249249 cmd = (struct aac_aifcmd *) fib_data(fibctx);
250250 cmd->command = cpu_to_le32(AifReqEvent);
251251
252− status = aac_fib_send(AifRequest,
252+ aac_fib_send(AifRequest,
253253 fibctx,
254254 sizeof(struct hw_fib)-sizeof(struct aac_fibhdr),
255255 FsaNormal,
@@ -258,7 +258,7 @@ static void aac_aif_callback(void *context, struct fib * fibptr) · 2 unmodified lines
258258 }
259259
260260
261−/**
261+/*
262262 * aac_intr_normal - Handle command replies
263263 * @dev: Device
264264 * @index: completion reference
@@ -403,12 +403,13 @@ unsigned int aac_intr_normal(struct aac_dev *dev, u32 index, int isAif, · 138 unmodified lines
403403 if (hwfib->header.XferState &
404404 cpu_to_le32(NoResponseExpected | Async)) {
405405 if (hwfib->header.XferState & cpu_to_le32(
406− NoResponseExpected))
406+ NoResponseExpected)) {
407407 FIB_COUNTER_INCREMENT(
408408 aac_config.NoResponseRecved);
409− else
409+ } else {
410410 FIB_COUNTER_INCREMENT(
411411 aac_config.AsyncRecved);
412+ }
412413 start_callback = 1;
413414 } else {
414415 unsigned long flagv;
drivers/scsi/aacraid/linit.c+3−3
@@ -230,8 +230,8 @@ static struct aac_driver_ident aac_drivers[] = { · 229 unmodified lines
230230
231231 /**
232232 * aac_queuecommand - queue a SCSI command
233+ * @shost: Scsi host to queue command on
233234 * @cmd: SCSI command to queue
234− * @done: Function to call on command completion
235235 *
236236 * Queues a command for execution by the associated Host Adapter.
237237 *
@@ -363,9 +363,10 @@ static int aac_biosparm(struct scsi_device *sdev, struct block_device *bdev, · 125 unmodified lines
363363
364364 param->cylinders = cap_to_cyls(capacity, param->heads * param->sectors);
365365 if (num < 4 && end_sec == param->sectors) {
366− if (param->cylinders != saved_cylinders)
366+ if (param->cylinders != saved_cylinders) {
367367 dprintk((KERN_DEBUG "Adopting geometry: heads=%d, sectors=%d from partition table %d.\n",
368368 param->heads, param->sectors, num));
369+ }
369370 } else if (end_head > 0 || end_sec > 0) {
370371 dprintk((KERN_DEBUG "Strange geometry: heads=%d, sectors=%d in partition table %d.\n",
371372 end_head + 1, end_sec, num));
@@ -1159,7 +1160,6 @@ static int aac_cfg_open(struct inode *inode, struct file *file) · 787 unmodified lines
11591160
11601161 /**
11611162 * aac_cfg_ioctl - AAC configuration request
1162− * @inode: inode of device
11631163 * @file: file handle
11641164 * @cmd: ioctl command code
11651165 * @arg: argument
drivers/scsi/aacraid/nark.c+1−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424
2525 /**
2626 * aac_nark_ioremap
27+ * @dev: device to ioremap
2728 * @size: mapping resize request
2829 *
2930 */
drivers/scsi/aacraid/rkt.c+3−2
@@ -57,6 +57,7 @@ static int aac_rkt_select_comm(struct aac_dev *dev, int comm) · 56 unmodified lines
5757
5858 /**
5959 * aac_rkt_ioremap
60+ * @dev: device to ioremap
6061 * @size: mapping resize request
6162 *
6263 */
@@ -77,8 +78,8 @@ static int aac_rkt_ioremap(struct aac_dev * dev, u32 size) · 14 unmodified lines
7778 * aac_rkt_init - initialize an i960 based AAC card
7879 * @dev: device to configure
7980 *
80− * Allocate and set up resources for the i960 based AAC variants. The
81− * device_interface in the commregion will be allocated and linked
81+ * Allocate and set up resources for the i960 based AAC variants. The
82+ * device_interface in the commregion will be allocated and linked
8283 * to the comm region.
8384 */
8485
drivers/scsi/aacraid/rx.c+11−1
@@ -144,7 +144,16 @@ static void aac_rx_enable_interrupt_message(struct aac_dev *dev) · 143 unmodified lines
144144 * @dev: Adapter
145145 * @command: Command to execute
146146 * @p1: first parameter
147− * @ret: adapter status
147+ * @p2: second parameter
148+ * @p3: third parameter
149+ * @p4: forth parameter
150+ * @p5: fifth parameter
151+ * @p6: sixth parameter
152+ * @status: adapter status
153+ * @r1: first return value
154+ * @r2: second return value
155+ * @r3: third return value
156+ * @r4: forth return value
148157 *
149158 * This routine will send a synchronous command to the adapter and wait
150159 * for its completion.
@@ -443,6 +452,7 @@ static int aac_rx_deliver_message(struct fib * fib) · 292 unmodified lines
443452
444453 /**
445454 * aac_rx_ioremap
455+ * @dev: adapter
446456 * @size: mapping resize request
447457 *
448458 */
drivers/scsi/aacraid/sa.c+14−5
@@ -135,13 +135,21 @@ static void aac_sa_notify_adapter(struct aac_dev *dev, u32 event) · 134 unmodified lines
135135 * @dev: Adapter
136136 * @command: Command to execute
137137 * @p1: first parameter
138+ * @p2: second parameter
139+ * @p3: third parameter
140+ * @p4: forth parameter
141+ * @p5: fifth parameter
142+ * @p6: sixth parameter
138143 * @ret: adapter status
144+ * @r1: first return value
145+ * @r2: second return value
146+ * @r3: third return value
147+ * @r4: forth return value
139148 *
140− * This routine will send a synchronous command to the adapter and wait
149+ * This routine will send a synchronous command to the adapter and wait
141150 * for its completion.
142151 */
143−
144−static int sa_sync_cmd(struct aac_dev *dev, u32 command,
152+static int sa_sync_cmd(struct aac_dev *dev, u32 command,
145153 u32 p1, u32 p2, u32 p3, u32 p4, u32 p5, u32 p6,
146154 u32 *ret, u32 *r1, u32 *r2, u32 *r3, u32 *r4)
147155 {
@@ -283,6 +291,7 @@ static int aac_sa_check_health(struct aac_dev *dev) · 135 unmodified lines
283291
284292 /**
285293 * aac_sa_ioremap
294+ * @dev: device to ioremap
286295 * @size: mapping resize request
287296 *
288297 */
@@ -300,8 +309,8 @@ static int aac_sa_ioremap(struct aac_dev * dev, u32 size) · 11 unmodified lines
300309 * aac_sa_init - initialize an ARM based AAC card
301310 * @dev: device to configure
302311 *
303− * Allocate and set up resources for the ARM based AAC variants. The
304− * device_interface in the commregion will be allocated and linked
312+ * Allocate and set up resources for the ARM based AAC variants. The
313+ * device_interface in the commregion will be allocated and linked
305314 * to the comm region.
306315 */
307316
drivers/scsi/aacraid/src.c+12−1
@@ -191,7 +191,16 @@ static void aac_src_enable_interrupt_message(struct aac_dev *dev) · 190 unmodified lines
191191 * @dev: Adapter
192192 * @command: Command to execute
193193 * @p1: first parameter
194− * @ret: adapter status
194+ * @p2: second parameter
195+ * @p3: third parameter
196+ * @p4: forth parameter
197+ * @p5: fifth parameter
198+ * @p6: sixth parameter
199+ * @status: adapter status
200+ * @r1: first return value
201+ * @r2: second return valu
202+ * @r3: third return value
203+ * @r4: forth return value
195204 *
196205 * This routine will send a synchronous command to the adapter and wait
197206 * for its completion.
@@ -602,6 +611,7 @@ static int aac_src_deliver_message(struct fib *fib) · 404 unmodified lines
602611
603612 /**
604613 * aac_src_ioremap
614+ * @dev: device ioremap
605615 * @size: mapping resize request
606616 *
607617 */
@@ -632,6 +642,7 @@ static int aac_src_ioremap(struct aac_dev *dev, u32 size) · 24 unmodified lines
632642
633643 /**
634644 * aac_srcv_ioremap
645+ * @dev: device ioremap
635646 * @size: mapping resize request
636647 *
637648 */
drivers/scsi/aha152x.c+1−2
@@ -2030,8 +2030,7 @@ static void datai_run(struct Scsi_Host *shpnt) · 2029 unmodified lines
20302030 fifodata, GETPORT(FIFOSTAT));
20312031 SETPORT(DMACNTRL0, ENDMA|_8BIT);
20322032 while(fifodata>0) {
2033− int data;
2034− data=GETPORT(DATAPORT);
2033+ GETPORT(DATAPORT);
20352034 fifodata--;
20362035 DATA_LEN++;
20372036 }
drivers/scsi/aic7xxx/aic79xx_core.c+3−17
@@ -1735,10 +1735,8 @@ ahd_dump_sglist(struct scb *scb) · 1734 unmodified lines
17351735 sg_list = (struct ahd_dma64_seg*)scb->sg_list;
17361736 for (i = 0; i < scb->sg_count; i++) {
17371737 uint64_t addr;
1738− uint32_t len;
17391738
17401739 addr = ahd_le64toh(sg_list[i].addr);
1741− len = ahd_le32toh(sg_list[i].len);
17421740 printk("sg[%d] - Addr 0x%x%x : Length %d%s\n",
17431741 i,
17441742 (uint32_t)((addr >> 32) & 0xFFFFFFFF),
@@ -1906,9 +1904,6 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) · 161 unmodified lines
19061904 {
19071905 struct ahd_devinfo devinfo;
19081906 struct scb *scb;
1909− struct ahd_initiator_tinfo *targ_info;
1910− struct ahd_tmode_tstate *tstate;
1911− struct ahd_transinfo *tinfo;
19121907 u_int scbid;
19131908
19141909 /*
@@ -1936,12 +1931,6 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) · 21 unmodified lines
19361931 SCB_GET_LUN(scb),
19371932 SCB_GET_CHANNEL(ahd, scb),
19381933 ROLE_INITIATOR);
1939− targ_info = ahd_fetch_transinfo(ahd,
1940− devinfo.channel,
1941− devinfo.our_scsiid,
1942− devinfo.target,
1943− &tstate);
1944− tinfo = &targ_info->curr;
19451934 ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
19461935 AHD_TRANS_ACTIVE, /*paused*/TRUE);
19471936 ahd_set_syncrate(ahd, &devinfo, /*period*/0,
@@ -2669,7 +2658,6 @@ ahd_handle_transmission_error(struct ahd_softc *ahd) · 721 unmodified lines
26692658 struct scb *scb;
26702659 u_int scbid;
26712660 u_int lqistat1;
2672− u_int lqistat2;
26732661 u_int msg_out;
26742662 u_int curphase;
26752663 u_int lastphase;
@@ -2680,7 +2668,7 @@ ahd_handle_transmission_error(struct ahd_softc *ahd) · 4 unmodified lines
26802668 scb = NULL;
26812669 ahd_set_modes(ahd, AHD_MODE_SCSI, AHD_MODE_SCSI);
26822670 lqistat1 = ahd_inb(ahd, LQISTAT1) & ~(LQIPHASE_LQ|LQIPHASE_NLQ);
2683− lqistat2 = ahd_inb(ahd, LQISTAT2);
2671+ ahd_inb(ahd, LQISTAT2);
26842672 if ((lqistat1 & (LQICRCI_NLQ|LQICRCI_LQ)) == 0
26852673 && (ahd->bugs & AHD_NLQICRC_DELAYED_BUG) != 0) {
26862674 u_int lqistate;
@@ -4218,13 +4206,11 @@ ahd_update_pending_scbs(struct ahd_softc *ahd) · 1531 unmodified lines
42184206 pending_scb_count = 0;
42194207 LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) {
42204208 struct ahd_devinfo devinfo;
4221− struct ahd_initiator_tinfo *tinfo;
42224209 struct ahd_tmode_tstate *tstate;
42234210
42244211 ahd_scb_devinfo(ahd, &devinfo, pending_scb);
4225− tinfo = ahd_fetch_transinfo(ahd, devinfo.channel,
4226− devinfo.our_scsiid,
4227− devinfo.target, &tstate);
4212+ ahd_fetch_transinfo(ahd, devinfo.channel, devinfo.our_scsiid,
4213+ devinfo.target, &tstate);
42284214 if ((tstate->auto_negotiate & devinfo.target_mask) == 0
42294215 && (pending_scb->flags & SCB_AUTO_NEGOTIATE) != 0) {
42304216 pending_scb->flags &= ~SCB_AUTO_NEGOTIATE;
drivers/scsi/aic7xxx/aic79xx_osm.c+10−23
@@ -700,9 +700,6 @@ ahd_linux_slave_alloc(struct scsi_device *sdev) · 699 unmodified lines
700700 static int
701701 ahd_linux_slave_configure(struct scsi_device *sdev)
702702 {
703− struct ahd_softc *ahd;
704−
705− ahd = *((struct ahd_softc **)sdev->host->hostdata);
706703 if (bootverbose)
707704 sdev_printk(KERN_INFO, sdev, "Slave Configure\n");
708705
@@ -778,16 +775,13 @@ ahd_linux_dev_reset(struct scsi_cmnd *cmd) · 69 unmodified lines
778775 struct scb *reset_scb;
779776 u_int cdb_byte;
780777 int retval = SUCCESS;
781− int paused;
782− int wait;
783778 struct ahd_initiator_tinfo *tinfo;
784779 struct ahd_tmode_tstate *tstate;
785780 unsigned long flags;
786781 DECLARE_COMPLETION_ONSTACK(done);
787782
788783 reset_scb = NULL;
789− paused = FALSE;
790− wait = FALSE;
784+
791785 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
792786
793787 scmd_printk(KERN_INFO, cmd,
@@ -1793,10 +1787,12 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb) · 999 unmodified lines
17931787 */
17941788 cmd->sense_buffer[0] = 0;
17951789 if (ahd_get_transaction_status(scb) == CAM_REQ_INPROG) {
1790+#ifdef AHD_REPORT_UNDERFLOWS
17961791 uint32_t amount_xferred;
17971792
17981793 amount_xferred =
17991794 ahd_get_transfer_length(scb) - ahd_get_residual(scb);
1795+#endif
18001796 if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) {
18011797 #ifdef AHD_DEBUG
18021798 if ((ahd_debug & AHD_SHOW_MISC) != 0) {
@@ -2147,7 +2143,7 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) · 344 unmodified lines
21472143 u_int last_phase;
21482144 u_int saved_scsiid;
21492145 u_int cdb_byte;
2150− int retval;
2146+ int retval = SUCCESS;
21512147 int was_paused;
21522148 int paused;
21532149 int wait;
@@ -2185,8 +2181,7 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) · 31 unmodified lines
21852181 * so we must not still own the command.
21862182 */
21872183 scmd_printk(KERN_INFO, cmd, "Is not an active device\n");
2188− retval = SUCCESS;
2189− goto no_cmd;
2184+ goto done;
21902185 }
21912186
21922187 /*
@@ -2199,7 +2194,7 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) · 6 unmodified lines
21992194
22002195 if (pending_scb == NULL) {
22012196 scmd_printk(KERN_INFO, cmd, "Command not found\n");
2202− goto no_cmd;
2197+ goto done;
22032198 }
22042199
22052200 if ((pending_scb->flags & SCB_RECOVERY_SCB) != 0) {
@@ -2207,7 +2202,7 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) · 1 unmodified line
22072202 * We can't queue two recovery actions using the same SCB
22082203 */
22092204 retval = FAILED;
2210− goto done;
2205+ goto done;
22112206 }
22122207
22132208 /*
@@ -2222,7 +2217,7 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) · 8 unmodified lines
22222217
22232218 if ((pending_scb->flags & SCB_ACTIVE) == 0) {
22242219 scmd_printk(KERN_INFO, cmd, "Command already completed\n");
2225− goto no_cmd;
2220+ goto done;
22262221 }
22272222
22282223 printk("%s: At time of recovery, card was %spaused\n",
@@ -2239,7 +2234,6 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) · 10 unmodified lines
22392234 printk("%s:%d:%d:%d: Cmd aborted from QINFIFO\n",
22402235 ahd_name(ahd), cmd->device->channel,
22412236 cmd->device->id, (u8)cmd->device->lun);
2242− retval = SUCCESS;
22432237 goto done;
22442238 }
22452239
@@ -2336,17 +2330,10 @@ ahd_linux_queue_abort_cmd(struct scsi_cmnd *cmd) · 90 unmodified lines
23362330 } else {
23372331 scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n");
23382332 retval = FAILED;
2339− goto done;
23402333 }
23412334
2342−no_cmd:
2343− /*
2344− * Our assumption is that if we don't have the command, no
2345− * recovery action was required, so we return success. Again,
2346− * the semantics of the mid-layer recovery engine are not
2347− * well defined, so this may change in time.
2348− */
2349− retval = SUCCESS;
2335+
2336+ ahd_restore_modes(ahd, saved_modes);
23502337 done:
23512338 if (paused)
23522339 ahd_unpause(ahd);
drivers/scsi/aic7xxx/aic7xxx_osm.c+2−11
@@ -564,8 +564,6 @@ ahc_linux_target_alloc(struct scsi_target *starget) · 563 unmodified lines
564564 struct scsi_target **ahc_targp = ahc_linux_target_in_softc(starget);
565565 unsigned short scsirate;
566566 struct ahc_devinfo devinfo;
567− struct ahc_initiator_tinfo *tinfo;
568− struct ahc_tmode_tstate *tstate;
569567 char channel = starget->channel + 'A';
570568 unsigned int our_id = ahc->our_id;
571569 unsigned int target_offset;
@@ -612,9 +610,6 @@ ahc_linux_target_alloc(struct scsi_target *starget) · 40 unmodified lines
612610 spi_max_offset(starget) = 0;
613611 spi_min_period(starget) =
614612 ahc_find_period(ahc, scsirate, maxsync);
615−
616− tinfo = ahc_fetch_transinfo(ahc, channel, ahc->our_id,
617− starget->id, &tstate);
618613 }
619614 ahc_compile_devinfo(&devinfo, our_id, starget->id,
620615 CAM_LUN_WILDCARD, channel,
@@ -671,10 +666,6 @@ ahc_linux_slave_alloc(struct scsi_device *sdev) · 50 unmodified lines
671666 static int
672667 ahc_linux_slave_configure(struct scsi_device *sdev)
673668 {
674− struct ahc_softc *ahc;
675−
676− ahc = *((struct ahc_softc **)sdev->host->hostdata);
677−
678669 if (bootverbose)
679670 sdev_printk(KERN_INFO, sdev, "Slave Configure\n");
680671
@@ -1601,7 +1592,6 @@ ahc_send_async(struct ahc_softc *ahc, char channel, · 920 unmodified lines
16011592 case AC_TRANSFER_NEG:
16021593 {
16031594 struct scsi_target *starget;
1604− struct ahc_linux_target *targ;
16051595 struct ahc_initiator_tinfo *tinfo;
16061596 struct ahc_tmode_tstate *tstate;
16071597 int target_offset;
@@ -1635,7 +1625,6 @@ ahc_send_async(struct ahc_softc *ahc, char channel, · 27 unmodified lines
16351625 starget = ahc->platform_data->starget[target_offset];
16361626 if (starget == NULL)
16371627 break;
1638− targ = scsi_transport_target_data(starget);
16391628
16401629 target_ppr_options =
16411630 (spi_dt(starget) ? MSG_EXT_PPR_DT_REQ : 0)
@@ -1722,10 +1711,12 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb) · 80 unmodified lines
17221711 */
17231712 cmd->sense_buffer[0] = 0;
17241713 if (ahc_get_transaction_status(scb) == CAM_REQ_INPROG) {
1714+#ifdef AHC_REPORT_UNDERFLOWS
17251715 uint32_t amount_xferred;
17261716
17271717 amount_xferred =
17281718 ahc_get_transfer_length(scb) - ahc_get_residual(scb);
1719+#endif
17291720 if ((scb->flags & SCB_TRANSMISSION_ERROR) != 0) {
17301721 #ifdef AHC_DEBUG
17311722 if ((ahc_debug & AHC_SHOW_MISC) != 0) {
drivers/scsi/aic94xx/aic94xx_dev.c+2−2
@@ -236,7 +236,7 @@ static int asd_init_sata_pm_table_ddb(struct domain_device *dev) · 235 unmodified lines
236236
237237 /**
238238 * asd_init_sata_pm_port_ddb -- SATA Port Multiplier Port
239− * dev: pointer to domain device
239+ * @dev: pointer to domain device
240240 *
241241 * For SATA Port Multiplier Ports we need to allocate one SATA Port
242242 * Multiplier Port DDB and depending on whether the target on it
@@ -281,7 +281,7 @@ static int asd_init_initiator_ddb(struct domain_device *dev) · 38 unmodified lines
281281
282282 /**
283283 * asd_init_sata_pm_ddb -- SATA Port Multiplier
284− * dev: pointer to domain device
284+ * @dev: pointer to domain device
285285 *
286286 * For STP and direct-attached SATA Port Multipliers we need
287287 * one target port DDB entry and one SATA PM table DDB entry.
drivers/scsi/aic94xx/aic94xx_hwi.c+1−2
@@ -575,7 +575,7 @@ static int asd_extend_cmdctx(struct asd_ha_struct *asd_ha) · 574 unmodified lines
575575
576576 /**
577577 * asd_init_ctxmem -- initialize context memory
578− * asd_ha: pointer to host adapter structure
578+ * @asd_ha: pointer to host adapter structure
579579 *
580580 * This function sets the maximum number of SCBs and
581581 * DDBs which can be used by the sequencer. This is normally
@@ -1146,7 +1146,6 @@ static void asd_swap_head_scb(struct asd_ha_struct *asd_ha, · 564 unmodified lines
11461146 /**
11471147 * asd_start_timers -- (add and) start timers of SCBs
11481148 * @list: pointer to struct list_head of the scbs
1149− * @to: timeout in jiffies
11501149 *
11511150 * If an SCB in the @list has no timer function, assign the default
11521151 * one, then start the timer of the SCB. This function is
drivers/scsi/aic94xx/aic94xx_init.c+1−1
@@ -530,7 +530,7 @@ static int asd_create_ha_caches(struct asd_ha_struct *asd_ha) · 529 unmodified lines
530530 return 0;
531531 }
532532
533−/**
533+/*
534534 * asd_free_edbs -- free empty data buffers
535535 * asd_ha: pointer to host adapter structure
536536 */
drivers/scsi/aic94xx/aic94xx_scb.c+3−3
@@ -123,8 +123,8 @@ static unsigned ord_phy(struct asd_ha_struct *asd_ha, struct asd_phy *phy) · 122 unmodified lines
123123
124124 /**
125125 * asd_get_attached_sas_addr -- extract/generate attached SAS address
126− * phy: pointer to asd_phy
127− * sas_addr: pointer to buffer where the SAS address is to be written
126+ * @phy: pointer to asd_phy
127+ * @sas_addr: pointer to buffer where the SAS address is to be written
128128 *
129129 * This function extracts the SAS address from an IDENTIFY frame
130130 * received. If OOB is SATA, then a SAS address is generated from the
@@ -847,7 +847,7 @@ void asd_build_initiate_link_adm_task(struct asd_ascb *ascb, int phy_id, · 716 unmodified lines
847847
848848 /**
849849 * asd_ascb_timedout -- called when a pending SCB's timer has expired
850− * @data: unsigned long, a pointer to the ascb in question
850+ * @t: Timer context used to fetch the SCB
851851 *
852852 * This is the default timeout function which does the most necessary.
853853 * Upper layers can implement their own timeout function, say to free
drivers/scsi/aic94xx/aic94xx_seq.c+5−1
@@ -582,6 +582,7 @@ static void asd_init_cseq_scratch(struct asd_ha_struct *asd_ha) · 581 unmodified lines
582582 /**
583583 * asd_init_lseq_mip -- initialize LSEQ Mode independent pages 0-3
584584 * @asd_ha: pointer to host adapter structure
585+ * @lseq: link sequencer
585586 */
586587 static void asd_init_lseq_mip(struct asd_ha_struct *asd_ha, u8 lseq)
587588 {
@@ -669,6 +670,7 @@ static void asd_init_lseq_mip(struct asd_ha_struct *asd_ha, u8 lseq) · 81 unmodified lines
669670 /**
670671 * asd_init_lseq_mdp -- initialize LSEQ mode dependent pages.
671672 * @asd_ha: pointer to host adapter structure
673+ * @lseq: link sequencer
672674 */
673675 static void asd_init_lseq_mdp(struct asd_ha_struct *asd_ha, int lseq)
674676 {
@@ -953,6 +955,7 @@ static void asd_init_cseq_cio(struct asd_ha_struct *asd_ha) · 278 unmodified lines
953955 /**
954956 * asd_init_lseq_cio -- initialize LmSEQ CIO registers
955957 * @asd_ha: pointer to host adapter structure
958+ * @lseq: link sequencer
956959 */
957960 static void asd_init_lseq_cio(struct asd_ha_struct *asd_ha, int lseq)
958961 {
@@ -1345,7 +1348,8 @@ int asd_start_seqs(struct asd_ha_struct *asd_ha) · 386 unmodified lines
13451348
13461349 /**
13471350 * asd_update_port_links -- update port_map_by_links and phy_is_up
1348− * @sas_phy: pointer to the phy which has been added to a port
1351+ * @asd_ha: pointer to host adapter structure
1352+ * @phy: pointer to the phy which has been added to a port
13491353 *
13501354 * 1) When a link reset has completed and we got BYTES DMAED with a
13511355 * valid frame we call this function for that phy, to indicate that
drivers/scsi/aic94xx/aic94xx_tmf.c+1−1
@@ -673,7 +673,7 @@ int asd_lu_reset(struct domain_device *dev, u8 *lun) · 672 unmodified lines
673673
674674 /**
675675 * asd_query_task -- send a QUERY TASK TMF to an I_T_L_Q nexus
676− * task: pointer to sas_task struct of interest
676+ * @task: pointer to sas_task struct of interest
677677 *
678678 * Returns: TMF_RESP_FUNC_COMPLETE if the task is not in the task set,
679679 * or TMF_RESP_FUNC_SUCC if the task is in the task set.
drivers/scsi/arcmsr/arcmsr_hba.c+5−13
@@ -283,11 +283,10 @@ static bool arcmsr_remap_pciregion(struct AdapterControlBlock *acb) · 282 unmodified lines
283283 }
284284 case ACB_ADAPTER_TYPE_D: {
285285 void __iomem *mem_base0;
286− unsigned long addr, range, flags;
286+ unsigned long addr, range;
287287
288288 addr = (unsigned long)pci_resource_start(pdev, 0);
289289 range = pci_resource_len(pdev, 0);
290− flags = pci_resource_flags(pdev, 0);
291290 mem_base0 = ioremap(addr, range);
292291 if (!mem_base0) {
293292 pr_notice("arcmsr%d: memory mapping region fail\n",
@@ -1067,12 +1066,11 @@ static void arcmsr_free_irq(struct pci_dev *pdev, · 773 unmodified lines
10671066
10681067 static int arcmsr_suspend(struct pci_dev *pdev, pm_message_t state)
10691068 {
1070− uint32_t intmask_org;
10711069 struct Scsi_Host *host = pci_get_drvdata(pdev);
10721070 struct AdapterControlBlock *acb =
10731071 (struct AdapterControlBlock *)host->hostdata;
10741072
1075− intmask_org = arcmsr_disable_outbound_ints(acb);
1073+ arcmsr_disable_outbound_ints(acb);
10761074 arcmsr_free_irq(pdev, acb);
10771075 del_timer_sync(&acb->eternal_timer);
10781076 if (set_date_time)
@@ -1407,7 +1405,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) · 328 unmodified lines
14071405 struct ARCMSR_CDB *pARCMSR_CDB;
14081406 bool error;
14091407 struct CommandControlBlock *pCCB;
1410− unsigned long ccb_cdb_phy, cdb_phy_hipart;
1408+ unsigned long ccb_cdb_phy;
14111409
14121410 switch (acb->adapter_type) {
14131411
@@ -1489,8 +1487,6 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) · 75 unmodified lines
14891487 ((toggle ^ 0x4000) + 1);
14901488 doneq_index = pmu->doneq_index;
14911489 spin_unlock_irqrestore(&acb->doneq_lock, flags);
1492− cdb_phy_hipart = pmu->done_qbuffer[doneq_index &
1493− 0xFFF].addressHigh;
14941490 addressLow = pmu->done_qbuffer[doneq_index &
14951491 0xFFF].addressLow;
14961492 ccb_cdb_phy = (addressLow & 0xFFFFFFF0);
@@ -2445,7 +2441,7 @@ static void arcmsr_hbaD_postqueue_isr(struct AdapterControlBlock *acb) · 948 unmodified lines
24452441 struct MessageUnit_D *pmu;
24462442 struct ARCMSR_CDB *arcmsr_cdb;
24472443 struct CommandControlBlock *ccb;
2448− unsigned long flags, ccb_cdb_phy, cdb_phy_hipart;
2444+ unsigned long flags, ccb_cdb_phy;
24492445
24502446 spin_lock_irqsave(&acb->doneq_lock, flags);
24512447 pmu = acb->pmuD;
@@ -2459,8 +2455,6 @@ static void arcmsr_hbaD_postqueue_isr(struct AdapterControlBlock *acb) · 7 unmodified lines
24592455 pmu->doneq_index = index_stripped ? (index_stripped | toggle) :
24602456 ((toggle ^ 0x4000) + 1);
24612457 doneq_index = pmu->doneq_index;
2462− cdb_phy_hipart = pmu->done_qbuffer[doneq_index &
2463− 0xFFF].addressHigh;
24642458 addressLow = pmu->done_qbuffer[doneq_index &
24652459 0xFFF].addressLow;
24662460 ccb_cdb_phy = (addressLow & 0xFFFFFFF0);
@@ -3495,7 +3489,7 @@ static int arcmsr_hbaD_polling_ccbdone(struct AdapterControlBlock *acb, · 1028 unmodified lines
34953489 bool error;
34963490 uint32_t poll_ccb_done = 0, poll_count = 0, flag_ccb;
34973491 int rtn, doneq_index, index_stripped, outbound_write_pointer, toggle;
3498− unsigned long flags, ccb_cdb_phy, cdb_phy_hipart;
3492+ unsigned long flags, ccb_cdb_phy;
34993493 struct ARCMSR_CDB *arcmsr_cdb;
35003494 struct CommandControlBlock *pCCB;
35013495 struct MessageUnit_D *pmu = acb->pmuD;
@@ -3527,8 +3521,6 @@ polling_hbaD_ccb_retry: · 25 unmodified lines
35273521 ((toggle ^ 0x4000) + 1);
35283522 doneq_index = pmu->doneq_index;
35293523 spin_unlock_irqrestore(&acb->doneq_lock, flags);
3530− cdb_phy_hipart = pmu->done_qbuffer[doneq_index &
3531− 0xFFF].addressHigh;
35323524 flag_ccb = pmu->done_qbuffer[doneq_index & 0xFFF].addressLow;
35333525 ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0);
35343526 if (acb->cdb_phyadd_hipart)
drivers/scsi/arm/cumana_2.c+1−1
@@ -450,7 +450,7 @@ static int cumanascsi2_probe(struct expansion_card *ec, · 449 unmodified lines
450450
451451 if (info->info.scsi.dma != NO_DMA)
452452 free_dma(info->info.scsi.dma);
453− free_irq(ec->irq, host);
453+ free_irq(ec->irq, info);
454454
455455 out_release:
456456 fas216_release(host);
drivers/scsi/arm/eesox.c+1−1
@@ -571,7 +571,7 @@ static int eesoxscsi_probe(struct expansion_card *ec, const struct ecard_id *id) · 570 unmodified lines
571571
572572 if (info->info.scsi.dma != NO_DMA)
573573 free_dma(info->info.scsi.dma);
574− free_irq(ec->irq, host);
574+ free_irq(ec->irq, info);
575575
576576 out_remove:
577577 fas216_remove(host);
drivers/scsi/arm/powertec.c+1−1
@@ -378,7 +378,7 @@ static int powertecscsi_probe(struct expansion_card *ec, · 377 unmodified lines
378378
379379 if (info->info.scsi.dma != NO_DMA)
380380 free_dma(info->info.scsi.dma);
381− free_irq(ec->irq, host);
381+ free_irq(ec->irq, info);
382382
383383 out_release:
384384 fas216_release(host);
drivers/scsi/be2iscsi/be_iscsi.c+7−4
@@ -27,6 +27,7 @@ extern struct iscsi_transport beiscsi_iscsi_transport; · 26 unmodified lines
2727
2828 /**
2929 * beiscsi_session_create - creates a new iscsi session
30+ * @ep: pointer to iscsi ep
3031 * @cmds_max: max commands supported
3132 * @qdepth: max queue depth supported
3233 * @initial_cmdsn: initial iscsi CMDSN
@@ -164,6 +165,7 @@ beiscsi_conn_create(struct iscsi_cls_session *cls_session, u32 cid) · 131 unmodified lines
164165 * @cls_session: pointer to iscsi cls session
165166 * @cls_conn: pointer to iscsi cls conn
166167 * @transport_fd: EP handle(64 bit)
168+ * @is_leading: indicate if this is the session leading connection (MCS)
167169 *
168170 * This function binds the TCP Conn with iSCSI Connection and Session.
169171 */
@@ -992,7 +994,7 @@ static void beiscsi_put_cid(struct beiscsi_hba *phba, unsigned short cid) · 822 unmodified lines
992994
993995 /**
994996 * beiscsi_free_ep - free endpoint
995− * @ep: pointer to iscsi endpoint structure
997+ * @beiscsi_ep: pointer to device endpoint struct
996998 */
997999 static void beiscsi_free_ep(struct beiscsi_endpoint *beiscsi_ep)
9981000 {
@@ -1027,9 +1029,10 @@ static void beiscsi_free_ep(struct beiscsi_endpoint *beiscsi_ep) · 28 unmodified lines
10271029
10281030 /**
10291031 * beiscsi_open_conn - Ask FW to open a TCP connection
1030− * @ep: endpoint to be used
1032+ * @ep: pointer to device endpoint struct
10311033 * @src_addr: The source IP address
10321034 * @dst_addr: The Destination IP address
1035+ * @non_blocking: blocking or non-blocking call
10331036 *
10341037 * Asks the FW to open a TCP connection
10351038 */
@@ -1123,7 +1126,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep, · 87 unmodified lines
11231126
11241127 /**
11251128 * beiscsi_ep_connect - Ask chip to create TCP Conn
1126− * @scsi_host: Pointer to scsi_host structure
1129+ * @shost: Pointer to scsi_host structure
11271130 * @dst_addr: The IP address of Target
11281131 * @non_blocking: blocking or non-blocking call
11291132 *
@@ -1228,7 +1231,7 @@ static void beiscsi_flush_cq(struct beiscsi_hba *phba) · 98 unmodified lines
12281231
12291232 /**
12301233 * beiscsi_conn_close - Invalidate and upload connection
1231− * @ep: The iscsi endpoint
1234+ * @beiscsi_ep: pointer to device endpoint struct
12321235 *
12331236 * Returns 0 on success, -1 on failure.
12341237 */
drivers/scsi/be2iscsi/be_main.c+2−2
@@ -977,7 +977,7 @@ beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context, · 976 unmodified lines
977977 * alloc_wrb_handle - To allocate a wrb handle
978978 * @phba: The hba pointer
979979 * @cid: The cid to use for allocation
980− * @pwrb_context: ptr to ptr to wrb context
980+ * @pcontext: ptr to ptr to wrb context
981981 *
982982 * This happens under session_lock until submission to chip
983983 */
@@ -1394,7 +1394,7 @@ static void hwi_complete_cmd(struct beiscsi_conn *beiscsi_conn, · 410 unmodified lines
13941394 spin_unlock_bh(&session->back_lock);
13951395 }
13961396
1397−/**
1397+/*
13981398 * ASYNC PDUs include
13991399 * a. Unsolicited NOP-In (target initiated NOP-In)
14001400 * b. ASYNC Messages
drivers/scsi/be2iscsi/be_mgmt.c+2−1
@@ -97,6 +97,7 @@ unsigned int mgmt_vendor_specific_fw_cmd(struct be_ctrl_info *ctrl, · 96 unmodified lines
9797
9898 /**
9999 * mgmt_open_connection()- Establish a TCP CXN
100+ * @phba: driver priv structure
100101 * @dst_addr: Destination Address
101102 * @beiscsi_ep: ptr to device endpoint struct
102103 * @nonemb_cmd: ptr to memory allocated for command
@@ -209,7 +210,7 @@ int mgmt_open_connection(struct beiscsi_hba *phba, · 106 unmodified lines
209210 return tag;
210211 }
211212
212−/*
213+/**
213214 * beiscsi_exec_nemb_cmd()- execute non-embedded MBX cmd
214215 * @phba: driver priv structure
215216 * @nonemb_cmd: DMA address of the MBX command to be issued
drivers/scsi/bfa/bfa_core.c+1−1
@@ -1237,7 +1237,7 @@ bfa_iocfc_disable_cb(void *bfa_arg, bfa_boolean_t compl) · 1236 unmodified lines
12371237 complete(&bfad->disable_comp);
12381238 }
12391239
1240−/**
1240+/*
12411241 * configure queue registers from firmware response
12421242 */
12431243 static void
drivers/scsi/bfa/bfa_fcpim.c+2−8
@@ -2335,9 +2335,7 @@ bfa_fcpim_lunmask_delete(struct bfa_s *bfa, u16 vf_id, wwn_t *pwwn, · 2334 unmodified lines
23352335 wwn_t rpwwn, struct scsi_lun lun)
23362336 {
23372337 struct bfa_lun_mask_s *lunm_list;
2338− struct bfa_rport_s *rp = NULL;
23392338 struct bfa_fcs_lport_s *port = NULL;
2340− struct bfa_fcs_rport_s *rp_fcs;
23412339 int i;
23422340
23432341 /* in min cfg lunm_list could be NULL but no commands should run. */
@@ -2353,12 +2351,8 @@ bfa_fcpim_lunmask_delete(struct bfa_s *bfa, u16 vf_id, wwn_t *pwwn, · 9 unmodified lines
23532351 port = bfa_fcs_lookup_port(
23542352 &((struct bfad_s *)bfa->bfad)->bfa_fcs,
23552353 vf_id, *pwwn);
2356− if (port) {
2354+ if (port)
23572355 *pwwn = port->port_cfg.pwwn;
2358− rp_fcs = bfa_fcs_lport_get_rport_by_pwwn(port, rpwwn);
2359− if (rp_fcs)
2360− rp = rp_fcs->bfa_rport;
2361− }
23622356 }
23632357
23642358 lunm_list = bfa_get_lun_mask_list(bfa);
@@ -3818,7 +3812,7 @@ bfa_iotag_attach(struct bfa_fcp_mod_s *fcp) · 1453 unmodified lines
38183812 }
38193813
38203814
3821−/**
3815+/*
38223816 * To send config req, first try to use throttle value from flash
38233817 * If 0, then use driver parameter
38243818 * We need to use min(flash_val, drv_val) because
drivers/scsi/bfa/bfa_fcs_rport.c+0−3
@@ -2240,15 +2240,12 @@ bfa_fcs_rport_process_adisc(struct bfa_fcs_rport_s *rport, · 2239 unmodified lines
22402240 struct bfa_fcxp_s *fcxp;
22412241 struct fchs_s fchs;
22422242 struct bfa_fcs_lport_s *port = rport->port;
2243− struct fc_adisc_s *adisc;
22442243
22452244 bfa_trc(port->fcs, rx_fchs->s_id);
22462245 bfa_trc(port->fcs, rx_fchs->d_id);
22472246
22482247 rport->stats.adisc_rcvd++;
22492248
2250− adisc = (struct fc_adisc_s *) (rx_fchs + 1);
2251−
22522249 /*
22532250 * Accept if the itnim for this rport is online.
22542251 * Else reject the ADISC.
drivers/scsi/bfa/bfa_ioc.c+25−32
@@ -701,7 +701,7 @@ static void · 700 unmodified lines
701701 bfa_iocpf_sm_fwcheck_entry(struct bfa_iocpf_s *iocpf)
702702 {
703703 struct bfi_ioc_image_hdr_s fwhdr;
704− u32 r32, fwstate, pgnum, pgoff, loff = 0;
704+ u32 r32, fwstate, pgnum, loff = 0;
705705 int i;
706706
707707 /*
@@ -731,7 +731,6 @@ bfa_iocpf_sm_fwcheck_entry(struct bfa_iocpf_s *iocpf) · 23 unmodified lines
731731 * Clear fwver hdr
732732 */
733733 pgnum = PSS_SMEM_PGNUM(iocpf->ioc->ioc_regs.smem_pg0, loff);
734− pgoff = PSS_SMEM_PGOFF(loff);
735734 writel(pgnum, iocpf->ioc->ioc_regs.host_page_num_fn);
736735
737736 for (i = 0; i < sizeof(struct bfi_ioc_image_hdr_s) / sizeof(u32); i++) {
@@ -1440,13 +1439,12 @@ bfa_ioc_lpu_stop(struct bfa_ioc_s *ioc) · 702 unmodified lines
14401439 void
14411440 bfa_ioc_fwver_get(struct bfa_ioc_s *ioc, struct bfi_ioc_image_hdr_s *fwhdr)
14421441 {
1443− u32 pgnum, pgoff;
1442+ u32 pgnum;
14441443 u32 loff = 0;
14451444 int i;
14461445 u32 *fwsig = (u32 *) fwhdr;
14471446
14481447 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
1449− pgoff = PSS_SMEM_PGOFF(loff);
14501448 writel(pgnum, ioc->ioc_regs.host_page_num_fn);
14511449
14521450 for (i = 0; i < (sizeof(struct bfi_ioc_image_hdr_s) / sizeof(u32));
@@ -1662,7 +1660,7 @@ bfa_status_t · 209 unmodified lines
16621660 bfa_ioc_fwsig_invalidate(struct bfa_ioc_s *ioc)
16631661 {
16641662
1665− u32 pgnum, pgoff;
1663+ u32 pgnum;
16661664 u32 loff = 0;
16671665 enum bfi_ioc_state ioc_fwstate;
16681666
@@ -1671,7 +1669,6 @@ bfa_ioc_fwsig_invalidate(struct bfa_ioc_s *ioc) · 2 unmodified lines
16711669 return BFA_STATUS_ADAPTER_ENABLED;
16721670
16731671 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
1674− pgoff = PSS_SMEM_PGOFF(loff);
16751672 writel(pgnum, ioc->ioc_regs.host_page_num_fn);
16761673 bfa_mem_write(ioc->ioc_regs.smem_page_start, loff, BFA_IOC_FW_INV_SIGN);
16771674
@@ -1863,7 +1860,7 @@ bfa_ioc_download_fw(struct bfa_ioc_s *ioc, u32 boot_type, · 185 unmodified lines
18631860 u32 boot_env)
18641861 {
18651862 u32 *fwimg;
1866− u32 pgnum, pgoff;
1863+ u32 pgnum;
18671864 u32 loff = 0;
18681865 u32 chunkno = 0;
18691866 u32 i;
@@ -1892,8 +1889,6 @@ bfa_ioc_download_fw(struct bfa_ioc_s *ioc, u32 boot_type, · 22 unmodified lines
18921889
18931890
18941891 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
1895− pgoff = PSS_SMEM_PGOFF(loff);
1896−
18971892 writel(pgnum, ioc->ioc_regs.host_page_num_fn);
18981893
18991894 for (i = 0; i < fwimg_size; i++) {
@@ -4763,11 +4758,9 @@ bfa_diag_memtest_done(void *cbarg) · 2863 unmodified lines
47634758 struct bfa_ioc_s *ioc = diag->ioc;
47644759 struct bfa_diag_memtest_result *res = diag->result;
47654760 u32 loff = BFI_BOOT_MEMTEST_RES_ADDR;
4766− u32 pgnum, pgoff, i;
4761+ u32 pgnum, i;
47674762
47684763 pgnum = PSS_SMEM_PGNUM(ioc->ioc_regs.smem_pg0, loff);
4769− pgoff = PSS_SMEM_PGOFF(loff);
4770−
47714764 writel(pgnum, ioc->ioc_regs.host_page_num_fn);
47724765
47734766 for (i = 0; i < (sizeof(struct bfa_diag_memtest_result) /
@@ -5026,7 +5019,7 @@ diag_portbeacon_comp(struct bfa_diag_s *diag) · 252 unmodified lines
50265019 /*
50275020 * Diag hmbox handler
50285021 */
5029−void
5022+static void
50305023 bfa_diag_intr(void *diagarg, struct bfi_mbmsg_s *msg)
50315024 {
50325025 struct bfa_diag_s *diag = diagarg;
@@ -6649,8 +6642,8 @@ enum bfa_flash_cmd { · 1616 unmodified lines
66496642 BFA_FLASH_READ_STATUS = 0x05, /* read status */
66506643 };
66516644
6652−/**
6653− * @brief hardware error definition
6645+/*
6646+ * Hardware error definition
66546647 */
66556648 enum bfa_flash_err {
66566649 BFA_FLASH_NOT_PRESENT = -1, /*!< flash not present */
@@ -6664,8 +6657,8 @@ enum bfa_flash_err { · 7 unmodified lines
66646657 BFA_FLASH_ERR_LEN = -9, /*!< invalid length */
66656658 };
66666659
6667−/**
6668− * @brief flash command register data structure
6660+/*
6661+ * Flash command register data structure
66696662 */
66706663 union bfa_flash_cmd_reg_u {
66716664 struct {
@@ -6688,8 +6681,8 @@ union bfa_flash_cmd_reg_u { · 16 unmodified lines
66886681 u32 i;
66896682 };
66906683
6691−/**
6692− * @brief flash device status register data structure
6684+/*
6685+ * Flash device status register data structure
66936686 */
66946687 union bfa_flash_dev_status_reg_u {
66956688 struct {
@@ -6714,8 +6707,8 @@ union bfa_flash_dev_status_reg_u { · 18 unmodified lines
67146707 u32 i;
67156708 };
67166709
6717−/**
6718− * @brief flash address register data structure
6710+/*
6711+ * Flash address register data structure
67196712 */
67206713 union bfa_flash_addr_reg_u {
67216714 struct {
@@ -6730,7 +6723,7 @@ union bfa_flash_addr_reg_u { · 8 unmodified lines
67306723 u32 i;
67316724 };
67326725
6733−/**
6726+/*
67346727 * dg flash_raw_private Flash raw private functions
67356728 */
67366729 static void
@@ -6771,7 +6764,7 @@ bfa_flash_cmd_act_check(void __iomem *pci_bar) · 34 unmodified lines
67716764 return 0;
67726765 }
67736766
6774−/**
6767+/*
67756768 * @brief
67766769 * Flush FLI data fifo.
67776770 *
@@ -6784,7 +6777,6 @@ static u32 · 6 unmodified lines
67846777 bfa_flash_fifo_flush(void __iomem *pci_bar)
67856778 {
67866779 u32 i;
6787− u32 t;
67886780 union bfa_flash_dev_status_reg_u dev_status;
67896781
67906782 dev_status.i = readl(pci_bar + FLI_DEV_STATUS_REG);
@@ -6794,7 +6786,7 @@ bfa_flash_fifo_flush(void __iomem *pci_bar) · 3 unmodified lines
67946786
67956787 /* fifo counter in terms of words */
67966788 for (i = 0; i < dev_status.r.fifo_cnt; i++)
6797− t = readl(pci_bar + FLI_RDDATA_REG);
6789+ readl(pci_bar + FLI_RDDATA_REG);
67986790
67996791 /*
68006792 * Check the device status. It may take some time.
@@ -6811,7 +6803,7 @@ bfa_flash_fifo_flush(void __iomem *pci_bar) · 10 unmodified lines
68116803 return 0;
68126804 }
68136805
6814−/**
6806+/*
68156807 * @brief
68166808 * Read flash status.
68176809 *
@@ -6856,7 +6848,7 @@ bfa_flash_status_read(void __iomem *pci_bar) · 38 unmodified lines
68566848 return ret_status;
68576849 }
68586850
6859−/**
6851+/*
68606852 * @brief
68616853 * Start flash read operation.
68626854 *
@@ -6902,7 +6894,7 @@ bfa_flash_read_start(void __iomem *pci_bar, u32 offset, u32 len, · 39 unmodified lines
69026894 return 0;
69036895 }
69046896
6905−/**
6897+/*
69066898 * @brief
69076899 * Check flash read operation.
69086900 *
@@ -6918,7 +6910,8 @@ bfa_flash_read_check(void __iomem *pci_bar) · 9 unmodified lines
69186910
69196911 return 0;
69206912 }
6921−/**
6913+
6914+/*
69226915 * @brief
69236916 * End flash read operation.
69246917 *
@@ -6944,7 +6937,7 @@ bfa_flash_read_end(void __iomem *pci_bar, u32 len, char *buf) · 19 unmodified lines
69446937 bfa_flash_fifo_flush(pci_bar);
69456938 }
69466939
6947−/**
6940+/*
69486941 * @brief
69496942 * Perform flash raw read.
69506943 *
@@ -6970,7 +6963,7 @@ bfa_raw_sem_get(void __iomem *bar) · 19 unmodified lines
69706963
69716964 }
69726965
6973−bfa_status_t
6966+static bfa_status_t
69746967 bfa_flash_sem_get(void __iomem *bar)
69756968 {
69766969 u32 n = FLASH_BLOCKING_OP_MAX;
@@ -6983,7 +6976,7 @@ bfa_flash_sem_get(void __iomem *bar) · 6 unmodified lines
69836976 return BFA_STATUS_OK;
69846977 }
69856978
6986−void
6979+static void
69876980 bfa_flash_sem_put(void __iomem *bar)
69886981 {
69896982 writel(0, (bar + FLASH_SEM_LOCK_REG));
drivers/scsi/bfa/bfa_ioc_ct.c+3−3
@@ -496,7 +496,7 @@ bfa_ioc_ct_sync_complete(struct bfa_ioc_s *ioc) · 495 unmodified lines
496496 return BFA_FALSE;
497497 }
498498
499−/**
499+/*
500500 * Called from bfa_ioc_attach() to map asic specific calls.
501501 */
502502 static void
@@ -517,7 +517,7 @@ bfa_ioc_set_ctx_hwif(struct bfa_ioc_s *ioc, struct bfa_ioc_hwif_s *hwif) · 14 unmodified lines
517517 hwif->ioc_get_alt_fwstate = bfa_ioc_ct_get_alt_ioc_fwstate;
518518 }
519519
520−/**
520+/*
521521 * Called from bfa_ioc_attach() to map asic specific calls.
522522 */
523523 void
@@ -532,7 +532,7 @@ bfa_ioc_set_ct_hwif(struct bfa_ioc_s *ioc) · 8 unmodified lines
532532 ioc->ioc_hwif = &hwif_ct;
533533 }
534534
535−/**
535+/*
536536 * Called from bfa_ioc_attach() to map asic specific calls.
537537 */
538538 void
drivers/scsi/bfa/bfa_port.c+2−2
@@ -756,7 +756,7 @@ bfa_cee_reset_stats(struct bfa_cee_s *cee, · 755 unmodified lines
756756 * @return void
757757 */
758758
759−void
759+static void
760760 bfa_cee_isr(void *cbarg, struct bfi_mbmsg_s *m)
761761 {
762762 union bfi_cee_i2h_msg_u *msg;
@@ -792,7 +792,7 @@ bfa_cee_isr(void *cbarg, struct bfi_mbmsg_s *m) · 29 unmodified lines
792792 * @return void
793793 */
794794
795−void
795+static void
796796 bfa_cee_notify(void *arg, enum bfa_ioc_event_e event)
797797 {
798798 struct bfa_cee_s *cee = (struct bfa_cee_s *) arg;
drivers/scsi/bfa/bfa_svc.c+2−2
@@ -2718,7 +2718,7 @@ bfa_fcport_sm_ddport(struct bfa_fcport_s *fcport, · 2717 unmodified lines
27182718 case BFA_FCPORT_SM_DPORTDISABLE:
27192719 case BFA_FCPORT_SM_ENABLE:
27202720 case BFA_FCPORT_SM_START:
2721− /**
2721+ /*
27222722 * Ignore event for a port that is ddport
27232723 */
27242724 break;
@@ -3839,7 +3839,7 @@ bfa_fcport_get_topology(struct bfa_s *bfa) · 1114 unmodified lines
38393839 return fcport->topology;
38403840 }
38413841
3842−/**
3842+/*
38433843 * Get config topology.
38443844 */
38453845 enum bfa_port_topology
drivers/scsi/bfa/bfad_bsg.c+111−111
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515
1616 BFA_TRC_FILE(LDRV, BSG);
1717
18−int
18+static int
1919 bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd)
2020 {
2121 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -38,7 +38,7 @@ bfad_iocmd_ioc_enable(struct bfad_s *bfad, void *cmd) · 16 unmodified lines
3838 return 0;
3939 }
4040
41−int
41+static int
4242 bfad_iocmd_ioc_disable(struct bfad_s *bfad, void *cmd)
4343 {
4444 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -146,7 +146,7 @@ bfad_iocmd_ioc_get_stats(struct bfad_s *bfad, void *cmd) · 101 unmodified lines
146146 return 0;
147147 }
148148
149−int
149+static int
150150 bfad_iocmd_ioc_get_fwstats(struct bfad_s *bfad, void *cmd,
151151 unsigned int payload_len)
152152 {
@@ -176,7 +176,7 @@ out: · 23 unmodified lines
176176 return 0;
177177 }
178178
179−int
179+static int
180180 bfad_iocmd_ioc_reset_stats(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
181181 {
182182 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -194,7 +194,7 @@ bfad_iocmd_ioc_reset_stats(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) · 11 unmodified lines
194194 return 0;
195195 }
196196
197−int
197+static int
198198 bfad_iocmd_ioc_set_name(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
199199 {
200200 struct bfa_bsg_ioc_name_s *iocmd = (struct bfa_bsg_ioc_name_s *) cmd;
@@ -208,7 +208,7 @@ bfad_iocmd_ioc_set_name(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) · 7 unmodified lines
208208 return 0;
209209 }
210210
211−int
211+static int
212212 bfad_iocmd_iocfc_get_attr(struct bfad_s *bfad, void *cmd)
213213 {
214214 struct bfa_bsg_iocfc_attr_s *iocmd = (struct bfa_bsg_iocfc_attr_s *)cmd;
@@ -219,7 +219,7 @@ bfad_iocmd_iocfc_get_attr(struct bfad_s *bfad, void *cmd) · 4 unmodified lines
219219 return 0;
220220 }
221221
222−int
222+static int
223223 bfad_iocmd_ioc_fw_sig_inv(struct bfad_s *bfad, void *cmd)
224224 {
225225 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -231,7 +231,7 @@ bfad_iocmd_ioc_fw_sig_inv(struct bfad_s *bfad, void *cmd) · 5 unmodified lines
231231 return 0;
232232 }
233233
234−int
234+static int
235235 bfad_iocmd_iocfc_set_intr(struct bfad_s *bfad, void *cmd)
236236 {
237237 struct bfa_bsg_iocfc_intr_s *iocmd = (struct bfa_bsg_iocfc_intr_s *)cmd;
@@ -244,7 +244,7 @@ bfad_iocmd_iocfc_set_intr(struct bfad_s *bfad, void *cmd) · 6 unmodified lines
244244 return 0;
245245 }
246246
247−int
247+static int
248248 bfad_iocmd_port_enable(struct bfad_s *bfad, void *cmd)
249249 {
250250 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -265,7 +265,7 @@ bfad_iocmd_port_enable(struct bfad_s *bfad, void *cmd) · 14 unmodified lines
265265 return 0;
266266 }
267267
268−int
268+static int
269269 bfad_iocmd_port_disable(struct bfad_s *bfad, void *cmd)
270270 {
271271 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -315,7 +315,7 @@ bfad_iocmd_port_get_attr(struct bfad_s *bfad, void *cmd) · 43 unmodified lines
315315 return 0;
316316 }
317317
318−int
318+static int
319319 bfad_iocmd_port_get_stats(struct bfad_s *bfad, void *cmd,
320320 unsigned int payload_len)
321321 {
@@ -349,7 +349,7 @@ out: · 27 unmodified lines
349349 return 0;
350350 }
351351
352−int
352+static int
353353 bfad_iocmd_port_reset_stats(struct bfad_s *bfad, void *cmd)
354354 {
355355 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -370,7 +370,7 @@ bfad_iocmd_port_reset_stats(struct bfad_s *bfad, void *cmd) · 14 unmodified lines
370370 return 0;
371371 }
372372
373−int
373+static int
374374 bfad_iocmd_set_port_cfg(struct bfad_s *bfad, void *iocmd, unsigned int v_cmd)
375375 {
376376 struct bfa_bsg_port_cfg_s *cmd = (struct bfa_bsg_port_cfg_s *)iocmd;
@@ -390,7 +390,7 @@ bfad_iocmd_set_port_cfg(struct bfad_s *bfad, void *iocmd, unsigned int v_cmd) · 13 unmodified lines
390390 return 0;
391391 }
392392
393−int
393+static int
394394 bfad_iocmd_port_cfg_maxfrsize(struct bfad_s *bfad, void *cmd)
395395 {
396396 struct bfa_bsg_port_cfg_maxfrsize_s *iocmd =
@@ -404,7 +404,7 @@ bfad_iocmd_port_cfg_maxfrsize(struct bfad_s *bfad, void *cmd) · 7 unmodified lines
404404 return 0;
405405 }
406406
407−int
407+static int
408408 bfad_iocmd_port_cfg_bbcr(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
409409 {
410410 struct bfa_bsg_bbcr_enable_s *iocmd =
@@ -427,7 +427,7 @@ bfad_iocmd_port_cfg_bbcr(struct bfad_s *bfad, unsigned int cmd, void *pcmd) · 16 unmodified lines
427427 return 0;
428428 }
429429
430−int
430+static int
431431 bfad_iocmd_port_get_bbcr_attr(struct bfad_s *bfad, void *pcmd)
432432 {
433433 struct bfa_bsg_bbcr_attr_s *iocmd = (struct bfa_bsg_bbcr_attr_s *) pcmd;
@@ -465,7 +465,7 @@ out: · 31 unmodified lines
465465 return 0;
466466 }
467467
468−int
468+static int
469469 bfad_iocmd_lport_get_stats(struct bfad_s *bfad, void *cmd)
470470 {
471471 struct bfa_fcs_lport_s *fcs_port;
@@ -489,7 +489,7 @@ out: · 17 unmodified lines
489489 return 0;
490490 }
491491
492−int
492+static int
493493 bfad_iocmd_lport_reset_stats(struct bfad_s *bfad, void *cmd)
494494 {
495495 struct bfa_fcs_lport_s *fcs_port;
@@ -523,7 +523,7 @@ out: · 27 unmodified lines
523523 return 0;
524524 }
525525
526−int
526+static int
527527 bfad_iocmd_lport_get_iostats(struct bfad_s *bfad, void *cmd)
528528 {
529529 struct bfa_fcs_lport_s *fcs_port;
@@ -548,7 +548,7 @@ out: · 18 unmodified lines
548548 return 0;
549549 }
550550
551−int
551+static int
552552 bfad_iocmd_lport_get_rports(struct bfad_s *bfad, void *cmd,
553553 unsigned int payload_len)
554554 {
@@ -590,7 +590,7 @@ out: · 35 unmodified lines
590590 return 0;
591591 }
592592
593−int
593+static int
594594 bfad_iocmd_rport_get_attr(struct bfad_s *bfad, void *cmd)
595595 {
596596 struct bfa_bsg_rport_attr_s *iocmd = (struct bfa_bsg_rport_attr_s *)cmd;
@@ -676,7 +676,7 @@ out: · 79 unmodified lines
676676 return 0;
677677 }
678678
679−int
679+static int
680680 bfad_iocmd_rport_get_stats(struct bfad_s *bfad, void *cmd)
681681 {
682682 struct bfa_bsg_rport_stats_s *iocmd =
@@ -717,7 +717,7 @@ out: · 34 unmodified lines
717717 return 0;
718718 }
719719
720−int
720+static int
721721 bfad_iocmd_rport_clr_stats(struct bfad_s *bfad, void *cmd)
722722 {
723723 struct bfa_bsg_rport_reset_stats_s *iocmd =
@@ -753,7 +753,7 @@ out: · 29 unmodified lines
753753 return 0;
754754 }
755755
756−int
756+static int
757757 bfad_iocmd_rport_set_speed(struct bfad_s *bfad, void *cmd)
758758 {
759759 struct bfa_bsg_rport_set_speed_s *iocmd =
@@ -789,7 +789,7 @@ out: · 29 unmodified lines
789789 return 0;
790790 }
791791
792−int
792+static int
793793 bfad_iocmd_vport_get_attr(struct bfad_s *bfad, void *cmd)
794794 {
795795 struct bfa_fcs_vport_s *fcs_vport;
@@ -812,7 +812,7 @@ out: · 16 unmodified lines
812812 return 0;
813813 }
814814
815−int
815+static int
816816 bfad_iocmd_vport_get_stats(struct bfad_s *bfad, void *cmd)
817817 {
818818 struct bfa_fcs_vport_s *fcs_vport;
@@ -840,7 +840,7 @@ out: · 21 unmodified lines
840840 return 0;
841841 }
842842
843−int
843+static int
844844 bfad_iocmd_vport_clr_stats(struct bfad_s *bfad, void *cmd)
845845 {
846846 struct bfa_fcs_vport_s *fcs_vport;
@@ -907,7 +907,7 @@ out: · 60 unmodified lines
907907 return 0;
908908 }
909909
910−int
910+static int
911911 bfad_iocmd_qos_set_bw(struct bfad_s *bfad, void *pcmd)
912912 {
913913 struct bfa_bsg_qos_bw_s *iocmd = (struct bfa_bsg_qos_bw_s *)pcmd;
@@ -920,7 +920,7 @@ bfad_iocmd_qos_set_bw(struct bfad_s *bfad, void *pcmd) · 6 unmodified lines
920920 return 0;
921921 }
922922
923−int
923+static int
924924 bfad_iocmd_ratelim(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
925925 {
926926 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -949,7 +949,7 @@ bfad_iocmd_ratelim(struct bfad_s *bfad, unsigned int cmd, void *pcmd) · 22 unmodified lines
949949 return 0;
950950 }
951951
952−int
952+static int
953953 bfad_iocmd_ratelim_speed(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
954954 {
955955 struct bfa_bsg_trl_speed_s *iocmd = (struct bfa_bsg_trl_speed_s *)pcmd;
@@ -978,7 +978,7 @@ bfad_iocmd_ratelim_speed(struct bfad_s *bfad, unsigned int cmd, void *pcmd) · 22 unmodified lines
978978 return 0;
979979 }
980980
981−int
981+static int
982982 bfad_iocmd_cfg_fcpim(struct bfad_s *bfad, void *cmd)
983983 {
984984 struct bfa_bsg_fcpim_s *iocmd = (struct bfa_bsg_fcpim_s *)cmd;
@@ -991,7 +991,7 @@ bfad_iocmd_cfg_fcpim(struct bfad_s *bfad, void *cmd) · 6 unmodified lines
991991 return 0;
992992 }
993993
994−int
994+static int
995995 bfad_iocmd_fcpim_get_modstats(struct bfad_s *bfad, void *cmd)
996996 {
997997 struct bfa_bsg_fcpim_modstats_s *iocmd =
@@ -1013,7 +1013,7 @@ bfad_iocmd_fcpim_get_modstats(struct bfad_s *bfad, void *cmd) · 15 unmodified lines
10131013 return 0;
10141014 }
10151015
1016−int
1016+static int
10171017 bfad_iocmd_fcpim_clr_modstats(struct bfad_s *bfad, void *cmd)
10181018 {
10191019 struct bfa_bsg_fcpim_modstatsclr_s *iocmd =
@@ -1035,7 +1035,7 @@ bfad_iocmd_fcpim_clr_modstats(struct bfad_s *bfad, void *cmd) · 15 unmodified lines
10351035 return 0;
10361036 }
10371037
1038−int
1038+static int
10391039 bfad_iocmd_fcpim_get_del_itn_stats(struct bfad_s *bfad, void *cmd)
10401040 {
10411041 struct bfa_bsg_fcpim_del_itn_stats_s *iocmd =
@@ -1160,7 +1160,7 @@ bfad_iocmd_itnim_get_itnstats(struct bfad_s *bfad, void *cmd) · 118 unmodified lines
11601160 return 0;
11611161 }
11621162
1163−int
1163+static int
11641164 bfad_iocmd_fcport_enable(struct bfad_s *bfad, void *cmd)
11651165 {
11661166 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -1173,7 +1173,7 @@ bfad_iocmd_fcport_enable(struct bfad_s *bfad, void *cmd) · 6 unmodified lines
11731173 return 0;
11741174 }
11751175
1176−int
1176+static int
11771177 bfad_iocmd_fcport_disable(struct bfad_s *bfad, void *cmd)
11781178 {
11791179 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -1186,7 +1186,7 @@ bfad_iocmd_fcport_disable(struct bfad_s *bfad, void *cmd) · 6 unmodified lines
11861186 return 0;
11871187 }
11881188
1189−int
1189+static int
11901190 bfad_iocmd_ioc_get_pcifn_cfg(struct bfad_s *bfad, void *cmd)
11911191 {
11921192 struct bfa_bsg_pcifn_cfg_s *iocmd = (struct bfa_bsg_pcifn_cfg_s *)cmd;
@@ -1208,7 +1208,7 @@ out: · 15 unmodified lines
12081208 return 0;
12091209 }
12101210
1211−int
1211+static int
12121212 bfad_iocmd_pcifn_create(struct bfad_s *bfad, void *cmd)
12131213 {
12141214 struct bfa_bsg_pcifn_s *iocmd = (struct bfa_bsg_pcifn_s *)cmd;
@@ -1231,7 +1231,7 @@ out: · 16 unmodified lines
12311231 return 0;
12321232 }
12331233
1234−int
1234+static int
12351235 bfad_iocmd_pcifn_delete(struct bfad_s *bfad, void *cmd)
12361236 {
12371237 struct bfa_bsg_pcifn_s *iocmd = (struct bfa_bsg_pcifn_s *)cmd;
@@ -1253,7 +1253,7 @@ out: · 15 unmodified lines
12531253 return 0;
12541254 }
12551255
1256−int
1256+static int
12571257 bfad_iocmd_pcifn_bw(struct bfad_s *bfad, void *cmd)
12581258 {
12591259 struct bfa_bsg_pcifn_s *iocmd = (struct bfa_bsg_pcifn_s *)cmd;
@@ -1277,7 +1277,7 @@ out: · 17 unmodified lines
12771277 return 0;
12781278 }
12791279
1280−int
1280+static int
12811281 bfad_iocmd_adapter_cfg_mode(struct bfad_s *bfad, void *cmd)
12821282 {
12831283 struct bfa_bsg_adapter_cfg_mode_s *iocmd =
@@ -1300,7 +1300,7 @@ out: · 16 unmodified lines
13001300 return 0;
13011301 }
13021302
1303−int
1303+static int
13041304 bfad_iocmd_port_cfg_mode(struct bfad_s *bfad, void *cmd)
13051305 {
13061306 struct bfa_bsg_port_cfg_mode_s *iocmd =
@@ -1324,7 +1324,7 @@ out: · 17 unmodified lines
13241324 return 0;
13251325 }
13261326
1327−int
1327+static int
13281328 bfad_iocmd_ablk_optrom(struct bfad_s *bfad, unsigned int cmd, void *pcmd)
13291329 {
13301330 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -1350,7 +1350,7 @@ out: · 19 unmodified lines
13501350 return 0;
13511351 }
13521352
1353−int
1353+static int
13541354 bfad_iocmd_faa_query(struct bfad_s *bfad, void *cmd)
13551355 {
13561356 struct bfa_bsg_faa_attr_s *iocmd = (struct bfa_bsg_faa_attr_s *)cmd;
@@ -1373,7 +1373,7 @@ out: · 16 unmodified lines
13731373 return 0;
13741374 }
13751375
1376−int
1376+static int
13771377 bfad_iocmd_cee_attr(struct bfad_s *bfad, void *cmd, unsigned int payload_len)
13781378 {
13791379 struct bfa_bsg_cee_attr_s *iocmd =
@@ -1409,7 +1409,7 @@ out: · 29 unmodified lines
14091409 return 0;
14101410 }
14111411
1412−int
1412+static int
14131413 bfad_iocmd_cee_get_stats(struct bfad_s *bfad, void *cmd,
14141414 unsigned int payload_len)
14151415 {
@@ -1446,7 +1446,7 @@ out: · 30 unmodified lines
14461446 return 0;
14471447 }
14481448
1449−int
1449+static int
14501450 bfad_iocmd_cee_reset_stats(struct bfad_s *bfad, void *cmd)
14511451 {
14521452 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -1460,7 +1460,7 @@ bfad_iocmd_cee_reset_stats(struct bfad_s *bfad, void *cmd) · 7 unmodified lines
14601460 return 0;
14611461 }
14621462
1463−int
1463+static int
14641464 bfad_iocmd_sfp_media(struct bfad_s *bfad, void *cmd)
14651465 {
14661466 struct bfa_bsg_sfp_media_s *iocmd = (struct bfa_bsg_sfp_media_s *)cmd;
@@ -1482,7 +1482,7 @@ out: · 15 unmodified lines
14821482 return 0;
14831483 }
14841484
1485−int
1485+static int
14861486 bfad_iocmd_sfp_speed(struct bfad_s *bfad, void *cmd)
14871487 {
14881488 struct bfa_bsg_sfp_speed_s *iocmd = (struct bfa_bsg_sfp_speed_s *)cmd;
@@ -1503,7 +1503,7 @@ out: · 14 unmodified lines
15031503 return 0;
15041504 }
15051505
1506−int
1506+static int
15071507 bfad_iocmd_flash_get_attr(struct bfad_s *bfad, void *cmd)
15081508 {
15091509 struct bfa_bsg_flash_attr_s *iocmd =
@@ -1524,7 +1524,7 @@ out: · 14 unmodified lines
15241524 return 0;
15251525 }
15261526
1527−int
1527+static int
15281528 bfad_iocmd_flash_erase_part(struct bfad_s *bfad, void *cmd)
15291529 {
15301530 struct bfa_bsg_flash_s *iocmd = (struct bfa_bsg_flash_s *)cmd;
@@ -1544,7 +1544,7 @@ out: · 13 unmodified lines
15441544 return 0;
15451545 }
15461546
1547−int
1547+static int
15481548 bfad_iocmd_flash_update_part(struct bfad_s *bfad, void *cmd,
15491549 unsigned int payload_len)
15501550 {
@@ -1576,7 +1576,7 @@ out: · 25 unmodified lines
15761576 return 0;
15771577 }
15781578
1579−int
1579+static int
15801580 bfad_iocmd_flash_read_part(struct bfad_s *bfad, void *cmd,
15811581 unsigned int payload_len)
15821582 {
@@ -1608,7 +1608,7 @@ out: · 25 unmodified lines
16081608 return 0;
16091609 }
16101610
1611−int
1611+static int
16121612 bfad_iocmd_diag_temp(struct bfad_s *bfad, void *cmd)
16131613 {
16141614 struct bfa_bsg_diag_get_temp_s *iocmd =
@@ -1630,7 +1630,7 @@ out: · 15 unmodified lines
16301630 return 0;
16311631 }
16321632
1633−int
1633+static int
16341634 bfad_iocmd_diag_memtest(struct bfad_s *bfad, void *cmd)
16351635 {
16361636 struct bfa_bsg_diag_memtest_s *iocmd =
@@ -1653,7 +1653,7 @@ out: · 16 unmodified lines
16531653 return 0;
16541654 }
16551655
1656−int
1656+static int
16571657 bfad_iocmd_diag_loopback(struct bfad_s *bfad, void *cmd)
16581658 {
16591659 struct bfa_bsg_diag_loopback_s *iocmd =
@@ -1676,7 +1676,7 @@ out: · 16 unmodified lines
16761676 return 0;
16771677 }
16781678
1679−int
1679+static int
16801680 bfad_iocmd_diag_fwping(struct bfad_s *bfad, void *cmd)
16811681 {
16821682 struct bfa_bsg_diag_fwping_s *iocmd =
@@ -1700,7 +1700,7 @@ out: · 17 unmodified lines
17001700 return 0;
17011701 }
17021702
1703−int
1703+static int
17041704 bfad_iocmd_diag_queuetest(struct bfad_s *bfad, void *cmd)
17051705 {
17061706 struct bfa_bsg_diag_qtest_s *iocmd = (struct bfa_bsg_diag_qtest_s *)cmd;
@@ -1721,7 +1721,7 @@ out: · 14 unmodified lines
17211721 return 0;
17221722 }
17231723
1724−int
1724+static int
17251725 bfad_iocmd_diag_sfp(struct bfad_s *bfad, void *cmd)
17261726 {
17271727 struct bfa_bsg_sfp_show_s *iocmd =
@@ -1744,7 +1744,7 @@ out: · 16 unmodified lines
17441744 return 0;
17451745 }
17461746
1747−int
1747+static int
17481748 bfad_iocmd_diag_led(struct bfad_s *bfad, void *cmd)
17491749 {
17501750 struct bfa_bsg_diag_led_s *iocmd = (struct bfa_bsg_diag_led_s *)cmd;
@@ -1757,7 +1757,7 @@ bfad_iocmd_diag_led(struct bfad_s *bfad, void *cmd) · 6 unmodified lines
17571757 return 0;
17581758 }
17591759
1760−int
1760+static int
17611761 bfad_iocmd_diag_beacon_lport(struct bfad_s *bfad, void *cmd)
17621762 {
17631763 struct bfa_bsg_diag_beacon_s *iocmd =
@@ -1772,7 +1772,7 @@ bfad_iocmd_diag_beacon_lport(struct bfad_s *bfad, void *cmd) · 8 unmodified lines
17721772 return 0;
17731773 }
17741774
1775−int
1775+static int
17761776 bfad_iocmd_diag_lb_stat(struct bfad_s *bfad, void *cmd)
17771777 {
17781778 struct bfa_bsg_diag_lb_stat_s *iocmd =
@@ -1787,7 +1787,7 @@ bfad_iocmd_diag_lb_stat(struct bfad_s *bfad, void *cmd) · 8 unmodified lines
17871787 return 0;
17881788 }
17891789
1790−int
1790+static int
17911791 bfad_iocmd_diag_dport_enable(struct bfad_s *bfad, void *pcmd)
17921792 {
17931793 struct bfa_bsg_dport_enable_s *iocmd =
@@ -1809,7 +1809,7 @@ bfad_iocmd_diag_dport_enable(struct bfad_s *bfad, void *pcmd) · 15 unmodified lines
18091809 return 0;
18101810 }
18111811
1812−int
1812+static int
18131813 bfad_iocmd_diag_dport_disable(struct bfad_s *bfad, void *pcmd)
18141814 {
18151815 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -1829,7 +1829,7 @@ bfad_iocmd_diag_dport_disable(struct bfad_s *bfad, void *pcmd) · 13 unmodified lines
18291829 return 0;
18301830 }
18311831
1832−int
1832+static int
18331833 bfad_iocmd_diag_dport_start(struct bfad_s *bfad, void *pcmd)
18341834 {
18351835 struct bfa_bsg_dport_enable_s *iocmd =
@@ -1854,7 +1854,7 @@ bfad_iocmd_diag_dport_start(struct bfad_s *bfad, void *pcmd) · 18 unmodified lines
18541854 return 0;
18551855 }
18561856
1857−int
1857+static int
18581858 bfad_iocmd_diag_dport_show(struct bfad_s *bfad, void *pcmd)
18591859 {
18601860 struct bfa_bsg_diag_dport_show_s *iocmd =
@@ -1869,7 +1869,7 @@ bfad_iocmd_diag_dport_show(struct bfad_s *bfad, void *pcmd) · 8 unmodified lines
18691869 }
18701870
18711871
1872−int
1872+static int
18731873 bfad_iocmd_phy_get_attr(struct bfad_s *bfad, void *cmd)
18741874 {
18751875 struct bfa_bsg_phy_attr_s *iocmd =
@@ -1890,7 +1890,7 @@ out: · 14 unmodified lines
18901890 return 0;
18911891 }
18921892
1893−int
1893+static int
18941894 bfad_iocmd_phy_get_stats(struct bfad_s *bfad, void *cmd)
18951895 {
18961896 struct bfa_bsg_phy_stats_s *iocmd =
@@ -1911,7 +1911,7 @@ out: · 14 unmodified lines
19111911 return 0;
19121912 }
19131913
1914−int
1914+static int
19151915 bfad_iocmd_phy_read(struct bfad_s *bfad, void *cmd, unsigned int payload_len)
19161916 {
19171917 struct bfa_bsg_phy_s *iocmd = (struct bfa_bsg_phy_s *)cmd;
@@ -1943,7 +1943,7 @@ out: · 25 unmodified lines
19431943 return 0;
19441944 }
19451945
1946−int
1946+static int
19471947 bfad_iocmd_vhba_query(struct bfad_s *bfad, void *cmd)
19481948 {
19491949 struct bfa_bsg_vhba_attr_s *iocmd =
@@ -1962,7 +1962,7 @@ bfad_iocmd_vhba_query(struct bfad_s *bfad, void *cmd) · 12 unmodified lines
19621962 return 0;
19631963 }
19641964
1965−int
1965+static int
19661966 bfad_iocmd_phy_update(struct bfad_s *bfad, void *cmd, unsigned int payload_len)
19671967 {
19681968 struct bfa_bsg_phy_s *iocmd = (struct bfa_bsg_phy_s *)cmd;
@@ -1992,7 +1992,7 @@ out: · 23 unmodified lines
19921992 return 0;
19931993 }
19941994
1995−int
1995+static int
19961996 bfad_iocmd_porglog_get(struct bfad_s *bfad, void *cmd)
19971997 {
19981998 struct bfa_bsg_debug_s *iocmd = (struct bfa_bsg_debug_s *)cmd;
@@ -2012,7 +2012,7 @@ out: · 13 unmodified lines
20122012 }
20132013
20142014 #define BFA_DEBUG_FW_CORE_CHUNK_SZ 0x4000U /* 16K chunks for FW dump */
2015−int
2015+static int
20162016 bfad_iocmd_debug_fw_core(struct bfad_s *bfad, void *cmd,
20172017 unsigned int payload_len)
20182018 {
@@ -2046,7 +2046,7 @@ out: · 27 unmodified lines
20462046 return 0;
20472047 }
20482048
2049−int
2049+static int
20502050 bfad_iocmd_debug_ctl(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
20512051 {
20522052 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2067,7 +2067,7 @@ bfad_iocmd_debug_ctl(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) · 14 unmodified lines
20672067 return 0;
20682068 }
20692069
2070−int
2070+static int
20712071 bfad_iocmd_porglog_ctl(struct bfad_s *bfad, void *cmd)
20722072 {
20732073 struct bfa_bsg_portlogctl_s *iocmd = (struct bfa_bsg_portlogctl_s *)cmd;
@@ -2081,7 +2081,7 @@ bfad_iocmd_porglog_ctl(struct bfad_s *bfad, void *cmd) · 7 unmodified lines
20812081 return 0;
20822082 }
20832083
2084−int
2084+static int
20852085 bfad_iocmd_fcpim_cfg_profile(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
20862086 {
20872087 struct bfa_bsg_fcpim_profile_s *iocmd =
@@ -2125,7 +2125,7 @@ bfad_iocmd_itnim_get_ioprofile(struct bfad_s *bfad, void *cmd) · 37 unmodified lines
21252125 return 0;
21262126 }
21272127
2128−int
2128+static int
21292129 bfad_iocmd_fcport_get_stats(struct bfad_s *bfad, void *cmd)
21302130 {
21312131 struct bfa_bsg_fcport_stats_s *iocmd =
@@ -2150,7 +2150,7 @@ out: · 18 unmodified lines
21502150 return 0;
21512151 }
21522152
2153−int
2153+static int
21542154 bfad_iocmd_fcport_reset_stats(struct bfad_s *bfad, void *cmd)
21552155 {
21562156 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2174,7 +2174,7 @@ out: · 17 unmodified lines
21742174 return 0;
21752175 }
21762176
2177−int
2177+static int
21782178 bfad_iocmd_boot_cfg(struct bfad_s *bfad, void *cmd)
21792179 {
21802180 struct bfa_bsg_boot_s *iocmd = (struct bfa_bsg_boot_s *)cmd;
@@ -2196,7 +2196,7 @@ out: · 15 unmodified lines
21962196 return 0;
21972197 }
21982198
2199−int
2199+static int
22002200 bfad_iocmd_boot_query(struct bfad_s *bfad, void *cmd)
22012201 {
22022202 struct bfa_bsg_boot_s *iocmd = (struct bfa_bsg_boot_s *)cmd;
@@ -2218,7 +2218,7 @@ out: · 15 unmodified lines
22182218 return 0;
22192219 }
22202220
2221−int
2221+static int
22222222 bfad_iocmd_preboot_query(struct bfad_s *bfad, void *cmd)
22232223 {
22242224 struct bfa_bsg_preboot_s *iocmd = (struct bfa_bsg_preboot_s *)cmd;
@@ -2237,7 +2237,7 @@ bfad_iocmd_preboot_query(struct bfad_s *bfad, void *cmd) · 12 unmodified lines
22372237 return 0;
22382238 }
22392239
2240−int
2240+static int
22412241 bfad_iocmd_ethboot_cfg(struct bfad_s *bfad, void *cmd)
22422242 {
22432243 struct bfa_bsg_ethboot_s *iocmd = (struct bfa_bsg_ethboot_s *)cmd;
@@ -2260,7 +2260,7 @@ out: · 16 unmodified lines
22602260 return 0;
22612261 }
22622262
2263−int
2263+static int
22642264 bfad_iocmd_ethboot_query(struct bfad_s *bfad, void *cmd)
22652265 {
22662266 struct bfa_bsg_ethboot_s *iocmd = (struct bfa_bsg_ethboot_s *)cmd;
@@ -2283,7 +2283,7 @@ out: · 16 unmodified lines
22832283 return 0;
22842284 }
22852285
2286−int
2286+static int
22872287 bfad_iocmd_cfg_trunk(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
22882288 {
22892289 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2323,7 +2323,7 @@ bfad_iocmd_cfg_trunk(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) · 33 unmodified lines
23232323 return 0;
23242324 }
23252325
2326−int
2326+static int
23272327 bfad_iocmd_trunk_get_attr(struct bfad_s *bfad, void *cmd)
23282328 {
23292329 struct bfa_bsg_trunk_attr_s *iocmd = (struct bfa_bsg_trunk_attr_s *)cmd;
@@ -2346,7 +2346,7 @@ bfad_iocmd_trunk_get_attr(struct bfad_s *bfad, void *cmd) · 16 unmodified lines
23462346 return 0;
23472347 }
23482348
2349−int
2349+static int
23502350 bfad_iocmd_qos(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
23512351 {
23522352 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2374,7 +2374,7 @@ bfad_iocmd_qos(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) · 21 unmodified lines
23742374 return 0;
23752375 }
23762376
2377−int
2377+static int
23782378 bfad_iocmd_qos_get_attr(struct bfad_s *bfad, void *cmd)
23792379 {
23802380 struct bfa_bsg_qos_attr_s *iocmd = (struct bfa_bsg_qos_attr_s *)cmd;
@@ -2400,7 +2400,7 @@ bfad_iocmd_qos_get_attr(struct bfad_s *bfad, void *cmd) · 19 unmodified lines
24002400 return 0;
24012401 }
24022402
2403−int
2403+static int
24042404 bfad_iocmd_qos_get_vc_attr(struct bfad_s *bfad, void *cmd)
24052405 {
24062406 struct bfa_bsg_qos_vc_attr_s *iocmd =
@@ -2432,7 +2432,7 @@ bfad_iocmd_qos_get_vc_attr(struct bfad_s *bfad, void *cmd) · 25 unmodified lines
24322432 return 0;
24332433 }
24342434
2435−int
2435+static int
24362436 bfad_iocmd_qos_get_stats(struct bfad_s *bfad, void *cmd)
24372437 {
24382438 struct bfa_bsg_fcport_stats_s *iocmd =
@@ -2464,7 +2464,7 @@ out: · 25 unmodified lines
24642464 return 0;
24652465 }
24662466
2467−int
2467+static int
24682468 bfad_iocmd_qos_reset_stats(struct bfad_s *bfad, void *cmd)
24692469 {
24702470 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)cmd;
@@ -2495,7 +2495,7 @@ out: · 24 unmodified lines
24952495 return 0;
24962496 }
24972497
2498−int
2498+static int
24992499 bfad_iocmd_vf_get_stats(struct bfad_s *bfad, void *cmd)
25002500 {
25012501 struct bfa_bsg_vf_stats_s *iocmd =
@@ -2518,7 +2518,7 @@ out: · 16 unmodified lines
25182518 return 0;
25192519 }
25202520
2521−int
2521+static int
25222522 bfad_iocmd_vf_clr_stats(struct bfad_s *bfad, void *cmd)
25232523 {
25242524 struct bfa_bsg_vf_reset_stats_s *iocmd =
@@ -2555,7 +2555,7 @@ bfad_iocmd_lunmask_reset_lunscan_mode(struct bfad_s *bfad, int lunmask_cfg) · 30 unmodified lines
25552555 bfad_reset_sdev_bflags(vport->drv_port.im_port, lunmask_cfg);
25562556 }
25572557
2558−int
2558+static int
25592559 bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd)
25602560 {
25612561 struct bfa_bsg_gen_s *iocmd = (struct bfa_bsg_gen_s *)pcmd;
@@ -2578,7 +2578,7 @@ bfad_iocmd_lunmask(struct bfad_s *bfad, void *pcmd, unsigned int v_cmd) · 16 unmodified lines
25782578 return 0;
25792579 }
25802580
2581−int
2581+static int
25822582 bfad_iocmd_fcpim_lunmask_query(struct bfad_s *bfad, void *cmd)
25832583 {
25842584 struct bfa_bsg_fcpim_lunmask_query_s *iocmd =
@@ -2592,7 +2592,7 @@ bfad_iocmd_fcpim_lunmask_query(struct bfad_s *bfad, void *cmd) · 7 unmodified lines
25922592 return 0;
25932593 }
25942594
2595−int
2595+static int
25962596 bfad_iocmd_fcpim_cfg_lunmask(struct bfad_s *bfad, void *cmd, unsigned int v_cmd)
25972597 {
25982598 struct bfa_bsg_fcpim_lunmask_s *iocmd =
@@ -2611,7 +2611,7 @@ bfad_iocmd_fcpim_cfg_lunmask(struct bfad_s *bfad, void *cmd, unsigned int v_cmd) · 12 unmodified lines
26112611 return 0;
26122612 }
26132613
2614−int
2614+static int
26152615 bfad_iocmd_fcpim_throttle_query(struct bfad_s *bfad, void *cmd)
26162616 {
26172617 struct bfa_bsg_fcpim_throttle_s *iocmd =
@@ -2626,7 +2626,7 @@ bfad_iocmd_fcpim_throttle_query(struct bfad_s *bfad, void *cmd) · 8 unmodified lines
26262626 return 0;
26272627 }
26282628
2629−int
2629+static int
26302630 bfad_iocmd_fcpim_throttle_set(struct bfad_s *bfad, void *cmd)
26312631 {
26322632 struct bfa_bsg_fcpim_throttle_s *iocmd =
@@ -2641,7 +2641,7 @@ bfad_iocmd_fcpim_throttle_set(struct bfad_s *bfad, void *cmd) · 8 unmodified lines
26412641 return 0;
26422642 }
26432643
2644−int
2644+static int
26452645 bfad_iocmd_tfru_read(struct bfad_s *bfad, void *cmd)
26462646 {
26472647 struct bfa_bsg_tfru_s *iocmd =
@@ -2663,7 +2663,7 @@ bfad_iocmd_tfru_read(struct bfad_s *bfad, void *cmd) · 15 unmodified lines
26632663 return 0;
26642664 }
26652665
2666−int
2666+static int
26672667 bfad_iocmd_tfru_write(struct bfad_s *bfad, void *cmd)
26682668 {
26692669 struct bfa_bsg_tfru_s *iocmd =
@@ -2685,7 +2685,7 @@ bfad_iocmd_tfru_write(struct bfad_s *bfad, void *cmd) · 15 unmodified lines
26852685 return 0;
26862686 }
26872687
2688−int
2688+static int
26892689 bfad_iocmd_fruvpd_read(struct bfad_s *bfad, void *cmd)
26902690 {
26912691 struct bfa_bsg_fruvpd_s *iocmd =
@@ -2707,7 +2707,7 @@ bfad_iocmd_fruvpd_read(struct bfad_s *bfad, void *cmd) · 15 unmodified lines
27072707 return 0;
27082708 }
27092709
2710−int
2710+static int
27112711 bfad_iocmd_fruvpd_update(struct bfad_s *bfad, void *cmd)
27122712 {
27132713 struct bfa_bsg_fruvpd_s *iocmd =
@@ -2729,7 +2729,7 @@ bfad_iocmd_fruvpd_update(struct bfad_s *bfad, void *cmd) · 15 unmodified lines
27292729 return 0;
27302730 }
27312731
2732−int
2732+static int
27332733 bfad_iocmd_fruvpd_get_max_size(struct bfad_s *bfad, void *cmd)
27342734 {
27352735 struct bfa_bsg_fruvpd_max_size_s *iocmd =
@@ -3177,7 +3177,7 @@ out: · 441 unmodified lines
31773177 }
31783178
31793179 /* FC passthru call backs */
3180−u64
3180+static u64
31813181 bfad_fcxp_get_req_sgaddr_cb(void *bfad_fcxp, int sgeid)
31823182 {
31833183 struct bfad_fcxp *drv_fcxp = bfad_fcxp;
@@ -3189,7 +3189,7 @@ bfad_fcxp_get_req_sgaddr_cb(void *bfad_fcxp, int sgeid) · 5 unmodified lines
31893189 return addr;
31903190 }
31913191
3192−u32
3192+static u32
31933193 bfad_fcxp_get_req_sglen_cb(void *bfad_fcxp, int sgeid)
31943194 {
31953195 struct bfad_fcxp *drv_fcxp = bfad_fcxp;
@@ -3199,7 +3199,7 @@ bfad_fcxp_get_req_sglen_cb(void *bfad_fcxp, int sgeid) · 3 unmodified lines
31993199 return sge->sg_len;
32003200 }
32013201
3202−u64
3202+static u64
32033203 bfad_fcxp_get_rsp_sgaddr_cb(void *bfad_fcxp, int sgeid)
32043204 {
32053205 struct bfad_fcxp *drv_fcxp = bfad_fcxp;
@@ -3211,7 +3211,7 @@ bfad_fcxp_get_rsp_sgaddr_cb(void *bfad_fcxp, int sgeid) · 5 unmodified lines
32113211 return addr;
32123212 }
32133213
3214−u32
3214+static u32
32153215 bfad_fcxp_get_rsp_sglen_cb(void *bfad_fcxp, int sgeid)
32163216 {
32173217 struct bfad_fcxp *drv_fcxp = bfad_fcxp;
@@ -3221,7 +3221,7 @@ bfad_fcxp_get_rsp_sglen_cb(void *bfad_fcxp, int sgeid) · 3 unmodified lines
32213221 return sge->sg_len;
32223222 }
32233223
3224−void
3224+static void
32253225 bfad_send_fcpt_cb(void *bfad_fcxp, struct bfa_fcxp_s *fcxp, void *cbarg,
32263226 bfa_status_t req_status, u32 rsp_len, u32 resid_len,
32273227 struct fchs_s *rsp_fchs)
@@ -3236,7 +3236,7 @@ bfad_send_fcpt_cb(void *bfad_fcxp, struct bfa_fcxp_s *fcxp, void *cbarg, · 8 unmodified lines
32363236 complete(&drv_fcxp->comp);
32373237 }
32383238
3239−struct bfad_buf_info *
3239+static struct bfad_buf_info *
32403240 bfad_fcxp_map_sg(struct bfad_s *bfad, void *payload_kbuf,
32413241 uint32_t payload_len, uint32_t *num_sgles)
32423242 {
@@ -3280,7 +3280,7 @@ out_free_mem: · 37 unmodified lines
32803280 return NULL;
32813281 }
32823282
3283−void
3283+static void
32843284 bfad_fcxp_free_mem(struct bfad_s *bfad, struct bfad_buf_info *buf_base,
32853285 uint32_t num_sgles)
32863286 {
@@ -3298,7 +3298,7 @@ bfad_fcxp_free_mem(struct bfad_s *bfad, struct bfad_buf_info *buf_base, · 11 unmodified lines
32983298 }
32993299 }
33003300
3301−int
3301+static int
33023302 bfad_fcxp_bsg_send(struct bsg_job *job, struct bfad_fcxp *drv_fcxp,
33033303 bfa_bsg_fcpt_t *bsg_fcpt)
33043304 {
@@ -3338,7 +3338,7 @@ bfad_fcxp_bsg_send(struct bsg_job *job, struct bfad_fcxp *drv_fcxp, · 33 unmodified lines
33383338 return BFA_STATUS_OK;
33393339 }
33403340
3341−int
3341+static int
33423342 bfad_im_bsg_els_ct_request(struct bsg_job *job)
33433343 {
33443344 struct bfa_bsg_data *bsg_data;
drivers/scsi/bnx2fc/bnx2fc_fcoe.c+8−10
@@ -1071,9 +1071,8 @@ static int bnx2fc_fip_recv(struct sk_buff *skb, struct net_device *dev, · 1070 unmodified lines
10711071 /**
10721072 * bnx2fc_update_src_mac - Update Ethernet MAC filters.
10731073 *
1074− * @fip: FCoE controller.
1075− * @old: Unicast MAC address to delete if the MAC is non-zero.
1076− * @new: Unicast MAC address to add.
1074+ * @lport: The local port
1075+ * @addr: Location of data to copy
10771076 *
10781077 * Remove any previously-set unicast MAC filter.
10791078 * Add secondary FCoE MAC address filter for our OUI.
@@ -1659,8 +1658,7 @@ static void __bnx2fc_destroy(struct bnx2fc_interface *interface) · 579 unmodified lines
16591658 /**
16601659 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
16611660 *
1662− * @buffer: The name of the Ethernet interface to be destroyed
1663− * @kp: The associated kernel parameter
1661+ * @netdev: The net device that the FCoE interface is on
16641662 *
16651663 * Called from sysfs.
16661664 *
@@ -2101,7 +2099,7 @@ static int __bnx2fc_disable(struct fcoe_ctlr *ctlr) · 434 unmodified lines
21012099 return 0;
21022100 }
21032101
2104−/**
2102+/*
21052103 * Deperecated: Use bnx2fc_enabled()
21062104 */
21072105 static int bnx2fc_disable(struct net_device *netdev)
@@ -2229,7 +2227,7 @@ done: · 121 unmodified lines
22292227 return 0;
22302228 }
22312229
2232−/**
2230+/*
22332231 * Deprecated: Use bnx2fc_enabled()
22342232 */
22352233 static int bnx2fc_enable(struct net_device *netdev)
@@ -2523,7 +2521,7 @@ static struct bnx2fc_hba *bnx2fc_hba_lookup(struct net_device · 287 unmodified lines
25232521 /**
25242522 * bnx2fc_ulp_exit - shuts down adapter instance and frees all resources
25252523 *
2526− * @dev cnic device handle
2524+ * @dev: cnic device handle
25272525 */
25282526 static void bnx2fc_ulp_exit(struct cnic_dev *dev)
25292527 {
@@ -2956,7 +2954,7 @@ static struct device_attribute *bnx2fc_host_attrs[] = { · 426 unmodified lines
29562954 NULL,
29572955 };
29582956
2959−/**
2957+/*
29602958 * scsi_host_template structure used while registering with SCSI-ml
29612959 */
29622960 static struct scsi_host_template bnx2fc_shost_template = {
@@ -2989,7 +2987,7 @@ static struct libfc_function_template bnx2fc_libfc_fcn_templ = { · 26 unmodified lines
29892987 .rport_event_callback = bnx2fc_rport_event_handler,
29902988 };
29912989
2992−/**
2990+/*
29932991 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface
29942992 * structure carrying callback function pointers
29952993 */
drivers/scsi/bnx2fc/bnx2fc_hwi.c+4−18
@@ -485,7 +485,7 @@ int bnx2fc_send_session_disable_req(struct fcoe_port *port, · 484 unmodified lines
485485 /**
486486 * bnx2fc_send_session_destroy_req - initiates FCoE Session destroy
487487 *
488− * @port: port structure pointer
488+ * @hba: adapter structure pointer
489489 * @tgt: bnx2fc_rport structure pointer
490490 */
491491 int bnx2fc_send_session_destroy_req(struct bnx2fc_hba *hba,
@@ -635,7 +635,6 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe) · 143 unmodified lines
635635 struct bnx2fc_cmd *io_req = NULL;
636636 struct bnx2fc_interface *interface = tgt->port->priv;
637637 struct bnx2fc_hba *hba = interface->hba;
638− int task_idx, index;
639638 int rc = 0;
640639 u64 err_warn_bit_map;
641640 u8 err_warn = 0xff;
@@ -701,15 +700,12 @@ static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe) · 59 unmodified lines
701700 BNX2FC_TGT_DBG(tgt, "buf_offsets - tx = 0x%x, rx = 0x%x\n",
702701 err_entry->data.tx_buf_off, err_entry->data.rx_buf_off);
703702
704−
705703 if (xid > hba->max_xid) {
706704 BNX2FC_TGT_DBG(tgt, "xid(0x%x) out of FW range\n",
707705 xid);
708706 goto ret_err_rqe;
709707 }
710708
711− task_idx = xid / BNX2FC_TASKS_PER_PAGE;
712− index = xid % BNX2FC_TASKS_PER_PAGE;
713709
714710 io_req = (struct bnx2fc_cmd *)hba->cmd_mgr->cmds[xid];
715711 if (!io_req)
@@ -833,8 +829,6 @@ ret_err_rqe: · 117 unmodified lines
833829 }
834830 BNX2FC_TGT_DBG(tgt, "warn = 0x%x\n", err_warn);
835831
836− task_idx = xid / BNX2FC_TASKS_PER_PAGE;
837− index = xid % BNX2FC_TASKS_PER_PAGE;
838832 io_req = (struct bnx2fc_cmd *)hba->cmd_mgr->cmds[xid];
839833 if (!io_req)
840834 goto ret_warn_rqe;
@@ -1008,7 +1002,6 @@ static bool bnx2fc_pending_work(struct bnx2fc_rport *tgt, unsigned int wqe) · 167 unmodified lines
10081002 unsigned char *rq_data = NULL;
10091003 unsigned char rq_data_buff[BNX2FC_RQ_BUF_SZ];
10101004 int task_idx, index;
1011− unsigned char *dummy;
10121005 u16 xid;
10131006 u8 num_rq;
10141007 int i;
@@ -1038,7 +1031,7 @@ static bool bnx2fc_pending_work(struct bnx2fc_rport *tgt, unsigned int wqe) · 23 unmodified lines
10381031 if (num_rq > 1) {
10391032 /* We do not need extra sense data */
10401033 for (i = 1; i < num_rq; i++)
1041− dummy = bnx2fc_get_next_rqe(tgt, 1);
1034+ bnx2fc_get_next_rqe(tgt, 1);
10421035 }
10431036
10441037 if (rq_data)
@@ -1341,8 +1334,8 @@ static void bnx2fc_init_failure(struct bnx2fc_hba *hba, u32 err_code) · 296 unmodified lines
13411334 /**
13421335 * bnx2fc_indicae_kcqe - process KCQE
13431336 *
1344− * @hba: adapter structure pointer
1345− * @kcqe: kcqe pointer
1337+ * @context: adapter structure pointer
1338+ * @kcq: kcqe pointer
13461339 * @num_cqe: Number of completion queue elements
13471340 *
13481341 * Generic KCQ event handler
@@ -1510,7 +1503,6 @@ void bnx2fc_init_seq_cleanup_task(struct bnx2fc_cmd *seq_clnp_req, · 161 unmodified lines
15101503 u64 phys_addr = (u64)orig_io_req->bd_tbl->bd_tbl_dma;
15111504 u32 orig_offset = offset;
15121505 int bd_count;
1513− int orig_task_idx, index;
15141506 int i;
15151507
15161508 memset(task, 0, sizeof(struct fcoe_task_ctx_entry));
@@ -1560,8 +1552,6 @@ void bnx2fc_init_seq_cleanup_task(struct bnx2fc_cmd *seq_clnp_req, · 43 unmodified lines
15601552 offset; /* adjusted offset */
15611553 task->txwr_only.sgl_ctx.sgl.mul_sgl.cur_sge_idx = i;
15621554 } else {
1563− orig_task_idx = orig_xid / BNX2FC_TASKS_PER_PAGE;
1564− index = orig_xid % BNX2FC_TASKS_PER_PAGE;
15651555
15661556 /* Multiple SGEs were used for this IO */
15671557 sgl = &task->rxwr_only.union_ctx.read_info.sgl_ctx.sgl;
@@ -2089,11 +2079,7 @@ static int bnx2fc_allocate_hash_table(struct bnx2fc_hba *hba) · 521 unmodified lines
20892079 pbl = hba->hash_tbl_pbl;
20902080 i = 0;
20912081 while (*pbl && *(pbl + 1)) {
2092− u32 lo;
2093− u32 hi;
2094− lo = *pbl;
20952082 ++pbl;
2096− hi = *pbl;
20972083 ++pbl;
20982084 ++i;
20992085 }
drivers/scsi/bnx2fc/bnx2fc_tgt.c+3−4
@@ -431,7 +431,7 @@ static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, · 430 unmodified lines
431431 return 0;
432432 }
433433
434−/**
434+/*
435435 * This event_callback is called after successful completion of libfc
436436 * initiated target login. bnx2fc can proceed with initiating the session
437437 * establishment.
@@ -656,9 +656,8 @@ static void bnx2fc_free_conn_id(struct bnx2fc_hba *hba, u32 conn_id) · 218 unmodified lines
656656 spin_unlock_bh(&hba->hba_lock);
657657 }
658658
659−/**
660− *bnx2fc_alloc_session_resc - Allocate qp resources for the session
661− *
659+/*
660+ * bnx2fc_alloc_session_resc - Allocate qp resources for the session
662661 */
663662 static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
664663 struct bnx2fc_rport *tgt)
drivers/scsi/bnx2i/bnx2i_hwi.c+27−26
@@ -181,7 +181,7 @@ int bnx2i_arm_cq_event_coalescing(struct bnx2i_endpoint *ep, u8 action) · 180 unmodified lines
181181
182182 /**
183183 * bnx2i_get_rq_buf - copy RQ buffer contents to driver buffer
184− * @conn: iscsi connection on which RQ event occurred
184+ * @bnx2i_conn: iscsi connection on which RQ event occurred
185185 * @ptr: driver buffer to which RQ buffer contents is to
186186 * be copied
187187 * @len: length of valid data inside RQ buf
@@ -223,7 +223,7 @@ static void bnx2i_ring_577xx_doorbell(struct bnx2i_conn *conn) · 35 unmodified lines
223223
224224 /**
225225 * bnx2i_put_rq_buf - Replenish RQ buffer, if required ring on chip doorbell
226− * @conn: iscsi connection on which event to post
226+ * @bnx2i_conn: iscsi connection on which event to post
227227 * @count: number of RQ buffer being posted to chip
228228 *
229229 * No need to ring hardware doorbell for 57710 family of devices
@@ -258,7 +258,7 @@ void bnx2i_put_rq_buf(struct bnx2i_conn *bnx2i_conn, int count) · 28 unmodified lines
258258
259259 /**
260260 * bnx2i_ring_sq_dbell - Ring SQ doorbell to wake-up the processing engine
261− * @conn: iscsi connection to which new SQ entries belong
261+ * @bnx2i_conn: iscsi connection to which new SQ entries belong
262262 * @count: number of SQ WQEs to post
263263 *
264264 * SQ DB is updated in host memory and TX Doorbell is rung for 57710 family
@@ -283,7 +283,7 @@ static void bnx2i_ring_sq_dbell(struct bnx2i_conn *bnx2i_conn, int count) · 18 unmodified lines
283283
284284 /**
285285 * bnx2i_ring_dbell_update_sq_params - update SQ driver parameters
286− * @conn: iscsi connection to which new SQ entries belong
286+ * @bnx2i_conn: iscsi connection to which new SQ entries belong
287287 * @count: number of SQ WQEs to post
288288 *
289289 * this routine will update SQ driver parameters and ring the doorbell
@@ -320,9 +320,9 @@ static void bnx2i_ring_dbell_update_sq_params(struct bnx2i_conn *bnx2i_conn, · 30 unmodified lines
320320
321321 /**
322322 * bnx2i_send_iscsi_login - post iSCSI login request MP WQE to hardware
323− * @conn: iscsi connection
324− * @cmd: driver command structure which is requesting
325− * a WQE to sent to chip for further processing
323+ * @bnx2i_conn: iscsi connection
324+ * @task: transport layer's command structure pointer which is requesting
325+ * a WQE to sent to chip for further processing
326326 *
327327 * prepare and post an iSCSI Login request WQE to CNIC firmware
328328 */
@@ -373,7 +373,7 @@ int bnx2i_send_iscsi_login(struct bnx2i_conn *bnx2i_conn, · 44 unmodified lines
373373
374374 /**
375375 * bnx2i_send_iscsi_tmf - post iSCSI task management request MP WQE to hardware
376− * @conn: iscsi connection
376+ * @bnx2i_conn: iscsi connection
377377 * @mtask: driver command structure which is requesting
378378 * a WQE to sent to chip for further processing
379379 *
@@ -447,7 +447,7 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, · 67 unmodified lines
447447
448448 /**
449449 * bnx2i_send_iscsi_text - post iSCSI text WQE to hardware
450− * @conn: iscsi connection
450+ * @bnx2i_conn: iscsi connection
451451 * @mtask: driver command structure which is requesting
452452 * a WQE to sent to chip for further processing
453453 *
@@ -495,7 +495,7 @@ int bnx2i_send_iscsi_text(struct bnx2i_conn *bnx2i_conn, · 41 unmodified lines
495495
496496 /**
497497 * bnx2i_send_iscsi_scsicmd - post iSCSI scsicmd request WQE to hardware
498− * @conn: iscsi connection
498+ * @bnx2i_conn: iscsi connection
499499 * @cmd: driver command structure which is requesting
500500 * a WQE to sent to chip for further processing
501501 *
@@ -517,9 +517,9 @@ int bnx2i_send_iscsi_scsicmd(struct bnx2i_conn *bnx2i_conn, · 15 unmodified lines
517517
518518 /**
519519 * bnx2i_send_iscsi_nopout - post iSCSI NOPOUT request WQE to hardware
520− * @conn: iscsi connection
521− * @cmd: driver command structure which is requesting
522− * a WQE to sent to chip for further processing
520+ * @bnx2i_conn: iscsi connection
521+ * @task: transport layer's command structure pointer which is
522+ * requesting a WQE to sent to chip for further processing
523523 * @datap: payload buffer pointer
524524 * @data_len: payload data length
525525 * @unsol: indicated whether nopout pdu is unsolicited pdu or
@@ -579,9 +579,9 @@ int bnx2i_send_iscsi_nopout(struct bnx2i_conn *bnx2i_conn, · 53 unmodified lines
579579
580580 /**
581581 * bnx2i_send_iscsi_logout - post iSCSI logout request WQE to hardware
582− * @conn: iscsi connection
583− * @cmd: driver command structure which is requesting
584− * a WQE to sent to chip for further processing
582+ * @bnx2i_conn: iscsi connection
583+ * @task: transport layer's command structure pointer which is
584+ * requesting a WQE to sent to chip for further processing
585585 *
586586 * prepare and post logout request WQE to CNIC firmware
587587 */
@@ -678,7 +678,8 @@ void bnx2i_update_iscsi_conn(struct iscsi_conn *conn) · 90 unmodified lines
678678
679679 /**
680680 * bnx2i_ep_ofld_timer - post iSCSI logout request WQE to hardware
681− * @data: endpoint (transport handle) structure pointer
681+ * @t: timer context used to fetch the endpoint (transport
682+ * handle) structure pointer
682683 *
683684 * routine to handle connection offload/destroy request timeout
684685 */
@@ -1662,7 +1663,7 @@ static void bnx2i_process_nopin_local_cmpl(struct iscsi_session *session, · 977 unmodified lines
16621663
16631664 /**
16641665 * bnx2i_unsol_pdu_adjust_rq - makes adjustments to RQ after unsol pdu is recvd
1665− * @conn: iscsi connection
1666+ * @bnx2i_conn: iscsi connection
16661667 *
16671668 * Firmware advances RQ producer index for every unsolicited PDU even if
16681669 * payload data length is '0'. This function makes corresponding
@@ -1885,7 +1886,9 @@ int bnx2i_percpu_io_thread(void *arg) · 216 unmodified lines
18851886
18861887 /**
18871888 * bnx2i_queue_scsi_cmd_resp - queue cmd completion to the percpu thread
1889+ * @session: iscsi session
18881890 * @bnx2i_conn: bnx2i connection
1891+ * @cqe: pointer to newly DMA'ed CQE entry for processing
18891892 *
18901893 * this function is called by generic KCQ handler to queue all pending cmd
18911894 * completion CQEs
@@ -2466,8 +2469,9 @@ static void bnx2i_process_ofld_cmpl(struct bnx2i_hba *hba, · 574 unmodified lines
24662469
24672470 /**
24682471 * bnx2i_indicate_kcqe - process iscsi conn update completion KCQE
2469− * @hba: adapter structure pointer
2470− * @update_kcqe: kcqe pointer
2472+ * @context: adapter structure pointer
2473+ * @kcqe: kcqe pointer
2474+ * @num_cqe: number of kcqes to process
24712475 *
24722476 * Generic KCQ event handler/dispatcher
24732477 */
@@ -2614,8 +2618,7 @@ static void bnx2i_cm_abort_cmpl(struct cnic_sock *cm_sk) · 140 unmodified lines
26142618
26152619 /**
26162620 * bnx2i_cm_remote_close - process received TCP FIN
2617− * @hba: adapter structure pointer
2618− * @update_kcqe: kcqe pointer
2621+ * @cm_sk: cnic sock structure pointer
26192622 *
26202623 * function callback exported via bnx2i - cnic driver interface to indicate
26212624 * async TCP events such as FIN
@@ -2631,8 +2634,7 @@ static void bnx2i_cm_remote_close(struct cnic_sock *cm_sk) · 9 unmodified lines
26312634
26322635 /**
26332636 * bnx2i_cm_remote_abort - process TCP RST and start conn cleanup
2634− * @hba: adapter structure pointer
2635− * @update_kcqe: kcqe pointer
2637+ * @cm_sk: cnic sock structure pointer
26362638 *
26372639 * function callback exported via bnx2i - cnic driver interface to
26382640 * indicate async TCP events (RST) sent by the peer.
@@ -2669,10 +2671,9 @@ static int bnx2i_send_nl_mesg(void *context, u32 msg_type, · 30 unmodified lines
26692671 }
26702672
26712673
2672−/**
2674+/*
26732675 * bnx2i_cnic_cb - global template of bnx2i - cnic driver interface structure
26742676 * carrying callback function pointers
2675− *
26762677 */
26772678 struct cnic_ulp_ops bnx2i_cnic_cb = {
26782679 .cnic_init = bnx2i_ulp_init,
drivers/scsi/bnx2i/bnx2i_init.c+1−1
@@ -73,7 +73,7 @@ DEFINE_PER_CPU(struct bnx2i_percpu_s, bnx2i_percpu); · 72 unmodified lines
7373 /**
7474 * bnx2i_identify_device - identifies NetXtreme II device type
7575 * @hba: Adapter structure pointer
76− * @cnic: Corresponding cnic device
76+ * @dev: Corresponding cnic device
7777 *
7878 * This function identifies the NX2 device type and sets appropriate
7979 * queue mailbox register access method, 5709 requires driver to
drivers/scsi/bnx2i/bnx2i_iscsi.c+9−10
@@ -228,7 +228,7 @@ static void bnx2i_setup_cmd_wqe_template(struct bnx2i_cmd *cmd) · 227 unmodified lines
228228 /**
229229 * bnx2i_bind_conn_to_iscsi_cid - bind conn structure to 'iscsi_cid'
230230 * @hba: pointer to adapter instance
231− * @conn: pointer to iscsi connection
231+ * @bnx2i_conn: pointer to iscsi connection
232232 * @iscsi_cid: iscsi context ID, range 0 - (MAX_CONN - 1)
233233 *
234234 * update iscsi cid table entry with connection pointer. This enables
@@ -463,7 +463,6 @@ static int bnx2i_alloc_bdt(struct bnx2i_hba *hba, struct iscsi_session *session, · 228 unmodified lines
463463 * bnx2i_destroy_cmd_pool - destroys iscsi command pool and release BD table
464464 * @hba: adapter instance pointer
465465 * @session: iscsi session pointer
466− * @cmd: iscsi command structure
467466 */
468467 static void bnx2i_destroy_cmd_pool(struct bnx2i_hba *hba,
469468 struct iscsi_session *session)
@@ -582,8 +581,7 @@ static void bnx2i_free_mp_bdt(struct bnx2i_hba *hba) · 112 unmodified lines
582581
583582 /**
584583 * bnx2i_drop_session - notifies iscsid of connection error.
585− * @hba: adapter instance pointer
586− * @session: iscsi session pointer
584+ * @cls_session: iscsi cls session pointer
587585 *
588586 * This notifies iscsid that there is a error, so it can initiate
589587 * recovery.
@@ -1277,7 +1275,8 @@ static int bnx2i_task_xmit(struct iscsi_task *task) · 687 unmodified lines
12771275
12781276 /**
12791277 * bnx2i_session_create - create a new iscsi session
1280− * @cmds_max: max commands supported
1278+ * @ep: pointer to iscsi endpoint
1279+ * @cmds_max: user specified maximum commands
12811280 * @qdepth: scsi queue depth to support
12821281 * @initial_cmdsn: initial iscsi CMDSN to be used for this session
12831282 *
@@ -1971,7 +1970,7 @@ static int bnx2i_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) · 687 unmodified lines
19711970
19721971 /**
19731972 * bnx2i_ep_tcp_conn_active - check EP state transition
1974− * @ep: endpoint pointer
1973+ * @bnx2i_ep: endpoint pointer
19751974 *
19761975 * check if underlying TCP connection is active
19771976 */
@@ -2014,9 +2013,9 @@ static int bnx2i_ep_tcp_conn_active(struct bnx2i_endpoint *bnx2i_ep) · 36 unmodified lines
20142013 }
20152014
20162015
2017−/*
2016+/**
20182017 * bnx2i_hw_ep_disconnect - executes TCP connection teardown process in the hw
2019− * @ep: TCP connection (bnx2i endpoint) handle
2018+ * @bnx2i_ep: TCP connection (bnx2i endpoint) handle
20202019 *
20212020 * executes TCP connection teardown process
20222021 */
@@ -2171,8 +2170,8 @@ out: · 148 unmodified lines
21712170
21722171 /**
21732172 * bnx2i_nl_set_path - ISCSI_UEVENT_PATH_UPDATE user message handler
2174− * @buf: pointer to buffer containing iscsi path message
2175− *
2173+ * @shost: scsi host pointer
2174+ * @params: pointer to buffer containing iscsi path message
21762175 */
21772176 static int bnx2i_nl_set_path(struct Scsi_Host *shost, struct iscsi_path *params)
21782177 {
drivers/scsi/bnx2i/bnx2i_sysfs.c+4−0
@@ -30,6 +30,7 @@ static inline struct bnx2i_hba *bnx2i_dev_to_hba(struct device *dev) · 29 unmodified lines
3030 /**
3131 * bnx2i_show_sq_info - return(s currently configured send queue (SQ) size
3232 * @dev: device pointer
33+ * @attr: device attribute (unused)
3334 * @buf: buffer to return current SQ size parameter
3435 *
3536 * Returns current SQ size parameter, this paramater determines the number
@@ -47,6 +48,7 @@ static ssize_t bnx2i_show_sq_info(struct device *dev, · 11 unmodified lines
4748 /**
4849 * bnx2i_set_sq_info - update send queue (SQ) size parameter
4950 * @dev: device pointer
51+ * @attr: device attribute (unused)
5052 * @buf: buffer to return current SQ size parameter
5153 * @count: parameter buffer size
5254 *
@@ -87,6 +89,7 @@ skip_config: · 34 unmodified lines
8789 /**
8890 * bnx2i_show_ccell_info - returns command cell (HQ) size
8991 * @dev: device pointer
92+ * @attr: device attribute (unused)
9093 * @buf: buffer to return current SQ size parameter
9194 *
9295 * returns per-connection TCP history queue size parameter
@@ -103,6 +106,7 @@ static ssize_t bnx2i_show_ccell_info(struct device *dev, · 10 unmodified lines
103106 /**
104107 * bnx2i_get_link_state - set command cell (HQ) size
105108 * @dev: device pointer
109+ * @attr: device attribute (unused)
106110 * @buf: buffer to return current SQ size parameter
107111 * @count: parameter buffer size
108112 *
drivers/scsi/csiostor/csio_hw.c+1−1
@@ -306,7 +306,7 @@ csio_hw_get_vpd_params(struct csio_hw *hw, struct csio_vpd *p) · 305 unmodified lines
306306 uint8_t *vpd, csum;
307307 const struct t4_vpd_hdr *v;
308308 /* To get around compilation warning from strstrip */
309− char *s;
309+ char __always_unused *s;
310310
311311 if (csio_is_valid_vpd(hw))
312312 return 0;
drivers/scsi/csiostor/csio_hw_t5.c+2−4
@@ -148,12 +148,11 @@ csio_t5_mc_read(struct csio_hw *hw, int idx, uint32_t addr, __be32 *data, · 147 unmodified lines
148148 {
149149 int i;
150150 uint32_t mc_bist_cmd_reg, mc_bist_cmd_addr_reg, mc_bist_cmd_len_reg;
151− uint32_t mc_bist_status_rdata_reg, mc_bist_data_pattern_reg;
151+ uint32_t mc_bist_data_pattern_reg;
152152
153153 mc_bist_cmd_reg = MC_REG(MC_P_BIST_CMD_A, idx);
154154 mc_bist_cmd_addr_reg = MC_REG(MC_P_BIST_CMD_ADDR_A, idx);
155155 mc_bist_cmd_len_reg = MC_REG(MC_P_BIST_CMD_LEN_A, idx);
156− mc_bist_status_rdata_reg = MC_REG(MC_P_BIST_STATUS_RDATA_A, idx);
157156 mc_bist_data_pattern_reg = MC_REG(MC_P_BIST_DATA_PATTERN_A, idx);
158157
159158 if (csio_rd_reg32(hw, mc_bist_cmd_reg) & START_BIST_F)
@@ -196,7 +195,7 @@ csio_t5_edc_read(struct csio_hw *hw, int idx, uint32_t addr, __be32 *data, · 36 unmodified lines
196195 {
197196 int i;
198197 uint32_t edc_bist_cmd_reg, edc_bist_cmd_addr_reg, edc_bist_cmd_len_reg;
199− uint32_t edc_bist_cmd_data_pattern, edc_bist_status_rdata_reg;
198+ uint32_t edc_bist_cmd_data_pattern;
200199
201200 /*
202201 * These macro are missing in t4_regs.h file.
@@ -208,7 +207,6 @@ csio_t5_edc_read(struct csio_hw *hw, int idx, uint32_t addr, __be32 *data, · 5 unmodified lines
208207 edc_bist_cmd_addr_reg = EDC_REG_T5(EDC_H_BIST_CMD_ADDR_A, idx);
209208 edc_bist_cmd_len_reg = EDC_REG_T5(EDC_H_BIST_CMD_LEN_A, idx);
210209 edc_bist_cmd_data_pattern = EDC_REG_T5(EDC_H_BIST_DATA_PATTERN_A, idx);
211− edc_bist_status_rdata_reg = EDC_REG_T5(EDC_H_BIST_STATUS_RDATA_A, idx);
212210 #undef EDC_REG_T5
213211 #undef EDC_STRIDE_T5
214212
drivers/scsi/csiostor/csio_init.c+1−1
@@ -582,7 +582,7 @@ csio_hw_free(struct csio_hw *hw) · 581 unmodified lines
582582 * @hw: The HW module.
583583 * @dev: The device associated with this invocation.
584584 * @probe: Called from probe context or not?
585− * @os_pln: Parent lnode if any.
585+ * @pln: Parent lnode if any.
586586 *
587587 * Allocates lnode structure via scsi_host_alloc, initializes
588588 * shost, initializes lnode module and registers with SCSI ML
drivers/scsi/csiostor/csio_lnode.c+1−2
@@ -2068,10 +2068,9 @@ csio_ln_exit(struct csio_lnode *ln) · 2067 unmodified lines
20682068 ln->fcfinfo = NULL;
20692069 }
20702070
2071−/**
2071+/*
20722072 * csio_lnode_init - Initialize the members of an lnode.
20732073 * @ln: lnode
2074− *
20752074 */
20762075 int
20772076 csio_lnode_init(struct csio_lnode *ln, struct csio_hw *hw,
drivers/scsi/csiostor/csio_rnode.c+1−1
@@ -862,7 +862,7 @@ csio_rnode_devloss_handler(struct csio_rnode *rn) · 861 unmodified lines
862862 /**
863863 * csio_rnode_fwevt_handler - Event handler for firmware rnode events.
864864 * @rn: rnode
865− *
865+ * @fwevt: firmware event to handle
866866 */
867867 void
868868 csio_rnode_fwevt_handler(struct csio_rnode *rn, uint8_t fwevt)
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c+7−10
@@ -361,7 +361,7 @@ static inline void make_tx_data_wr(struct cxgbi_sock *csk, struct sk_buff *skb, · 360 unmodified lines
361361 /* len includes the length of any HW ULP additions */
362362 req->len = htonl(len);
363363 /* V_TX_ULP_SUBMODE sets both the mode and submode */
364− req->flags = htonl(V_TX_ULP_SUBMODE(cxgbi_skcb_ulp_mode(skb)) |
364+ req->flags = htonl(V_TX_ULP_SUBMODE(cxgbi_skcb_tx_ulp_mode(skb)) |
365365 V_TX_SHOVE((skb_peek(&csk->write_queue) ? 0 : 1)));
366366 req->sndseq = htonl(csk->snd_nxt);
367367 req->param = htonl(V_TX_PORT(l2t->smt_idx));
@@ -375,10 +375,8 @@ static inline void make_tx_data_wr(struct cxgbi_sock *csk, struct sk_buff *skb, · 7 unmodified lines
375375 }
376376 }
377377
378−/**
378+/*
379379 * push_tx_frames -- start transmit
380− * @c3cn: the offloaded connection
381− * @req_completion: request wr_ack or not
382380 *
383381 * Prepends TX_DATA_WR or CPL_CLOSE_CON_REQ headers to buffers waiting in a
384382 * connection's send queue and sends them on to T3. Must be called with the
@@ -442,7 +440,7 @@ static int push_tx_frames(struct cxgbi_sock *csk, int req_completion) · 57 unmodified lines
442440 req_completion = 1;
443441 csk->wr_una_cred = 0;
444442 }
445− len += cxgbi_ulp_extra_len(cxgbi_skcb_ulp_mode(skb));
443+ len += cxgbi_ulp_extra_len(cxgbi_skcb_tx_ulp_mode(skb));
446444 make_tx_data_wr(csk, skb, len, req_completion);
447445 csk->snd_nxt += len;
448446 cxgbi_skcb_clear_flag(skb, SKCBF_TX_NEED_HDR);
@@ -886,11 +884,6 @@ free_cpl_skbs: · 437 unmodified lines
886884 return -ENOMEM;
887885 }
888886
889−/**
890− * release_offload_resources - release offload resource
891− * @c3cn: the offloaded iscsi tcp connection.
892− * Release resources held by an offload connection (TID, L2T entry, etc.)
893− */
894887 static void l2t_put(struct cxgbi_sock *csk)
895888 {
896889 struct t3cdev *t3dev = (struct t3cdev *)csk->cdev->lldev;
@@ -902,6 +895,10 @@ static void l2t_put(struct cxgbi_sock *csk) · 5 unmodified lines
902895 }
903896 }
904897
898+/*
899+ * release_offload_resources - release offload resource
900+ * Release resources held by an offload connection (TID, L2T entry, etc.)
901+ */
905902 static void release_offload_resources(struct cxgbi_sock *csk)
906903 {
907904 struct t3cdev *t3dev = (struct t3cdev *)csk->cdev->lldev;
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c+184−58
@@ -197,7 +197,10 @@ static inline bool is_ofld_imm(const struct sk_buff *skb) · 196 unmodified lines
197197 if (likely(cxgbi_skcb_test_flag(skb, SKCBF_TX_NEED_HDR)))
198198 len += sizeof(struct fw_ofld_tx_data_wr);
199199
200− return len <= MAX_IMM_TX_PKT_LEN;
200+ if (likely(cxgbi_skcb_test_flag((struct sk_buff *)skb, SKCBF_TX_ISO)))
201+ len += sizeof(struct cpl_tx_data_iso);
202+
203+ return (len <= MAX_IMM_OFLD_TX_DATA_WR_LEN);
201204 }
202205
203206 static void send_act_open_req(struct cxgbi_sock *csk, struct sk_buff *skb,
@@ -641,7 +644,10 @@ static inline int send_tx_flowc_wr(struct cxgbi_sock *csk) · 437 unmodified lines
641644 flowc->mnemval[8].mnemonic = 0;
642645 flowc->mnemval[8].val = 0;
643646 flowc->mnemval[8].mnemonic = FW_FLOWC_MNEM_TXDATAPLEN_MAX;
644− flowc->mnemval[8].val = 16384;
647+ if (csk->cdev->skb_iso_txhdr)
648+ flowc->mnemval[8].val = cpu_to_be32(CXGBI_MAX_ISO_DATA_IN_SKB);
649+ else
650+ flowc->mnemval[8].val = cpu_to_be32(16128);
645651 #ifdef CONFIG_CHELSIO_T4_DCB
646652 flowc->mnemval[9].mnemonic = FW_FLOWC_MNEM_DCBPRIO;
647653 if (vlan == CPL_L2T_VLAN_NONE) {
@@ -667,38 +673,86 @@ static inline int send_tx_flowc_wr(struct cxgbi_sock *csk) · 19 unmodified lines
667673 return flowclen16;
668674 }
669675
670−static inline void make_tx_data_wr(struct cxgbi_sock *csk, struct sk_buff *skb,
671− int dlen, int len, u32 credits, int compl)
676+static void
677+cxgb4i_make_tx_iso_cpl(struct sk_buff *skb, struct cpl_tx_data_iso *cpl)
678+{
679+ struct cxgbi_iso_info *info = (struct cxgbi_iso_info *)skb->head;
680+ u32 imm_en = !!(info->flags & CXGBI_ISO_INFO_IMM_ENABLE);
681+ u32 fslice = !!(info->flags & CXGBI_ISO_INFO_FSLICE);
682+ u32 lslice = !!(info->flags & CXGBI_ISO_INFO_LSLICE);
683+ u32 pdu_type = (info->op == ISCSI_OP_SCSI_CMD) ? 0 : 1;
684+ u32 submode = cxgbi_skcb_tx_ulp_mode(skb) & 0x3;
685+
686+ cpl->op_to_scsi = cpu_to_be32(CPL_TX_DATA_ISO_OP_V(CPL_TX_DATA_ISO) |
687+ CPL_TX_DATA_ISO_FIRST_V(fslice) |
688+ CPL_TX_DATA_ISO_LAST_V(lslice) |
689+ CPL_TX_DATA_ISO_CPLHDRLEN_V(0) |
690+ CPL_TX_DATA_ISO_HDRCRC_V(submode & 1) |
691+ CPL_TX_DATA_ISO_PLDCRC_V(((submode >> 1) & 1)) |
692+ CPL_TX_DATA_ISO_IMMEDIATE_V(imm_en) |
693+ CPL_TX_DATA_ISO_SCSI_V(pdu_type));
694+
695+ cpl->ahs_len = info->ahs;
696+ cpl->mpdu = cpu_to_be16(DIV_ROUND_UP(info->mpdu, 4));
697+ cpl->burst_size = cpu_to_be32(info->burst_size);
698+ cpl->len = cpu_to_be32(info->len);
699+ cpl->reserved2_seglen_offset =
700+ cpu_to_be32(CPL_TX_DATA_ISO_SEGLEN_OFFSET_V(info->segment_offset));
701+ cpl->datasn_offset = cpu_to_be32(info->datasn_offset);
702+ cpl->buffer_offset = cpu_to_be32(info->buffer_offset);
703+ cpl->reserved3 = cpu_to_be32(0);
704+ log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
705+ "iso: flags 0x%x, op %u, ahs %u, num_pdu %u, mpdu %u, "
706+ "burst_size %u, iso_len %u\n",
707+ info->flags, info->op, info->ahs, info->num_pdu,
708+ info->mpdu, info->burst_size << 2, info->len);
709+}
710+
711+static void
712+cxgb4i_make_tx_data_wr(struct cxgbi_sock *csk, struct sk_buff *skb, int dlen,
713+ int len, u32 credits, int compl)
672714 {
715+ struct cxgbi_device *cdev = csk->cdev;
716+ struct cxgb4_lld_info *lldi = cxgbi_cdev_priv(cdev);
673717 struct fw_ofld_tx_data_wr *req;
674− unsigned int submode = cxgbi_skcb_ulp_mode(skb) & 3;
675− unsigned int wr_ulp_mode = 0, val;
676− bool imm = is_ofld_imm(skb);
677−
678− req = __skb_push(skb, sizeof(*req));
679−
680− if (imm) {
681− req->op_to_immdlen = htonl(FW_WR_OP_V(FW_OFLD_TX_DATA_WR) |
682− FW_WR_COMPL_F |
683− FW_WR_IMMDLEN_V(dlen));
684− req->flowid_len16 = htonl(FW_WR_FLOWID_V(csk->tid) |
685− FW_WR_LEN16_V(credits));
686− } else {
687− req->op_to_immdlen =
688− cpu_to_be32(FW_WR_OP_V(FW_OFLD_TX_DATA_WR) |
689− FW_WR_COMPL_F |
690− FW_WR_IMMDLEN_V(0));
691− req->flowid_len16 =
692− cpu_to_be32(FW_WR_FLOWID_V(csk->tid) |
693− FW_WR_LEN16_V(credits));
718+ struct cpl_tx_data_iso *cpl;
719+ u32 submode = cxgbi_skcb_tx_ulp_mode(skb) & 0x3;
720+ u32 wr_ulp_mode = 0;
721+ u32 hdr_size = sizeof(*req);
722+ u32 opcode = FW_OFLD_TX_DATA_WR;
723+ u32 immlen = 0;
724+ u32 force = is_t5(lldi->adapter_type) ? TX_FORCE_V(!submode) :
725+ T6_TX_FORCE_F;
726+
727+ if (cxgbi_skcb_test_flag(skb, SKCBF_TX_ISO)) {
728+ hdr_size += sizeof(struct cpl_tx_data_iso);
729+ opcode = FW_ISCSI_TX_DATA_WR;
730+ immlen += sizeof(struct cpl_tx_data_iso);
731+ submode |= 8;
694732 }
733+
734+ if (is_ofld_imm(skb))
735+ immlen += dlen;
736+
737+ req = (struct fw_ofld_tx_data_wr *)__skb_push(skb, hdr_size);
738+ req->op_to_immdlen = cpu_to_be32(FW_WR_OP_V(opcode) |
739+ FW_WR_COMPL_V(compl) |
740+ FW_WR_IMMDLEN_V(immlen));
741+ req->flowid_len16 = cpu_to_be32(FW_WR_FLOWID_V(csk->tid) |
742+ FW_WR_LEN16_V(credits));
743+ req->plen = cpu_to_be32(len);
744+ cpl = (struct cpl_tx_data_iso *)(req + 1);
745+
746+ if (likely(cxgbi_skcb_test_flag(skb, SKCBF_TX_ISO)))
747+ cxgb4i_make_tx_iso_cpl(skb, cpl);
748+
695749 if (submode)
696750 wr_ulp_mode = FW_OFLD_TX_DATA_WR_ULPMODE_V(ULP2_MODE_ISCSI) |
697− FW_OFLD_TX_DATA_WR_ULPSUBMODE_V(submode);
698− val = skb_peek(&csk->write_queue) ? 0 : 1;
699− req->tunnel_to_proxy = htonl(wr_ulp_mode |
700− FW_OFLD_TX_DATA_WR_SHOVE_V(val));
701− req->plen = htonl(len);
751+ FW_OFLD_TX_DATA_WR_ULPSUBMODE_V(submode);
752+
753+ req->tunnel_to_proxy = cpu_to_be32(wr_ulp_mode | force |
754+ FW_OFLD_TX_DATA_WR_SHOVE_V(1U));
755+
702756 if (!cxgbi_sock_flag(csk, CTPF_TX_DATA_SENT))
703757 cxgbi_sock_set_flag(csk, CTPF_TX_DATA_SENT);
704758 }
@@ -716,30 +770,34 @@ static int push_tx_frames(struct cxgbi_sock *csk, int req_completion) · 11 unmodified lines
716770 if (unlikely(csk->state < CTP_ESTABLISHED ||
717771 csk->state == CTP_CLOSE_WAIT_1 || csk->state >= CTP_ABORTING)) {
718772 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK |
719− 1 << CXGBI_DBG_PDU_TX,
720− "csk 0x%p,%u,0x%lx,%u, in closing state.\n",
721− csk, csk->state, csk->flags, csk->tid);
773+ 1 << CXGBI_DBG_PDU_TX,
774+ "csk 0x%p,%u,0x%lx,%u, in closing state.\n",
775+ csk, csk->state, csk->flags, csk->tid);
722776 return 0;
723777 }
724778
725− while (csk->wr_cred && (skb = skb_peek(&csk->write_queue)) != NULL) {
726− int dlen = skb->len;
727− int len = skb->len;
728− unsigned int credits_needed;
729− int flowclen16 = 0;
779+ while (csk->wr_cred && ((skb = skb_peek(&csk->write_queue)) != NULL)) {
780+ struct cxgbi_iso_info *iso_cpl;
781+ u32 dlen = skb->len;
782+ u32 len = skb->len;
783+ u32 iso_cpl_len = 0;
784+ u32 flowclen16 = 0;
785+ u32 credits_needed;
786+ u32 num_pdu = 1, hdr_len;
787+
788+ if (cxgbi_skcb_test_flag(skb, SKCBF_TX_ISO))
789+ iso_cpl_len = sizeof(struct cpl_tx_data_iso);
730790
731− skb_reset_transport_header(skb);
732791 if (is_ofld_imm(skb))
733− credits_needed = DIV_ROUND_UP(dlen, 16);
792+ credits_needed = DIV_ROUND_UP(dlen + iso_cpl_len, 16);
734793 else
735− credits_needed = DIV_ROUND_UP(
736− 8 * calc_tx_flits_ofld(skb),
737− 16);
794+ credits_needed =
795+ DIV_ROUND_UP((8 * calc_tx_flits_ofld(skb)) +
796+ iso_cpl_len, 16);
738797
739798 if (likely(cxgbi_skcb_test_flag(skb, SKCBF_TX_NEED_HDR)))
740− credits_needed += DIV_ROUND_UP(
741− sizeof(struct fw_ofld_tx_data_wr),
742− 16);
799+ credits_needed +=
800+ DIV_ROUND_UP(sizeof(struct fw_ofld_tx_data_wr), 16);
743801
744802 /*
745803 * Assumes the initial credits is large enough to support
@@ -754,14 +812,19 @@ static int push_tx_frames(struct cxgbi_sock *csk, int req_completion) · 8 unmodified lines
754812
755813 if (csk->wr_cred < credits_needed) {
756814 log_debug(1 << CXGBI_DBG_PDU_TX,
757− "csk 0x%p, skb %u/%u, wr %d < %u.\n",
758− csk, skb->len, skb->data_len,
759− credits_needed, csk->wr_cred);
815+ "csk 0x%p, skb %u/%u, wr %d < %u.\n",
816+ csk, skb->len, skb->data_len,
817+ credits_needed, csk->wr_cred);
818+
819+ csk->no_tx_credits++;
760820 break;
761821 }
822+
823+ csk->no_tx_credits = 0;
824+
762825 __skb_unlink(skb, &csk->write_queue);
763826 set_wr_txq(skb, CPL_PRIORITY_DATA, csk->port_id);
764− skb->csum = credits_needed + flowclen16;
827+ skb->csum = (__force __wsum)(credits_needed + flowclen16);
765828 csk->wr_cred -= credits_needed;
766829 csk->wr_una_cred += credits_needed;
767830 cxgbi_sock_enqueue_wr(csk, skb);
@@ -771,25 +834,42 @@ static int push_tx_frames(struct cxgbi_sock *csk, int req_completion) · 3 unmodified lines
771834 csk, skb->len, skb->data_len, credits_needed,
772835 csk->wr_cred, csk->wr_una_cred);
773836
837+ if (!req_completion &&
838+ ((csk->wr_una_cred >= (csk->wr_max_cred / 2)) ||
839+ after(csk->write_seq, (csk->snd_una + csk->snd_win / 2))))
840+ req_completion = 1;
841+
774842 if (likely(cxgbi_skcb_test_flag(skb, SKCBF_TX_NEED_HDR))) {
775− len += cxgbi_ulp_extra_len(cxgbi_skcb_ulp_mode(skb));
776− make_tx_data_wr(csk, skb, dlen, len, credits_needed,
777− req_completion);
843+ u32 ulp_mode = cxgbi_skcb_tx_ulp_mode(skb);
844+
845+ if (cxgbi_skcb_test_flag(skb, SKCBF_TX_ISO)) {
846+ iso_cpl = (struct cxgbi_iso_info *)skb->head;
847+ num_pdu = iso_cpl->num_pdu;
848+ hdr_len = cxgbi_skcb_tx_iscsi_hdrlen(skb);
849+ len += (cxgbi_ulp_extra_len(ulp_mode) * num_pdu) +
850+ (hdr_len * (num_pdu - 1));
851+ } else {
852+ len += cxgbi_ulp_extra_len(ulp_mode);
853+ }
854+
855+ cxgb4i_make_tx_data_wr(csk, skb, dlen, len,
856+ credits_needed, req_completion);
778857 csk->snd_nxt += len;
779858 cxgbi_skcb_clear_flag(skb, SKCBF_TX_NEED_HDR);
780859 } else if (cxgbi_skcb_test_flag(skb, SKCBF_TX_FLAG_COMPL) &&
781860 (csk->wr_una_cred >= (csk->wr_max_cred / 2))) {
782861 struct cpl_close_con_req *req =
783862 (struct cpl_close_con_req *)skb->data;
784− req->wr.wr_hi |= htonl(FW_WR_COMPL_F);
863+
864+ req->wr.wr_hi |= cpu_to_be32(FW_WR_COMPL_F);
785865 }
866+
786867 total_size += skb->truesize;
787868 t4_set_arp_err_handler(skb, csk, arp_failure_skb_discard);
788869
789870 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_PDU_TX,
790− "csk 0x%p,%u,0x%lx,%u, skb 0x%p, %u.\n",
791− csk, csk->state, csk->flags, csk->tid, skb, len);
792−
871+ "csk 0x%p,%u,0x%lx,%u, skb 0x%p, %u.\n",
872+ csk, csk->state, csk->flags, csk->tid, skb, len);
793873 cxgb4_l2t_send(csk->cdev->ports[csk->port_id], skb, csk->l2t);
794874 }
795875 return total_size;
@@ -2111,10 +2191,30 @@ static int cxgb4i_ddp_init(struct cxgbi_device *cdev) · 1315 unmodified lines
21112191 return 0;
21122192 }
21132193
2194+static bool is_memfree(struct adapter *adap)
2195+{
2196+ u32 io;
2197+
2198+ io = t4_read_reg(adap, MA_TARGET_MEM_ENABLE_A);
2199+ if (is_t5(adap->params.chip)) {
2200+ if ((io & EXT_MEM0_ENABLE_F) || (io & EXT_MEM1_ENABLE_F))
2201+ return false;
2202+ } else if (io & EXT_MEM_ENABLE_F) {
2203+ return false;
2204+ }
2205+
2206+ return true;
2207+}
2208+
21142209 static void *t4_uld_add(const struct cxgb4_lld_info *lldi)
21152210 {
21162211 struct cxgbi_device *cdev;
21172212 struct port_info *pi;
2213+ struct net_device *ndev;
2214+ struct adapter *adap;
2215+ struct tid_info *t;
2216+ u32 max_cmds = CXGB4I_SCSI_HOST_QDEPTH;
2217+ u32 max_conn = CXGBI_MAX_CONN;
21182218 int i, rc;
21192219
21202220 cdev = cxgbi_device_register(sizeof(*lldi), lldi->nports);
@@ -2154,14 +2254,40 @@ static void *t4_uld_add(const struct cxgb4_lld_info *lldi) · 33 unmodified lines
21542254 pr_info("t4 0x%p ddp init failed %d.\n", cdev, rc);
21552255 goto err_out;
21562256 }
2257+
2258+ ndev = cdev->ports[0];
2259+ adap = netdev2adap(ndev);
2260+ if (adap) {
2261+ t = &adap->tids;
2262+ if (t->ntids <= CXGBI_MAX_CONN)
2263+ max_conn = t->ntids;
2264+
2265+ if (is_memfree(adap)) {
2266+ cdev->flags |= CXGBI_FLAG_DEV_ISO_OFF;
2267+ max_cmds = CXGB4I_SCSI_HOST_QDEPTH >> 2;
2268+
2269+ pr_info("%s: 0x%p, tid %u, SO adapter.\n",
2270+ ndev->name, cdev, t->ntids);
2271+ }
2272+ } else {
2273+ pr_info("%s, 0x%p, NO adapter struct.\n", ndev->name, cdev);
2274+ }
2275+
2276+ /* ISO is enabled in T5/T6 firmware version >= 1.13.43.0 */
2277+ if (!is_t4(lldi->adapter_type) &&
2278+ (lldi->fw_vers >= 0x10d2b00) &&
2279+ !(cdev->flags & CXGBI_FLAG_DEV_ISO_OFF))
2280+ cdev->skb_iso_txhdr = sizeof(struct cpl_tx_data_iso);
2281+
21572282 rc = cxgb4i_ofld_init(cdev);
21582283 if (rc) {
21592284 pr_info("t4 0x%p ofld init failed.\n", cdev);
21602285 goto err_out;
21612286 }
21622287
2163− rc = cxgbi_hbas_add(cdev, CXGB4I_MAX_LUN, CXGBI_MAX_CONN,
2164− &cxgb4i_host_template, cxgb4i_stt);
2288+ cxgb4i_host_template.can_queue = max_cmds;
2289+ rc = cxgbi_hbas_add(cdev, CXGB4I_MAX_LUN, max_conn,
2290+ &cxgb4i_host_template, cxgb4i_stt);
21652291 if (rc)
21662292 goto err_out;
21672293
drivers/scsi/cxgbi/libcxgbi.c+502−170
@@ -359,13 +359,15 @@ int cxgbi_hbas_add(struct cxgbi_device *cdev, u64 max_lun, · 358 unmodified lines
359359 shost->max_lun = max_lun;
360360 shost->max_id = max_id;
361361 shost->max_channel = 0;
362− shost->max_cmd_len = 16;
362+ shost->max_cmd_len = SCSI_MAX_VARLEN_CDB_SIZE;
363363
364364 chba = iscsi_host_priv(shost);
365365 chba->cdev = cdev;
366366 chba->ndev = cdev->ports[i];
367367 chba->shost = shost;
368368
369+ shost->can_queue = sht->can_queue - ISCSI_MGMT_CMDS_MAX;
370+
369371 log_debug(1 << CXGBI_DBG_DEV,
370372 "cdev 0x%p, p#%d %s: chba 0x%p.\n",
371373 cdev, i, cdev->ports[i]->name, chba);
@@ -1136,82 +1138,6 @@ void cxgbi_sock_check_wr_invariants(const struct cxgbi_sock *csk) · 764 unmodified lines
11361138 }
11371139 EXPORT_SYMBOL_GPL(cxgbi_sock_check_wr_invariants);
11381140
1139−static int cxgbi_sock_send_pdus(struct cxgbi_sock *csk, struct sk_buff *skb)
1140−{
1141− struct cxgbi_device *cdev = csk->cdev;
1142− struct sk_buff *next;
1143− int err, copied = 0;
1144−
1145− spin_lock_bh(&csk->lock);
1146−
1147− if (csk->state != CTP_ESTABLISHED) {
1148− log_debug(1 << CXGBI_DBG_PDU_TX,
1149− "csk 0x%p,%u,0x%lx,%u, EAGAIN.\n",
1150− csk, csk->state, csk->flags, csk->tid);
1151− err = -EAGAIN;
1152− goto out_err;
1153− }
1154−
1155− if (csk->err) {
1156− log_debug(1 << CXGBI_DBG_PDU_TX,
1157− "csk 0x%p,%u,0x%lx,%u, EPIPE %d.\n",
1158− csk, csk->state, csk->flags, csk->tid, csk->err);
1159− err = -EPIPE;
1160− goto out_err;
1161− }
1162−
1163− if (csk->write_seq - csk->snd_una >= csk->snd_win) {
1164− log_debug(1 << CXGBI_DBG_PDU_TX,
1165− "csk 0x%p,%u,0x%lx,%u, FULL %u-%u >= %u.\n",
1166− csk, csk->state, csk->flags, csk->tid, csk->write_seq,
1167− csk->snd_una, csk->snd_win);
1168− err = -ENOBUFS;
1169− goto out_err;
1170− }
1171−
1172− while (skb) {
1173− int frags = skb_shinfo(skb)->nr_frags +
1174− (skb->len != skb->data_len);
1175−
1176− if (unlikely(skb_headroom(skb) < cdev->skb_tx_rsvd)) {
1177− pr_err("csk 0x%p, skb head %u < %u.\n",
1178− csk, skb_headroom(skb), cdev->skb_tx_rsvd);
1179− err = -EINVAL;
1180− goto out_err;
1181− }
1182−
1183− if (frags >= SKB_WR_LIST_SIZE) {
1184− pr_err("csk 0x%p, frags %d, %u,%u >%u.\n",
1185− csk, skb_shinfo(skb)->nr_frags, skb->len,
1186− skb->data_len, (uint)(SKB_WR_LIST_SIZE));
1187− err = -EINVAL;
1188− goto out_err;
1189− }
1190−
1191− next = skb->next;
1192− skb->next = NULL;
1193− cxgbi_skcb_set_flag(skb, SKCBF_TX_NEED_HDR);
1194− cxgbi_sock_skb_entail(csk, skb);
1195− copied += skb->len;
1196− csk->write_seq += skb->len +
1197− cxgbi_ulp_extra_len(cxgbi_skcb_ulp_mode(skb));
1198− skb = next;
1199− }
1200−
1201− if (likely(skb_queue_len(&csk->write_queue)))
1202− cdev->csk_push_tx_frames(csk, 1);
1203−done:
1204− spin_unlock_bh(&csk->lock);
1205− return copied;
1206−
1207−out_err:
1208− if (copied == 0 && err == -EPIPE)
1209− copied = csk->err ? csk->err : -EPIPE;
1210− else
1211− copied = err;
1212− goto done;
1213−}
1214−
12151141 static inline void
12161142 scmd_get_params(struct scsi_cmnd *sc, struct scatterlist **sgl,
12171143 unsigned int *sgcnt, unsigned int *dlen,
@@ -1284,8 +1210,6 @@ EXPORT_SYMBOL_GPL(cxgbi_ddp_set_one_ppod); · 66 unmodified lines
12841210 * APIs interacting with open-iscsi libraries
12851211 */
12861212
1287−static unsigned char padding[4];
1288−
12891213 int cxgbi_ddp_ppm_setup(void **ppm_pp, struct cxgbi_device *cdev,
12901214 struct cxgbi_tag_format *tformat,
12911215 unsigned int iscsi_size, unsigned int llimit,
@@ -1833,9 +1757,10 @@ static int sgl_seek_offset(struct scatterlist *sgl, unsigned int sgcnt, · 541 unmodified lines
18331757 return -EFAULT;
18341758 }
18351759
1836−static int sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset,
1837− unsigned int dlen, struct page_frag *frags,
1838− int frag_max)
1760+static int
1761+sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset,
1762+ unsigned int dlen, struct page_frag *frags,
1763+ int frag_max, u32 *dlimit)
18391764 {
18401765 unsigned int datalen = dlen;
18411766 unsigned int sglen = sg->length - sgoffset;
@@ -1867,6 +1792,7 @@ static int sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset, · 25 unmodified lines
18671792 if (i >= frag_max) {
18681793 pr_warn("too many pages %u, dlen %u.\n",
18691794 frag_max, dlen);
1795+ *dlimit = dlen - datalen;
18701796 return -EINVAL;
18711797 }
18721798
@@ -1883,38 +1809,220 @@ static int sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset, · 10 unmodified lines
18831809 return i;
18841810 }
18851811
1886−int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 opcode)
1812+static void cxgbi_task_data_sgl_check(struct iscsi_task *task)
18871813 {
1888− struct iscsi_tcp_conn *tcp_conn = task->conn->dd_data;
1814+ struct scsi_cmnd *sc = task->sc;
1815+ struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
1816+ struct scatterlist *sg, *sgl = NULL;
1817+ u32 sgcnt = 0;
1818+ int i;
1819+
1820+ tdata->flags = CXGBI_TASK_SGL_CHECKED;
1821+ if (!sc)
1822+ return;
1823+
1824+ scmd_get_params(sc, &sgl, &sgcnt, &tdata->dlen, 0);
1825+ if (!sgl || !sgcnt) {
1826+ tdata->flags |= CXGBI_TASK_SGL_COPY;
1827+ return;
1828+ }
1829+
1830+ for_each_sg(sgl, sg, sgcnt, i) {
1831+ if (page_count(sg_page(sg)) < 1) {
1832+ tdata->flags |= CXGBI_TASK_SGL_COPY;
1833+ return;
1834+ }
1835+ }
1836+}
1837+
1838+static int
1839+cxgbi_task_data_sgl_read(struct iscsi_task *task, u32 offset, u32 count,
1840+ u32 *dlimit)
1841+{
1842+ struct scsi_cmnd *sc = task->sc;
1843+ struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
1844+ struct scatterlist *sgl = NULL;
1845+ struct scatterlist *sg;
1846+ u32 dlen = 0;
1847+ u32 sgcnt;
1848+ int err;
1849+
1850+ if (!sc)
1851+ return 0;
1852+
1853+ scmd_get_params(sc, &sgl, &sgcnt, &dlen, 0);
1854+ if (!sgl || !sgcnt)
1855+ return 0;
1856+
1857+ err = sgl_seek_offset(sgl, sgcnt, offset, &tdata->sgoffset, &sg);
1858+ if (err < 0) {
1859+ pr_warn("tpdu max, sgl %u, bad offset %u/%u.\n",
1860+ sgcnt, offset, tdata->dlen);
1861+ return err;
1862+ }
1863+ err = sgl_read_to_frags(sg, tdata->sgoffset, count,
1864+ tdata->frags, MAX_SKB_FRAGS, dlimit);
1865+ if (err < 0) {
1866+ log_debug(1 << CXGBI_DBG_ISCSI,
1867+ "sgl max limit, sgl %u, offset %u, %u/%u, dlimit %u.\n",
1868+ sgcnt, offset, count, tdata->dlen, *dlimit);
1869+ return err;
1870+ }
1871+ tdata->offset = offset;
1872+ tdata->count = count;
1873+ tdata->nr_frags = err;
1874+ tdata->total_count = count;
1875+ tdata->total_offset = offset;
1876+
1877+ log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
1878+ "%s: offset %u, count %u,\n"
1879+ "err %u, total_count %u, total_offset %u\n",
1880+ __func__, offset, count, err, tdata->total_count, tdata->total_offset);
1881+
1882+ return 0;
1883+}
1884+
1885+int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 op)
1886+{
1887+ struct iscsi_conn *conn = task->conn;
1888+ struct iscsi_session *session = task->conn->session;
1889+ struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
18891890 struct cxgbi_conn *cconn = tcp_conn->dd_data;
18901891 struct cxgbi_device *cdev = cconn->chba->cdev;
1891− struct iscsi_conn *conn = task->conn;
1892+ struct cxgbi_sock *csk = cconn->cep ? cconn->cep->csk : NULL;
18921893 struct iscsi_tcp_task *tcp_task = task->dd_data;
18931894 struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
18941895 struct scsi_cmnd *sc = task->sc;
1895− struct cxgbi_sock *csk = cconn->cep->csk;
1896− struct net_device *ndev = cdev->ports[csk->port_id];
1897− int headroom = SKB_TX_ISCSI_PDU_HEADER_MAX;
1896+ u32 headroom = SKB_TX_ISCSI_PDU_HEADER_MAX;
1897+ u32 max_txdata_len = conn->max_xmit_dlength;
1898+ u32 iso_tx_rsvd = 0, local_iso_info = 0;
1899+ u32 last_tdata_offset, last_tdata_count;
1900+ int err = 0;
1901+
1902+ if (!tcp_task) {
1903+ pr_err("task 0x%p, tcp_task 0x%p, tdata 0x%p.\n",
1904+ task, tcp_task, tdata);
1905+ return -ENOMEM;
1906+ }
1907+ if (!csk) {
1908+ pr_err("task 0x%p, csk gone.\n", task);
1909+ return -EPIPE;
1910+ }
1911+
1912+ op &= ISCSI_OPCODE_MASK;
18981913
18991914 tcp_task->dd_data = tdata;
19001915 task->hdr = NULL;
19011916
1902− if (SKB_MAX_HEAD(cdev->skb_tx_rsvd) > (512 * MAX_SKB_FRAGS) &&
1903− (opcode == ISCSI_OP_SCSI_DATA_OUT ||
1904− (opcode == ISCSI_OP_SCSI_CMD &&
1905− sc->sc_data_direction == DMA_TO_DEVICE)))
1906− /* data could goes into skb head */
1907− headroom += min_t(unsigned int,
1908− SKB_MAX_HEAD(cdev->skb_tx_rsvd),
1909− conn->max_xmit_dlength);
1917+ last_tdata_count = tdata->count;
1918+ last_tdata_offset = tdata->offset;
1919+
1920+ if ((op == ISCSI_OP_SCSI_DATA_OUT) ||
1921+ ((op == ISCSI_OP_SCSI_CMD) &&
1922+ (sc->sc_data_direction == DMA_TO_DEVICE))) {
1923+ u32 remaining_data_tosend, dlimit = 0;
1924+ u32 max_pdu_size, max_num_pdu, num_pdu;
1925+ u32 count;
19101926
1911− tdata->skb = alloc_skb(cdev->skb_tx_rsvd + headroom, GFP_ATOMIC);
1927+ /* Preserve conn->max_xmit_dlength because it can get updated to
1928+ * ISO data size.
1929+ */
1930+ if (task->state == ISCSI_TASK_PENDING)
1931+ tdata->max_xmit_dlength = conn->max_xmit_dlength;
1932+
1933+ if (!tdata->offset)
1934+ cxgbi_task_data_sgl_check(task);
1935+
1936+ remaining_data_tosend =
1937+ tdata->dlen - tdata->offset - tdata->count;
1938+
1939+recalculate_sgl:
1940+ max_txdata_len = tdata->max_xmit_dlength;
1941+ log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
1942+ "tdata->dlen %u, remaining to send %u "
1943+ "conn->max_xmit_dlength %u, "
1944+ "tdata->max_xmit_dlength %u\n",
1945+ tdata->dlen, remaining_data_tosend,
1946+ conn->max_xmit_dlength, tdata->max_xmit_dlength);
1947+
1948+ if (cdev->skb_iso_txhdr && !csk->disable_iso &&
1949+ (remaining_data_tosend > tdata->max_xmit_dlength) &&
1950+ !(remaining_data_tosend % 4)) {
1951+ u32 max_iso_data;
1952+
1953+ if ((op == ISCSI_OP_SCSI_CMD) &&
1954+ session->initial_r2t_en)
1955+ goto no_iso;
1956+
1957+ max_pdu_size = tdata->max_xmit_dlength +
1958+ ISCSI_PDU_NONPAYLOAD_LEN;
1959+ max_iso_data = rounddown(CXGBI_MAX_ISO_DATA_IN_SKB,
1960+ csk->advmss);
1961+ max_num_pdu = max_iso_data / max_pdu_size;
1962+
1963+ num_pdu = (remaining_data_tosend +
1964+ tdata->max_xmit_dlength - 1) /
1965+ tdata->max_xmit_dlength;
1966+
1967+ if (num_pdu > max_num_pdu)
1968+ num_pdu = max_num_pdu;
1969+
1970+ conn->max_xmit_dlength = tdata->max_xmit_dlength * num_pdu;
1971+ max_txdata_len = conn->max_xmit_dlength;
1972+ iso_tx_rsvd = cdev->skb_iso_txhdr;
1973+ local_iso_info = sizeof(struct cxgbi_iso_info);
1974+
1975+ log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
1976+ "max_pdu_size %u, max_num_pdu %u, "
1977+ "max_txdata %u, num_pdu %u\n",
1978+ max_pdu_size, max_num_pdu,
1979+ max_txdata_len, num_pdu);
1980+ }
1981+no_iso:
1982+ count = min_t(u32, max_txdata_len, remaining_data_tosend);
1983+ err = cxgbi_task_data_sgl_read(task,
1984+ tdata->offset + tdata->count,
1985+ count, &dlimit);
1986+ if (unlikely(err < 0)) {
1987+ log_debug(1 << CXGBI_DBG_ISCSI,
1988+ "task 0x%p, tcp_task 0x%p, tdata 0x%p, "
1989+ "sgl err %d, count %u, dlimit %u\n",
1990+ task, tcp_task, tdata, err, count, dlimit);
1991+ if (dlimit) {
1992+ remaining_data_tosend =
1993+ rounddown(dlimit,
1994+ tdata->max_xmit_dlength);
1995+ if (!remaining_data_tosend)
1996+ remaining_data_tosend = dlimit;
1997+
1998+ dlimit = 0;
1999+
2000+ conn->max_xmit_dlength = remaining_data_tosend;
2001+ goto recalculate_sgl;
2002+ }
2003+
2004+ pr_err("task 0x%p, tcp_task 0x%p, tdata 0x%p, "
2005+ "sgl err %d\n",
2006+ task, tcp_task, tdata, err);
2007+ goto ret_err;
2008+ }
2009+
2010+ if ((tdata->flags & CXGBI_TASK_SGL_COPY) ||
2011+ (tdata->nr_frags > MAX_SKB_FRAGS))
2012+ headroom += conn->max_xmit_dlength;
2013+ }
2014+
2015+ tdata->skb = alloc_skb(local_iso_info + cdev->skb_tx_rsvd +
2016+ iso_tx_rsvd + headroom, GFP_ATOMIC);
19122017 if (!tdata->skb) {
1913− ndev->stats.tx_dropped++;
1914− return -ENOMEM;
2018+ tdata->count = last_tdata_count;
2019+ tdata->offset = last_tdata_offset;
2020+ err = -ENOMEM;
2021+ goto ret_err;
19152022 }
19162023
1917− skb_reserve(tdata->skb, cdev->skb_tx_rsvd);
2024+ skb_reserve(tdata->skb, local_iso_info + cdev->skb_tx_rsvd +
2025+ iso_tx_rsvd);
19182026
19192027 if (task->sc) {
19202028 task->hdr = (struct iscsi_hdr *)tdata->skb->data;
@@ -1923,25 +2031,100 @@ int cxgbi_conn_alloc_pdu(struct iscsi_task *task, u8 opcode) · 2 unmodified lines
19232031 if (!task->hdr) {
19242032 __kfree_skb(tdata->skb);
19252033 tdata->skb = NULL;
1926− ndev->stats.tx_dropped++;
19272034 return -ENOMEM;
19282035 }
19292036 }
1930− task->hdr_max = SKB_TX_ISCSI_PDU_HEADER_MAX; /* BHS + AHS */
2037+
2038+ task->hdr_max = SKB_TX_ISCSI_PDU_HEADER_MAX;
2039+
2040+ if (iso_tx_rsvd)
2041+ cxgbi_skcb_set_flag(tdata->skb, SKCBF_TX_ISO);
19312042
19322043 /* data_out uses scsi_cmd's itt */
1933− if (opcode != ISCSI_OP_SCSI_DATA_OUT)
2044+ if (op != ISCSI_OP_SCSI_DATA_OUT)
19342045 task_reserve_itt(task, &task->hdr->itt);
19352046
19362047 log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
1937− "task 0x%p, op 0x%x, skb 0x%p,%u+%u/%u, itt 0x%x.\n",
1938− task, opcode, tdata->skb, cdev->skb_tx_rsvd, headroom,
1939− conn->max_xmit_dlength, ntohl(task->hdr->itt));
2048+ "task 0x%p, op 0x%x, skb 0x%p,%u+%u/%u, itt 0x%x.\n",
2049+ task, op, tdata->skb, cdev->skb_tx_rsvd, headroom,
2050+ conn->max_xmit_dlength, be32_to_cpu(task->hdr->itt));
19402051
19412052 return 0;
2053+
2054+ret_err:
2055+ conn->max_xmit_dlength = tdata->max_xmit_dlength;
2056+ return err;
19422057 }
19432058 EXPORT_SYMBOL_GPL(cxgbi_conn_alloc_pdu);
19442059
2060+static int
2061+cxgbi_prep_iso_info(struct iscsi_task *task, struct sk_buff *skb,
2062+ u32 count)
2063+{
2064+ struct cxgbi_iso_info *iso_info = (struct cxgbi_iso_info *)skb->head;
2065+ struct iscsi_r2t_info *r2t;
2066+ struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
2067+ struct iscsi_conn *conn = task->conn;
2068+ struct iscsi_session *session = conn->session;
2069+ struct iscsi_tcp_task *tcp_task = task->dd_data;
2070+ u32 burst_size = 0, r2t_dlength = 0, dlength;
2071+ u32 max_pdu_len = tdata->max_xmit_dlength;
2072+ u32 segment_offset = 0;
2073+ u32 num_pdu;
2074+
2075+ if (unlikely(!cxgbi_skcb_test_flag(skb, SKCBF_TX_ISO)))
2076+ return 0;
2077+
2078+ memset(iso_info, 0, sizeof(struct cxgbi_iso_info));
2079+
2080+ if (task->hdr->opcode == ISCSI_OP_SCSI_CMD && session->imm_data_en) {
2081+ iso_info->flags |= CXGBI_ISO_INFO_IMM_ENABLE;
2082+ burst_size = count;
2083+ }
2084+
2085+ dlength = ntoh24(task->hdr->dlength);
2086+ dlength = min(dlength, max_pdu_len);
2087+ hton24(task->hdr->dlength, dlength);
2088+
2089+ num_pdu = (count + max_pdu_len - 1) / max_pdu_len;
2090+
2091+ if (iscsi_task_has_unsol_data(task))
2092+ r2t = &task->unsol_r2t;
2093+ else
2094+ r2t = tcp_task->r2t;
2095+
2096+ if (r2t) {
2097+ log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
2098+ "count %u, tdata->count %u, num_pdu %u,"
2099+ "task->hdr_len %u, r2t->data_length %u, r2t->sent %u\n",
2100+ count, tdata->count, num_pdu, task->hdr_len,
2101+ r2t->data_length, r2t->sent);
2102+
2103+ r2t_dlength = r2t->data_length - r2t->sent;
2104+ segment_offset = r2t->sent;
2105+ r2t->datasn += num_pdu - 1;
2106+ }
2107+
2108+ if (!r2t || !r2t->sent)
2109+ iso_info->flags |= CXGBI_ISO_INFO_FSLICE;
2110+
2111+ if (task->hdr->flags & ISCSI_FLAG_CMD_FINAL)
2112+ iso_info->flags |= CXGBI_ISO_INFO_LSLICE;
2113+
2114+ task->hdr->flags &= ~ISCSI_FLAG_CMD_FINAL;
2115+
2116+ iso_info->op = task->hdr->opcode;
2117+ iso_info->ahs = task->hdr->hlength;
2118+ iso_info->num_pdu = num_pdu;
2119+ iso_info->mpdu = max_pdu_len;
2120+ iso_info->burst_size = (burst_size + r2t_dlength) >> 2;
2121+ iso_info->len = count + task->hdr_len;
2122+ iso_info->segment_offset = segment_offset;
2123+
2124+ cxgbi_skcb_tx_iscsi_hdrlen(skb) = task->hdr_len;
2125+ return 0;
2126+}
2127+
19452128 static inline void tx_skb_setmode(struct sk_buff *skb, int hcrc, int dcrc)
19462129 {
19472130 if (hcrc || dcrc) {
@@ -1951,133 +2134,260 @@ static inline void tx_skb_setmode(struct sk_buff *skb, int hcrc, int dcrc) · 3 unmodified lines
19512134 submode |= 1;
19522135 if (dcrc)
19532136 submode |= 2;
1954− cxgbi_skcb_ulp_mode(skb) = (ULP2_MODE_ISCSI << 4) | submode;
2137+ cxgbi_skcb_tx_ulp_mode(skb) = (ULP2_MODE_ISCSI << 4) | submode;
19552138 } else
1956− cxgbi_skcb_ulp_mode(skb) = 0;
2139+ cxgbi_skcb_tx_ulp_mode(skb) = 0;
19572140 }
19582141
2142+static struct page *rsvd_page;
2143+
19592144 int cxgbi_conn_init_pdu(struct iscsi_task *task, unsigned int offset,
19602145 unsigned int count)
19612146 {
19622147 struct iscsi_conn *conn = task->conn;
2148+ struct iscsi_tcp_task *tcp_task = task->dd_data;
19632149 struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
1964− struct sk_buff *skb = tdata->skb;
1965− unsigned int datalen = count;
1966− int i, padlen = iscsi_padding(count);
2150+ struct sk_buff *skb;
2151+ struct scsi_cmnd *sc = task->sc;
2152+ u32 expected_count, expected_offset;
2153+ u32 datalen = count, dlimit = 0;
2154+ u32 i, padlen = iscsi_padding(count);
19672155 struct page *pg;
2156+ int err;
2157+
2158+ if (!tcp_task || (tcp_task->dd_data != tdata)) {
2159+ pr_err("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n",
2160+ task, task->sc, tcp_task,
2161+ tcp_task ? tcp_task->dd_data : NULL, tdata);
2162+ return -EINVAL;
2163+ }
2164+ skb = tdata->skb;
19682165
19692166 log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
1970− "task 0x%p,0x%p, skb 0x%p, 0x%x,0x%x,0x%x, %u+%u.\n",
1971− task, task->sc, skb, (*skb->data) & ISCSI_OPCODE_MASK,
1972− ntohl(task->cmdsn), ntohl(task->hdr->itt), offset, count);
2167+ "task 0x%p,0x%p, skb 0x%p, 0x%x,0x%x,0x%x, %u+%u.\n",
2168+ task, task->sc, skb, (*skb->data) & ISCSI_OPCODE_MASK,
2169+ be32_to_cpu(task->cmdsn), be32_to_cpu(task->hdr->itt), offset, count);
19732170
19742171 skb_put(skb, task->hdr_len);
19752172 tx_skb_setmode(skb, conn->hdrdgst_en, datalen ? conn->datadgst_en : 0);
1976− if (!count)
2173+ if (!count) {
2174+ tdata->count = count;
2175+ tdata->offset = offset;
2176+ tdata->nr_frags = 0;
2177+ tdata->total_offset = 0;
2178+ tdata->total_count = 0;
2179+ if (tdata->max_xmit_dlength)
2180+ conn->max_xmit_dlength = tdata->max_xmit_dlength;
2181+ cxgbi_skcb_clear_flag(skb, SKCBF_TX_ISO);
19772182 return 0;
2183+ }
19782184
1979− if (task->sc) {
1980− struct scsi_data_buffer *sdb = &task->sc->sdb;
1981− struct scatterlist *sg = NULL;
1982− int err;
2185+ log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
2186+ "data->total_count %u, tdata->total_offset %u\n",
2187+ tdata->total_count, tdata->total_offset);
19832188
1984− tdata->offset = offset;
1985− tdata->count = count;
1986− err = sgl_seek_offset(
1987− sdb->table.sgl, sdb->table.nents,
1988− tdata->offset, &tdata->sgoffset, &sg);
1989− if (err < 0) {
1990− pr_warn("tpdu, sgl %u, bad offset %u/%u.\n",
1991− sdb->table.nents, tdata->offset, sdb->length);
1992− return err;
1993− }
1994− err = sgl_read_to_frags(sg, tdata->sgoffset, tdata->count,
1995− tdata->frags, MAX_PDU_FRAGS);
2189+ expected_count = tdata->total_count;
2190+ expected_offset = tdata->total_offset;
2191+
2192+ if ((count != expected_count) ||
2193+ (offset != expected_offset)) {
2194+ err = cxgbi_task_data_sgl_read(task, offset, count, &dlimit);
19962195 if (err < 0) {
1997− pr_warn("tpdu, sgl %u, bad offset %u + %u.\n",
1998− sdb->table.nents, tdata->offset, tdata->count);
2196+ pr_err("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p "
2197+ "dlimit %u, sgl err %d.\n", task, task->sc,
2198+ tcp_task, tcp_task ? tcp_task->dd_data : NULL,
2199+ tdata, dlimit, err);
19992200 return err;
20002201 }
2001− tdata->nr_frags = err;
2202+ }
2203+
2204+ /* Restore original value of conn->max_xmit_dlength because
2205+ * it can get updated to ISO data size.
2206+ */
2207+ conn->max_xmit_dlength = tdata->max_xmit_dlength;
2208+
2209+ if (sc) {
2210+ struct page_frag *frag = tdata->frags;
20022211
2003− if (tdata->nr_frags > MAX_SKB_FRAGS ||
2004− (padlen && tdata->nr_frags == MAX_SKB_FRAGS)) {
2212+ if ((tdata->flags & CXGBI_TASK_SGL_COPY) ||
2213+ (tdata->nr_frags > MAX_SKB_FRAGS) ||
2214+ (padlen && (tdata->nr_frags ==
2215+ MAX_SKB_FRAGS))) {
20052216 char *dst = skb->data + task->hdr_len;
2006− struct page_frag *frag = tdata->frags;
20072217
20082218 /* data fits in the skb's headroom */
20092219 for (i = 0; i < tdata->nr_frags; i++, frag++) {
20102220 char *src = kmap_atomic(frag->page);
20112221
2012− memcpy(dst, src+frag->offset, frag->size);
2222+ memcpy(dst, src + frag->offset, frag->size);
20132223 dst += frag->size;
20142224 kunmap_atomic(src);
20152225 }
2226+
20162227 if (padlen) {
20172228 memset(dst, 0, padlen);
20182229 padlen = 0;
20192230 }
20202231 skb_put(skb, count + padlen);
20212232 } else {
2022− /* data fit into frag_list */
2023− for (i = 0; i < tdata->nr_frags; i++) {
2024− __skb_fill_page_desc(skb, i,
2025− tdata->frags[i].page,
2026− tdata->frags[i].offset,
2027− tdata->frags[i].size);
2028− skb_frag_ref(skb, i);
2233+ for (i = 0; i < tdata->nr_frags; i++, frag++) {
2234+ get_page(frag->page);
2235+ skb_fill_page_desc(skb, i, frag->page,
2236+ frag->offset, frag->size);
20292237 }
2030− skb_shinfo(skb)->nr_frags = tdata->nr_frags;
2238+
20312239 skb->len += count;
20322240 skb->data_len += count;
20332241 skb->truesize += count;
20342242 }
2035−
20362243 } else {
2037− pg = virt_to_page(task->data);
2038−
2244+ pg = virt_to_head_page(task->data);
20392245 get_page(pg);
2040− skb_fill_page_desc(skb, 0, pg, offset_in_page(task->data),
2041− count);
2246+ skb_fill_page_desc(skb, 0, pg,
2247+ task->data - (char *)page_address(pg),
2248+ count);
20422249 skb->len += count;
20432250 skb->data_len += count;
20442251 skb->truesize += count;
20452252 }
20462253
20472254 if (padlen) {
2048− i = skb_shinfo(skb)->nr_frags;
2255+ get_page(rsvd_page);
20492256 skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
2050− virt_to_page(padding), offset_in_page(padding),
2051− padlen);
2257+ rsvd_page, 0, padlen);
20522258
20532259 skb->data_len += padlen;
20542260 skb->truesize += padlen;
20552261 skb->len += padlen;
20562262 }
20572263
2264+ if (likely(count > tdata->max_xmit_dlength))
2265+ cxgbi_prep_iso_info(task, skb, count);
2266+ else
2267+ cxgbi_skcb_clear_flag(skb, SKCBF_TX_ISO);
2268+
20582269 return 0;
20592270 }
20602271 EXPORT_SYMBOL_GPL(cxgbi_conn_init_pdu);
20612272
2273+static int cxgbi_sock_tx_queue_up(struct cxgbi_sock *csk, struct sk_buff *skb)
2274+{
2275+ struct cxgbi_device *cdev = csk->cdev;
2276+ struct cxgbi_iso_info *iso_cpl;
2277+ u32 frags = skb_shinfo(skb)->nr_frags;
2278+ u32 extra_len, num_pdu, hdr_len;
2279+ u32 iso_tx_rsvd = 0;
2280+
2281+ if (csk->state != CTP_ESTABLISHED) {
2282+ log_debug(1 << CXGBI_DBG_PDU_TX,
2283+ "csk 0x%p,%u,0x%lx,%u, EAGAIN.\n",
2284+ csk, csk->state, csk->flags, csk->tid);
2285+ return -EPIPE;
2286+ }
2287+
2288+ if (csk->err) {
2289+ log_debug(1 << CXGBI_DBG_PDU_TX,
2290+ "csk 0x%p,%u,0x%lx,%u, EPIPE %d.\n",
2291+ csk, csk->state, csk->flags, csk->tid, csk->err);
2292+ return -EPIPE;
2293+ }
2294+
2295+ if ((cdev->flags & CXGBI_FLAG_DEV_T3) &&
2296+ before((csk->snd_win + csk->snd_una), csk->write_seq)) {
2297+ log_debug(1 << CXGBI_DBG_PDU_TX,
2298+ "csk 0x%p,%u,0x%lx,%u, FULL %u-%u >= %u.\n",
2299+ csk, csk->state, csk->flags, csk->tid, csk->write_seq,
2300+ csk->snd_una, csk->snd_win);
2301+ return -ENOBUFS;
2302+ }
2303+
2304+ if (cxgbi_skcb_test_flag(skb, SKCBF_TX_ISO))
2305+ iso_tx_rsvd = cdev->skb_iso_txhdr;
2306+
2307+ if (unlikely(skb_headroom(skb) < (cdev->skb_tx_rsvd + iso_tx_rsvd))) {
2308+ pr_err("csk 0x%p, skb head %u < %u.\n",
2309+ csk, skb_headroom(skb), cdev->skb_tx_rsvd);
2310+ return -EINVAL;
2311+ }
2312+
2313+ if (skb->len != skb->data_len)
2314+ frags++;
2315+
2316+ if (frags >= SKB_WR_LIST_SIZE) {
2317+ pr_err("csk 0x%p, frags %u, %u,%u >%lu.\n",
2318+ csk, skb_shinfo(skb)->nr_frags, skb->len,
2319+ skb->data_len, SKB_WR_LIST_SIZE);
2320+ return -EINVAL;
2321+ }
2322+
2323+ cxgbi_skcb_set_flag(skb, SKCBF_TX_NEED_HDR);
2324+ skb_reset_transport_header(skb);
2325+ cxgbi_sock_skb_entail(csk, skb);
2326+
2327+ extra_len = cxgbi_ulp_extra_len(cxgbi_skcb_tx_ulp_mode(skb));
2328+
2329+ if (likely(cxgbi_skcb_test_flag(skb, SKCBF_TX_ISO))) {
2330+ iso_cpl = (struct cxgbi_iso_info *)skb->head;
2331+ num_pdu = iso_cpl->num_pdu;
2332+ hdr_len = cxgbi_skcb_tx_iscsi_hdrlen(skb);
2333+ extra_len = (cxgbi_ulp_extra_len(cxgbi_skcb_tx_ulp_mode(skb)) *
2334+ num_pdu) + (hdr_len * (num_pdu - 1));
2335+ }
2336+
2337+ csk->write_seq += (skb->len + extra_len);
2338+
2339+ return 0;
2340+}
2341+
2342+static int cxgbi_sock_send_skb(struct cxgbi_sock *csk, struct sk_buff *skb)
2343+{
2344+ struct cxgbi_device *cdev = csk->cdev;
2345+ int len = skb->len;
2346+ int err;
2347+
2348+ spin_lock_bh(&csk->lock);
2349+ err = cxgbi_sock_tx_queue_up(csk, skb);
2350+ if (err < 0) {
2351+ spin_unlock_bh(&csk->lock);
2352+ return err;
2353+ }
2354+
2355+ if (likely(skb_queue_len(&csk->write_queue)))
2356+ cdev->csk_push_tx_frames(csk, 0);
2357+ spin_unlock_bh(&csk->lock);
2358+ return len;
2359+}
2360+
20622361 int cxgbi_conn_xmit_pdu(struct iscsi_task *task)
20632362 {
20642363 struct iscsi_tcp_conn *tcp_conn = task->conn->dd_data;
20652364 struct cxgbi_conn *cconn = tcp_conn->dd_data;
2365+ struct iscsi_tcp_task *tcp_task = task->dd_data;
20662366 struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
20672367 struct cxgbi_task_tag_info *ttinfo = &tdata->ttinfo;
2068− struct sk_buff *skb = tdata->skb;
2368+ struct sk_buff *skb;
20692369 struct cxgbi_sock *csk = NULL;
2070− unsigned int datalen;
2370+ u32 pdulen = 0;
2371+ u32 datalen;
20712372 int err;
20722373
2374+ if (!tcp_task || (tcp_task->dd_data != tdata)) {
2375+ pr_err("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n",
2376+ task, task->sc, tcp_task,
2377+ tcp_task ? tcp_task->dd_data : NULL, tdata);
2378+ return -EINVAL;
2379+ }
2380+
2381+ skb = tdata->skb;
20732382 if (!skb) {
20742383 log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
2075− "task 0x%p\n", task);
2384+ "task 0x%p, skb NULL.\n", task);
20762385 return 0;
20772386 }
20782387
20792388 if (cconn && cconn->cep)
20802389 csk = cconn->cep->csk;
2390+
20812391 if (!csk) {
20822392 log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
20832393 "task 0x%p, csk gone.\n", task);
@@ -2101,13 +2411,12 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *task) · 17 unmodified lines
21012411 if (!task->sc)
21022412 memcpy(skb->data, task->hdr, SKB_TX_ISCSI_PDU_HEADER_MAX);
21032413
2104− err = cxgbi_sock_send_pdus(cconn->cep->csk, skb);
2414+ err = cxgbi_sock_send_skb(csk, skb);
21052415 if (err > 0) {
2106− int pdulen = err;
2416+ pdulen += err;
21072417
2108− log_debug(1 << CXGBI_DBG_PDU_TX,
2109− "task 0x%p,0x%p, skb 0x%p, len %u/%u, rv %d.\n",
2110− task, task->sc, skb, skb->len, skb->data_len, err);
2418+ log_debug(1 << CXGBI_DBG_PDU_TX, "task 0x%p,0x%p, rv %d.\n",
2419+ task, task->sc, err);
21112420
21122421 if (task->conn->hdrdgst_en)
21132422 pdulen += ISCSI_DIGEST_SIZE;
@@ -2116,24 +2425,42 @@ int cxgbi_conn_xmit_pdu(struct iscsi_task *task) · 2 unmodified lines
21162425 pdulen += ISCSI_DIGEST_SIZE;
21172426
21182427 task->conn->txdata_octets += pdulen;
2428+
2429+ if (unlikely(cxgbi_is_iso_config(csk) && cxgbi_is_iso_disabled(csk))) {
2430+ if (time_after(jiffies, csk->prev_iso_ts + HZ)) {
2431+ csk->disable_iso = false;
2432+ csk->prev_iso_ts = 0;
2433+ log_debug(1 << CXGBI_DBG_PDU_TX,
2434+ "enable iso: csk 0x%p\n", csk);
2435+ }
2436+ }
2437+
21192438 return 0;
21202439 }
21212440
21222441 if (err == -EAGAIN || err == -ENOBUFS) {
21232442 log_debug(1 << CXGBI_DBG_PDU_TX,
2124− "task 0x%p, skb 0x%p, len %u/%u, %d EAGAIN.\n",
2125− task, skb, skb->len, skb->data_len, err);
2443+ "task 0x%p, skb 0x%p, len %u/%u, %d EAGAIN.\n",
2444+ task, skb, skb->len, skb->data_len, err);
21262445 /* reset skb to send when we are called again */
21272446 tdata->skb = skb;
2447+
2448+ if (cxgbi_is_iso_config(csk) && !cxgbi_is_iso_disabled(csk) &&
2449+ (csk->no_tx_credits++ >= 2)) {
2450+ csk->disable_iso = true;
2451+ csk->prev_iso_ts = jiffies;
2452+ log_debug(1 << CXGBI_DBG_PDU_TX,
2453+ "disable iso:csk 0x%p, ts:%lu\n",
2454+ csk, csk->prev_iso_ts);
2455+ }
2456+
21282457 return err;
21292458 }
21302459
2131− log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
2132− "itt 0x%x, skb 0x%p, len %u/%u, xmit err %d.\n",
2133− task->itt, skb, skb->len, skb->data_len, err);
2134−
21352460 __kfree_skb(skb);
2136−
2461+ log_debug(1 << CXGBI_DBG_ISCSI | 1 << CXGBI_DBG_PDU_TX,
2462+ "itt 0x%x, skb 0x%p, len %u/%u, xmit err %d.\n",
2463+ task->itt, skb, skb->len, skb->data_len, err);
21372464 iscsi_conn_printk(KERN_ERR, task->conn, "xmit err %d.\n", err);
21382465 iscsi_conn_failure(task->conn, ISCSI_ERR_XMIT_FAILED);
21392466 return err;
@@ -2145,7 +2472,7 @@ void cxgbi_cleanup_task(struct iscsi_task *task) · 5 unmodified lines
21452472 struct iscsi_tcp_task *tcp_task = task->dd_data;
21462473 struct cxgbi_task_data *tdata = iscsi_task_cxgbi_data(task);
21472474
2148− if (!tcp_task || !tdata || (tcp_task->dd_data != tdata)) {
2475+ if (!tcp_task || (tcp_task->dd_data != tdata)) {
21492476 pr_info("task 0x%p,0x%p, tcp_task 0x%p, tdata 0x%p/0x%p.\n",
21502477 task, task->sc, tcp_task,
21512478 tcp_task ? tcp_task->dd_data : NULL, tdata);
@@ -2749,12 +3076,17 @@ static int __init libcxgbi_init_module(void) · 597 unmodified lines
27493076
27503077 BUILD_BUG_ON(sizeof_field(struct sk_buff, cb) <
27513078 sizeof(struct cxgbi_skb_cb));
3079+ rsvd_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
3080+ if (!rsvd_page)
3081+ return -ENOMEM;
3082+
27523083 return 0;
27533084 }
27543085
27553086 static void __exit libcxgbi_exit_module(void)
27563087 {
27573088 cxgbi_device_unregister_all(0xFF);
3089+ put_page(rsvd_page);
27583090 return;
27593091 }
27603092
drivers/scsi/cxgbi/libcxgbi.h+42−4
@@ -76,6 +76,14 @@ do { \ · 75 unmodified lines
7676 #define ULP2_MAX_PDU_PAYLOAD \
7777 (ULP2_MAX_PKT_SIZE - ISCSI_PDU_NONPAYLOAD_LEN)
7878
79+#define CXGBI_ULP2_MAX_ISO_PAYLOAD 65535
80+
81+#define CXGBI_MAX_ISO_DATA_IN_SKB \
82+ min_t(u32, MAX_SKB_FRAGS << PAGE_SHIFT, CXGBI_ULP2_MAX_ISO_PAYLOAD)
83+
84+#define cxgbi_is_iso_config(csk) ((csk)->cdev->skb_iso_txhdr)
85+#define cxgbi_is_iso_disabled(csk) ((csk)->disable_iso)
86+
7987 /*
8088 * For iscsi connections HW may inserts digest bytes into the pdu. Those digest
8189 * bytes are not sent by the host but are part of the TCP payload and therefore
@@ -162,6 +170,10 @@ struct cxgbi_sock { · 80 unmodified lines
162170 u32 write_seq;
163171 u32 snd_win;
164172 u32 rcv_win;
173+
174+ bool disable_iso;
175+ u32 no_tx_credits;
176+ unsigned long prev_iso_ts;
165177 };
166178
167179 /*
@@ -203,6 +215,8 @@ struct cxgbi_skb_tx_cb { · 35 unmodified lines
203215 void *handle;
204216 void *arp_err_handler;
205217 struct sk_buff *wr_next;
218+ u16 iscsi_hdr_len;
219+ u8 ulp_mode;
206220 };
207221
208222 enum cxgbi_skcb_flags {
@@ -218,6 +232,7 @@ enum cxgbi_skcb_flags { · 9 unmodified lines
218232 SKCBF_RX_HCRC_ERR, /* header digest error */
219233 SKCBF_RX_DCRC_ERR, /* data digest error */
220234 SKCBF_RX_PAD_ERR, /* padding byte error */
235+ SKCBF_TX_ISO, /* iso cpl in tx skb */
221236 };
222237
223238 struct cxgbi_skb_cb {
@@ -225,18 +240,18 @@ struct cxgbi_skb_cb { · 1 unmodified line
225240 struct cxgbi_skb_rx_cb rx;
226241 struct cxgbi_skb_tx_cb tx;
227242 };
228− unsigned char ulp_mode;
229243 unsigned long flags;
230244 unsigned int seq;
231245 };
232246
233247 #define CXGBI_SKB_CB(skb) ((struct cxgbi_skb_cb *)&((skb)->cb[0]))
234248 #define cxgbi_skcb_flags(skb) (CXGBI_SKB_CB(skb)->flags)
235−#define cxgbi_skcb_ulp_mode(skb) (CXGBI_SKB_CB(skb)->ulp_mode)
236249 #define cxgbi_skcb_tcp_seq(skb) (CXGBI_SKB_CB(skb)->seq)
237250 #define cxgbi_skcb_rx_ddigest(skb) (CXGBI_SKB_CB(skb)->rx.ddigest)
238251 #define cxgbi_skcb_rx_pdulen(skb) (CXGBI_SKB_CB(skb)->rx.pdulen)
239252 #define cxgbi_skcb_tx_wr_next(skb) (CXGBI_SKB_CB(skb)->tx.wr_next)
253+#define cxgbi_skcb_tx_iscsi_hdrlen(skb) (CXGBI_SKB_CB(skb)->tx.iscsi_hdr_len)
254+#define cxgbi_skcb_tx_ulp_mode(skb) (CXGBI_SKB_CB(skb)->tx.ulp_mode)
240255
241256 static inline void cxgbi_skcb_set_flag(struct sk_buff *skb,
242257 enum cxgbi_skcb_flags flag)
@@ -458,6 +473,7 @@ struct cxgbi_ports_map { · 215 unmodified lines
458473 #define CXGBI_FLAG_IPV4_SET 0x10
459474 #define CXGBI_FLAG_USE_PPOD_OFLDQ 0x40
460475 #define CXGBI_FLAG_DDP_OFF 0x100
476+#define CXGBI_FLAG_DEV_ISO_OFF 0x400
461477
462478 struct cxgbi_device {
463479 struct list_head list_head;
@@ -477,6 +493,7 @@ struct cxgbi_device { · 13 unmodified lines
477493 unsigned int pfvf;
478494 unsigned int rx_credit_thres;
479495 unsigned int skb_tx_rsvd;
496+ u32 skb_iso_txhdr;
480497 unsigned int skb_rx_extra; /* for msg coalesced mode */
481498 unsigned int tx_max_size;
482499 unsigned int rx_max_size;
@@ -523,20 +540,41 @@ struct cxgbi_endpoint { · 40 unmodified lines
523540 struct cxgbi_sock *csk;
524541 };
525542
526−#define MAX_PDU_FRAGS ((ULP2_MAX_PDU_PAYLOAD + 512 - 1) / 512)
527543 struct cxgbi_task_data {
544+#define CXGBI_TASK_SGL_CHECKED 0x1
545+#define CXGBI_TASK_SGL_COPY 0x2
546+ u8 flags;
528547 unsigned short nr_frags;
529− struct page_frag frags[MAX_PDU_FRAGS];
548+ struct page_frag frags[MAX_SKB_FRAGS];
530549 struct sk_buff *skb;
531550 unsigned int dlen;
532551 unsigned int offset;
533552 unsigned int count;
534553 unsigned int sgoffset;
554+ u32 total_count;
555+ u32 total_offset;
556+ u32 max_xmit_dlength;
535557 struct cxgbi_task_tag_info ttinfo;
536558 };
537559 #define iscsi_task_cxgbi_data(task) \
538560 ((task)->dd_data + sizeof(struct iscsi_tcp_task))
539561
562+struct cxgbi_iso_info {
563+#define CXGBI_ISO_INFO_FSLICE 0x1
564+#define CXGBI_ISO_INFO_LSLICE 0x2
565+#define CXGBI_ISO_INFO_IMM_ENABLE 0x4
566+ u8 flags;
567+ u8 op;
568+ u8 ahs;
569+ u8 num_pdu;
570+ u32 mpdu;
571+ u32 burst_size;
572+ u32 len;
573+ u32 segment_offset;
574+ u32 datasn_offset;
575+ u32 buffer_offset;
576+};
577+
540578 static inline void *cxgbi_alloc_big_mem(unsigned int size,
541579 gfp_t gfp)
542580 {
drivers/scsi/dpt_i2o.c+0−4
@@ -1331,7 +1331,6 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba) · 1330 unmodified lines
13311331 printk(KERN_ERR"IOP reset failed - no free memory.\n");
13321332 return -ENOMEM;
13331333 }
1334− memset(status,0,4);
13351334
13361335 msg[0]=EIGHT_WORD_MSG_SIZE|SGL_OFFSET_0;
13371336 msg[1]=I2O_CMD_ADAPTER_RESET<<24|HOST_TID<<12|ADAPTER_TID;
@@ -2784,7 +2783,6 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) · 1446 unmodified lines
27842783 pHba->name);
27852784 return -ENOMEM;
27862785 }
2787− memset(status, 0, 4);
27882786
27892787 writel(EIGHT_WORD_MSG_SIZE| SGL_OFFSET_6, &msg[0]);
27902788 writel(I2O_CMD_OUTBOUND_INIT<<24 | HOST_TID<<12 | ADAPTER_TID, &msg[1]);
@@ -2838,7 +2836,6 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) · 47 unmodified lines
28382836 printk(KERN_ERR "%s: Could not allocate reply pool\n", pHba->name);
28392837 return -ENOMEM;
28402838 }
2841− memset(pHba->reply_pool, 0 , pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4);
28422839
28432840 for(i = 0; i < pHba->reply_fifo_size; i++) {
28442841 writel(pHba->reply_pool_pa + (i * REPLY_FRAME_SIZE * 4),
@@ -3073,7 +3070,6 @@ static int adpt_i2o_build_sys_table(void) · 228 unmodified lines
30733070 printk(KERN_WARNING "SysTab Set failed. Out of memory.\n");
30743071 return -ENOMEM;
30753072 }
3076− memset(sys_tbl, 0, sys_tbl_len);
30773073
30783074 sys_tbl->num_entries = hba_count;
30793075 sys_tbl->version = I2OVERSION;
drivers/scsi/esas2r/esas2r.h+2−1
@@ -1225,8 +1225,9 @@ static inline void esas2r_rq_init_request(struct esas2r_request *rq, · 1224 unmodified lines
12251225
12261226 /* req_table entry should be NULL at this point - if not, halt */
12271227
1228− if (a->req_table[LOWORD(vrq->scsi.handle)])
1228+ if (a->req_table[LOWORD(vrq->scsi.handle)]) {
12291229 esas2r_bugon();
1230+ }
12301231
12311232 /* fill in the table for this handle so we can get back to the
12321233 * request.
drivers/scsi/esas2r/esas2r_log.c+5−5
@@ -75,7 +75,7 @@ static char event_buffer[EVENT_LOG_BUFF_SIZE]; · 74 unmodified lines
7575 /* A lock to protect the shared buffer used for formatting messages. */
7676 static DEFINE_SPINLOCK(event_buffer_lock);
7777
78−/**
78+/*
7979 * translates an esas2r-defined logging event level to a kernel logging level.
8080 *
8181 * @param [in] level the esas2r-defined logging event level to translate
@@ -101,7 +101,7 @@ static const char *translate_esas2r_event_level_to_kernel(const long level) · 19 unmodified lines
101101 }
102102 }
103103
104−/**
104+/*
105105 * the master logging function. this function will format the message as
106106 * outlined by the formatting string, the input device information and the
107107 * substitution arguments and output the resulting string to the system log.
@@ -170,7 +170,7 @@ static int esas2r_log_master(const long level, · 62 unmodified lines
170170 return 0;
171171 }
172172
173−/**
173+/*
174174 * formats and logs a message to the system log.
175175 *
176176 * @param [in] level the event level of the message
@@ -193,7 +193,7 @@ int esas2r_log(const long level, const char *format, ...) · 16 unmodified lines
193193 return retval;
194194 }
195195
196−/**
196+/*
197197 * formats and logs a message to the system log. this message will include
198198 * device information.
199199 *
@@ -221,7 +221,7 @@ int esas2r_log_dev(const long level, · 21 unmodified lines
221221 return retval;
222222 }
223223
224−/**
224+/*
225225 * formats and logs a message to the system log. this message will include
226226 * device information.
227227 *
drivers/scsi/fcoe/fcoe.c+4−6
@@ -645,7 +645,7 @@ static int fcoe_lport_config(struct fc_lport *lport) · 644 unmodified lines
645645 return 0;
646646 }
647647
648−/**
648+/*
649649 * fcoe_netdev_features_change - Updates the lport's offload flags based
650650 * on the LLD netdev's FCoE feature flags
651651 */
@@ -2029,7 +2029,7 @@ static int fcoe_ctlr_enabled(struct fcoe_ctlr_device *cdev) · 1377 unmodified lines
20292029
20302030 /**
20312031 * fcoe_ctlr_mode() - Switch FIP mode
2032− * @cdev: The FCoE Controller that is being modified
2032+ * @ctlr_dev: The FCoE Controller that is being modified
20332033 *
20342034 * When the FIP mode has been changed we need to update
20352035 * the multicast addresses to ensure we get the correct
@@ -2136,9 +2136,7 @@ static bool fcoe_match(struct net_device *netdev) · 100 unmodified lines
21362136
21372137 /**
21382138 * fcoe_dcb_create() - Initialize DCB attributes and hooks
2139− * @netdev: The net_device object of the L2 link that should be queried
2140− * @port: The fcoe_port to bind FCoE APP priority with
2141− * @
2139+ * @fcoe: The new FCoE interface
21422140 */
21432141 static void fcoe_dcb_create(struct fcoe_interface *fcoe)
21442142 {
@@ -2609,7 +2607,7 @@ static void fcoe_logo_resp(struct fc_seq *seq, struct fc_frame *fp, void *arg) · 464 unmodified lines
26092607 fc_lport_logo_resp(seq, fp, lport);
26102608 }
26112609
2612−/**
2610+/*
26132611 * fcoe_elsct_send - FCoE specific ELS handler
26142612 *
26152613 * This does special case handling of FIP encapsualted ELS exchanges for FCoE,
drivers/scsi/fcoe/fcoe_ctlr.c+15−15
@@ -134,6 +134,7 @@ static void fcoe_ctlr_map_dest(struct fcoe_ctlr *fip) · 133 unmodified lines
134134 /**
135135 * fcoe_ctlr_init() - Initialize the FCoE Controller instance
136136 * @fip: The FCoE controller to initialize
137+ * @mode: FIP mode to set
137138 */
138139 void fcoe_ctlr_init(struct fcoe_ctlr *fip, enum fip_mode mode)
139140 {
@@ -336,7 +337,7 @@ static void fcoe_ctlr_announce(struct fcoe_ctlr *fip) · 196 unmodified lines
336337 printk(KERN_NOTICE "libfcoe: host%d: "
337338 "FIP Fibre-Channel Forwarder MAC %pM deselected\n",
338339 fip->lp->host->host_no, fip->dest_addr);
339− memset(fip->dest_addr, 0, ETH_ALEN);
340+ eth_zero_addr(fip->dest_addr);
340341 }
341342 if (sel) {
342343 printk(KERN_INFO "libfcoe: host%d: FIP selected "
@@ -587,6 +588,7 @@ static void fcoe_ctlr_send_keep_alive(struct fcoe_ctlr *fip, · 244 unmodified lines
587588 /**
588589 * fcoe_ctlr_encaps() - Encapsulate an ELS frame for FIP, without sending it
589590 * @fip: The FCoE controller for the ELS frame
591+ * @lport: The local port
590592 * @dtype: The FIP descriptor type for the frame
591593 * @skb: The FCoE ELS frame including FC header but no FCoE headers
592594 * @d_id: The destination port ID.
@@ -1302,7 +1304,7 @@ drop: · 709 unmodified lines
13021304 /**
13031305 * fcoe_ctlr_recv_els() - Handle an incoming link reset frame
13041306 * @fip: The FCoE controller that received the frame
1305− * @fh: The received FIP header
1307+ * @skb: The received FIP packet
13061308 *
13071309 * There may be multiple VN_Port descriptors.
13081310 * The overall length has already been checked.
@@ -1775,7 +1777,7 @@ unlock: · 466 unmodified lines
17751777
17761778 /**
17771779 * fcoe_ctlr_timeout() - FIP timeout handler
1778− * @arg: The FCoE controller that timed out
1780+ * @t: Timer context use to obtain the controller reference
17791781 */
17801782 static void fcoe_ctlr_timeout(struct timer_list *t)
17811783 {
@@ -1887,6 +1889,7 @@ static void fcoe_ctlr_recv_work(struct work_struct *recv_work) · 105 unmodified lines
18871889 /**
18881890 * fcoe_ctlr_recv_flogi() - Snoop pre-FIP receipt of FLOGI response
18891891 * @fip: The FCoE controller
1892+ * @lport: The local port
18901893 * @fp: The FC frame to snoop
18911894 *
18921895 * Snoop potential response to FLOGI or even incoming FLOGI.
@@ -2158,7 +2161,7 @@ static struct fc_rport_operations fcoe_ctlr_vn_rport_ops = { · 265 unmodified lines
21582161
21592162 /**
21602163 * fcoe_ctlr_disc_stop_locked() - stop discovery in VN2VN mode
2161− * @fip: The FCoE controller
2164+ * @lport: The local port
21622165 *
21632166 * Called with ctlr_mutex held.
21642167 */
@@ -2179,7 +2182,7 @@ static void fcoe_ctlr_disc_stop_locked(struct fc_lport *lport) · 14 unmodified lines
21792182
21802183 /**
21812184 * fcoe_ctlr_disc_stop() - stop discovery in VN2VN mode
2182− * @fip: The FCoE controller
2185+ * @lport: The local port
21832186 *
21842187 * Called through the local port template for discovery.
21852188 * Called without the ctlr_mutex held.
@@ -2195,7 +2198,7 @@ static void fcoe_ctlr_disc_stop(struct fc_lport *lport) · 9 unmodified lines
21952198
21962199 /**
21972200 * fcoe_ctlr_disc_stop_final() - stop discovery for shutdown in VN2VN mode
2198− * @fip: The FCoE controller
2201+ * @lport: The local port
21992202 *
22002203 * Called through the local port template for discovery.
22012204 * Called without the ctlr_mutex held.
@@ -2262,7 +2265,7 @@ static void fcoe_ctlr_vn_start(struct fcoe_ctlr *fip) · 60 unmodified lines
22622265 * fcoe_ctlr_vn_parse - parse probe request or response
22632266 * @fip: The FCoE controller
22642267 * @skb: incoming packet
2265− * @rdata: buffer for resulting parsed VN entry plus fcoe_rport
2268+ * @frport: parsed FCoE rport from the probe request
22662269 *
22672270 * Returns non-zero error number on error.
22682271 * Does not consume the packet.
@@ -2793,7 +2796,7 @@ drop: · 524 unmodified lines
27932796 * fcoe_ctlr_vlan_parse - parse vlan discovery request or response
27942797 * @fip: The FCoE controller
27952798 * @skb: incoming packet
2796− * @rdata: buffer for resulting parsed VLAN entry plus fcoe_rport
2799+ * @frport: parsed FCoE rport from the probe request
27972800 *
27982801 * Returns non-zero error number on error.
27992802 * Does not consume the packet.
@@ -2892,7 +2895,6 @@ len_err: · 92 unmodified lines
28922895 * @fip: The FCoE controller
28932896 * @sub: sub-opcode for vlan notification or vn2vn vlan notification
28942897 * @dest: The destination Ethernet MAC address
2895− * @min_len: minimum size of the Ethernet payload to be sent
28962898 */
28972899 static void fcoe_ctlr_vlan_send(struct fcoe_ctlr *fip,
28982900 enum fip_vlan_subcode sub,
@@ -2969,9 +2971,8 @@ static void fcoe_ctlr_vlan_disc_reply(struct fcoe_ctlr *fip, · 70 unmodified lines
29692971
29702972 /**
29712973 * fcoe_ctlr_vlan_recv - vlan request receive handler for VN2VN mode.
2972− * @lport: The local port
2973− * @fp: The received frame
2974− *
2974+ * @fip: The FCoE controller
2975+ * @skb: The received FIP packet
29752976 */
29762977 static int fcoe_ctlr_vlan_recv(struct fcoe_ctlr *fip, struct sk_buff *skb)
29772978 {
@@ -3015,9 +3016,8 @@ static void fcoe_ctlr_disc_recv(struct fc_lport *lport, struct fc_frame *fp) · 37 unmodified lines
30153016 fc_frame_free(fp);
30163017 }
30173018
3018−/**
3019− * fcoe_ctlr_disc_recv - start discovery for VN2VN mode.
3020− * @fip: The FCoE controller
3019+/*
3020+ * fcoe_ctlr_disc_start - start discovery for VN2VN mode.
30213021 *
30223022 * This sets a flag indicating that remote ports should be created
30233023 * and started for the peers we discover. We use the disc_callback
drivers/scsi/fcoe/fcoe_transport.c+3−1
@@ -382,6 +382,7 @@ EXPORT_SYMBOL_GPL(fcoe_clean_pending_queue); · 381 unmodified lines
382382 /**
383383 * fcoe_check_wait_queue() - Attempt to clear the transmit backlog
384384 * @lport: The local port whose backlog is to be cleared
385+ * @skb: The received FIP packet
385386 *
386387 * This empties the wait_queue, dequeues the head of the wait_queue queue
387388 * and calls fcoe_start_io() for each packet. If all skb have been
@@ -439,7 +440,7 @@ EXPORT_SYMBOL_GPL(fcoe_check_wait_queue); · 51 unmodified lines
439440
440441 /**
441442 * fcoe_queue_timer() - The fcoe queue timer
442− * @lport: The local port
443+ * @t: Timer context use to obtain the FCoE port
443444 *
444445 * Calls fcoe_check_wait_queue on timeout
445446 */
@@ -672,6 +673,7 @@ static void fcoe_del_netdev_mapping(struct net_device *netdev) · 226 unmodified lines
672673 /**
673674 * fcoe_netdev_map_lookup - find the fcoe transport that matches the netdev on which
674675 * it was created
676+ * @netdev: The net device that the FCoE interface is on
675677 *
676678 * Returns : ptr to the fcoe transport that supports this netdev or NULL
677679 * if not found.
drivers/scsi/fdomain.h+1−1
@@ -103,7 +103,7 @@ enum { · 102 unmodified lines
103103 #define REG_FIFO_COUNT 14 /* R: FIFO Data Count */
104104
105105 #ifdef CONFIG_PM_SLEEP
106−static const struct dev_pm_ops fdomain_pm_ops;
106+static const struct dev_pm_ops __maybe_unused fdomain_pm_ops;
107107 #define FDOMAIN_PM_OPS (&fdomain_pm_ops)
108108 #else
109109 #define FDOMAIN_PM_OPS NULL
drivers/scsi/fnic/fnic_scsi.c+2−1
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <linux/scatterlist.h>
2424 #include <linux/skbuff.h>
2525 #include <linux/spinlock.h>
26+#include <linux/etherdevice.h>
2627 #include <linux/if_ether.h>
2728 #include <linux/if_vlan.h>
2829 #include <linux/delay.h>
@@ -275,7 +276,7 @@ int fnic_flogi_reg_handler(struct fnic *fnic, u32 fc_id) · 246 unmodified lines
275276 }
276277
277278 if (fnic->ctlr.map_dest) {
278− memset(gw_mac, 0xff, ETH_ALEN);
279+ eth_broadcast_addr(gw_mac);
279280 format = FCPIO_FLOGI_REG_DEF_DEST;
280281 } else {
281282 memcpy(gw_mac, fnic->ctlr.dest_addr, ETH_ALEN);
drivers/scsi/hisi_sas/hisi_sas_v1_hw.c+3−1
@@ -1258,8 +1258,10 @@ static void slot_complete_v1_hw(struct hisi_hba *hisi_hba, · 1257 unmodified lines
12581258 !(cmplt_hdr_data & CMPLT_HDR_RSPNS_XFRD_MSK)) {
12591259
12601260 slot_err_v1_hw(hisi_hba, task, slot);
1261− if (unlikely(slot->abort))
1261+ if (unlikely(slot->abort)) {
1262+ sas_task_abort(task);
12621263 return;
1264+ }
12631265 goto out;
12641266 }
12651267
drivers/scsi/hisi_sas/hisi_sas_v2_hw.c+4−2
@@ -2404,8 +2404,10 @@ static void slot_complete_v2_hw(struct hisi_hba *hisi_hba, · 2403 unmodified lines
24042404 error_info[0], error_info[1],
24052405 error_info[2], error_info[3]);
24062406
2407− if (unlikely(slot->abort))
2407+ if (unlikely(slot->abort)) {
2408+ sas_task_abort(task);
24082409 return;
2410+ }
24092411 goto out;
24102412 }
24112413
@@ -3300,7 +3302,7 @@ static irq_handler_t fatal_interrupts[HISI_SAS_FATAL_INT_NR] = { · 888 unmodified lines
33003302 fatal_axi_int_v2_hw
33013303 };
33023304
3303−/**
3305+/*
33043306 * There is a limitation in the hip06 chipset that we need
33053307 * to map in all mbigen interrupts, even if they are not used.
33063308 */
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c+3−1
@@ -2235,8 +2235,10 @@ static void slot_complete_v3_hw(struct hisi_hba *hisi_hba, · 2234 unmodified lines
22352235 dw0, dw1, complete_hdr->act, dw3,
22362236 error_info[0], error_info[1],
22372237 error_info[2], error_info[3]);
2238− if (unlikely(slot->abort))
2238+ if (unlikely(slot->abort)) {
2239+ sas_task_abort(task);
22392240 return;
2241+ }
22402242 goto out;
22412243 }
22422244
drivers/scsi/hosts.c+5−3
@@ -272,8 +272,10 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, · 271 unmodified lines
272272 if (shost->transportt->create_work_queue) {
273273 snprintf(shost->work_q_name, sizeof(shost->work_q_name),
274274 "scsi_wq_%d", shost->host_no);
275− shost->work_q = create_singlethread_workqueue(
276− shost->work_q_name);
275+ shost->work_q = alloc_workqueue("%s",
276+ WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
277+ 1, shost->work_q_name);
278+
277279 if (!shost->work_q) {
278280 error = -EINVAL;
279281 goto out_free_shost_data;
@@ -487,7 +489,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize) · 207 unmodified lines
487489 }
488490
489491 shost->tmf_work_q = alloc_workqueue("scsi_tmf_%d",
490− WQ_UNBOUND | WQ_MEM_RECLAIM,
492+ WQ_UNBOUND | WQ_MEM_RECLAIM | WQ_SYSFS,
491493 1, shost->host_no);
492494 if (!shost->tmf_work_q) {
493495 shost_printk(KERN_WARNING, shost,
drivers/scsi/hpsa.c+27−8
@@ -59,7 +59,7 @@ · 58 unmodified lines
5959 * HPSA_DRIVER_VERSION must be 3 byte values (0-255) separated by '.'
6060 * with an optional trailing '-' followed by a byte value (0-255).
6161 */
62−#define HPSA_DRIVER_VERSION "3.4.20-170"
62+#define HPSA_DRIVER_VERSION "3.4.20-200"
6363 #define DRIVER_NAME "HP HPSA Driver (v " HPSA_DRIVER_VERSION ")"
6464 #define HPSA "hpsa"
6565
@@ -2134,6 +2134,7 @@ static int hpsa_slave_alloc(struct scsi_device *sdev) · 2068 unmodified lines
21342134 }
21352135
21362136 /* configure scsi device based on internal per-device structure */
2137+#define CTLR_TIMEOUT (120 * HZ)
21372138 static int hpsa_slave_configure(struct scsi_device *sdev)
21382139 {
21392140 struct hpsa_scsi_dev_t *sd;
@@ -2144,17 +2145,21 @@ static int hpsa_slave_configure(struct scsi_device *sdev) · 4 unmodified lines
21442145
21452146 if (sd) {
21462147 sd->was_removed = 0;
2148+ queue_depth = sd->queue_depth != 0 ?
2149+ sd->queue_depth : sdev->host->can_queue;
21472150 if (sd->external) {
21482151 queue_depth = EXTERNAL_QD;
21492152 sdev->eh_timeout = HPSA_EH_PTRAID_TIMEOUT;
21502153 blk_queue_rq_timeout(sdev->request_queue,
21512154 HPSA_EH_PTRAID_TIMEOUT);
2152− } else {
2153− queue_depth = sd->queue_depth != 0 ?
2154− sd->queue_depth : sdev->host->can_queue;
21552155 }
2156− } else
2156+ if (is_hba_lunid(sd->scsi3addr)) {
2157+ sdev->eh_timeout = CTLR_TIMEOUT;
2158+ blk_queue_rq_timeout(sdev->request_queue, CTLR_TIMEOUT);
2159+ }
2160+ } else {
21572161 queue_depth = sdev->host->can_queue;
2162+ }
21582163
21592164 scsi_change_queue_depth(sdev, queue_depth);
21602165
@@ -3443,9 +3448,14 @@ static void hpsa_get_enclosure_info(struct ctlr_info *h, · 1282 unmodified lines
34433448 struct ErrorInfo *ei = NULL;
34443449 struct bmic_sense_storage_box_params *bssbp = NULL;
34453450 struct bmic_identify_physical_device *id_phys = NULL;
3446− struct ext_report_lun_entry *rle = &rlep->LUN[rle_index];
3451+ struct ext_report_lun_entry *rle;
34473452 u16 bmic_device_index = 0;
34483453
3454+ if (rle_index < 0 || rle_index >= HPSA_MAX_PHYS_LUN)
3455+ return;
3456+
3457+ rle = &rlep->LUN[rle_index];
3458+
34493459 encl_dev->eli =
34503460 hpsa_get_enclosure_logical_identifier(h, scsi3addr);
34513461
@@ -4174,6 +4184,9 @@ static void hpsa_get_ioaccel_drive_info(struct ctlr_info *h, · 722 unmodified lines
41744184 int rc;
41754185 struct ext_report_lun_entry *rle;
41764186
4187+ if (rle_index < 0 || rle_index >= HPSA_MAX_PHYS_LUN)
4188+ return;
4189+
41774190 rle = &rlep->LUN[rle_index];
41784191
41794192 dev->ioaccel_handle = rle->ioaccel_handle;
@@ -4198,7 +4211,12 @@ static void hpsa_get_path_info(struct hpsa_scsi_dev_t *this_device, · 18 unmodified lines
41984211 struct ReportExtendedLUNdata *rlep, int rle_index,
41994212 struct bmic_identify_physical_device *id_phys)
42004213 {
4201− struct ext_report_lun_entry *rle = &rlep->LUN[rle_index];
4214+ struct ext_report_lun_entry *rle;
4215+
4216+ if (rle_index < 0 || rle_index >= HPSA_MAX_PHYS_LUN)
4217+ return;
4218+
4219+ rle = &rlep->LUN[rle_index];
42024220
42034221 if ((rle->device_flags & 0x08) && this_device->ioaccel_handle)
42044222 this_device->hba_ioaccel_enabled = 1;
@@ -4420,7 +4438,8 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) · 215 unmodified lines
44204438 /*
44214439 * Skip over some devices such as a spare.
44224440 */
4423− if (!tmpdevice->external && physical_device) {
4441+ if (phys_dev_index >= 0 && !tmpdevice->external &&
4442+ physical_device) {
44244443 skip_device = hpsa_skip_device(h, lunaddrbytes,
44254444 &physdev_list->LUN[phys_dev_index]);
44264445 if (skip_device)
drivers/scsi/hpsa.h+1−1
@@ -57,7 +57,7 @@ struct hpsa_sas_phy { · 56 unmodified lines
5757 bool added_to_port;
5858 };
5959
60−#define EXTERNAL_QD 7
60+#define EXTERNAL_QD 128
6161 struct hpsa_scsi_dev_t {
6262 unsigned int devtype;
6363 int bus, target, lun; /* as presented to the OS */
drivers/scsi/ibmvscsi/ibmvfc.c+1−1
@@ -1344,7 +1344,7 @@ static void ibmvfc_map_sg_list(struct scsi_cmnd *scmd, int nseg, · 1343 unmodified lines
13441344 }
13451345
13461346 /**
1347− * ibmvfc_map_sg_data - Maps dma for a scatterlist and initializes decriptor fields
1347+ * ibmvfc_map_sg_data - Maps dma for a scatterlist and initializes descriptor fields
13481348 * @scmd: struct scsi_cmnd with the scatterlist
13491349 * @evt: ibmvfc event struct
13501350 * @vfc_cmd: vfc_cmd that contains the memory descriptor
drivers/scsi/ibmvscsi/ibmvscsi.c+1−1
@@ -669,7 +669,7 @@ static int map_sg_list(struct scsi_cmnd *cmd, int nseg, · 668 unmodified lines
669669 }
670670
671671 /**
672− * map_sg_data: - Maps dma for a scatterlist and initializes decriptor fields
672+ * map_sg_data: - Maps dma for a scatterlist and initializes descriptor fields
673673 * @cmd: struct scsi_cmnd with the scatterlist
674674 * @srp_cmd: srp_cmd that contains the memory descriptor
675675 * @dev: device for which to map dma memory
drivers/scsi/imm.c+0−3
@@ -903,7 +903,6 @@ static int imm_engine(imm_struct *dev, struct scsi_cmnd *cmd) · 902 unmodified lines
903903 w_ctr(ppb, 0x4);
904904 }
905905 return 0; /* Finished */
906− break;
907906
908907 default:
909908 printk("imm: Invalid scsi phase\n");
@@ -969,10 +968,8 @@ static int imm_abort(struct scsi_cmnd *cmd) · 59 unmodified lines
969968 case 1: /* Have not connected to interface */
970969 dev->cur_cmd = NULL; /* Forget the problem */
971970 return SUCCESS;
972− break;
973971 default: /* SCSI command sent, can not abort */
974972 return FAILED;
975− break;
976973 }
977974 }
978975
drivers/scsi/ipr.c+57−33
@@ -670,6 +670,7 @@ static void ipr_reinit_ipr_cmnd(struct ipr_cmnd *ipr_cmd) · 669 unmodified lines
670670 /**
671671 * ipr_init_ipr_cmnd - Initialize an IPR Cmnd block
672672 * @ipr_cmd: ipr command struct
673+ * @fast_done: fast done function call-back
673674 *
674675 * Return value:
675676 * none
@@ -687,7 +688,7 @@ static void ipr_init_ipr_cmnd(struct ipr_cmnd *ipr_cmd, · 11 unmodified lines
687688
688689 /**
689690 * __ipr_get_free_ipr_cmnd - Get a free IPR Cmnd block
690− * @ioa_cfg: ioa config struct
691+ * @hrrq: hrr queue
691692 *
692693 * Return value:
693694 * pointer to ipr command struct
@@ -737,7 +738,6 @@ struct ipr_cmnd *ipr_get_free_ipr_cmnd(struct ipr_ioa_cfg *ioa_cfg) · 43 unmodified lines
737738 static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg,
738739 u32 clr_ints)
739740 {
740− volatile u32 int_reg;
741741 int i;
742742
743743 /* Stop new interrupts */
@@ -757,7 +757,7 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg, · 13 unmodified lines
757757 if (ioa_cfg->sis64)
758758 writel(~0, ioa_cfg->regs.clr_interrupt_reg);
759759 writel(clr_ints, ioa_cfg->regs.clr_interrupt_reg32);
760− int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
760+ readl(ioa_cfg->regs.sense_interrupt_reg);
761761 }
762762
763763 /**
@@ -1287,7 +1287,7 @@ static int ipr_is_same_device(struct ipr_resource_entry *res, · 523 unmodified lines
12871287 /**
12881288 * __ipr_format_res_path - Format the resource path for printing.
12891289 * @res_path: resource path
1290− * @buf: buffer
1290+ * @buffer: buffer
12911291 * @len: length of buffer provided
12921292 *
12931293 * Return value:
@@ -1310,7 +1310,7 @@ static char *__ipr_format_res_path(u8 *res_path, char *buffer, int len) · 16 unmodified lines
13101310 * ipr_format_res_path - Format the resource path for printing.
13111311 * @ioa_cfg: ioa config struct
13121312 * @res_path: resource path
1313− * @buf: buffer
1313+ * @buffer: buffer
13141314 * @len: length of buffer provided
13151315 *
13161316 * Return value:
@@ -1391,7 +1391,6 @@ static void ipr_update_res_entry(struct ipr_resource_entry *res, · 74 unmodified lines
13911391 * ipr_clear_res_target - Clear the bit in the bit map representing the target
13921392 * for the resource.
13931393 * @res: resource entry struct
1394− * @cfgtew: config table entry wrapper struct
13951394 *
13961395 * Return value:
13971396 * none
@@ -2667,7 +2666,7 @@ static void ipr_process_error(struct ipr_cmnd *ipr_cmd) · 1269 unmodified lines
26672666
26682667 /**
26692668 * ipr_timeout - An internally generated op has timed out.
2670− * @ipr_cmd: ipr command struct
2669+ * @t: Timer context used to fetch ipr command struct
26712670 *
26722671 * This function blocks host requests and initiates an
26732672 * adapter reset.
@@ -2700,7 +2699,7 @@ static void ipr_timeout(struct timer_list *t) · 26 unmodified lines
27002699
27012700 /**
27022701 * ipr_oper_timeout - Adapter timed out transitioning to operational
2703− * @ipr_cmd: ipr command struct
2702+ * @t: Timer context used to fetch ipr command struct
27042703 *
27052704 * This function blocks host requests and initiates an
27062705 * adapter reset.
@@ -3484,6 +3483,7 @@ static struct bin_attribute ipr_trace_attr = { · 777 unmodified lines
34843483 /**
34853484 * ipr_show_fw_version - Show the firmware version
34863485 * @dev: class device struct
3486+ * @attr: device attribute (unused)
34873487 * @buf: buffer
34883488 *
34893489 * Return value:
@@ -3518,6 +3518,7 @@ static struct device_attribute ipr_fw_version_attr = { · 28 unmodified lines
35183518 /**
35193519 * ipr_show_log_level - Show the adapter's error logging level
35203520 * @dev: class device struct
3521+ * @attr: device attribute (unused)
35213522 * @buf: buffer
35223523 *
35233524 * Return value:
@@ -3540,7 +3541,9 @@ static ssize_t ipr_show_log_level(struct device *dev, · 16 unmodified lines
35403541 /**
35413542 * ipr_store_log_level - Change the adapter's error logging level
35423543 * @dev: class device struct
3544+ * @attr: device attribute (unused)
35433545 * @buf: buffer
3546+ * @count: buffer size
35443547 *
35453548 * Return value:
35463549 * number of bytes printed to buffer
@@ -3571,6 +3574,7 @@ static struct device_attribute ipr_log_level_attr = { · 24 unmodified lines
35713574 /**
35723575 * ipr_store_diagnostics - IOA Diagnostics interface
35733576 * @dev: device struct
3577+ * @attr: device attribute (unused)
35743578 * @buf: buffer
35753579 * @count: buffer size
35763580 *
@@ -3631,7 +3635,8 @@ static struct device_attribute ipr_diagnostics_attr = { · 54 unmodified lines
36313635
36323636 /**
36333637 * ipr_show_adapter_state - Show the adapter's state
3634− * @class_dev: device struct
3638+ * @dev: device struct
3639+ * @attr: device attribute (unused)
36353640 * @buf: buffer
36363641 *
36373642 * Return value:
@@ -3657,6 +3662,7 @@ static ssize_t ipr_show_adapter_state(struct device *dev, · 19 unmodified lines
36573662 /**
36583663 * ipr_store_adapter_state - Change adapter state
36593664 * @dev: device struct
3665+ * @attr: device attribute (unused)
36603666 * @buf: buffer
36613667 * @count: buffer size
36623668 *
@@ -3708,6 +3714,7 @@ static struct device_attribute ipr_ioa_state_attr = { · 45 unmodified lines
37083714 /**
37093715 * ipr_store_reset_adapter - Reset the adapter
37103716 * @dev: device struct
3717+ * @attr: device attribute (unused)
37113718 * @buf: buffer
37123719 * @count: buffer size
37133720 *
@@ -3749,6 +3756,7 @@ static int ipr_iopoll(struct irq_poll *iop, int budget); · 35 unmodified lines
37493756 /**
37503757 * ipr_show_iopoll_weight - Show ipr polling mode
37513758 * @dev: class device struct
3759+ * @attr: device attribute (unused)
37523760 * @buf: buffer
37533761 *
37543762 * Return value:
@@ -3772,7 +3780,9 @@ static ssize_t ipr_show_iopoll_weight(struct device *dev, · 17 unmodified lines
37723780 /**
37733781 * ipr_store_iopoll_weight - Change the adapter's polling mode
37743782 * @dev: class device struct
3783+ * @attr: device attribute (unused)
37753784 * @buf: buffer
3785+ * @count: buffer size
37763786 *
37773787 * Return value:
37783788 * number of bytes printed to buffer
@@ -3871,7 +3881,7 @@ static struct ipr_sglist *ipr_alloc_ucode_buffer(int buf_len) · 92 unmodified lines
38713881
38723882 /**
38733883 * ipr_free_ucode_buffer - Frees a microcode download buffer
3874− * @p_dnld: scatter/gather list pointer
3884+ * @sglist: scatter/gather list pointer
38753885 *
38763886 * Free a DMA'able ucode download buffer previously allocated with
38773887 * ipr_alloc_ucode_buffer
@@ -4059,7 +4069,8 @@ static int ipr_update_ioa_ucode(struct ipr_ioa_cfg *ioa_cfg, · 181 unmodified lines
40594069
40604070 /**
40614071 * ipr_store_update_fw - Update the firmware on the adapter
4062− * @class_dev: device struct
4072+ * @dev: device struct
4073+ * @attr: device attribute (unused)
40634074 * @buf: buffer
40644075 * @count: buffer size
40654076 *
@@ -4139,6 +4150,7 @@ static struct device_attribute ipr_update_fw_attr = { · 73 unmodified lines
41394150 /**
41404151 * ipr_show_fw_type - Show the adapter's firmware type.
41414152 * @dev: class device struct
4153+ * @attr: device attribute (unused)
41424154 * @buf: buffer
41434155 *
41444156 * Return value:
@@ -4480,7 +4492,6 @@ static int ipr_free_dump(struct ipr_ioa_cfg *ioa_cfg) { return 0; }; · 335 unmodified lines
44804492 * ipr_change_queue_depth - Change the device's queue depth
44814493 * @sdev: scsi device struct
44824494 * @qdepth: depth to set
4483− * @reason: calling context
44844495 *
44854496 * Return value:
44864497 * actual depth set
@@ -4650,6 +4661,7 @@ static struct device_attribute ipr_resource_type_attr = { · 163 unmodified lines
46504661 /**
46514662 * ipr_show_raw_mode - Show the adapter's raw mode
46524663 * @dev: class device struct
4664+ * @attr: device attribute (unused)
46534665 * @buf: buffer
46544666 *
46554667 * Return value:
@@ -4677,7 +4689,9 @@ static ssize_t ipr_show_raw_mode(struct device *dev, · 21 unmodified lines
46774689 /**
46784690 * ipr_store_raw_mode - Change the adapter's raw mode
46794691 * @dev: class device struct
4692+ * @attr: device attribute (unused)
46804693 * @buf: buffer
4694+ * @count: buffer size
46814695 *
46824696 * Return value:
46834697 * number of bytes printed to buffer
@@ -5060,7 +5074,7 @@ static int ipr_match_lun(struct ipr_cmnd *ipr_cmd, void *device) · 376 unmodified lines
50605074
50615075 /**
50625076 * ipr_cmnd_is_free - Check if a command is free or not
5063− * @ipr_cmd ipr command struct
5077+ * @ipr_cmd: ipr command struct
50645078 *
50655079 * Returns:
50665080 * true / false
@@ -5096,7 +5110,7 @@ static int ipr_match_res(struct ipr_cmnd *ipr_cmd, void *resource) · 29 unmodified lines
50965110
50975111 /**
50985112 * ipr_wait_for_ops - Wait for matching commands to complete
5099− * @ipr_cmd: ipr command struct
5113+ * @ioa_cfg: ioa config struct
51005114 * @device: device to match (sdev)
51015115 * @match: match function to use
51025116 *
@@ -5261,6 +5275,7 @@ static int ipr_device_reset(struct ipr_ioa_cfg *ioa_cfg, · 158 unmodified lines
52615275 * ipr_sata_reset - Reset the SATA port
52625276 * @link: SATA link to reset
52635277 * @classes: class of the attached device
5278+ * @deadline: unused
52645279 *
52655280 * This function issues a SATA phy reset to the affected ATA link.
52665281 *
@@ -5440,7 +5455,7 @@ static void ipr_bus_reset_done(struct ipr_cmnd *ipr_cmd) · 173 unmodified lines
54405455
54415456 /**
54425457 * ipr_abort_timeout - An abort task has timed out
5443− * @ipr_cmd: ipr command struct
5458+ * @t: Timer context used to fetch ipr command struct
54445459 *
54455460 * This function handles when an abort task times out. If this
54465461 * happens we issue a bus reset since we have resources tied
@@ -5494,7 +5509,7 @@ static int ipr_cancel_op(struct scsi_cmnd *scsi_cmd) · 47 unmodified lines
54945509 struct ipr_ioa_cfg *ioa_cfg;
54955510 struct ipr_resource_entry *res;
54965511 struct ipr_cmd_pkt *cmd_pkt;
5497− u32 ioasc, int_reg;
5512+ u32 ioasc;
54985513 int i, op_found = 0;
54995514 struct ipr_hrr_queue *hrrq;
55005515
@@ -5517,7 +5532,7 @@ static int ipr_cancel_op(struct scsi_cmnd *scsi_cmd) · 16 unmodified lines
55175532 * by a still not detected EEH error. In such cases, reading a register will
55185533 * trigger the EEH recovery infrastructure.
55195534 */
5520− int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
5535+ readl(ioa_cfg->regs.sense_interrupt_reg);
55215536
55225537 if (!ipr_is_gscsi(res))
55235538 return FAILED;
@@ -5569,7 +5584,8 @@ static int ipr_cancel_op(struct scsi_cmnd *scsi_cmd) · 45 unmodified lines
55695584
55705585 /**
55715586 * ipr_eh_abort - Abort a single op
5572− * @scsi_cmd: scsi command struct
5587+ * @shost: scsi host struct
5588+ * @elapsed_time: elapsed time
55735589 *
55745590 * Return value:
55755591 * 0 if scan in progress / 1 if scan is complete
@@ -5696,6 +5712,7 @@ static irqreturn_t ipr_handle_other_interrupt(struct ipr_ioa_cfg *ioa_cfg, · 120 unmodified lines
56965712 * ipr_isr_eh - Interrupt service routine error handler
56975713 * @ioa_cfg: ioa config struct
56985714 * @msg: message to log
5715+ * @number: various meanings depending on the caller/message
56995716 *
57005717 * Return value:
57015718 * none
@@ -5762,7 +5779,6 @@ static int ipr_process_hrrq(struct ipr_hrr_queue *hrr_queue, int budget, · 60 unmodified lines
57625779
57635780 static int ipr_iopoll(struct irq_poll *iop, int budget)
57645781 {
5765− struct ipr_ioa_cfg *ioa_cfg;
57665782 struct ipr_hrr_queue *hrrq;
57675783 struct ipr_cmnd *ipr_cmd, *temp;
57685784 unsigned long hrrq_flags;
@@ -5770,7 +5786,6 @@ static int ipr_iopoll(struct irq_poll *iop, int budget) · 1 unmodified line
57705786 LIST_HEAD(doneq);
57715787
57725788 hrrq = container_of(iop, struct ipr_hrr_queue, iopoll);
5773− ioa_cfg = hrrq->ioa_cfg;
57745789
57755790 spin_lock_irqsave(hrrq->lock, hrrq_flags);
57765791 completed_ops = ipr_process_hrrq(hrrq, budget, &doneq);
@@ -6268,8 +6283,7 @@ static void ipr_dump_ioasa(struct ipr_ioa_cfg *ioa_cfg, · 491 unmodified lines
62686283
62696284 /**
62706285 * ipr_gen_sense - Generate SCSI sense data from an IOASA
6271− * @ioasa: IOASA
6272− * @sense_buf: sense data buffer
6286+ * @ipr_cmd: ipr command struct
62736287 *
62746288 * Return value:
62756289 * none
@@ -6702,7 +6716,7 @@ static int ipr_ioctl(struct scsi_device *sdev, unsigned int cmd, · 426 unmodified lines
67026716
67036717 /**
67046718 * ipr_info - Get information about the card/driver
6705− * @scsi_host: scsi host struct
6719+ * @host: scsi host struct
67066720 *
67076721 * Return value:
67086722 * pointer to buffer with description string
@@ -7592,7 +7606,7 @@ static int ipr_ioafp_mode_select_page28(struct ipr_cmnd *ipr_cmd) · 883 unmodified lines
75927606 /**
75937607 * ipr_build_mode_sense - Builds a mode sense command
75947608 * @ipr_cmd: ipr command struct
7595− * @res: resource entry struct
7609+ * @res_handle: resource entry struct
75967610 * @parm: Byte 2 of mode sense command
75977611 * @dma_addr: DMA address of mode sense buffer
75987612 * @xfer_len: Size of DMA buffer
@@ -7939,6 +7953,7 @@ static void ipr_build_ioa_service_action(struct ipr_cmnd *ipr_cmd, · 340 unmodified lines
79397953 /**
79407954 * ipr_ioafp_set_caching_parameters - Issue Set Cache parameters service
79417955 * action
7956+ * @ipr_cmd: ipr command struct
79427957 *
79437958 * Return value:
79447959 * none
@@ -7975,6 +7990,10 @@ static int ipr_ioafp_set_caching_parameters(struct ipr_cmnd *ipr_cmd) · 30 unmodified lines
79757990 /**
79767991 * ipr_ioafp_inquiry - Send an Inquiry to the adapter.
79777992 * @ipr_cmd: ipr command struct
7993+ * @flags: flags to send
7994+ * @page: page to inquire
7995+ * @dma_addr: DMA address
7996+ * @xfer_len: transfer data length
79787997 *
79797998 * This utility function sends an inquiry to the adapter.
79807999 *
@@ -8265,7 +8284,7 @@ static int ipr_ioafp_identify_hrrq(struct ipr_cmnd *ipr_cmd) · 284 unmodified lines
82658284
82668285 /**
82678286 * ipr_reset_timer_done - Adapter reset timer function
8268− * @ipr_cmd: ipr command struct
8287+ * @t: Timer context used to fetch ipr command struct
82698288 *
82708289 * Description: This function is used in adapter reset processing
82718290 * for timing events. If the reset_cmd pointer in the IOA
@@ -8659,7 +8678,6 @@ static int ipr_dump_mailbox_wait(struct ipr_cmnd *ipr_cmd) · 387 unmodified lines
86598678 static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
86608679 {
86618680 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
8662− u32 int_reg;
86638681
86648682 ENTER;
86658683 ioa_cfg->pdev->state_saved = true;
@@ -8675,7 +8693,7 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd) · 9 unmodified lines
86758693 if (ioa_cfg->sis64) {
86768694 /* Set the adapter to the correct endian mode. */
86778695 writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg);
8678− int_reg = readl(ioa_cfg->regs.endian_swap_reg);
8696+ readl(ioa_cfg->regs.endian_swap_reg);
86798697 }
86808698
86818699 if (ioa_cfg->ioa_unit_checked) {
@@ -9483,7 +9501,6 @@ static pci_ers_result_t ipr_pci_error_detected(struct pci_dev *pdev, · 801 unmodified lines
94839501 * Description: This is the second phase of adapter initialization
94849502 * This function takes care of initilizing the adapter to the point
94859503 * where it can accept new commands.
9486−
94879504 * Return value:
94889505 * 0 on success / -EIO on failure
94899506 **/
@@ -9597,7 +9614,7 @@ static void ipr_free_irqs(struct ipr_ioa_cfg *ioa_cfg) · 107 unmodified lines
95979614
95989615 /**
95999616 * ipr_free_all_resources - Free all allocated resources for an adapter.
9600− * @ipr_cmd: ipr command struct
9617+ * @ioa_cfg: ioa config struct
96019618 *
96029619 * This function frees all allocated resources for the
96039620 * specified adapter.
@@ -10059,7 +10076,8 @@ static int ipr_request_other_msi_irqs(struct ipr_ioa_cfg *ioa_cfg, · 455 unmodified lines
1005910076
1006010077 /**
1006110078 * ipr_test_intr - Handle the interrupt generated in ipr_test_msi().
10062− * @pdev: PCI device struct
10079+ * @devp: PCI device struct
10080+ * @irq: IRQ number
1006310081 *
1006410082 * Description: Simply set the msi_received flag to 1 indicating that
1006510083 * Message Signaled Interrupts are supported.
@@ -10085,6 +10103,7 @@ static irqreturn_t ipr_test_intr(int irq, void *devp) · 19 unmodified lines
1008510103
1008610104 /**
1008710105 * ipr_test_msi - Test for Message Signaled Interrupt (MSI) support.
10106+ * @ioa_cfg: ioa config struct
1008810107 * @pdev: PCI device struct
1008910108 *
1009010109 * Description: This routine sets up and initiates a test interrupt to determine
@@ -10097,7 +10116,6 @@ static irqreturn_t ipr_test_intr(int irq, void *devp) · 6 unmodified lines
1009710116 static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev)
1009810117 {
1009910118 int rc;
10100− volatile u32 int_reg;
1010110119 unsigned long lock_flags = 0;
1010210120 int irq = pci_irq_vector(pdev, 0);
1010310121
@@ -10108,7 +10126,7 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev) · 4 unmodified lines
1010810126 ioa_cfg->msi_received = 0;
1010910127 ipr_mask_and_clear_interrupts(ioa_cfg, ~IPR_PCII_IOA_TRANS_TO_OPER);
1011010128 writel(IPR_PCII_IO_DEBUG_ACKNOWLEDGE, ioa_cfg->regs.clr_interrupt_mask_reg32);
10111− int_reg = readl(ioa_cfg->regs.sense_interrupt_mask_reg);
10129+ readl(ioa_cfg->regs.sense_interrupt_mask_reg);
1011210130 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
1011310131
1011410132 rc = request_irq(irq, ipr_test_intr, 0, IPR_NAME, ioa_cfg);
@@ -10119,7 +10137,7 @@ static int ipr_test_msi(struct ipr_ioa_cfg *ioa_cfg, struct pci_dev *pdev) · 4 unmodified lines
1011910137 dev_info(&pdev->dev, "IRQ assigned: %d\n", irq);
1012010138
1012110139 writel(IPR_PCII_IO_DEBUG_ACKNOWLEDGE, ioa_cfg->regs.sense_interrupt_reg32);
10122− int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
10140+ readl(ioa_cfg->regs.sense_interrupt_reg);
1012310141 wait_event_timeout(ioa_cfg->msi_wait_q, ioa_cfg->msi_received, HZ);
1012410142 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
1012510143 ipr_mask_and_clear_interrupts(ioa_cfg, ~IPR_PCII_IOA_TRANS_TO_OPER);
@@ -10530,6 +10548,8 @@ static void ipr_remove(struct pci_dev *pdev) · 404 unmodified lines
1053010548
1053110549 /**
1053210550 * ipr_probe - Adapter hot plug add entry point
10551+ * @pdev: pci device struct
10552+ * @dev_id: pci device ID
1053310553 *
1053410554 * Return value:
1053510555 * 0 on success / non-zero on failure
@@ -10786,6 +10806,7 @@ static struct pci_driver ipr_driver = { · 250 unmodified lines
1078610806
1078710807 /**
1078810808 * ipr_halt_done - Shutdown prepare completion
10809+ * @ipr_cmd: ipr command struct
1078910810 *
1079010811 * Return value:
1079110812 * none
@@ -10797,6 +10818,9 @@ static void ipr_halt_done(struct ipr_cmnd *ipr_cmd) · 5 unmodified lines
1079710818
1079810819 /**
1079910820 * ipr_halt - Issue shutdown prepare to all adapters
10821+ * @nb: Notifier block
10822+ * @event: Notifier event
10823+ * @buf: Notifier data (unused)
1080010824 *
1080110825 * Return value:
1080210826 * NOTIFY_OK on success / NOTIFY_DONE on failure
drivers/scsi/ipr.h+2−2
@@ -1684,7 +1684,7 @@ struct ipr_dump_entry_header { · 1683 unmodified lines
16841684 struct ipr_dump_location_entry {
16851685 struct ipr_dump_entry_header hdr;
16861686 u8 location[20];
1687−}__attribute__((packed));
1687+}__attribute__((packed, aligned (4)));
16881688
16891689 struct ipr_dump_trace_entry {
16901690 struct ipr_dump_entry_header hdr;
@@ -1708,7 +1708,7 @@ struct ipr_driver_dump { · 17 unmodified lines
17081708 struct ipr_dump_location_entry location_entry;
17091709 struct ipr_dump_ioa_type_entry ioa_type_entry;
17101710 struct ipr_dump_trace_entry trace_entry;
1711−}__attribute__((packed));
1711+}__attribute__((packed, aligned (4)));
17121712
17131713 struct ipr_ioa_dump {
17141714 struct ipr_dump_entry_header hdr;
drivers/scsi/ips.c+13−21
@@ -2239,7 +2239,7 @@ ips_get_bios_version(ips_ha_t * ha, int intr) · 2238 unmodified lines
22392239 major = 0;
22402240 minor = 0;
22412241
2242− strncpy(ha->bios_version, " ?", 8);
2242+ memcpy(ha->bios_version, " ?", 8);
22432243
22442244 if (ha->pcidev->device == IPS_DEVICEID_COPPERHEAD) {
22452245 if (IPS_USE_MEMIO(ha)) {
@@ -3515,11 +3515,11 @@ ips_send_cmd(ips_ha_t * ha, ips_scb_t * scb) · 1269 unmodified lines
35153515 inquiry.Flags[1] =
35163516 IPS_SCSI_INQ_WBus16 |
35173517 IPS_SCSI_INQ_Sync;
3518− strncpy(inquiry.VendorId, "IBM ",
3518+ memcpy(inquiry.VendorId, "IBM ",
35193519 8);
3520− strncpy(inquiry.ProductId,
3520+ memcpy(inquiry.ProductId,
35213521 "SERVERAID ", 16);
3522− strncpy(inquiry.ProductRevisionLevel,
3522+ memcpy(inquiry.ProductRevisionLevel,
35233523 "1.00", 4);
35243524
35253525 ips_scmd_buf_write(scb->scsi_cmd,
@@ -4036,9 +4036,9 @@ ips_inquiry(ips_ha_t * ha, ips_scb_t * scb) · 510 unmodified lines
40364036 inquiry.Flags[0] = IPS_SCSI_INQ_Address16;
40374037 inquiry.Flags[1] =
40384038 IPS_SCSI_INQ_WBus16 | IPS_SCSI_INQ_Sync | IPS_SCSI_INQ_CmdQue;
4039− strncpy(inquiry.VendorId, "IBM ", 8);
4040− strncpy(inquiry.ProductId, "SERVERAID ", 16);
4041− strncpy(inquiry.ProductRevisionLevel, "1.00", 4);
4039+ memcpy(inquiry.VendorId, "IBM ", 8);
4040+ memcpy(inquiry.ProductId, "SERVERAID ", 16);
4041+ memcpy(inquiry.ProductRevisionLevel, "1.00", 4);
40424042
40434043 ips_scmd_buf_write(scb->scsi_cmd, &inquiry, sizeof (inquiry));
40444044
@@ -4697,7 +4697,6 @@ ips_init_copperhead(ips_ha_t * ha) · 652 unmodified lines
46974697 uint8_t Isr;
46984698 uint8_t Cbsp;
46994699 uint8_t PostByte[IPS_MAX_POST_BYTES];
4700− uint8_t ConfigByte[IPS_MAX_CONFIG_BYTES];
47014700 int i, j;
47024701
47034702 METHOD_TRACE("ips_init_copperhead", 1);
@@ -4742,7 +4741,7 @@ ips_init_copperhead(ips_ha_t * ha) · 38 unmodified lines
47424741 /* error occurred */
47434742 return (0);
47444743
4745− ConfigByte[i] = inb(ha->io_addr + IPS_REG_ISPR);
4744+ inb(ha->io_addr + IPS_REG_ISPR);
47464745 outb(Isr, ha->io_addr + IPS_REG_HISR);
47474746 }
47484747
@@ -4791,7 +4790,6 @@ ips_init_copperhead_memio(ips_ha_t * ha) · 42 unmodified lines
47914790 uint8_t Isr = 0;
47924791 uint8_t Cbsp;
47934792 uint8_t PostByte[IPS_MAX_POST_BYTES];
4794− uint8_t ConfigByte[IPS_MAX_CONFIG_BYTES];
47954793 int i, j;
47964794
47974795 METHOD_TRACE("ips_init_copperhead_memio", 1);
@@ -4836,7 +4834,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) · 38 unmodified lines
48364834 /* error occurred */
48374835 return (0);
48384836
4839− ConfigByte[i] = readb(ha->mem_ptr + IPS_REG_ISPR);
4837+ readb(ha->mem_ptr + IPS_REG_ISPR);
48404838 writeb(Isr, ha->mem_ptr + IPS_REG_HISR);
48414839 }
48424840
@@ -5622,10 +5620,10 @@ ips_write_driver_status(ips_ha_t * ha, int intr) · 779 unmodified lines
56225620 /* change values (as needed) */
56235621 ha->nvram->operating_system = IPS_OS_LINUX;
56245622 ha->nvram->adapter_type = ha->ad_type;
5625− strncpy((char *) ha->nvram->driver_high, IPS_VERSION_HIGH, 4);
5626− strncpy((char *) ha->nvram->driver_low, IPS_VERSION_LOW, 4);
5627− strncpy((char *) ha->nvram->bios_high, ha->bios_version, 4);
5628− strncpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4);
5623+ memcpy((char *) ha->nvram->driver_high, IPS_VERSION_HIGH, 4);
5624+ memcpy((char *) ha->nvram->driver_low, IPS_VERSION_LOW, 4);
5625+ memcpy((char *) ha->nvram->bios_high, ha->bios_version, 4);
5626+ memcpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4);
56295627
56305628 ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */
56315629
@@ -6835,8 +6833,6 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) · 1203 unmodified lines
68356833 uint32_t mem_addr;
68366834 uint32_t io_len;
68376835 uint32_t mem_len;
6838− uint8_t bus;
6839− uint8_t func;
68406836 int j;
68416837 int index;
68426838 dma_addr_t dma_address;
@@ -6856,10 +6852,6 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) · 13 unmodified lines
68566852 if (index >= IPS_MAX_ADAPTERS)
68576853 return -1;
68586854
6859− /* stuff that we get in dev */
6860− bus = pci_dev->bus->number;
6861− func = pci_dev->devfn;
6862−
68636855 /* Init MEM/IO addresses to 0 */
68646856 mem_addr = 0;
68656857 io_addr = 0;
drivers/scsi/isci/request.c+1−1
@@ -3444,7 +3444,7 @@ struct isci_request *isci_tmf_request_from_tag(struct isci_host *ihost, · 3443 unmodified lines
34443444 int isci_request_execute(struct isci_host *ihost, struct isci_remote_device *idev,
34453445 struct sas_task *task, u16 tag)
34463446 {
3447− enum sci_status status = SCI_FAILURE_UNSUPPORTED_PROTOCOL;
3447+ enum sci_status status;
34483448 struct isci_request *ireq;
34493449 unsigned long flags;
34503450 int ret = 0;
drivers/scsi/libfc/fc_disc.c+3−3
@@ -337,7 +337,7 @@ static void fc_disc_error(struct fc_disc *disc, struct fc_frame *fp) · 336 unmodified lines
337337
338338 /**
339339 * fc_disc_gpn_ft_req() - Send Get Port Names by FC-4 type (GPN_FT) request
340− * @lport: The discovery context
340+ * @disc: The discovery context
341341 */
342342 static void fc_disc_gpn_ft_req(struct fc_disc *disc)
343343 {
@@ -370,7 +370,7 @@ err: · 26 unmodified lines
370370
371371 /**
372372 * fc_disc_gpn_ft_parse() - Parse the body of the dNS GPN_FT response.
373− * @lport: The local port the GPN_FT was received on
373+ * @disc: The discovery context
374374 * @buf: The GPN_FT response buffer
375375 * @len: The size of response buffer
376376 *
@@ -488,7 +488,7 @@ static void fc_disc_timeout(struct work_struct *work) · 111 unmodified lines
488488 * fc_disc_gpn_ft_resp() - Handle a response frame from Get Port Names (GPN_FT)
489489 * @sp: The sequence that the GPN_FT response was received on
490490 * @fp: The GPN_FT response frame
491− * @lp_arg: The discovery context
491+ * @disc_arg: The discovery context
492492 *
493493 * Locking Note: This function is called without disc mutex held, and
494494 * should do all its processing with the mutex held
drivers/scsi/libfc/fc_exch.c+6−1
@@ -49,6 +49,8 @@ static struct workqueue_struct *fc_exch_workqueue; · 48 unmodified lines
4949 * @total_exches: Total allocated exchanges
5050 * @lock: Exch pool lock
5151 * @ex_list: List of exchanges
52+ * @left: Cache of free slot in exch array
53+ * @right: Cache of free slot in exch array
5254 *
5355 * This structure manages per cpu exchanges in array of exchange pointers.
5456 * This array is allocated followed by struct fc_exch_pool memory for
@@ -60,7 +62,6 @@ struct fc_exch_pool { · 5 unmodified lines
6062 u16 next_index;
6163 u16 total_exches;
6264
63− /* two cache of free slot in exch array */
6465 u16 left;
6566 u16 right;
6667 } ____cacheline_aligned_in_smp;
@@ -74,6 +75,7 @@ struct fc_exch_pool { · 7 unmodified lines
7475 * @ep_pool: Reserved exchange pointers
7576 * @pool_max_index: Max exch array index in exch pool
7677 * @pool: Per cpu exch pool
78+ * @lport: Local exchange port
7779 * @stats: Statistics structure
7880 *
7981 * This structure is the center for creating exchanges and sequences.
@@ -702,6 +704,9 @@ int fc_seq_exch_abort(const struct fc_seq *req_sp, unsigned int timer_msec) · 622 unmodified lines
702704
703705 /**
704706 * fc_invoke_resp() - invoke ep->resp()
707+ * @ep: The exchange to be operated on
708+ * @fp: The frame pointer to pass through to ->resp()
709+ * @sp: The sequence pointer to pass through to ->resp()
705710 *
706711 * Notes:
707712 * It is assumed that after initialization finished (this means the
drivers/scsi/libfc/fc_fcp.c+7−4
@@ -289,6 +289,7 @@ static int fc_fcp_send_abort(struct fc_fcp_pkt *fsp) · 288 unmodified lines
289289 /**
290290 * fc_fcp_retry_cmd() - Retry a fcp_pkt
291291 * @fsp: The FCP packet to be retried
292+ * @status_code: The FCP status code to set
292293 *
293294 * Sets the status code to be FC_ERROR and then calls
294295 * fc_fcp_complete_locked() which in turn calls fc_io_compl().
@@ -580,7 +581,7 @@ err: · 285 unmodified lines
580581 /**
581582 * fc_fcp_send_data() - Send SCSI data to a target
582583 * @fsp: The FCP packet the data is on
583− * @sp: The sequence the data is to be sent on
584+ * @seq: The sequence the data is to be sent on
584585 * @offset: The starting offset for this data request
585586 * @seq_blen: The burst length for this data request
586587 *
@@ -1283,7 +1284,7 @@ static int fc_fcp_pkt_abort(struct fc_fcp_pkt *fsp) · 696 unmodified lines
12831284
12841285 /**
12851286 * fc_lun_reset_send() - Send LUN reset command
1286− * @data: The FCP packet that identifies the LUN to be reset
1287+ * @t: Timer context used to fetch the FSP packet
12871288 */
12881289 static void fc_lun_reset_send(struct timer_list *t)
12891290 {
@@ -1409,7 +1410,7 @@ static void fc_fcp_cleanup(struct fc_lport *lport) · 119 unmodified lines
14091410
14101411 /**
14111412 * fc_fcp_timeout() - Handler for fcp_pkt timeouts
1412− * @data: The FCP packet that has timed out
1413+ * @t: Timer context used to fetch the FSP packet
14131414 *
14141415 * If REC is supported then just issue it and return. The REC exchange will
14151416 * complete or time out and recovery can continue at that point. Otherwise,
@@ -1691,6 +1692,7 @@ out: · 275 unmodified lines
16911692 /**
16921693 * fc_fcp_recovery() - Handler for fcp_pkt recovery
16931694 * @fsp: The FCP pkt that needs to be aborted
1695+ * @code: The FCP status code to set
16941696 */
16951697 static void fc_fcp_recovery(struct fc_fcp_pkt *fsp, u8 code)
16961698 {
@@ -1709,6 +1711,7 @@ static void fc_fcp_recovery(struct fc_fcp_pkt *fsp, u8 code) · 12 unmodified lines
17091711 * fc_fcp_srr() - Send a SRR request (Sequence Retransmission Request)
17101712 * @fsp: The FCP packet the SRR is to be sent on
17111713 * @r_ctl: The R_CTL field for the SRR request
1714+ * @offset: The SRR relative offset
17121715 * This is called after receiving status but insufficient data, or
17131716 * when expecting status but the request has timed out.
17141717 */
@@ -1851,7 +1854,7 @@ static inline int fc_fcp_lport_queue_ready(struct fc_lport *lport) · 136 unmodified lines
18511854 /**
18521855 * fc_queuecommand() - The queuecommand function of the SCSI template
18531856 * @shost: The Scsi_Host that the command was issued to
1854− * @cmd: The scsi_cmnd to be executed
1857+ * @sc_cmd: The scsi_cmnd to be executed
18551858 *
18561859 * This is the i/o strategy routine, called by the SCSI layer.
18571860 */
drivers/scsi/libfc/fc_lport.c+5−2
@@ -405,7 +405,7 @@ static void fc_lport_recv_rlir_req(struct fc_lport *lport, struct fc_frame *fp) · 404 unmodified lines
405405 /**
406406 * fc_lport_recv_echo_req() - Handle received ECHO request
407407 * @lport: The local port receiving the ECHO
408− * @fp: ECHO request frame
408+ * @in_fp: ECHO request frame
409409 */
410410 static void fc_lport_recv_echo_req(struct fc_lport *lport,
411411 struct fc_frame *in_fp)
@@ -440,7 +440,7 @@ static void fc_lport_recv_echo_req(struct fc_lport *lport, · 28 unmodified lines
440440 /**
441441 * fc_lport_recv_rnid_req() - Handle received Request Node ID data request
442442 * @lport: The local port receiving the RNID
443− * @fp: The RNID request frame
443+ * @in_fp: The RNID request frame
444444 */
445445 static void fc_lport_recv_rnid_req(struct fc_lport *lport,
446446 struct fc_frame *in_fp)
@@ -1325,6 +1325,7 @@ static void fc_lport_enter_scr(struct fc_lport *lport) · 878 unmodified lines
13251325 /**
13261326 * fc_lport_enter_ns() - register some object with the name server
13271327 * @lport: Fibre Channel local port to register
1328+ * @state: Local port state
13281329 */
13291330 static void fc_lport_enter_ns(struct fc_lport *lport, enum fc_lport_state state)
13301331 {
@@ -1423,6 +1424,7 @@ err: · 92 unmodified lines
14231424 /**
14241425 * fc_lport_enter_ms() - management server commands
14251426 * @lport: Fibre Channel local port to register
1427+ * @state: Local port state
14261428 */
14271429 static void fc_lport_enter_ms(struct fc_lport *lport, enum fc_lport_state state)
14281430 {
@@ -1932,6 +1934,7 @@ static void fc_lport_bsg_resp(struct fc_seq *sp, struct fc_frame *fp, · 503 unmodified lines
19321934 * @job: The BSG Passthrough job
19331935 * @lport: The local port sending the request
19341936 * @did: The destination port id
1937+ * @tov: The timeout period (in ms)
19351938 */
19361939 static int fc_lport_els_request(struct bsg_job *job,
19371940 struct fc_lport *lport,
drivers/scsi/libfc/fc_rport.c+2−2
@@ -121,7 +121,7 @@ EXPORT_SYMBOL(fc_rport_lookup); · 120 unmodified lines
121121 /**
122122 * fc_rport_create() - Create a new remote port
123123 * @lport: The local port this remote port will be associated with
124− * @ids: The identifiers for the new remote port
124+ * @port_id: The identifiers for the new remote port
125125 *
126126 * The remote port will start in the INIT state.
127127 */
@@ -1445,7 +1445,7 @@ drop: · 1317 unmodified lines
14451445 * fc_rport_logo_resp() - Handler for logout (LOGO) responses
14461446 * @sp: The sequence the LOGO was on
14471447 * @fp: The LOGO response frame
1448− * @lport_arg: The local port
1448+ * @rdata_arg: The remote port
14491449 */
14501450 static void fc_rport_logo_resp(struct fc_seq *sp, struct fc_frame *fp,
14511451 void *rdata_arg)
drivers/scsi/libsas/sas_ata.c+15−2
@@ -507,10 +507,23 @@ void sas_ata_end_eh(struct ata_port *ap) · 506 unmodified lines
507507 spin_unlock_irqrestore(&ha->lock, flags);
508508 }
509509
510+static int sas_ata_prereset(struct ata_link *link, unsigned long deadline)
511+{
512+ struct ata_port *ap = link->ap;
513+ struct domain_device *dev = ap->private_data;
514+ struct sas_phy *local_phy = sas_get_local_phy(dev);
515+ int res = 0;
516+
517+ if (!local_phy->enabled || test_bit(SAS_DEV_GONE, &dev->state))
518+ res = -ENOENT;
519+ sas_put_local_phy(local_phy);
520+
521+ return res;
522+}
523+
510524 static struct ata_port_operations sas_sata_ops = {
511− .prereset = ata_std_prereset,
525+ .prereset = sas_ata_prereset,
512526 .hardreset = sas_ata_hard_reset,
513− .postreset = ata_std_postreset,
514527 .error_handler = ata_std_error_handler,
515528 .post_internal_cmd = sas_ata_post_internal,
516529 .qc_defer = ata_std_qc_defer,
drivers/scsi/libsas/sas_expander.c+1−1
@@ -427,7 +427,7 @@ out_err: · 426 unmodified lines
427427 static int sas_expander_discover(struct domain_device *dev)
428428 {
429429 struct expander_device *ex = &dev->ex_dev;
430− int res = -ENOMEM;
430+ int res;
431431
432432 ex->ex_phy = kcalloc(ex->num_phys, sizeof(*ex->ex_phy), GFP_KERNEL);
433433 if (!ex->ex_phy)
drivers/scsi/lpfc/lpfc.h+15−0
@@ -627,6 +627,14 @@ struct lpfc_ras_fwlog { · 626 unmodified lines
627627 enum ras_state state; /* RAS logging running state */
628628 };
629629
630+#define DBG_LOG_STR_SZ 256
631+#define DBG_LOG_SZ 256
632+
633+struct dbg_log_ent {
634+ char log[DBG_LOG_STR_SZ];
635+ u64 t_ns;
636+};
637+
630638 enum lpfc_irq_chann_mode {
631639 /* Assign IRQs to all possible cpus that have hardware queues */
632640 NORMAL_MODE,
@@ -709,6 +717,9 @@ struct lpfc_hba { · 76 unmodified lines
709717 struct workqueue_struct *wq;
710718 struct delayed_work eq_delay_work;
711719
720+#define LPFC_IDLE_STAT_DELAY 1000
721+ struct delayed_work idle_stat_delay_work;
722+
712723 struct lpfc_sli sli;
713724 uint8_t pci_dev_grp; /* lpfc PCI dev group: 0x0, 0x1, 0x2,... */
714725 uint32_t sli_rev; /* SLI2, SLI3, or SLI4 */
@@ -1237,6 +1248,10 @@ struct lpfc_hba { · 522 unmodified lines
12371248 struct scsi_host_template port_template;
12381249 /* SCSI host template information - for all vports */
12391250 struct scsi_host_template vport_template;
1251+ atomic_t dbg_log_idx;
1252+ atomic_t dbg_log_cnt;
1253+ atomic_t dbg_log_dmping;
1254+ struct dbg_log_ent dbg_log[DBG_LOG_SZ];
12401255 };
12411256
12421257 static inline struct Scsi_Host *
drivers/scsi/lpfc/lpfc_bsg.c+17−18
@@ -2404,33 +2404,27 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job) · 2403 unmodified lines
24042404 union lpfc_sli4_cfg_shdr *shdr;
24052405 uint32_t shdr_status, shdr_add_status;
24062406 struct diag_status *diag_status_reply;
2407− int mbxstatus, rc = 0;
2407+ int mbxstatus, rc = -ENODEV, rc1 = 0;
24082408
24092409 shost = fc_bsg_to_shost(job);
2410− if (!shost) {
2411− rc = -ENODEV;
2410+ if (!shost)
24122411 goto job_error;
2413− }
2412+
24142413 vport = shost_priv(shost);
2415− if (!vport) {
2416− rc = -ENODEV;
2414+ if (!vport)
24172415 goto job_error;
2418− }
2416+
24192417 phba = vport->phba;
2420− if (!phba) {
2421− rc = -ENODEV;
2418+ if (!phba)
24222419 goto job_error;
2423− }
24242420
2425− if (phba->sli_rev < LPFC_SLI_REV4) {
2426− rc = -ENODEV;
2421+
2422+ if (phba->sli_rev < LPFC_SLI_REV4)
24272423 goto job_error;
2428− }
2424+
24292425 if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) <
2430− LPFC_SLI_INTF_IF_TYPE_2) {
2431− rc = -ENODEV;
2426+ LPFC_SLI_INTF_IF_TYPE_2)
24322427 goto job_error;
2433− }
24342428
24352429 if (job->request_len < sizeof(struct fc_bsg_request) +
24362430 sizeof(struct sli4_link_diag)) {
@@ -2465,8 +2459,10 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job) · 28 unmodified lines
24652459 alloc_len = lpfc_sli4_config(phba, pmboxq, LPFC_MBOX_SUBSYSTEM_FCOE,
24662460 LPFC_MBOX_OPCODE_FCOE_LINK_DIAG_STATE,
24672461 req_len, LPFC_SLI4_MBX_EMBED);
2468− if (alloc_len != req_len)
2462+ if (alloc_len != req_len) {
2463+ rc = -ENOMEM;
24692464 goto link_diag_test_exit;
2465+ }
24702466
24712467 run_link_diag_test = &pmboxq->u.mqe.un.link_diag_test;
24722468 bf_set(lpfc_mbx_run_diag_test_link_num, &run_link_diag_test->u.req,
@@ -2515,7 +2511,7 @@ lpfc_sli4_bsg_link_diag_test(struct bsg_job *job) · 42 unmodified lines
25152511 diag_status_reply->shdr_add_status = shdr_add_status;
25162512
25172513 link_diag_test_exit:
2518− rc = lpfc_sli4_bsg_set_link_diag_state(phba, 0);
2514+ rc1 = lpfc_sli4_bsg_set_link_diag_state(phba, 0);
25192515
25202516 if (pmboxq)
25212517 mempool_free(pmboxq, phba->mbox_mem_pool);
@@ -2524,6 +2520,8 @@ link_diag_test_exit: · 2 unmodified lines
25242520
25252521 job_error:
25262522 /* make error code available to userspace */
2523+ if (rc1 && !rc)
2524+ rc = rc1;
25272525 bsg_reply->result = rc;
25282526 /* complete the job back to userspace if no error */
25292527 if (rc == 0)
@@ -4306,6 +4304,7 @@ lpfc_bsg_handle_sli_cfg_mbox(struct lpfc_hba *phba, struct bsg_job *job, · 1776 unmodified lines
43064304 case COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES:
43074305 case COMN_OPCODE_GET_CNTL_ATTRIBUTES:
43084306 case COMN_OPCODE_GET_PROFILE_CONFIG:
4307+ case COMN_OPCODE_SET_FEATURES:
43094308 lpfc_printf_log(phba, KERN_INFO, LOG_LIBDFC,
43104309 "3106 Handled SLI_CONFIG "
43114310 "subsys_comn, opcode:x%x\n",
drivers/scsi/lpfc/lpfc_bsg.h+14−0
@@ -225,6 +225,10 @@ struct lpfc_sli_config_hdr { · 224 unmodified lines
225225 uint32_t reserved5;
226226 };
227227
228+#define LPFC_CSF_BOOT_DEV 0x1D
229+#define LPFC_CSF_QUERY 0
230+#define LPFC_CSF_SAVE 1
231+
228232 struct lpfc_sli_config_emb0_subsys {
229233 struct lpfc_sli_config_hdr sli_config_hdr;
230234 #define LPFC_MBX_SLI_CONFIG_MAX_MSE 19
@@ -243,6 +247,15 @@ struct lpfc_sli_config_emb0_subsys { · 12 unmodified lines
243247 #define FCOE_OPCODE_ADD_FCF 0x09
244248 #define FCOE_OPCODE_SET_DPORT_MODE 0x27
245249 #define FCOE_OPCODE_GET_DPORT_RESULTS 0x28
250+ uint32_t timeout; /* comn_set_feature timeout */
251+ uint32_t request_length; /* comn_set_feature request len */
252+ uint32_t version; /* comn_set_feature version */
253+ uint32_t csf_feature; /* comn_set_feature feature */
254+ uint32_t word69; /* comn_set_feature parameter len */
255+ uint32_t word70; /* comn_set_feature parameter val0 */
256+#define lpfc_emb0_subcmnd_csf_p0_SHIFT 0
257+#define lpfc_emb0_subcmnd_csf_p0_MASK 0x3
258+#define lpfc_emb0_subcmnd_csf_p0_WORD word70
246259 };
247260
248261 struct lpfc_sli_config_emb1_subsys {
@@ -261,6 +274,7 @@ struct lpfc_sli_config_emb1_subsys { · 12 unmodified lines
261274 #define COMN_OPCODE_WRITE_OBJECT 0xAC
262275 #define COMN_OPCODE_READ_OBJECT_LIST 0xAD
263276 #define COMN_OPCODE_DELETE_OBJECT 0xAE
277+#define COMN_OPCODE_SET_FEATURES 0xBF
264278 #define COMN_OPCODE_GET_CNTL_ADDL_ATTRIBUTES 0x79
265279 #define COMN_OPCODE_GET_CNTL_ATTRIBUTES 0x20
266280 uint32_t timeout;
drivers/scsi/lpfc/lpfc_crtn.h+1−1
@@ -386,7 +386,7 @@ void lpfc_rq_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp); · 385 unmodified lines
386386 int lpfc_link_reset(struct lpfc_vport *vport);
387387
388388 /* Function prototypes. */
389−int lpfc_check_pci_resettable(const struct lpfc_hba *phba);
389+int lpfc_check_pci_resettable(struct lpfc_hba *phba);
390390 const char* lpfc_info(struct Scsi_Host *);
391391 int lpfc_scan_finished(struct Scsi_Host *, unsigned long);
392392
drivers/scsi/lpfc/lpfc_ct.c+13−13
@@ -300,7 +300,7 @@ lpfc_ct_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *ctiocb) · 299 unmodified lines
300300 return 0;
301301 }
302302
303−/**
303+/*
304304 * lpfc_gen_req - Build and issue a GEN_REQUEST command to the SLI Layer
305305 * @vport: pointer to a host virtual N_Port data structure.
306306 * @bmp: Pointer to BPL for SLI command
@@ -394,7 +394,7 @@ lpfc_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp, · 87 unmodified lines
394394 return 0;
395395 }
396396
397−/**
397+/*
398398 * lpfc_ct_cmd - Build and issue a CT command
399399 * @vport: pointer to a host virtual N_Port data structure.
400400 * @inmp: Pointer to data buffer for response data.
@@ -750,7 +750,7 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 349 unmodified lines
750750 if (vport->fc_flag & FC_RSCN_MODE)
751751 lpfc_els_flush_rscn(vport);
752752 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
753− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
753+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
754754 "0257 GID_FT Query error: 0x%x 0x%x\n",
755755 irsp->ulpStatus, vport->fc_ns_retry);
756756 } else {
@@ -811,7 +811,7 @@ lpfc_cmpl_ct_cmd_gid_ft(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 54 unmodified lines
811811
812812 } else {
813813 /* NameServer Rsp Error */
814− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
814+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
815815 "0241 NameServer Rsp Error "
816816 "Data: x%x x%x x%x x%x\n",
817817 CTrsp->CommandResponse.bits.CmdRsp,
@@ -951,7 +951,7 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 133 unmodified lines
951951 if (vport->fc_flag & FC_RSCN_MODE)
952952 lpfc_els_flush_rscn(vport);
953953 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
954− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
954+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
955955 "4103 GID_FT Query error: 0x%x 0x%x\n",
956956 irsp->ulpStatus, vport->fc_ns_retry);
957957 } else {
@@ -1012,7 +1012,7 @@ lpfc_cmpl_ct_cmd_gid_pt(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 54 unmodified lines
10121012 }
10131013 } else {
10141014 /* NameServer Rsp Error */
1015− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1015+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
10161016 "4109 NameServer Rsp Error "
10171017 "Data: x%x x%x x%x x%x\n",
10181018 CTrsp->CommandResponse.bits.CmdRsp,
@@ -1143,7 +1143,7 @@ lpfc_cmpl_ct_cmd_gff_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 124 unmodified lines
11431143 }
11441144 }
11451145 }
1146− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1146+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
11471147 "0267 NameServer GFF Rsp "
11481148 "x%x Error (%d %d) Data: x%x x%x\n",
11491149 did, irsp->ulpStatus, irsp->un.ulpWord[4],
@@ -1271,7 +1271,7 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 121 unmodified lines
12711271 }
12721272 }
12731273 } else
1274− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1274+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
12751275 "3065 GFT_ID failed x%08x\n", irsp->ulpStatus);
12761276
12771277 lpfc_ct_free_iocb(phba, cmdiocb);
@@ -1320,7 +1320,7 @@ lpfc_cmpl_ct(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 42 unmodified lines
13201320 irsp->ulpStatus, irsp->un.ulpWord[4], cmdcode);
13211321
13221322 if (irsp->ulpStatus) {
1323− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1323+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
13241324 "0268 NS cmd x%x Error (x%x x%x)\n",
13251325 cmdcode, irsp->ulpStatus, irsp->un.ulpWord[4]);
13261326
@@ -1843,7 +1843,7 @@ ns_cmd_free_mpvirt: · 516 unmodified lines
18431843 ns_cmd_free_mp:
18441844 kfree(mp);
18451845 ns_cmd_exit:
1846− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1846+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
18471847 "0266 Issue NameServer Req x%x err %d Data: x%x x%x\n",
18481848 cmdcode, rc, vport->fc_flag, vport->fc_rscn_id_cnt);
18491849 return 1;
@@ -3019,8 +3019,8 @@ int (*lpfc_fdmi_port_action[]) · 1169 unmodified lines
30193019 * lpfc_fdmi_cmd - Build and send a FDMI cmd to the specified NPort
30203020 * @vport: pointer to a host virtual N_Port data structure.
30213021 * @ndlp: ndlp to send FDMI cmd to (if NULL use FDMI_DID)
3022− * cmdcode: FDMI command to send
3023− * mask: Mask of HBA or PORT Attributes to send
3022+ * @cmdcode: FDMI command to send
3023+ * @new_mask: Mask of HBA or PORT Attributes to send
30243024 *
30253025 * Builds and sends a FDMI command using the CT subsystem.
30263026 */
@@ -3262,7 +3262,7 @@ fdmi_cmd_exit: · 235 unmodified lines
32623262
32633263 /**
32643264 * lpfc_delayed_disc_tmo - Timeout handler for delayed discovery timer.
3265− * @ptr - Context object of the timer.
3265+ * @t: Context object of the timer.
32663266 *
32673267 * This function set the WORKER_DELAYED_DISC_TMO flag and wake up
32683268 * the worker thread.
drivers/scsi/lpfc/lpfc_els.c+75−68
@@ -100,7 +100,7 @@ lpfc_els_chk_latt(struct lpfc_vport *vport) · 99 unmodified lines
100100 return 0;
101101
102102 /* Pending Link Event during Discovery */
103− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
103+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
104104 "0237 Pending Link Event during "
105105 "Discovery: State x%x\n",
106106 phba->pport->port_state);
@@ -440,8 +440,9 @@ fail_free_mbox: · 333 unmodified lines
440440
441441 fail:
442442 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
443− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
444− "0249 Cannot issue Register Fabric login: Err %d\n", err);
443+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
444+ "0249 Cannot issue Register Fabric login: Err %d\n",
445+ err);
445446 return -ENXIO;
446447 }
447448
@@ -524,8 +525,8 @@ fail: · 76 unmodified lines
524525 }
525526
526527 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
527− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
528− "0289 Issue Register VFI failed: Err %d\n", rc);
528+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
529+ "0289 Issue Register VFI failed: Err %d\n", rc);
529530 return rc;
530531 }
531532
@@ -550,7 +551,7 @@ lpfc_issue_unreg_vfi(struct lpfc_vport *vport) · 18 unmodified lines
550551
551552 mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
552553 if (!mboxq) {
553− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX,
554+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
554555 "2556 UNREG_VFI mbox allocation failed"
555556 "HBA state x%x\n", phba->pport->port_state);
556557 return -ENOMEM;
@@ -562,7 +563,7 @@ lpfc_issue_unreg_vfi(struct lpfc_vport *vport) · 5 unmodified lines
562563
563564 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT);
564565 if (rc == MBX_NOT_FINISHED) {
565− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX,
566+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
566567 "2557 UNREG_VFI issue mbox failed rc x%x "
567568 "HBA state x%x\n",
568569 rc, phba->pport->port_state);
@@ -1041,18 +1042,18 @@ stop_rr_fcf_flogi: · 472 unmodified lines
10411042 if (!(irsp->ulpStatus == IOSTAT_LOCAL_REJECT &&
10421043 ((irsp->un.ulpWord[4] & IOERR_PARAM_MASK) ==
10431044 IOERR_LOOP_OPEN_FAILURE)))
1044− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1045− "2858 FLOGI failure Status:x%x/x%x "
1046− "TMO:x%x Data x%x x%x\n",
1047− irsp->ulpStatus, irsp->un.ulpWord[4],
1048− irsp->ulpTimeout, phba->hba_flag,
1049− phba->fcf.fcf_flag);
1045+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1046+ "2858 FLOGI failure Status:x%x/x%x TMO"
1047+ ":x%x Data x%x x%x\n",
1048+ irsp->ulpStatus, irsp->un.ulpWord[4],
1049+ irsp->ulpTimeout, phba->hba_flag,
1050+ phba->fcf.fcf_flag);
10501051
10511052 /* Check for retry */
10521053 if (lpfc_els_retry(phba, cmdiocb, rspiocb))
10531054 goto out;
10541055
1055− lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS,
1056+ lpfc_printf_vlog(vport, KERN_WARNING, LOG_TRACE_EVENT,
10561057 "0150 FLOGI failure Status:x%x/x%x "
10571058 "xri x%x TMO:x%x\n",
10581059 irsp->ulpStatus, irsp->un.ulpWord[4],
@@ -1132,8 +1133,7 @@ stop_rr_fcf_flogi: · 73 unmodified lines
11321133 else if (!(phba->hba_flag & HBA_FCOE_MODE))
11331134 rc = lpfc_cmpl_els_flogi_nport(vport, ndlp, sp);
11341135 else {
1135− lpfc_printf_vlog(vport, KERN_ERR,
1136− LOG_FIP | LOG_ELS,
1136+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
11371137 "2831 FLOGI response with cleared Fabric "
11381138 "bit fcf_index 0x%x "
11391139 "Switch Name %02x%02x%02x%02x%02x%02x%02x%02x "
@@ -1934,7 +1934,7 @@ lpfc_cmpl_els_rrq(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 794 unmodified lines
19341934
19351935 ndlp = lpfc_findnode_did(vport, irsp->un.elsreq64.remoteID);
19361936 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) || ndlp != rrq->ndlp) {
1937− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1937+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
19381938 "2882 RRQ completes to NPort x%x "
19391939 "with no ndlp. Data: x%x x%x x%x\n",
19401940 irsp->un.elsreq64.remoteID,
@@ -1957,10 +1957,11 @@ lpfc_cmpl_els_rrq(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 16 unmodified lines
19571957 (((irsp->un.ulpWord[4]) >> 16 != LSRJT_INVALID_CMD) &&
19581958 ((irsp->un.ulpWord[4]) >> 16 != LSRJT_UNABLE_TPC)) ||
19591959 (phba)->pport->cfg_log_verbose & LOG_ELS)
1960− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1961− "2881 RRQ failure DID:%06X Status:x%x/x%x\n",
1962− ndlp->nlp_DID, irsp->ulpStatus,
1963− irsp->un.ulpWord[4]);
1960+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1961+ "2881 RRQ failure DID:%06X Status:"
1962+ "x%x/x%x\n",
1963+ ndlp->nlp_DID, irsp->ulpStatus,
1964+ irsp->un.ulpWord[4]);
19641965 }
19651966 out:
19661967 if (rrq)
@@ -2010,7 +2011,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 43 unmodified lines
20102011
20112012 ndlp = lpfc_findnode_did(vport, irsp->un.elsreq64.remoteID);
20122013 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
2013− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
2014+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
20142015 "0136 PLOGI completes to NPort x%x "
20152016 "with no ndlp. Data: x%x x%x x%x\n",
20162017 irsp->un.elsreq64.remoteID,
@@ -2059,7 +2060,7 @@ lpfc_cmpl_els_plogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 42 unmodified lines
20592060 (((irsp->un.ulpWord[4]) >> 16 != LSRJT_INVALID_CMD) &&
20602061 ((irsp->un.ulpWord[4]) >> 16 != LSRJT_UNABLE_TPC)) ||
20612062 (phba)->pport->cfg_log_verbose & LOG_ELS)
2062− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
2063+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
20632064 "2753 PLOGI failure DID:%06X Status:x%x/x%x\n",
20642065 ndlp->nlp_DID, irsp->ulpStatus,
20652066 irsp->un.ulpWord[4]);
@@ -2237,6 +2238,7 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 171 unmodified lines
22372238 IOCB_t *irsp;
22382239 struct lpfc_nodelist *ndlp;
22392240 char *mode;
2241+ u32 loglevel;
22402242
22412243 /* we pass cmdiocb to state machine which needs rspiocb as well */
22422244 cmdiocb->context_un.rsp_iocb = rspiocb;
@@ -2278,13 +2280,16 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 35 unmodified lines
22782280 * could be expected.
22792281 */
22802282 if ((vport->fc_flag & FC_FABRIC) ||
2281− (vport->cfg_enable_fc4_type != LPFC_ENABLE_BOTH))
2283+ (vport->cfg_enable_fc4_type != LPFC_ENABLE_BOTH)) {
22822284 mode = KERN_ERR;
2283− else
2285+ loglevel = LOG_TRACE_EVENT;
2286+ } else {
22842287 mode = KERN_INFO;
2288+ loglevel = LOG_ELS;
2289+ }
22852290
22862291 /* PRLI failed */
2287− lpfc_printf_vlog(vport, mode, LOG_ELS,
2292+ lpfc_printf_vlog(vport, mode, loglevel,
22882293 "2754 PRLI failure DID:%06X Status:x%x/x%x, "
22892294 "data: x%x\n",
22902295 ndlp->nlp_DID, irsp->ulpStatus,
@@ -2695,7 +2700,7 @@ lpfc_cmpl_els_adisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 404 unmodified lines
26952700 goto out;
26962701 }
26972702 /* ADISC failed */
2698− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
2703+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
26992704 "2755 ADISC failure DID:%06X Status:x%x/x%x\n",
27002705 ndlp->nlp_DID, irsp->ulpStatus,
27012706 irsp->un.ulpWord[4]);
@@ -2853,7 +2858,7 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 151 unmodified lines
28532858 */
28542859 if (irsp->ulpStatus) {
28552860 /* LOGO failed */
2856− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
2861+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
28572862 "2756 LOGO failure, No Retry DID:%06X Status:x%x/x%x\n",
28582863 ndlp->nlp_DID, irsp->ulpStatus,
28592864 irsp->un.ulpWord[4]);
@@ -3597,7 +3602,7 @@ lpfc_cancel_retry_delay_tmo(struct lpfc_vport *vport, struct lpfc_nodelist *nlp) · 737 unmodified lines
35973602
35983603 /**
35993604 * lpfc_els_retry_delay - Timer function with a ndlp delayed function timer
3600− * @ptr: holder for the pointer to the timer function associated data (ndlp).
3605+ * @t: pointer to the timer function associated data (ndlp).
36013606 *
36023607 * This routine is invoked by the ndlp delayed-function timer to check
36033608 * whether there is any pending ELS retry event(s) with the node. If not, it
@@ -3734,7 +3739,7 @@ lpfc_link_reset(struct lpfc_vport *vport) · 130 unmodified lines
37343739 "2851 Attempt link reset\n");
37353740 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
37363741 if (!mbox) {
3737− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
3742+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
37383743 "2852 Failed to allocate mbox memory");
37393744 return 1;
37403745 }
@@ -3756,7 +3761,7 @@ lpfc_link_reset(struct lpfc_vport *vport) · 15 unmodified lines
37563761 mbox->vport = vport;
37573762 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
37583763 if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) {
3759− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
3764+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
37603765 "2853 Failed to issue INIT_LINK "
37613766 "mbox command, rc:x%x\n", rc);
37623767 mempool_free(mbox, phba->mbox_mem_pool);
@@ -3860,7 +3865,7 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 97 unmodified lines
38603865 break;
38613866
38623867 case IOERR_ILLEGAL_COMMAND:
3863− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
3868+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
38643869 "0124 Retry illegal cmd x%x "
38653870 "retry:x%x delay:x%x\n",
38663871 cmd, cmdiocb->retry, delay);
@@ -3970,7 +3975,8 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 103 unmodified lines
39703975 if ((phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) &&
39713976 (cmd == ELS_CMD_FDISC) &&
39723977 (stat.un.b.lsRjtRsnCodeExp == LSEXP_OUT_OF_RESOURCE)){
3973− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
3978+ lpfc_printf_vlog(vport, KERN_ERR,
3979+ LOG_TRACE_EVENT,
39743980 "0125 FDISC Failed (x%x). "
39753981 "Fabric out of resources\n",
39763982 stat.un.lsRjtError);
@@ -4009,7 +4015,8 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 32 unmodified lines
40094015 LSEXP_NOTHING_MORE) {
40104016 vport->fc_sparam.cmn.bbRcvSizeMsb &= 0xf;
40114017 retry = 1;
4012− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4018+ lpfc_printf_vlog(vport, KERN_ERR,
4019+ LOG_TRACE_EVENT,
40134020 "0820 FLOGI Failed (x%x). "
40144021 "BBCredit Not Supported\n",
40154022 stat.un.lsRjtError);
@@ -4022,7 +4029,8 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 6 unmodified lines
40224029 ((stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_PNAME) ||
40234030 (stat.un.b.lsRjtRsnCodeExp == LSEXP_INVALID_NPORT_ID))
40244031 ) {
4025− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4032+ lpfc_printf_vlog(vport, KERN_ERR,
4033+ LOG_TRACE_EVENT,
40264034 "0122 FDISC Failed (x%x). "
40274035 "Fabric Detected Bad WWN\n",
40284036 stat.un.lsRjtError);
@@ -4200,7 +4208,7 @@ out_retry: · 171 unmodified lines
42004208 }
42014209 /* No retry ELS command <elsCmd> to remote NPORT <did> */
42024210 if (logerr) {
4203− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4211+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
42044212 "0137 No retry ELS command x%x to remote "
42054213 "NPORT x%x: Out of Resources: Error:x%x/%x\n",
42064214 cmd, did, irsp->ulpStatus,
@@ -4499,7 +4507,7 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 292 unmodified lines
44994507 irsp = &rspiocb->iocb;
45004508
45014509 if (!vport) {
4502− lpfc_printf_log(phba, KERN_ERR, LOG_ELS,
4510+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
45034511 "3177 ELS response failed\n");
45044512 goto out;
45054513 }
@@ -4605,7 +4613,7 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 99 unmodified lines
46054613 ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND;
46064614
46074615 /* ELS rsp: Cannot issue reg_login for <NPortid> */
4608− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4616+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
46094617 "0138 ELS rsp: Cannot issue reg_login for x%x "
46104618 "Data: x%x x%x x%x\n",
46114619 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
@@ -4843,7 +4851,7 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag, · 231 unmodified lines
48434851 /**
48444852 * lpfc_els_rsp_reject - Propare and issue a rjt response iocb command
48454853 * @vport: pointer to a virtual N_Port data structure.
4846− * @rejectError:
4854+ * @rejectError: reject response to issue
48474855 * @oldiocb: pointer to the original lpfc command iocb data structure.
48484856 * @ndlp: pointer to a node-list data structure.
48494857 * @mbox: pointer to the driver internal queue element for mailbox command.
@@ -6411,8 +6419,8 @@ lpfc_els_rcv_lcb(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, · 1561 unmodified lines
64116419 lcb_context->rx_id = cmdiocb->iocb.ulpContext;
64126420 lcb_context->ndlp = lpfc_nlp_get(ndlp);
64136421 if (lpfc_sli4_set_beacon(vport, lcb_context, state)) {
6414− lpfc_printf_vlog(ndlp->vport, KERN_ERR,
6415− LOG_ELS, "0193 failed to send mail box");
6422+ lpfc_printf_vlog(ndlp->vport, KERN_ERR, LOG_TRACE_EVENT,
6423+ "0193 failed to send mail box");
64166424 kfree(lcb_context);
64176425 lpfc_nlp_put(ndlp);
64186426 rjt_err = LSRJT_UNABLE_TPC;
@@ -6621,7 +6629,7 @@ lpfc_send_rscn_event(struct lpfc_vport *vport, · 202 unmodified lines
66216629 rscn_event_data = kmalloc(sizeof(struct lpfc_rscn_event_header) +
66226630 payload_len, GFP_KERNEL);
66236631 if (!rscn_event_data) {
6624− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
6632+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
66256633 "0147 Failed to allocate memory for RSCN event\n");
66266634 return;
66276635 }
@@ -6998,7 +7006,7 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, · 370 unmodified lines
69987006
69997007 /* An FLOGI ELS command <elsCmd> was received from DID <did> in
70007008 Loop Mode */
7001− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
7009+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
70027010 "0113 An FLOGI ELS command x%x was "
70037011 "received from DID x%x in Loop Mode\n",
70047012 cmd, did);
@@ -7879,7 +7887,7 @@ lpfc_els_rcv_fan(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, · 874 unmodified lines
78797887
78807888 /**
78817889 * lpfc_els_timeout - Handler funciton to the els timer
7882− * @ptr: holder for the timer function associated data.
7890+ * @t: timer context used to obtain the vport.
78837891 *
78847892 * This routine is invoked by the ELS timer after timeout. It posts the ELS
78857893 * timer timeout event by setting the WORKER_ELS_TMO bit to the work port
@@ -7988,7 +7996,7 @@ lpfc_els_timeout_handler(struct lpfc_vport *vport) · 102 unmodified lines
79887996
79897997 list_for_each_entry_safe(piocb, tmp_iocb, &abort_list, dlist) {
79907998 cmd = &piocb->iocb;
7991− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
7999+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
79928000 "0127 ELS timeout Data: x%x x%x x%x "
79938001 "x%x\n", els_command,
79948002 remote_ID, cmd->ulpCommand, cmd->ulpIoTag);
@@ -8098,7 +8106,7 @@ lpfc_els_flush_cmd(struct lpfc_vport *vport) · 103 unmodified lines
80988106 spin_unlock_irqrestore(&phba->hbalock, iflags);
80998107 }
81008108 if (!list_empty(&abort_list))
8101− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
8109+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
81028110 "3387 abort list for txq not empty\n");
81038111 INIT_LIST_HEAD(&abort_list);
81048112
@@ -8252,7 +8260,7 @@ lpfc_send_els_failure_event(struct lpfc_hba *phba, · 147 unmodified lines
82528260 * lpfc_send_els_event - Posts unsolicited els event
82538261 * @vport: Pointer to vport object.
82548262 * @ndlp: Pointer FC node object.
8255− * @cmd: ELS command code.
8263+ * @payload: ELS command code type.
82568264 *
82578265 * This function posts an event when there is an incoming
82588266 * unsolicited ELS command.
@@ -8269,7 +8277,7 @@ lpfc_send_els_event(struct lpfc_vport *vport, · 10 unmodified lines
82698277 if (*payload == ELS_CMD_LOGO) {
82708278 logo_data = kmalloc(sizeof(struct lpfc_logo_event), GFP_KERNEL);
82718279 if (!logo_data) {
8272− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
8280+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
82738281 "0148 Failed to allocate memory "
82748282 "for LOGO event\n");
82758283 return;
@@ -8279,7 +8287,7 @@ lpfc_send_els_event(struct lpfc_vport *vport, · 3 unmodified lines
82798287 els_data = kmalloc(sizeof(struct lpfc_els_event_header),
82808288 GFP_KERNEL);
82818289 if (!els_data) {
8282− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
8290+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
82838291 "0149 Failed to allocate memory "
82848292 "for ELS event\n");
82858293 return;
@@ -8337,7 +8345,7 @@ DECLARE_ENUM2STR_LOOKUP(lpfc_get_fpin_li_event_nm, fc_fpin_li_event_types, · 51 unmodified lines
83378345 /**
83388346 * lpfc_els_rcv_fpin_li - Process an FPIN Link Integrity Event.
83398347 * @vport: Pointer to vport object.
8340− * @lnk_not: Pointer to the Link Integrity Notification Descriptor.
8348+ * @tlv: Pointer to the Link Integrity Notification Descriptor.
83418349 *
83428350 * This function processes a link integrity FPIN event by
83438351 * logging a message
@@ -8396,7 +8404,7 @@ lpfc_els_rcv_fpin(struct lpfc_vport *vport, struct fc_els_fpin *fpin, · 52 unmodified lines
83968404 break;
83978405 default:
83988406 dtag_nm = lpfc_get_tlv_dtag_nm(dtag);
8399− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
8407+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
84008408 "4678 skipped FPIN descriptor[%d]: "
84018409 "tag x%x (%s)\n",
84028410 desc_cnt, dtag, dtag_nm);
@@ -8811,7 +8819,7 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, · 408 unmodified lines
88118819 rjt_exp = LSEXP_NOTHING_MORE;
88128820
88138821 /* Unknown ELS command <elsCmd> received from NPORT <did> */
8814− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
8822+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
88158823 "0115 Unknown ELS command x%x "
88168824 "received from NPORT x%x\n", cmd, did);
88178825 if (newnode)
@@ -8856,7 +8864,7 @@ lsrjt: · 38 unmodified lines
88568864
88578865 dropit:
88588866 if (vport && !(vport->load_flag & FC_UNLOADING))
8859− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
8867+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
88608868 "0111 Dropping received ELS cmd "
88618869 "Data: x%x x%x x%x\n",
88628870 icmd->ulpStatus, icmd->un.ulpWord[4], icmd->ulpTimeout);
@@ -9006,7 +9014,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport) · 143 unmodified lines
90069014 spin_lock_irq(shost->host_lock);
90079015 if (vport->fc_flag & FC_DISC_DELAYED) {
90089016 spin_unlock_irq(shost->host_lock);
9009− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
9017+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
90109018 "3334 Delay fc port discovery for %d seconds\n",
90119019 phba->fc_ratov);
90129020 mod_timer(&vport->delayed_disc_tmo,
@@ -9024,7 +9032,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport) · 11 unmodified lines
90249032 return;
90259033 }
90269034 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
9027− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
9035+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
90289036 "0251 NameServer login: no memory\n");
90299037 return;
90309038 }
@@ -9036,7 +9044,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport) · 5 unmodified lines
90369044 return;
90379045 }
90389046 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
9039− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
9047+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
90409048 "0348 NameServer login: node freed\n");
90419049 return;
90429050 }
@@ -9047,7 +9055,7 @@ lpfc_do_scr_ns_plogi(struct lpfc_hba *phba, struct lpfc_vport *vport) · 4 unmodified lines
90479055
90489056 if (lpfc_issue_els_plogi(vport, ndlp->nlp_DID, 0)) {
90499057 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
9050− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
9058+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
90519059 "0252 Cannot issue NameServer login\n");
90529060 return;
90539061 }
@@ -9084,7 +9092,7 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 30 unmodified lines
90849092 spin_unlock_irq(shost->host_lock);
90859093
90869094 if (mb->mbxStatus) {
9087− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
9095+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
90889096 "0915 Register VPI failed : Status: x%x"
90899097 " upd bit: x%x \n", mb->mbxStatus,
90909098 mb->un.varRegVpi.upd);
@@ -9114,8 +9122,8 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 23 unmodified lines
91149122 rc = lpfc_sli_issue_mbox(phba, pmb,
91159123 MBX_NOWAIT);
91169124 if (rc == MBX_NOT_FINISHED) {
9117− lpfc_printf_vlog(vport,
9118− KERN_ERR, LOG_MBOX,
9125+ lpfc_printf_vlog(vport, KERN_ERR,
9126+ LOG_TRACE_EVENT,
91199127 "2732 Failed to issue INIT_VPI"
91209128 " mailbox command\n");
91219129 } else {
@@ -9203,12 +9211,12 @@ lpfc_register_new_vport(struct lpfc_hba *phba, struct lpfc_vport *vport, · 81 unmodified lines
92039211 lpfc_nlp_put(ndlp);
92049212 mempool_free(mbox, phba->mbox_mem_pool);
92059213
9206− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
9214+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
92079215 "0253 Register VPI: Can't send mbox\n");
92089216 goto mbox_err_exit;
92099217 }
92109218 } else {
9211− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
9219+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
92129220 "0254 Register VPI: no memory\n");
92139221 goto mbox_err_exit;
92149222 }
@@ -9370,7 +9378,7 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 155 unmodified lines
93709378 if (lpfc_els_retry(phba, cmdiocb, rspiocb))
93719379 goto out;
93729380 /* FDISC failed */
9373− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
9381+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
93749382 "0126 FDISC failed. (x%x/x%x)\n",
93759383 irsp->ulpStatus, irsp->un.ulpWord[4]);
93769384 goto fdisc_failed;
@@ -9492,7 +9500,7 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 115 unmodified lines
94929500 ELS_CMD_FDISC);
94939501 if (!elsiocb) {
94949502 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
9495− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
9503+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
94969504 "0255 Issue FDISC: no IOCB\n");
94979505 return 1;
94989506 }
@@ -9546,7 +9554,7 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 47 unmodified lines
95469554 if (rc == IOCB_ERROR) {
95479555 lpfc_els_free_iocb(phba, elsiocb);
95489556 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
9549− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
9557+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
95509558 "0256 Issue FDISC: Cannot send IOCB\n");
95519559 return 1;
95529560 }
@@ -9666,7 +9674,7 @@ lpfc_issue_els_npiv_logo(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 113 unmodified lines
96669674
96679675 /**
96689676 * lpfc_fabric_block_timeout - Handler function to the fabric block timer
9669− * @ptr: holder for the timer function associated data.
9677+ * @t: timer context used to obtain the lpfc hba.
96709678 *
96719679 * This routine is invoked by the fabric iocb block timer after
96729680 * timeout. It posts the fabric iocb block timeout event by setting the
@@ -10127,8 +10135,7 @@ lpfc_sli_abts_recover_port(struct lpfc_vport *vport, · 454 unmodified lines
1012710135 "rport in state 0x%x\n", ndlp->nlp_state);
1012810136 return;
1012910137 }
10130− lpfc_printf_log(phba, KERN_ERR,
10131− LOG_ELS | LOG_FCP_ERROR | LOG_NVME_IOERR,
10138+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1013210139 "3094 Start rport recovery on shost id 0x%x "
1013310140 "fc_id 0x%06x vpi 0x%x rpi 0x%x state 0x%x "
1013410141 "flags 0x%x\n",
drivers/scsi/lpfc/lpfc_hbadisc.c+122−109
@@ -155,17 +155,17 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) · 154 unmodified lines
155155 return;
156156
157157 if (rport->port_name != wwn_to_u64(ndlp->nlp_portname.u.wwn))
158− lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE,
159− "6789 rport name %llx != node port name %llx",
160− rport->port_name,
161− wwn_to_u64(ndlp->nlp_portname.u.wwn));
158+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
159+ "6789 rport name %llx != node port name %llx",
160+ rport->port_name,
161+ wwn_to_u64(ndlp->nlp_portname.u.wwn));
162162
163163 evtp = &ndlp->dev_loss_evt;
164164
165165 if (!list_empty(&evtp->evt_listp)) {
166− lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE,
167− "6790 rport name %llx dev_loss_evt pending",
168− rport->port_name);
166+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
167+ "6790 rport name %llx dev_loss_evt pending",
168+ rport->port_name);
169169 return;
170170 }
171171
@@ -295,7 +295,7 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) · 123 unmodified lines
295295 }
296296
297297 if (warn_on) {
298− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
298+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
299299 "0203 Devloss timeout on "
300300 "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
301301 "NPort x%06x Data: x%x x%x x%x\n",
@@ -304,7 +304,7 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) · 2 unmodified lines
304304 ndlp->nlp_DID, ndlp->nlp_flag,
305305 ndlp->nlp_state, ndlp->nlp_rpi);
306306 } else {
307− lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY,
307+ lpfc_printf_vlog(vport, KERN_INFO, LOG_TRACE_EVENT,
308308 "0204 Devloss timeout on "
309309 "WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x "
310310 "NPort x%06x Data: x%x x%x x%x\n",
@@ -755,7 +755,7 @@ lpfc_do_work(void *p) · 444 unmodified lines
755755 || kthread_should_stop()));
756756 /* Signal wakeup shall terminate the worker thread */
757757 if (rc) {
758− lpfc_printf_log(phba, KERN_ERR, LOG_ELS,
758+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
759759 "0433 Wakeup on signal: rc=x%x\n", rc);
760760 break;
761761 }
@@ -1092,7 +1092,7 @@ lpfc_mbx_cmpl_clear_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 330 unmodified lines
10921092 /* Check for error */
10931093 if ((mb->mbxStatus) && (mb->mbxStatus != 0x1601)) {
10941094 /* CLEAR_LA mbox error <mbxStatus> state <hba_state> */
1095− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
1095+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
10961096 "0320 CLEAR_LA mbxStatus error x%x hba "
10971097 "state x%x\n",
10981098 mb->mbxStatus, vport->port_state);
@@ -1180,7 +1180,7 @@ lpfc_mbx_cmpl_local_config_link(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 81 unmodified lines
11801180 return;
11811181
11821182 out:
1183− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
1183+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
11841184 "0306 CONFIG_LINK mbxStatus error x%x "
11851185 "HBA state x%x\n",
11861186 pmb->u.mb.mbxStatus, vport->port_state);
@@ -1188,7 +1188,7 @@ out: · 1 unmodified line
11881188
11891189 lpfc_linkdown(phba);
11901190
1191− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1191+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
11921192 "0200 CONFIG_LINK bad hba state x%x\n",
11931193 vport->port_state);
11941194
@@ -1198,7 +1198,7 @@ out: · 3 unmodified lines
11981198
11991199 /**
12001200 * lpfc_sli4_clear_fcf_rr_bmask
1201− * @phba pointer to the struct lpfc_hba for this port.
1201+ * @phba: pointer to the struct lpfc_hba for this port.
12021202 * This fucnction resets the round robin bit mask and clears the
12031203 * fcf priority list. The list deletions are done while holding the
12041204 * hbalock. The ON_LIST flag and the FLOGI_FAILED flags are cleared
@@ -1224,10 +1224,10 @@ lpfc_mbx_cmpl_reg_fcfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 19 unmodified lines
12241224 struct lpfc_vport *vport = mboxq->vport;
12251225
12261226 if (mboxq->u.mb.mbxStatus) {
1227− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
1228− "2017 REG_FCFI mbxStatus error x%x "
1229− "HBA state x%x\n",
1230− mboxq->u.mb.mbxStatus, vport->port_state);
1227+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1228+ "2017 REG_FCFI mbxStatus error x%x "
1229+ "HBA state x%x\n", mboxq->u.mb.mbxStatus,
1230+ vport->port_state);
12311231 goto fail_out;
12321232 }
12331233
@@ -1297,7 +1297,7 @@ lpfc_fab_name_match(uint8_t *fab_name, struct fcf_record *new_fcf_record) · 63 unmodified lines
12971297
12981298 /**
12991299 * lpfc_sw_name_match - Check if the fcf switch name match.
1300− * @fab_name: pointer to fabric name.
1300+ * @sw_name: pointer to switch name.
13011301 * @new_fcf_record: pointer to fcf record.
13021302 *
13031303 * This routine compare the fcf record's switch name with provided
@@ -1385,7 +1385,7 @@ __lpfc_update_fcf_record_pri(struct lpfc_hba *phba, uint16_t fcf_index, · 81 unmodified lines
13851385
13861386 /**
13871387 * lpfc_copy_fcf_record - Copy fcf information to lpfc_hba.
1388− * @fcf: pointer to driver fcf record.
1388+ * @fcf_rec: pointer to driver fcf record.
13891389 * @new_fcf_record: pointer to fcf record.
13901390 *
13911391 * This routine copies the FCF information from the FCF
@@ -1848,7 +1848,7 @@ lpfc_sli4_fcf_rec_mbox_parse(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, · 456 unmodified lines
18481848 */
18491849 lpfc_sli4_mbx_sge_get(mboxq, 0, &sge);
18501850 if (unlikely(!mboxq->sge_array)) {
1851− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
1851+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
18521852 "2524 Failed to get the non-embedded SGE "
18531853 "virtual address\n");
18541854 return NULL;
@@ -1864,11 +1864,12 @@ lpfc_sli4_fcf_rec_mbox_parse(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, · 9 unmodified lines
18641864 if (shdr_status || shdr_add_status) {
18651865 if (shdr_status == STATUS_FCF_TABLE_EMPTY ||
18661866 if_type == LPFC_SLI_INTF_IF_TYPE_2)
1867− lpfc_printf_log(phba, KERN_ERR, LOG_FIP,
1867+ lpfc_printf_log(phba, KERN_ERR,
1868+ LOG_TRACE_EVENT,
18681869 "2726 READ_FCF_RECORD Indicates empty "
18691870 "FCF table.\n");
18701871 else
1871− lpfc_printf_log(phba, KERN_ERR, LOG_FIP,
1872+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
18721873 "2521 READ_FCF_RECORD mailbox failed "
18731874 "with status x%x add_status x%x, "
18741875 "mbx\n", shdr_status, shdr_add_status);
@@ -1952,7 +1953,7 @@ lpfc_sli4_log_fcf_record_info(struct lpfc_hba *phba, · 77 unmodified lines
19521953 }
19531954
19541955 /**
1955− lpfc_sli4_fcf_record_match - testing new FCF record for matching existing FCF
1956+ * lpfc_sli4_fcf_record_match - testing new FCF record for matching existing FCF
19561957 * @phba: pointer to lpfc hba data structure.
19571958 * @fcf_rec: pointer to an existing FCF record.
19581959 * @new_fcf_record: pointer to a new FCF record.
@@ -2066,7 +2067,7 @@ stop_flogi_current_fcf: · 107 unmodified lines
20662067 /**
20672068 * lpfc_sli4_fcf_pri_list_del
20682069 * @phba: pointer to lpfc hba data structure.
2069− * @fcf_index the index of the fcf record to delete
2070+ * @fcf_index: the index of the fcf record to delete
20702071 * This routine checks the on list flag of the fcf_index to be deleted.
20712072 * If it is one the list then it is removed from the list, and the flag
20722073 * is cleared. This routine grab the hbalock before removing the fcf
@@ -2096,7 +2097,7 @@ static void lpfc_sli4_fcf_pri_list_del(struct lpfc_hba *phba, · 23 unmodified lines
20962097 /**
20972098 * lpfc_sli4_set_fcf_flogi_fail
20982099 * @phba: pointer to lpfc hba data structure.
2099− * @fcf_index the index of the fcf record to update
2100+ * @fcf_index: the index of the fcf record to update
21002101 * This routine acquires the hbalock and then set the LPFC_FCF_FLOGI_FAILED
21012102 * flag so the the round robin slection for the particular priority level
21022103 * will try a different fcf record that does not have this bit set.
@@ -2116,7 +2117,8 @@ lpfc_sli4_set_fcf_flogi_fail(struct lpfc_hba *phba, uint16_t fcf_index) · 13 unmodified lines
21162117 /**
21172118 * lpfc_sli4_fcf_pri_list_add
21182119 * @phba: pointer to lpfc hba data structure.
2119− * @fcf_index the index of the fcf record to add
2120+ * @fcf_index: the index of the fcf record to add
2121+ * @new_fcf_record: pointer to a new FCF record.
21202122 * This routine checks the priority of the fcf_index to be added.
21212123 * If it is a lower priority than the current head of the fcf_pri list
21222124 * then it is added to the list in the right order.
@@ -2246,7 +2248,7 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 123 unmodified lines
22462248 new_fcf_record = lpfc_sli4_fcf_rec_mbox_parse(phba, mboxq,
22472249 &next_fcf_index);
22482250 if (!new_fcf_record) {
2249− lpfc_printf_log(phba, KERN_ERR, LOG_FIP,
2251+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
22502252 "2765 Mailbox command READ_FCF_RECORD "
22512253 "failed to retrieve a FCF record.\n");
22522254 /* Let next new FCF event trigger fast failover */
@@ -2290,7 +2292,8 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 37 unmodified lines
22902292 new_fcf_record, LPFC_FCOE_IGNORE_VID)) {
22912293 if (bf_get(lpfc_fcf_record_fcf_index, new_fcf_record) !=
22922294 phba->fcf.current_rec.fcf_indx) {
2293− lpfc_printf_log(phba, KERN_ERR, LOG_FIP,
2295+ lpfc_printf_log(phba, KERN_ERR,
2296+ LOG_TRACE_EVENT,
22942297 "2862 FCF (x%x) matches property "
22952298 "of in-use FCF (x%x)\n",
22962299 bf_get(lpfc_fcf_record_fcf_index,
@@ -2360,7 +2363,7 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 63 unmodified lines
23602363 phba->pport->fc_flag);
23612364 goto out;
23622365 } else
2363− lpfc_printf_log(phba, KERN_ERR, LOG_FIP,
2366+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
23642367 "2863 New FCF (x%x) matches "
23652368 "property of in-use FCF (x%x)\n",
23662369 bf_get(lpfc_fcf_record_fcf_index,
@@ -2774,10 +2777,9 @@ lpfc_init_vfi_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 407 unmodified lines
27742777 (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
27752778 LPFC_SLI_INTF_IF_TYPE_0) &&
27762779 mboxq->u.mb.mbxStatus != MBX_VFI_IN_USE) {
2777− lpfc_printf_vlog(vport, KERN_ERR,
2778− LOG_MBOX,
2779− "2891 Init VFI mailbox failed 0x%x\n",
2780− mboxq->u.mb.mbxStatus);
2780+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
2781+ "2891 Init VFI mailbox failed 0x%x\n",
2782+ mboxq->u.mb.mbxStatus);
27812783 mempool_free(mboxq, phba->mbox_mem_pool);
27822784 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
27832785 return;
@@ -2805,7 +2807,7 @@ lpfc_issue_init_vfi(struct lpfc_vport *vport) · 21 unmodified lines
28052807 mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
28062808 if (!mboxq) {
28072809 lpfc_printf_vlog(vport, KERN_ERR,
2808− LOG_MBOX, "2892 Failed to allocate "
2810+ LOG_TRACE_EVENT, "2892 Failed to allocate "
28092811 "init_vfi mailbox\n");
28102812 return;
28112813 }
@@ -2813,8 +2815,8 @@ lpfc_issue_init_vfi(struct lpfc_vport *vport) · 1 unmodified line
28132815 mboxq->mbox_cmpl = lpfc_init_vfi_cmpl;
28142816 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT);
28152817 if (rc == MBX_NOT_FINISHED) {
2816− lpfc_printf_vlog(vport, KERN_ERR,
2817− LOG_MBOX, "2893 Failed to issue init_vfi mailbox\n");
2818+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
2819+ "2893 Failed to issue init_vfi mailbox\n");
28182820 mempool_free(mboxq, vport->phba->mbox_mem_pool);
28192821 }
28202822 }
@@ -2834,10 +2836,9 @@ lpfc_init_vpi_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 13 unmodified lines
28342836 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
28352837
28362838 if (mboxq->u.mb.mbxStatus) {
2837− lpfc_printf_vlog(vport, KERN_ERR,
2838− LOG_MBOX,
2839− "2609 Init VPI mailbox failed 0x%x\n",
2840− mboxq->u.mb.mbxStatus);
2839+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
2840+ "2609 Init VPI mailbox failed 0x%x\n",
2841+ mboxq->u.mb.mbxStatus);
28412842 mempool_free(mboxq, phba->mbox_mem_pool);
28422843 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
28432844 return;
@@ -2851,7 +2852,7 @@ lpfc_init_vpi_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 7 unmodified lines
28512852 ndlp = lpfc_findnode_did(vport, Fabric_DID);
28522853 if (!ndlp)
28532854 lpfc_printf_vlog(vport, KERN_ERR,
2854− LOG_DISCOVERY,
2855+ LOG_TRACE_EVENT,
28552856 "2731 Cannot find fabric "
28562857 "controller node\n");
28572858 else
@@ -2864,7 +2865,7 @@ lpfc_init_vpi_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 6 unmodified lines
28642865 lpfc_initial_fdisc(vport);
28652866 else {
28662867 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
2867− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
2868+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
28682869 "2606 No NPIV Fabric support\n");
28692870 }
28702871 mempool_free(mboxq, phba->mbox_mem_pool);
@@ -2887,8 +2888,7 @@ lpfc_issue_init_vpi(struct lpfc_vport *vport) · 16 unmodified lines
28872888 if ((vport->port_type != LPFC_PHYSICAL_PORT) && (!vport->vpi)) {
28882889 vpi = lpfc_alloc_vpi(vport->phba);
28892890 if (!vpi) {
2890− lpfc_printf_vlog(vport, KERN_ERR,
2891− LOG_MBOX,
2891+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
28922892 "3303 Failed to obtain vport vpi\n");
28932893 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
28942894 return;
@@ -2899,7 +2899,7 @@ lpfc_issue_init_vpi(struct lpfc_vport *vport) · 4 unmodified lines
28992899 mboxq = mempool_alloc(vport->phba->mbox_mem_pool, GFP_KERNEL);
29002900 if (!mboxq) {
29012901 lpfc_printf_vlog(vport, KERN_ERR,
2902− LOG_MBOX, "2607 Failed to allocate "
2902+ LOG_TRACE_EVENT, "2607 Failed to allocate "
29032903 "init_vpi mailbox\n");
29042904 return;
29052905 }
@@ -2908,8 +2908,8 @@ lpfc_issue_init_vpi(struct lpfc_vport *vport) · 2 unmodified lines
29082908 mboxq->mbox_cmpl = lpfc_init_vpi_cmpl;
29092909 rc = lpfc_sli_issue_mbox(vport->phba, mboxq, MBX_NOWAIT);
29102910 if (rc == MBX_NOT_FINISHED) {
2911− lpfc_printf_vlog(vport, KERN_ERR,
2912− LOG_MBOX, "2608 Failed to issue init_vpi mailbox\n");
2911+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
2912+ "2608 Failed to issue init_vpi mailbox\n");
29132913 mempool_free(mboxq, vport->phba->mbox_mem_pool);
29142914 }
29152915 }
@@ -2953,7 +2953,7 @@ lpfc_start_fdiscs(struct lpfc_hba *phba) · 37 unmodified lines
29532953 lpfc_vport_set_state(vports[i],
29542954 FC_VPORT_NO_FABRIC_SUPP);
29552955 lpfc_printf_vlog(vports[i], KERN_ERR,
2956− LOG_ELS,
2956+ LOG_TRACE_EVENT,
29572957 "0259 No NPIV "
29582958 "Fabric support\n");
29592959 }
@@ -2977,10 +2977,10 @@ lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 17 unmodified lines
29772977 (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) !=
29782978 LPFC_SLI_INTF_IF_TYPE_0) &&
29792979 mboxq->u.mb.mbxStatus != MBX_VFI_IN_USE) {
2980− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
2981− "2018 REG_VFI mbxStatus error x%x "
2982− "HBA state x%x\n",
2983− mboxq->u.mb.mbxStatus, vport->port_state);
2980+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
2981+ "2018 REG_VFI mbxStatus error x%x "
2982+ "HBA state x%x\n",
2983+ mboxq->u.mb.mbxStatus, vport->port_state);
29842984 if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) {
29852985 /* FLOGI failed, use loop map to make discovery list */
29862986 lpfc_disc_list_loopmap(vport);
@@ -3067,7 +3067,7 @@ lpfc_mbx_cmpl_read_sparam(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 80 unmodified lines
30673067 /* Check for error */
30683068 if (mb->mbxStatus) {
30693069 /* READ_SPARAM mbox error <mbxStatus> state <hba_state> */
3070− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
3070+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
30713071 "0319 READ_SPARAM mbxStatus error x%x "
30723072 "hba state x%x>\n",
30733073 mb->mbxStatus, vport->port_state);
@@ -3286,7 +3286,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) · 212 unmodified lines
32863286 GFP_KERNEL);
32873287 if (unlikely(!fcf_record)) {
32883288 lpfc_printf_log(phba, KERN_ERR,
3289− LOG_MBOX | LOG_SLI,
3289+ LOG_TRACE_EVENT,
32903290 "2554 Could not allocate memory for "
32913291 "fcf record\n");
32923292 rc = -ENODEV;
@@ -3298,7 +3298,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) · 5 unmodified lines
32983298 rc = lpfc_sli4_add_fcf_record(phba, fcf_record);
32993299 if (unlikely(rc)) {
33003300 lpfc_printf_log(phba, KERN_ERR,
3301− LOG_MBOX | LOG_SLI,
3301+ LOG_TRACE_EVENT,
33023302 "2013 Could not manually add FCF "
33033303 "record 0, status %d\n", rc);
33043304 rc = -ENODEV;
@@ -3344,7 +3344,7 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la) · 39 unmodified lines
33443344 return;
33453345 out:
33463346 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
3347− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
3347+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
33483348 "0263 Discovery Mailbox error: state: 0x%x : x%px x%px\n",
33493349 vport->port_state, sparam_mbox, cfglink_mbox);
33503350 lpfc_issue_clear_la(phba, vport);
@@ -3617,7 +3617,7 @@ lpfc_mbx_cmpl_unreg_vpi(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 266 unmodified lines
36173617 break;
36183618 /* If VPI is busy, reset the HBA */
36193619 case 0x9700:
3620− lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE,
3620+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
36213621 "2798 Unreg_vpi failed vpi 0x%x, mb status = 0x%x\n",
36223622 vport->vpi, mb->mbxStatus);
36233623 if (!(phba->pport->load_flag & FC_UNLOADING))
@@ -3655,7 +3655,7 @@ lpfc_mbx_unreg_vpi(struct lpfc_vport *vport) · 31 unmodified lines
36553655 mbox->mbox_cmpl = lpfc_mbx_cmpl_unreg_vpi;
36563656 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
36573657 if (rc == MBX_NOT_FINISHED) {
3658− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
3658+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
36593659 "1800 Could not issue unreg_vpi\n");
36603660 mempool_free(mbox, phba->mbox_mem_pool);
36613661 vport->unreg_vpi_cmpl = VPORT_ERROR;
@@ -3742,7 +3742,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba) · 80 unmodified lines
37423742
37433743 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
37443744 if (!pmb) {
3745− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
3745+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
37463746 "0542 lpfc_create_static_vport failed to"
37473747 " allocate mailbox memory\n");
37483748 return;
@@ -3752,7 +3752,7 @@ lpfc_create_static_vport(struct lpfc_hba *phba) · 3 unmodified lines
37523752
37533753 vport_info = kzalloc(sizeof(struct static_vport_info), GFP_KERNEL);
37543754 if (!vport_info) {
3755− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
3755+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
37563756 "0543 lpfc_create_static_vport failed to"
37573757 " allocate vport_info\n");
37583758 mempool_free(pmb, phba->mbox_mem_pool);
@@ -3813,11 +3813,12 @@ lpfc_create_static_vport(struct lpfc_hba *phba) · 54 unmodified lines
38133813 if ((le32_to_cpu(vport_info->signature) != VPORT_INFO_SIG) ||
38143814 ((le32_to_cpu(vport_info->rev) & VPORT_INFO_REV_MASK)
38153815 != VPORT_INFO_REV)) {
3816− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
3817− "0545 lpfc_create_static_vport bad"
3818− " information header 0x%x 0x%x\n",
3819− le32_to_cpu(vport_info->signature),
3820− le32_to_cpu(vport_info->rev) & VPORT_INFO_REV_MASK);
3816+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
3817+ "0545 lpfc_create_static_vport bad"
3818+ " information header 0x%x 0x%x\n",
3819+ le32_to_cpu(vport_info->signature),
3820+ le32_to_cpu(vport_info->rev) &
3821+ VPORT_INFO_REV_MASK);
38213822
38223823 goto out;
38233824 }
@@ -3881,7 +3882,7 @@ lpfc_mbx_cmpl_fabric_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 57 unmodified lines
38813882 pmb->ctx_buf = NULL;
38823883
38833884 if (mb->mbxStatus) {
3884− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
3885+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
38853886 "0258 Register Fabric login error: 0x%x\n",
38863887 mb->mbxStatus);
38873888 lpfc_mbuf_free(phba, mp->virt, mp->phys);
@@ -3954,7 +3955,8 @@ lpfc_issue_gidft(struct lpfc_vport *vport) · 66 unmodified lines
39543955 /* Cannot issue NameServer FCP Query, so finish up
39553956 * discovery
39563957 */
3957− lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI,
3958+ lpfc_printf_vlog(vport, KERN_ERR,
3959+ LOG_TRACE_EVENT,
39583960 "0604 %s FC TYPE %x %s\n",
39593961 "Failed to issue GID_FT to ",
39603962 FC_TYPE_FCP,
@@ -3970,7 +3972,8 @@ lpfc_issue_gidft(struct lpfc_vport *vport) · 9 unmodified lines
39703972 /* Cannot issue NameServer NVME Query, so finish up
39713973 * discovery
39723974 */
3973− lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI,
3975+ lpfc_printf_vlog(vport, KERN_ERR,
3976+ LOG_TRACE_EVENT,
39743977 "0605 %s FC_TYPE %x %s %d\n",
39753978 "Failed to issue GID_FT to ",
39763979 FC_TYPE_NVME,
@@ -4002,7 +4005,7 @@ lpfc_issue_gidpt(struct lpfc_vport *vport) · 25 unmodified lines
40024005 /* Cannot issue NameServer FCP Query, so finish up
40034006 * discovery
40044007 */
4005− lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI,
4008+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
40064009 "0606 %s Port TYPE %x %s\n",
40074010 "Failed to issue GID_PT to ",
40084011 GID_PT_N_PORT,
@@ -4032,7 +4035,7 @@ lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 23 unmodified lines
40324035 vport->gidft_inp = 0;
40334036
40344037 if (mb->mbxStatus) {
4035− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
4038+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
40364039 "0260 Register NameServer error: 0x%x\n",
40374040 mb->mbxStatus);
40384041
@@ -4344,7 +4347,7 @@ lpfc_nlp_state_cleanup(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 305 unmodified lines
43444347 GFP_KERNEL);
43454348
43464349 if (!ndlp->lat_data)
4347− lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE,
4350+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
43484351 "0286 lpfc_nlp_state_cleanup failed to "
43494352 "allocate statistical data buffer DID "
43504353 "0x%x\n", ndlp->nlp_DID);
@@ -5013,8 +5016,8 @@ lpfc_unreg_hba_rpis(struct lpfc_hba *phba) · 662 unmodified lines
50135016
50145017 vports = lpfc_create_vport_work_array(phba);
50155018 if (!vports) {
5016− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
5017− "2884 Vport array allocation failed \n");
5019+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
5020+ "2884 Vport array allocation failed \n");
50185021 return;
50195022 }
50205023 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) {
@@ -5057,9 +5060,10 @@ lpfc_unreg_all_rpis(struct lpfc_vport *vport) · 36 unmodified lines
50575060 mempool_free(mbox, phba->mbox_mem_pool);
50585061
50595062 if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED))
5060− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
5061− "1836 Could not issue "
5062− "unreg_login(all_rpis) status %d\n", rc);
5063+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
5064+ "1836 Could not issue "
5065+ "unreg_login(all_rpis) status %d\n",
5066+ rc);
50635067 }
50645068 }
50655069
@@ -5086,7 +5090,7 @@ lpfc_unreg_default_rpis(struct lpfc_vport *vport) · 20 unmodified lines
50865090 mempool_free(mbox, phba->mbox_mem_pool);
50875091
50885092 if ((rc == MBX_TIMEOUT) || (rc == MBX_NOT_FINISHED))
5089− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX | LOG_VPORT,
5093+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
50905094 "1815 Could not issue "
50915095 "unreg_did (default rpis) status %d\n",
50925096 rc);
@@ -5907,7 +5911,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) · 814 unmodified lines
59075911 case LPFC_FLOGI:
59085912 /* port_state is identically LPFC_FLOGI while waiting for FLOGI cmpl */
59095913 /* Initial FLOGI timeout */
5910− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
5914+ lpfc_printf_vlog(vport, KERN_ERR,
5915+ LOG_TRACE_EVENT,
59115916 "0222 Initial %s timeout\n",
59125917 vport->vpi ? "FDISC" : "FLOGI");
59135918
@@ -5925,7 +5930,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) · 11 unmodified lines
59255930 case LPFC_FABRIC_CFG_LINK:
59265931 /* hba_state is identically LPFC_FABRIC_CFG_LINK while waiting for
59275932 NameServer login */
5928− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
5933+ lpfc_printf_vlog(vport, KERN_ERR,
5934+ LOG_TRACE_EVENT,
59295935 "0223 Timeout while waiting for "
59305936 "NameServer login\n");
59315937 /* Next look for NameServer ndlp */
@@ -5938,7 +5944,8 @@ lpfc_disc_timeout_handler(struct lpfc_vport *vport) · 6 unmodified lines
59385944
59395945 case LPFC_NS_QRY:
59405946 /* Check for wait for NameServer Rsp timeout */
5941− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
5947+ lpfc_printf_vlog(vport, KERN_ERR,
5948+ LOG_TRACE_EVENT,
59425949 "0224 NameServer Query timeout "
59435950 "Data: x%x x%x\n",
59445951 vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
@@ -5971,7 +5978,8 @@ restart_disc: · 26 unmodified lines
59715978 /* Setup and issue mailbox INITIALIZE LINK command */
59725979 initlinkmbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
59735980 if (!initlinkmbox) {
5974− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
5981+ lpfc_printf_vlog(vport, KERN_ERR,
5982+ LOG_TRACE_EVENT,
59755983 "0206 Device Discovery "
59765984 "completion error\n");
59775985 phba->link_state = LPFC_HBA_ERROR;
@@ -5993,7 +6001,8 @@ restart_disc: · 15 unmodified lines
59936001
59946002 case LPFC_DISC_AUTH:
59956003 /* Node Authentication timeout */
5996− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
6004+ lpfc_printf_vlog(vport, KERN_ERR,
6005+ LOG_TRACE_EVENT,
59976006 "0227 Node Authentication timeout\n");
59986007 lpfc_disc_flush_list(vport);
59996008
@@ -6013,7 +6022,8 @@ restart_disc: · 13 unmodified lines
60136022
60146023 case LPFC_VPORT_READY:
60156024 if (vport->fc_flag & FC_RSCN_MODE) {
6016− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
6025+ lpfc_printf_vlog(vport, KERN_ERR,
6026+ LOG_TRACE_EVENT,
60176027 "0231 RSCN timeout Data: x%x "
60186028 "x%x\n",
60196029 vport->fc_ns_retry, LPFC_MAX_NS_RETRY);
@@ -6027,7 +6037,8 @@ restart_disc: · 7 unmodified lines
60276037 break;
60286038
60296039 default:
6030− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
6040+ lpfc_printf_vlog(vport, KERN_ERR,
6041+ LOG_TRACE_EVENT,
60316042 "0273 Unexpected discovery timeout, "
60326043 "vport State x%x\n", vport->port_state);
60336044 break;
@@ -6036,7 +6047,8 @@ restart_disc: · 2 unmodified lines
60366047 switch (phba->link_state) {
60376048 case LPFC_CLEAR_LA:
60386049 /* CLEAR LA timeout */
6039− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
6050+ lpfc_printf_vlog(vport, KERN_ERR,
6051+ LOG_TRACE_EVENT,
60406052 "0228 CLEAR LA timeout\n");
60416053 clrlaerr = 1;
60426054 break;
@@ -6050,7 +6062,8 @@ restart_disc: · 7 unmodified lines
60506062 case LPFC_INIT_MBX_CMDS:
60516063 case LPFC_LINK_DOWN:
60526064 case LPFC_HBA_ERROR:
6053− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
6065+ lpfc_printf_vlog(vport, KERN_ERR,
6066+ LOG_TRACE_EVENT,
60546067 "0230 Unexpected timeout, hba link "
60556068 "state x%x\n", phba->link_state);
60566069 clrlaerr = 1;
@@ -6241,9 +6254,9 @@ lpfc_find_vport_by_vpid(struct lpfc_hba *phba, uint16_t vpi) · 184 unmodified lines
62416254 }
62426255
62436256 if (i >= phba->max_vpi) {
6244− lpfc_printf_log(phba, KERN_ERR, LOG_ELS,
6245− "2936 Could not find Vport mapped "
6246− "to vpi %d\n", vpi);
6257+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
6258+ "2936 Could not find Vport mapped "
6259+ "to vpi %d\n", vpi);
62476260 return NULL;
62486261 }
62496262 }
@@ -6547,10 +6560,10 @@ lpfc_unregister_vfi_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 297 unmodified lines
65476560 struct Scsi_Host *shost = lpfc_shost_from_vport(vport);
65486561
65496562 if (mboxq->u.mb.mbxStatus) {
6550− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX,
6551− "2555 UNREG_VFI mbxStatus error x%x "
6552− "HBA state x%x\n",
6553− mboxq->u.mb.mbxStatus, vport->port_state);
6563+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
6564+ "2555 UNREG_VFI mbxStatus error x%x "
6565+ "HBA state x%x\n",
6566+ mboxq->u.mb.mbxStatus, vport->port_state);
65546567 }
65556568 spin_lock_irq(shost->host_lock);
65566569 phba->pport->fc_flag &= ~FC_VFI_REGISTERED;
@@ -6572,10 +6585,10 @@ lpfc_unregister_fcfi_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 15 unmodified lines
65726585 struct lpfc_vport *vport = mboxq->vport;
65736586
65746587 if (mboxq->u.mb.mbxStatus) {
6575− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX,
6576− "2550 UNREG_FCFI mbxStatus error x%x "
6577− "HBA state x%x\n",
6578− mboxq->u.mb.mbxStatus, vport->port_state);
6588+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
6589+ "2550 UNREG_FCFI mbxStatus error x%x "
6590+ "HBA state x%x\n",
6591+ mboxq->u.mb.mbxStatus, vport->port_state);
65796592 }
65806593 mempool_free(mboxq, phba->mbox_mem_pool);
65816594 return;
@@ -6664,7 +6677,7 @@ lpfc_sli4_unregister_fcf(struct lpfc_hba *phba) · 82 unmodified lines
66646677
66656678 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
66666679 if (!mbox) {
6667− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX,
6680+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
66686681 "2551 UNREG_FCFI mbox allocation failed"
66696682 "HBA state x%x\n", phba->pport->port_state);
66706683 return -ENOMEM;
@@ -6675,7 +6688,7 @@ lpfc_sli4_unregister_fcf(struct lpfc_hba *phba) · 4 unmodified lines
66756688 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
66766689
66776690 if (rc == MBX_NOT_FINISHED) {
6678− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
6691+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
66796692 "2552 Unregister FCFI command failed rc x%x "
66806693 "HBA state x%x\n",
66816694 rc, phba->pport->port_state);
@@ -6699,7 +6712,7 @@ lpfc_unregister_fcf_rescan(struct lpfc_hba *phba) · 17 unmodified lines
66996712 /* Preparation for unregistering fcf */
67006713 rc = lpfc_unregister_fcf_prep(phba);
67016714 if (rc) {
6702− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
6715+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
67036716 "2748 Failed to prepare for unregistering "
67046717 "HBA's FCF record: rc=%d\n", rc);
67056718 return;
@@ -6735,7 +6748,7 @@ lpfc_unregister_fcf_rescan(struct lpfc_hba *phba) · 29 unmodified lines
67356748 spin_lock_irq(&phba->hbalock);
67366749 phba->fcf.fcf_flag &= ~FCF_INIT_DISC;
67376750 spin_unlock_irq(&phba->hbalock);
6738− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY|LOG_MBOX,
6751+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
67396752 "2553 lpfc_unregister_unused_fcf failed "
67406753 "to read FCF record HBA state x%x\n",
67416754 phba->pport->port_state);
@@ -6757,7 +6770,7 @@ lpfc_unregister_fcf(struct lpfc_hba *phba) · 15 unmodified lines
67576770 /* Preparation for unregistering fcf */
67586771 rc = lpfc_unregister_fcf_prep(phba);
67596772 if (rc) {
6760− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
6773+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
67616774 "2749 Failed to prepare for unregistering "
67626775 "HBA's FCF record: rc=%d\n", rc);
67636776 return;
@@ -6844,9 +6857,9 @@ lpfc_read_fcf_conn_tbl(struct lpfc_hba *phba, · 80 unmodified lines
68446857 conn_entry = kzalloc(sizeof(struct lpfc_fcf_conn_entry),
68456858 GFP_KERNEL);
68466859 if (!conn_entry) {
6847− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6848− "2566 Failed to allocate connection"
6849− " table entry\n");
6860+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
6861+ "2566 Failed to allocate connection"
6862+ " table entry\n");
68506863 return;
68516864 }
68526865
@@ -6990,7 +7003,7 @@ lpfc_parse_fcoe_conf(struct lpfc_hba *phba, · 137 unmodified lines
69907003
69917004 /* Check the region signature first */
69927005 if (memcmp(buff, LPFC_REGION23_SIGNATURE, 4)) {
6993− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7006+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
69947007 "2567 Config region 23 has bad signature\n");
69957008 return;
69967009 }
@@ -6999,8 +7012,8 @@ lpfc_parse_fcoe_conf(struct lpfc_hba *phba, · 2 unmodified lines
69997012
70007013 /* Check the data structure version */
70017014 if (buff[offset] != LPFC_REGION23_VERSION) {
7002− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7003− "2568 Config region 23 has bad version\n");
7015+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
7016+ "2568 Config region 23 has bad version\n");
70047017 return;
70057018 }
70067019 offset += 4;
drivers/scsi/lpfc/lpfc_hw4.h+4−1
@@ -650,6 +650,9 @@ struct lpfc_register { · 649 unmodified lines
650650 #define lpfc_sliport_status_oti_SHIFT 29
651651 #define lpfc_sliport_status_oti_MASK 0x1
652652 #define lpfc_sliport_status_oti_WORD word0
653+#define lpfc_sliport_status_dip_SHIFT 25
654+#define lpfc_sliport_status_dip_MASK 0x1
655+#define lpfc_sliport_status_dip_WORD word0
653656 #define lpfc_sliport_status_rn_SHIFT 24
654657 #define lpfc_sliport_status_rn_MASK 0x1
655658 #define lpfc_sliport_status_rn_WORD word0
@@ -3531,7 +3534,7 @@ struct lpfc_sli4_parameters { · 2875 unmodified lines
35313534 };
35323535
35333536 #define LPFC_SET_UE_RECOVERY 0x10
3534−#define LPFC_SET_MDS_DIAGS 0x11
3537+#define LPFC_SET_MDS_DIAGS 0x12
35353538 #define LPFC_SET_DUAL_DUMP 0x1e
35363539 struct lpfc_mbx_set_feature {
35373540 struct mbox_header header;
drivers/scsi/lpfc/lpfc_init.c+468−271
@@ -153,7 +153,7 @@ lpfc_config_port_prep(struct lpfc_hba *phba) · 152 unmodified lines
153153 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
154154
155155 if (rc != MBX_SUCCESS) {
156− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
156+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
157157 "0324 Config Port initialization "
158158 "error, mbxCmd x%x READ_NVPARM, "
159159 "mbxStatus x%x\n",
@@ -177,7 +177,7 @@ lpfc_config_port_prep(struct lpfc_hba *phba) · 17 unmodified lines
177177 lpfc_read_rev(phba, pmb);
178178 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
179179 if (rc != MBX_SUCCESS) {
180− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
180+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
181181 "0439 Adapter failed to init, mbxCmd x%x "
182182 "READ_REV, mbxStatus x%x\n",
183183 mb->mbxCommand, mb->mbxStatus);
@@ -192,7 +192,7 @@ lpfc_config_port_prep(struct lpfc_hba *phba) · 8 unmodified lines
192192 */
193193 if (mb->un.varRdRev.rr == 0) {
194194 vp->rev.rBit = 0;
195− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
195+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
196196 "0440 Adapter failed to init, READ_REV has "
197197 "missing revision information.\n");
198198 mempool_free(pmb, phba->mbox_mem_pool);
@@ -253,13 +253,15 @@ lpfc_config_port_prep(struct lpfc_hba *phba) · 54 unmodified lines
253253 */
254254 if (mb->un.varDmp.word_cnt == 0)
255255 break;
256− if (mb->un.varDmp.word_cnt > DMP_VPD_SIZE - offset)
257− mb->un.varDmp.word_cnt = DMP_VPD_SIZE - offset;
256+
257+ i = mb->un.varDmp.word_cnt * sizeof(uint32_t);
258+ if (offset + i > DMP_VPD_SIZE)
259+ i = DMP_VPD_SIZE - offset;
258260 lpfc_sli_pcimem_bcopy(((uint8_t *)mb) + DMP_RSP_OFFSET,
259− lpfc_vpd_data + offset,
260− mb->un.varDmp.word_cnt);
261− offset += mb->un.varDmp.word_cnt;
262− } while (mb->un.varDmp.word_cnt && offset < DMP_VPD_SIZE);
261+ lpfc_vpd_data + offset, i);
262+ offset += i;
263+ } while (offset < DMP_VPD_SIZE);
264+
263265 lpfc_parse_vpd(phba, lpfc_vpd_data, offset);
264266
265267 kfree(lpfc_vpd_data);
@@ -442,7 +444,7 @@ lpfc_config_port_post(struct lpfc_hba *phba) · 176 unmodified lines
442444
443445 pmb->vport = vport;
444446 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
445− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
447+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
446448 "0448 Adapter failed init, mbxCmd x%x "
447449 "READ_SPARM mbxStatus x%x\n",
448450 mb->mbxCommand, mb->mbxStatus);
@@ -496,7 +498,7 @@ lpfc_config_port_post(struct lpfc_hba *phba) · 47 unmodified lines
496498 lpfc_read_config(phba, pmb);
497499 pmb->vport = vport;
498500 if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) {
499− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
501+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
500502 "0453 Adapter failed to init, mbxCmd x%x "
501503 "READ_CONFIG, mbxStatus x%x\n",
502504 mb->mbxCommand, mb->mbxStatus);
@@ -545,7 +547,7 @@ lpfc_config_port_post(struct lpfc_hba *phba) · 42 unmodified lines
545547 }
546548 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
547549 if (rc != MBX_SUCCESS) {
548− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
550+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
549551 "0352 Config MSI mailbox command "
550552 "failed, mbxCmd x%x, mbxStatus x%x\n",
551553 pmb->u.mb.mbxCommand,
@@ -596,17 +598,15 @@ lpfc_config_port_post(struct lpfc_hba *phba) · 44 unmodified lines
596598 jiffies + msecs_to_jiffies(1000 * phba->eratt_poll_interval));
597599
598600 if (phba->hba_flag & LINK_DISABLED) {
599− lpfc_printf_log(phba,
600− KERN_ERR, LOG_INIT,
601− "2598 Adapter Link is disabled.\n");
601+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
602+ "2598 Adapter Link is disabled.\n");
602603 lpfc_down_link(phba, pmb);
603604 pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
604605 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
605606 if ((rc != MBX_SUCCESS) && (rc != MBX_BUSY)) {
606− lpfc_printf_log(phba,
607− KERN_ERR, LOG_INIT,
608− "2599 Adapter failed to issue DOWN_LINK"
609− " mbox command rc 0x%x\n", rc);
607+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
608+ "2599 Adapter failed to issue DOWN_LINK"
609+ " mbox command rc 0x%x\n", rc);
610610
611611 mempool_free(pmb, phba->mbox_mem_pool);
612612 return -EIO;
@@ -630,9 +630,7 @@ lpfc_config_port_post(struct lpfc_hba *phba) · 17 unmodified lines
630630 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
631631
632632 if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) {
633− lpfc_printf_log(phba,
634− KERN_ERR,
635− LOG_INIT,
633+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
636634 "0456 Adapter failed to issue "
637635 "ASYNCEVT_ENABLE mbox status x%x\n",
638636 rc);
@@ -652,7 +650,8 @@ lpfc_config_port_post(struct lpfc_hba *phba) · 13 unmodified lines
652650 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
653651
654652 if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) {
655− lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "0435 Adapter failed "
653+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
654+ "0435 Adapter failed "
656655 "to get Option ROM version status x%x\n", rc);
657656 mempool_free(pmb, phba->mbox_mem_pool);
658657 }
@@ -730,10 +729,10 @@ lpfc_hba_init_link_fc_topology(struct lpfc_hba *phba, uint32_t fc_topology, · 71 unmodified lines
730729 ((phba->cfg_link_speed == LPFC_USER_LINK_SPEED_64G) &&
731730 !(phba->lmt & LMT_64Gb))) {
732731 /* Reset link speed to auto */
733− lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT,
734− "1302 Invalid speed for this board:%d "
735− "Reset link speed to auto.\n",
736− phba->cfg_link_speed);
732+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
733+ "1302 Invalid speed for this board:%d "
734+ "Reset link speed to auto.\n",
735+ phba->cfg_link_speed);
737736 phba->cfg_link_speed = LPFC_USER_LINK_SPEED_AUTO;
738737 }
739738 lpfc_init_link(phba, pmb, fc_topology, phba->cfg_link_speed);
@@ -742,10 +741,10 @@ lpfc_hba_init_link_fc_topology(struct lpfc_hba *phba, uint32_t fc_topology, · 2 unmodified lines
742741 lpfc_set_loopback_flag(phba);
743742 rc = lpfc_sli_issue_mbox(phba, pmb, flag);
744743 if ((rc != MBX_BUSY) && (rc != MBX_SUCCESS)) {
745− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
746− "0498 Adapter failed to init, mbxCmd x%x "
747− "INIT_LINK, mbxStatus x%x\n",
748− mb->mbxCommand, mb->mbxStatus);
744+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
745+ "0498 Adapter failed to init, mbxCmd x%x "
746+ "INIT_LINK, mbxStatus x%x\n",
747+ mb->mbxCommand, mb->mbxStatus);
749748 if (phba->sli_rev <= LPFC_SLI_REV3) {
750749 /* Clear all interrupt enable conditions */
751750 writel(0, phba->HCregaddr);
@@ -791,17 +790,15 @@ lpfc_hba_down_link(struct lpfc_hba *phba, uint32_t flag) · 39 unmodified lines
791790 return -ENOMEM;
792791 }
793792
794− lpfc_printf_log(phba,
795− KERN_ERR, LOG_INIT,
796− "0491 Adapter Link is disabled.\n");
793+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
794+ "0491 Adapter Link is disabled.\n");
797795 lpfc_down_link(phba, pmb);
798796 pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
799797 rc = lpfc_sli_issue_mbox(phba, pmb, flag);
800798 if ((rc != MBX_SUCCESS) && (rc != MBX_BUSY)) {
801− lpfc_printf_log(phba,
802− KERN_ERR, LOG_INIT,
803− "2522 Adapter failed to issue DOWN_LINK"
804− " mbox command rc 0x%x\n", rc);
799+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
800+ "2522 Adapter failed to issue DOWN_LINK"
801+ " mbox command rc 0x%x\n", rc);
805802
806803 mempool_free(pmb, phba->mbox_mem_pool);
807804 return -EIO;
@@ -996,7 +993,6 @@ lpfc_hba_clean_txcmplq(struct lpfc_hba *phba) · 188 unmodified lines
996993
997994 /**
998995 * lpfc_hba_down_post_s3 - Perform lpfc uninitialization after HBA reset
999− int i;
1000996 * @phba: pointer to lpfc HBA data structure.
1001997 *
1002998 * This routine will do uninitialization after the HBA is reset when bring
@@ -1124,7 +1120,7 @@ lpfc_hba_down_post(struct lpfc_hba *phba) · 121 unmodified lines
11241120
11251121 /**
11261122 * lpfc_hb_timeout - The HBA-timer timeout handler
1127− * @ptr: unsigned long holds the pointer to lpfc hba data structure.
1123+ * @t: timer context used to obtain the pointer to lpfc hba data structure.
11281124 *
11291125 * This is the HBA-timer timeout handler registered to the lpfc driver. When
11301126 * this timer fires, a HBA timeout event shall be posted to the lpfc driver
@@ -1158,7 +1154,7 @@ lpfc_hb_timeout(struct timer_list *t) · 27 unmodified lines
11581154
11591155 /**
11601156 * lpfc_rrq_timeout - The RRQ-timer timeout handler
1161− * @ptr: unsigned long holds the pointer to lpfc hba data structure.
1157+ * @t: timer context used to obtain the pointer to lpfc hba data structure.
11621158 *
11631159 * This is the RRQ-timer timeout handler registered to the lpfc driver. When
11641160 * this timer fires, a RRQ timeout event shall be posted to the lpfc driver
@@ -1222,6 +1218,75 @@ lpfc_hb_mbox_cmpl(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmboxq) · 57 unmodified lines
12221218 return;
12231219 }
12241220
1221+/*
1222+ * lpfc_idle_stat_delay_work - idle_stat tracking
1223+ *
1224+ * This routine tracks per-cq idle_stat and determines polling decisions.
1225+ *
1226+ * Return codes:
1227+ * None
1228+ **/
1229+static void
1230+lpfc_idle_stat_delay_work(struct work_struct *work)
1231+{
1232+ struct lpfc_hba *phba = container_of(to_delayed_work(work),
1233+ struct lpfc_hba,
1234+ idle_stat_delay_work);
1235+ struct lpfc_queue *cq;
1236+ struct lpfc_sli4_hdw_queue *hdwq;
1237+ struct lpfc_idle_stat *idle_stat;
1238+ u32 i, idle_percent;
1239+ u64 wall, wall_idle, diff_wall, diff_idle, busy_time;
1240+
1241+ if (phba->pport->load_flag & FC_UNLOADING)
1242+ return;
1243+
1244+ if (phba->link_state == LPFC_HBA_ERROR ||
1245+ phba->pport->fc_flag & FC_OFFLINE_MODE)
1246+ goto requeue;
1247+
1248+ for_each_present_cpu(i) {
1249+ hdwq = &phba->sli4_hba.hdwq[phba->sli4_hba.cpu_map[i].hdwq];
1250+ cq = hdwq->io_cq;
1251+
1252+ /* Skip if we've already handled this cq's primary CPU */
1253+ if (cq->chann != i)
1254+ continue;
1255+
1256+ idle_stat = &phba->sli4_hba.idle_stat[i];
1257+
1258+ /* get_cpu_idle_time returns values as running counters. Thus,
1259+ * to know the amount for this period, the prior counter values
1260+ * need to be subtracted from the current counter values.
1261+ * From there, the idle time stat can be calculated as a
1262+ * percentage of 100 - the sum of the other consumption times.
1263+ */
1264+ wall_idle = get_cpu_idle_time(i, &wall, 1);
1265+ diff_idle = wall_idle - idle_stat->prev_idle;
1266+ diff_wall = wall - idle_stat->prev_wall;
1267+
1268+ if (diff_wall <= diff_idle)
1269+ busy_time = 0;
1270+ else
1271+ busy_time = diff_wall - diff_idle;
1272+
1273+ idle_percent = div64_u64(100 * busy_time, diff_wall);
1274+ idle_percent = 100 - idle_percent;
1275+
1276+ if (idle_percent < 15)
1277+ cq->poll_mode = LPFC_QUEUE_WORK;
1278+ else
1279+ cq->poll_mode = LPFC_IRQ_POLL;
1280+
1281+ idle_stat->prev_idle = wall_idle;
1282+ idle_stat->prev_wall = wall;
1283+ }
1284+
1285+requeue:
1286+ schedule_delayed_work(&phba->idle_stat_delay_work,
1287+ msecs_to_jiffies(LPFC_IDLE_STAT_DELAY));
1288+}
1289+
12251290 static void
12261291 lpfc_hb_eq_delay_work(struct work_struct *work)
12271292 {
@@ -1538,11 +1603,11 @@ lpfc_handle_deferred_eratt(struct lpfc_hba *phba) · 310 unmodified lines
15381603 return;
15391604 }
15401605
1541− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1542− "0479 Deferred Adapter Hardware Error "
1543− "Data: x%x x%x x%x\n",
1544− phba->work_hs,
1545− phba->work_status[0], phba->work_status[1]);
1606+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1607+ "0479 Deferred Adapter Hardware Error "
1608+ "Data: x%x x%x x%x\n",
1609+ phba->work_hs, phba->work_status[0],
1610+ phba->work_status[1]);
15461611
15471612 spin_lock_irq(&phba->hbalock);
15481613 psli->sli_flag &= ~LPFC_SLI_ACTIVE;
@@ -1693,7 +1758,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba) · 144 unmodified lines
16931758 temp_event_data.event_code = LPFC_CRIT_TEMP;
16941759 temp_event_data.data = (uint32_t)temperature;
16951760
1696− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1761+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
16971762 "0406 Adapter maximum temperature exceeded "
16981763 "(%ld), taking this port offline "
16991764 "Data: x%x x%x x%x\n",
@@ -1717,7 +1782,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba) · 17 unmodified lines
17171782 * failure is a value other than FFER6. Do not call the offline
17181783 * twice. This is the adapter hardware error path.
17191784 */
1720− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1785+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
17211786 "0457 Adapter Hardware Error "
17221787 "Data: x%x x%x x%x\n",
17231788 phba->work_hs,
@@ -1738,7 +1803,7 @@ lpfc_handle_eratt_s3(struct lpfc_hba *phba) · 14 unmodified lines
17381803 * lpfc_sli4_port_sta_fn_reset - The SLI4 function reset due to port status reg
17391804 * @phba: pointer to lpfc hba data structure.
17401805 * @mbx_action: flag for mailbox shutdown action.
1741− *
1806+ * @en_rn_msg: send reset/port recovery message.
17421807 * This routine is invoked to perform an SLI4 port PCI function reset in
17431808 * response to port status register polling attention. It waits for port
17441809 * status register (ERR, RDY, RN) bits before proceeding with function reset.
@@ -1765,7 +1830,7 @@ lpfc_sli4_port_sta_fn_reset(struct lpfc_hba *phba, int mbx_action, · 20 unmodified lines
17651830
17661831 /* need reset: attempt for port recovery */
17671832 if (en_rn_msg)
1768− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1833+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
17691834 "2887 Reset Needed: Attempting Port "
17701835 "Recovery...\n");
17711836 lpfc_offline_prep(phba, mbx_action);
@@ -1775,14 +1840,14 @@ lpfc_sli4_port_sta_fn_reset(struct lpfc_hba *phba, int mbx_action, · 3 unmodified lines
17751840 lpfc_sli4_disable_intr(phba);
17761841 rc = lpfc_sli_brdrestart(phba);
17771842 if (rc) {
1778− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1843+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
17791844 "6309 Failed to restart board\n");
17801845 return rc;
17811846 }
17821847 /* request and enable interrupt */
17831848 intr_mode = lpfc_sli4_enable_intr(phba, phba->intr_mode);
17841849 if (intr_mode == LPFC_INTR_ERROR) {
1785− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1850+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
17861851 "3175 Failed to enable interrupt\n");
17871852 return -EIO;
17881853 }
@@ -1821,7 +1886,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) · 32 unmodified lines
18211886 * we cannot communicate with the pci card anyway.
18221887 */
18231888 if (pci_channel_offline(phba->pcidev)) {
1824− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1889+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
18251890 "3166 pci channel is offline\n");
18261891 lpfc_sli4_offline_eratt(phba);
18271892 return;
@@ -1844,7 +1909,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) · 16 unmodified lines
18441909 lpfc_sli4_offline_eratt(phba);
18451910 return;
18461911 }
1847− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1912+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
18481913 "7623 Checking UE recoverable");
18491914
18501915 for (i = 0; i < phba->sli4_hba.ue_to_sr / 1000; i++) {
@@ -1861,7 +1926,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) · 10 unmodified lines
18611926 msleep(1000);
18621927 }
18631928
1864− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1929+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
18651930 "4827 smphr_port_status x%x : Waited %dSec",
18661931 smphr_port_status, i);
18671932
@@ -1879,14 +1944,14 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) · 11 unmodified lines
18791944 LPFC_MBX_NO_WAIT, en_rn_msg);
18801945 if (rc == 0)
18811946 return;
1882− lpfc_printf_log(phba,
1883− KERN_ERR, LOG_INIT,
1947+ lpfc_printf_log(phba, KERN_ERR,
1948+ LOG_TRACE_EVENT,
18841949 "4215 Failed to recover UE");
18851950 break;
18861951 }
18871952 }
18881953 }
1889− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1954+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
18901955 "7624 Firmware not ready: Failing UE recovery,"
18911956 " waited %dSec", i);
18921957 phba->link_state = LPFC_HBA_ERROR;
@@ -1899,7 +1964,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) · 6 unmodified lines
18991964 &portstat_reg.word0);
19001965 /* consider PCI bus read error as pci_channel_offline */
19011966 if (pci_rd_rc1 == -EIO) {
1902− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1967+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
19031968 "3151 PCI bus read access failure: x%x\n",
19041969 readl(phba->sli4_hba.u.if_type2.STATUSregaddr));
19051970 lpfc_sli4_offline_eratt(phba);
@@ -1908,10 +1973,10 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) · 2 unmodified lines
19081973 reg_err1 = readl(phba->sli4_hba.u.if_type2.ERR1regaddr);
19091974 reg_err2 = readl(phba->sli4_hba.u.if_type2.ERR2regaddr);
19101975 if (bf_get(lpfc_sliport_status_oti, &portstat_reg)) {
1911− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1912− "2889 Port Overtemperature event, "
1913− "taking port offline Data: x%x x%x\n",
1914− reg_err1, reg_err2);
1976+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1977+ "2889 Port Overtemperature event, "
1978+ "taking port offline Data: x%x x%x\n",
1979+ reg_err1, reg_err2);
19151980
19161981 phba->sfp_alarm |= LPFC_TRANSGRESSION_HIGH_TEMPERATURE;
19171982 temp_event_data.event_type = FC_REG_TEMPERATURE_EVENT;
@@ -1933,17 +1998,17 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) · 15 unmodified lines
19331998 }
19341999 if (reg_err1 == SLIPORT_ERR1_REG_ERR_CODE_2 &&
19352000 reg_err2 == SLIPORT_ERR2_REG_FW_RESTART) {
1936− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
2001+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
19372002 "3143 Port Down: Firmware Update "
19382003 "Detected\n");
19392004 en_rn_msg = false;
19402005 } else if (reg_err1 == SLIPORT_ERR1_REG_ERR_CODE_2 &&
19412006 reg_err2 == SLIPORT_ERR2_REG_FORCED_DUMP)
1942− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
2007+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
19432008 "3144 Port Down: Debug Dump\n");
19442009 else if (reg_err1 == SLIPORT_ERR1_REG_ERR_CODE_2 &&
19452010 reg_err2 == SLIPORT_ERR2_REG_FUNC_PROVISON)
1946− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
2011+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
19472012 "3145 Port Down: Provisioning\n");
19482013
19492014 /* If resets are disabled then leave the HBA alone and return */
@@ -1962,7 +2027,7 @@ lpfc_handle_eratt_s4(struct lpfc_hba *phba) · 12 unmodified lines
19622027 break;
19632028 }
19642029 /* fall through for not able to recover */
1965− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
2030+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
19662031 "3152 Unrecoverable error\n");
19672032 phba->link_state = LPFC_HBA_ERROR;
19682033 break;
@@ -2080,8 +2145,8 @@ lpfc_handle_latt_err_exit: · 111 unmodified lines
20802145 lpfc_linkdown(phba);
20812146 phba->link_state = LPFC_HBA_ERROR;
20822147
2083− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
2084− "0300 LATT: Cannot issue READ_LA: Data:%d\n", rc);
2148+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
2149+ "0300 LATT: Cannot issue READ_LA: Data:%d\n", rc);
20852150
20862151 return;
20872152 }
@@ -2830,12 +2895,13 @@ lpfc_cleanup(struct lpfc_vport *vport) · 742 unmodified lines
28302895 */
28312896 while (!list_empty(&vport->fc_nodes)) {
28322897 if (i++ > 3000) {
2833− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
2898+ lpfc_printf_vlog(vport, KERN_ERR,
2899+ LOG_TRACE_EVENT,
28342900 "0233 Nodelist not empty\n");
28352901 list_for_each_entry_safe(ndlp, next_ndlp,
28362902 &vport->fc_nodes, nlp_listp) {
28372903 lpfc_printf_vlog(ndlp->vport, KERN_ERR,
2838− LOG_NODE,
2904+ LOG_TRACE_EVENT,
28392905 "0282 did:x%x ndlp:x%px "
28402906 "usgmap:x%x refcnt:%d\n",
28412907 ndlp->nlp_DID, (void *)ndlp,
@@ -2922,6 +2988,7 @@ lpfc_stop_hba_timers(struct lpfc_hba *phba) · 80 unmodified lines
29222988 if (phba->pport)
29232989 lpfc_stop_vport_timers(phba->pport);
29242990 cancel_delayed_work_sync(&phba->eq_delay_work);
2991+ cancel_delayed_work_sync(&phba->idle_stat_delay_work);
29252992 del_timer_sync(&phba->sli.mbox_tmo);
29262993 del_timer_sync(&phba->fabric_block_timer);
29272994 del_timer_sync(&phba->eratt_poll);
@@ -2942,7 +3009,7 @@ lpfc_stop_hba_timers(struct lpfc_hba *phba) · 14 unmodified lines
29423009 lpfc_sli4_stop_fcf_redisc_wait_timer(phba);
29433010 break;
29443011 default:
2945− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
3012+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
29463013 "0297 Invalid device group (x%x)\n",
29473014 phba->pci_dev_grp);
29483015 break;
@@ -2953,6 +3020,7 @@ lpfc_stop_hba_timers(struct lpfc_hba *phba) · 4 unmodified lines
29533020 /**
29543021 * lpfc_block_mgmt_io - Mark a HBA's management interface as blocked
29553022 * @phba: pointer to lpfc hba data structure.
3023+ * @mbx_action: flag for mailbox no wait action.
29563024 *
29573025 * This routine marks a HBA's management interface as blocked. Once the HBA's
29583026 * management interface is marked as blocked, all the user space access to
@@ -2989,10 +3057,10 @@ lpfc_block_mgmt_io(struct lpfc_hba *phba, int mbx_action) · 30 unmodified lines
29893057 /* Check active mailbox complete status every 2ms */
29903058 msleep(2);
29913059 if (time_after(jiffies, timeout)) {
2992− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
2993− "2813 Mgmt IO is Blocked %x "
2994− "- mbox cmd %x still active\n",
2995− phba->sli.sli_flag, actcmd);
3060+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
3061+ "2813 Mgmt IO is Blocked %x "
3062+ "- mbox cmd %x still active\n",
3063+ phba->sli.sli_flag, actcmd);
29963064 break;
29973065 }
29983066 }
@@ -3337,7 +3405,7 @@ lpfc_online(struct lpfc_hba *phba) · 338 unmodified lines
33373405 !phba->nvmet_support) {
33383406 error = lpfc_nvme_create_localport(phba->pport);
33393407 if (error)
3340− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
3408+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
33413409 "6132 NVME restore reg failed "
33423410 "on nvmei error x%x\n", error);
33433411 }
@@ -3403,6 +3471,7 @@ lpfc_unblock_mgmt_io(struct lpfc_hba * phba) · 59 unmodified lines
34033471 /**
34043472 * lpfc_offline_prep - Prepare a HBA to be brought offline
34053473 * @phba: pointer to lpfc hba data structure.
3474+ * @mbx_action: flag for mailbox shutdown action.
34063475 *
34073476 * This routine is invoked to prepare a HBA to be brought offline. It performs
34083477 * unregistration login to all the nodes on all vports and flushes the mailbox
@@ -3677,7 +3746,8 @@ lpfc_sli4_els_sgl_update(struct lpfc_hba *phba) · 268 unmodified lines
36773746 sglq_entry = kzalloc(sizeof(struct lpfc_sglq),
36783747 GFP_KERNEL);
36793748 if (sglq_entry == NULL) {
3680− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3749+ lpfc_printf_log(phba, KERN_ERR,
3750+ LOG_TRACE_EVENT,
36813751 "2562 Failure to allocate an "
36823752 "ELS sgl entry:%d\n", i);
36833753 rc = -ENOMEM;
@@ -3688,7 +3758,8 @@ lpfc_sli4_els_sgl_update(struct lpfc_hba *phba) · 4 unmodified lines
36883758 &sglq_entry->phys);
36893759 if (sglq_entry->virt == NULL) {
36903760 kfree(sglq_entry);
3691− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3761+ lpfc_printf_log(phba, KERN_ERR,
3762+ LOG_TRACE_EVENT,
36923763 "2563 Failure to allocate an "
36933764 "ELS mbuf:%d\n", i);
36943765 rc = -ENOMEM;
@@ -3743,7 +3814,8 @@ lpfc_sli4_els_sgl_update(struct lpfc_hba *phba) · 48 unmodified lines
37433814 &phba->sli4_hba.lpfc_els_sgl_list, list) {
37443815 lxri = lpfc_sli4_next_xritag(phba);
37453816 if (lxri == NO_XRI) {
3746− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3817+ lpfc_printf_log(phba, KERN_ERR,
3818+ LOG_TRACE_EVENT,
37473819 "2400 Failed to allocate xri for "
37483820 "ELS sgl\n");
37493821 rc = -ENOMEM;
@@ -3798,7 +3870,8 @@ lpfc_sli4_nvmet_sgl_update(struct lpfc_hba *phba) · 48 unmodified lines
37983870 sglq_entry = kzalloc(sizeof(struct lpfc_sglq),
37993871 GFP_KERNEL);
38003872 if (sglq_entry == NULL) {
3801− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3873+ lpfc_printf_log(phba, KERN_ERR,
3874+ LOG_TRACE_EVENT,
38023875 "6303 Failure to allocate an "
38033876 "NVMET sgl entry:%d\n", i);
38043877 rc = -ENOMEM;
@@ -3809,7 +3882,8 @@ lpfc_sli4_nvmet_sgl_update(struct lpfc_hba *phba) · 4 unmodified lines
38093882 &sglq_entry->phys);
38103883 if (sglq_entry->virt == NULL) {
38113884 kfree(sglq_entry);
3812− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3885+ lpfc_printf_log(phba, KERN_ERR,
3886+ LOG_TRACE_EVENT,
38133887 "6304 Failure to allocate an "
38143888 "NVMET buf:%d\n", i);
38153889 rc = -ENOMEM;
@@ -3865,7 +3939,8 @@ lpfc_sli4_nvmet_sgl_update(struct lpfc_hba *phba) · 49 unmodified lines
38653939 &phba->sli4_hba.lpfc_nvmet_sgl_list, list) {
38663940 lxri = lpfc_sli4_next_xritag(phba);
38673941 if (lxri == NO_XRI) {
3868− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3942+ lpfc_printf_log(phba, KERN_ERR,
3943+ LOG_TRACE_EVENT,
38693944 "6307 Failed to allocate xri for "
38703945 "NVMET sgl\n");
38713946 rc = -ENOMEM;
@@ -4039,7 +4114,8 @@ lpfc_sli4_io_sgl_update(struct lpfc_hba *phba) · 167 unmodified lines
40394114 &io_sgl_list, list) {
40404115 lxri = lpfc_sli4_next_xritag(phba);
40414116 if (lxri == NO_XRI) {
4042− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
4117+ lpfc_printf_log(phba, KERN_ERR,
4118+ LOG_TRACE_EVENT,
40434119 "6075 Failed to allocate xri for "
40444120 "nvme buffer\n");
40454121 rc = -ENOMEM;
@@ -4058,8 +4134,8 @@ out_free_mem: · 12 unmodified lines
40584134
40594135 /**
40604136 * lpfc_new_io_buf - IO buffer allocator for HBA with SLI4 IF spec
4061− * @vport: The virtual port for which this call being executed.
4062− * @num_to_allocate: The requested number of buffers to allocate.
4137+ * @phba: Pointer to lpfc hba data structure.
4138+ * @num_to_alloc: The requested number of buffers to allocate.
40634139 *
40644140 * This routine allocates nvme buffers for device with SLI-4 interface spec,
40654141 * the nvme buffer contains all the necessary information needed to initiate
@@ -4109,7 +4185,8 @@ lpfc_new_io_buf(struct lpfc_hba *phba, int num_to_alloc) · 43 unmodified lines
41094185 if ((phba->sli3_options & LPFC_SLI3_BG_ENABLED) &&
41104186 (((unsigned long)(lpfc_ncmd->data) &
41114187 (unsigned long)(SLI4_PAGE_SIZE - 1)) != 0)) {
4112− lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
4188+ lpfc_printf_log(phba, KERN_ERR,
4189+ LOG_TRACE_EVENT,
41134190 "3369 Memory alignment err: "
41144191 "addr=%lx\n",
41154192 (unsigned long)lpfc_ncmd->data);
@@ -4138,7 +4215,7 @@ lpfc_new_io_buf(struct lpfc_hba *phba, int num_to_alloc) · 22 unmodified lines
41384215 dma_pool_free(phba->lpfc_sg_dma_buf_pool,
41394216 lpfc_ncmd->data, lpfc_ncmd->dma_handle);
41404217 kfree(lpfc_ncmd);
4141− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
4218+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
41424219 "6121 Failed to allocate IOTAG for"
41434220 " XRI:0x%x\n", lxri);
41444221 lpfc_sli4_free_xri(phba, lxri);
@@ -4189,7 +4266,7 @@ lpfc_get_wwpn(struct lpfc_hba *phba) · 44 unmodified lines
41894266 lpfc_read_nv(phba, mboxq);
41904267 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
41914268 if (rc != MBX_SUCCESS) {
4192− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
4269+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
41934270 "6019 Mailbox failed , mbxCmd x%x "
41944271 "READ_NV, mbxStatus x%x\n",
41954272 bf_get(lpfc_mqe_command, &mboxq->u.mqe),
@@ -4249,7 +4326,8 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev) · 53 unmodified lines
42494326
42504327 for (i = 0; i < lpfc_no_hba_reset_cnt; i++) {
42514328 if (wwn == lpfc_no_hba_reset[i]) {
4252− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
4329+ lpfc_printf_log(phba, KERN_ERR,
4330+ LOG_TRACE_EVENT,
42534331 "6020 Setting use_no_reset port=%llx\n",
42544332 wwn);
42554333 use_no_reset_hba = true;
@@ -4646,7 +4724,7 @@ lpfc_fcf_redisc_wait_start_timer(struct lpfc_hba *phba) · 390 unmodified lines
46464724
46474725 /**
46484726 * lpfc_sli4_fcf_redisc_wait_tmo - FCF table rediscover wait timeout
4649− * @ptr: Map to lpfc_hba data structure pointer.
4727+ * @t: Timer context used to obtain the pointer to lpfc hba data structure.
46504728 *
46514729 * This routine is invoked when waiting for FCF table rediscover has been
46524730 * timed out. If new FCF record(s) has (have) been discovered during the
@@ -4694,7 +4772,7 @@ lpfc_sli4_parse_latt_fault(struct lpfc_hba *phba, · 41 unmodified lines
46944772 case LPFC_ASYNC_LINK_FAULT_LR_LRR:
46954773 break;
46964774 default:
4697− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
4775+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
46984776 "0398 Unknown link fault code: x%x\n",
46994777 bf_get(lpfc_acqe_link_fault, acqe_link));
47004778 break;
@@ -4730,7 +4808,7 @@ lpfc_sli4_parse_latt_type(struct lpfc_hba *phba, · 29 unmodified lines
47304808 att_type = LPFC_ATT_LINK_UP;
47314809 break;
47324810 default:
4733− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
4811+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
47344812 "0399 Invalid link attention type: x%x\n",
47354813 bf_get(lpfc_acqe_link_status, acqe_link));
47364814 att_type = LPFC_ATT_RESERVED;
@@ -4902,19 +4980,19 @@ lpfc_sli4_async_link_evt(struct lpfc_hba *phba, · 165 unmodified lines
49024980 phba->fcoe_eventtag = acqe_link->event_tag;
49034981 pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
49044982 if (!pmb) {
4905− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
4983+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
49064984 "0395 The mboxq allocation failed\n");
49074985 return;
49084986 }
49094987 mp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL);
49104988 if (!mp) {
4911− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
4989+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
49124990 "0396 The lpfc_dmabuf allocation failed\n");
49134991 goto out_free_pmb;
49144992 }
49154993 mp->virt = lpfc_mbuf_alloc(phba, 0, &mp->phys);
49164994 if (!mp->virt) {
4917− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
4995+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
49184996 "0397 The mbuf allocation failed\n");
49194997 goto out_free_dmabuf;
49204998 }
@@ -5013,7 +5091,6 @@ out_free_pmb: · 92 unmodified lines
50135091 * lpfc_async_link_speed_to_read_top - Parse async evt link speed code to read
50145092 * topology.
50155093 * @phba: pointer to lpfc hba data structure.
5016− * @evt_code: asynchronous event code.
50175094 * @speed_code: asynchronous event link speed code.
50185095 *
50195096 * This routine is to parse the giving SLI4 async event link speed code into
@@ -5115,7 +5192,7 @@ lpfc_update_trunk_link_status(struct lpfc_hba *phba, · 95 unmodified lines
51155192 phba->trunk_link.link3.fault = port_fault & 0x8 ? err : 0;
51165193 }
51175194
5118− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5195+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
51195196 "2910 Async FC Trunking Event - Speed:%d\n"
51205197 "\tLogical speed:%d "
51215198 "port0: %s port1: %s port2: %s port3: %s\n",
@@ -5125,7 +5202,7 @@ lpfc_update_trunk_link_status(struct lpfc_hba *phba, · 3 unmodified lines
51255202 trunk_link_status(2), trunk_link_status(3));
51265203
51275204 if (port_fault)
5128− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5205+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
51295206 "3202 trunk error:0x%x (%s) seen on port0:%s "
51305207 /*
51315208 * SLI-4: We have only 0xA error codes
@@ -5159,7 +5236,7 @@ lpfc_sli4_async_fc_evt(struct lpfc_hba *phba, struct lpfc_acqe_fc_la *acqe_fc) · 27 unmodified lines
51595236
51605237 if (bf_get(lpfc_trailer_type, acqe_fc) !=
51615238 LPFC_FC_LA_EVENT_TYPE_FC_LINK) {
5162− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5239+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
51635240 "2895 Non FC link Event detected.(%d)\n",
51645241 bf_get(lpfc_trailer_type, acqe_fc));
51655242 return;
@@ -5207,19 +5284,19 @@ lpfc_sli4_async_fc_evt(struct lpfc_hba *phba, struct lpfc_acqe_fc_la *acqe_fc) · 41 unmodified lines
52075284 phba->sli4_hba.link_state.fault);
52085285 pmb = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
52095286 if (!pmb) {
5210− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5287+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
52115288 "2897 The mboxq allocation failed\n");
52125289 return;
52135290 }
52145291 mp = kmalloc(sizeof(struct lpfc_dmabuf), GFP_KERNEL);
52155292 if (!mp) {
5216− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5293+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
52175294 "2898 The lpfc_dmabuf allocation failed\n");
52185295 goto out_free_pmb;
52195296 }
52205297 mp->virt = lpfc_mbuf_alloc(phba, 0, &mp->phys);
52215298 if (!mp->virt) {
5222− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5299+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
52235300 "2899 The mbuf allocation failed\n");
52245301 goto out_free_dmabuf;
52255302 }
@@ -5291,7 +5368,7 @@ out_free_pmb: · 65 unmodified lines
52915368 /**
52925369 * lpfc_sli4_async_sli_evt - Process the asynchronous SLI link event
52935370 * @phba: pointer to lpfc hba data structure.
5294− * @acqe_fc: pointer to the async SLI completion queue entry.
5371+ * @acqe_sli: pointer to the async SLI completion queue entry.
52955372 *
52965373 * This routine is to handle the SLI4 asynchronous SLI events.
52975374 **/
@@ -5386,7 +5463,7 @@ lpfc_sli4_async_sli_evt(struct lpfc_hba *phba, struct lpfc_acqe_sli *acqe_sli) · 88 unmodified lines
53865463 &misconfigured->theEvent);
53875464 break;
53885465 default:
5389− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5466+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
53905467 "3296 "
53915468 "LPFC_SLI_EVENT_TYPE_MISCONFIGURED "
53925469 "event: Invalid link %d",
@@ -5438,7 +5515,8 @@ lpfc_sli4_async_sli_evt(struct lpfc_hba *phba, struct lpfc_acqe_sli *acqe_sli) · 45 unmodified lines
54385515 rc = lpfc_sli4_read_config(phba);
54395516 if (rc) {
54405517 phba->lmt = 0;
5441− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5518+ lpfc_printf_log(phba, KERN_ERR,
5519+ LOG_TRACE_EVENT,
54425520 "3194 Unable to retrieve supported "
54435521 "speeds, rc = 0x%x\n", rc);
54445522 }
@@ -5546,7 +5624,7 @@ lpfc_sli4_perform_vport_cvl(struct lpfc_vport *vport) · 101 unmodified lines
55465624
55475625 /**
55485626 * lpfc_sli4_perform_all_vport_cvl - Perform clear virtual link on all vports
5549− * @vport: pointer to lpfc hba data structure.
5627+ * @phba: pointer to lpfc hba data structure.
55505628 *
55515629 * This routine is to perform Clear Virtual Link (CVL) on all vports in
55525630 * response to a FCF dead event.
@@ -5567,7 +5645,7 @@ lpfc_sli4_perform_all_vport_cvl(struct lpfc_hba *phba) · 14 unmodified lines
55675645 /**
55685646 * lpfc_sli4_async_fip_evt - Process the asynchronous FCoE FIP event
55695647 * @phba: pointer to lpfc hba data structure.
5570− * @acqe_link: pointer to the async fcoe completion queue entry.
5648+ * @acqe_fip: pointer to the async fcoe completion queue entry.
55715649 *
55725650 * This routine is to handle the SLI4 asynchronous fcoe event.
55735651 **/
@@ -5590,8 +5668,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, · 16 unmodified lines
55905668 case LPFC_FIP_EVENT_TYPE_NEW_FCF:
55915669 case LPFC_FIP_EVENT_TYPE_FCF_PARAM_MOD:
55925670 if (event_type == LPFC_FIP_EVENT_TYPE_NEW_FCF)
5593− lpfc_printf_log(phba, KERN_ERR, LOG_FIP |
5594− LOG_DISCOVERY,
5671+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
55955672 "2546 New FCF event, evt_tag:x%x, "
55965673 "index:x%x\n",
55975674 acqe_fip->event_tag,
@@ -5644,23 +5721,24 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, · 46 unmodified lines
56445721 rc = lpfc_sli4_fcf_scan_read_fcf_rec(phba,
56455722 LPFC_FCOE_FCF_GET_FIRST);
56465723 if (rc)
5647− lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY,
5724+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
56485725 "2547 Issue FCF scan read FCF mailbox "
56495726 "command failed (x%x)\n", rc);
56505727 break;
56515728
56525729 case LPFC_FIP_EVENT_TYPE_FCF_TABLE_FULL:
5653− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5654− "2548 FCF Table full count 0x%x tag 0x%x\n",
5655− bf_get(lpfc_acqe_fip_fcf_count, acqe_fip),
5656− acqe_fip->event_tag);
5730+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
5731+ "2548 FCF Table full count 0x%x tag 0x%x\n",
5732+ bf_get(lpfc_acqe_fip_fcf_count, acqe_fip),
5733+ acqe_fip->event_tag);
56575734 break;
56585735
56595736 case LPFC_FIP_EVENT_TYPE_FCF_DEAD:
56605737 phba->fcoe_cvl_eventtag = acqe_fip->event_tag;
5661− lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY,
5662− "2549 FCF (x%x) disconnected from network, "
5663− "tag:x%x\n", acqe_fip->index, acqe_fip->event_tag);
5738+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
5739+ "2549 FCF (x%x) disconnected from network, "
5740+ "tag:x%x\n", acqe_fip->index,
5741+ acqe_fip->event_tag);
56645742 /*
56655743 * If we are in the middle of FCF failover process, clear
56665744 * the corresponding FCF bit in the roundrobin bitmap.
@@ -5697,7 +5775,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, · 30 unmodified lines
56975775 rc = lpfc_sli4_redisc_fcf_table(phba);
56985776 if (rc) {
56995777 lpfc_printf_log(phba, KERN_ERR, LOG_FIP |
5700− LOG_DISCOVERY,
5778+ LOG_TRACE_EVENT,
57015779 "2772 Issue FCF rediscover mailbox "
57025780 "command failed, fail through to FCF "
57035781 "dead event\n");
@@ -5721,7 +5799,8 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, · 17 unmodified lines
57215799 break;
57225800 case LPFC_FIP_EVENT_TYPE_CVL:
57235801 phba->fcoe_cvl_eventtag = acqe_fip->event_tag;
5724− lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY,
5802+ lpfc_printf_log(phba, KERN_ERR,
5803+ LOG_TRACE_EVENT,
57255804 "2718 Clear Virtual Link Received for VPI 0x%x"
57265805 " tag 0x%x\n", acqe_fip->index, acqe_fip->event_tag);
57275806
@@ -5788,7 +5867,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, · 60 unmodified lines
57885867 rc = lpfc_sli4_redisc_fcf_table(phba);
57895868 if (rc) {
57905869 lpfc_printf_log(phba, KERN_ERR, LOG_FIP |
5791− LOG_DISCOVERY,
5870+ LOG_TRACE_EVENT,
57925871 "2774 Issue FCF rediscover "
57935872 "mailbox command failed, "
57945873 "through to CVL event\n");
@@ -5809,9 +5888,9 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, · 14 unmodified lines
58095888 }
58105889 break;
58115890 default:
5812− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5813− "0288 Unknown FCoE event type 0x%x event tag "
5814− "0x%x\n", event_type, acqe_fip->event_tag);
5891+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
5892+ "0288 Unknown FCoE event type 0x%x event tag "
5893+ "0x%x\n", event_type, acqe_fip->event_tag);
58155894 break;
58165895 }
58175896 }
@@ -5819,7 +5898,7 @@ lpfc_sli4_async_fip_evt(struct lpfc_hba *phba, · 1 unmodified line
58195898 /**
58205899 * lpfc_sli4_async_dcbx_evt - Process the asynchronous dcbx event
58215900 * @phba: pointer to lpfc hba data structure.
5822− * @acqe_link: pointer to the async dcbx completion queue entry.
5901+ * @acqe_dcbx: pointer to the async dcbx completion queue entry.
58235902 *
58245903 * This routine is to handle the SLI4 asynchronous dcbx event.
58255904 **/
@@ -5828,7 +5907,7 @@ lpfc_sli4_async_dcbx_evt(struct lpfc_hba *phba, · 2 unmodified lines
58285907 struct lpfc_acqe_dcbx *acqe_dcbx)
58295908 {
58305909 phba->fc_eventTag = acqe_dcbx->event_tag;
5831− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5910+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
58325911 "0290 The SLI4 DCBX asynchronous event is not "
58335912 "handled yet\n");
58345913 }
@@ -5836,7 +5915,7 @@ lpfc_sli4_async_dcbx_evt(struct lpfc_hba *phba, · 1 unmodified line
58365915 /**
58375916 * lpfc_sli4_async_grp5_evt - Process the asynchronous group5 event
58385917 * @phba: pointer to lpfc hba data structure.
5839− * @acqe_link: pointer to the async grp5 completion queue entry.
5918+ * @acqe_grp5: pointer to the async grp5 completion queue entry.
58405919 *
58415920 * This routine is to handle the SLI4 asynchronous grp5 event. A grp5 event
58425921 * is an asynchronous notified of a logical link speed change. The Port
@@ -5905,7 +5984,8 @@ void lpfc_sli4_async_event_proc(struct lpfc_hba *phba) · 62 unmodified lines
59055984 lpfc_sli4_async_sli_evt(phba, &cq_event->cqe.acqe_sli);
59065985 break;
59075986 default:
5908− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5987+ lpfc_printf_log(phba, KERN_ERR,
5988+ LOG_TRACE_EVENT,
59095989 "1804 Invalid asynchronous event code: "
59105990 "x%x\n", bf_get(lpfc_trailer_code,
59115991 &cq_event->cqe.mcqe_cmpl));
@@ -5941,7 +6021,7 @@ void lpfc_sli4_fcf_redisc_event_proc(struct lpfc_hba *phba) · 29 unmodified lines
59416021 "2777 Start post-quiescent FCF table scan\n");
59426022 rc = lpfc_sli4_fcf_scan_read_fcf_rec(phba, LPFC_FCOE_FCF_GET_FIRST);
59436023 if (rc)
5944− lpfc_printf_log(phba, KERN_ERR, LOG_FIP | LOG_DISCOVERY,
6024+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
59456025 "2747 Issue FCF scan read FCF mailbox "
59466026 "command failed 0x%x\n", rc);
59476027 }
@@ -6012,7 +6092,7 @@ static void lpfc_log_intr_mode(struct lpfc_hba *phba, uint32_t intr_mode) · 64 unmodified lines
60126092 "0480 Enabled MSI-X interrupt mode.\n");
60136093 break;
60146094 default:
6015− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6095+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
60166096 "0482 Illegal interrupt mode.\n");
60176097 break;
60186098 }
@@ -6060,7 +6140,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phba) · 41 unmodified lines
60606140 out_disable_device:
60616141 pci_disable_device(pdev);
60626142 out_error:
6063− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6143+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
60646144 "1401 Failed to enable pci device\n");
60656145 return -ENODEV;
60666146 }
@@ -6161,7 +6241,7 @@ lpfc_sli_probe_sriov_nr_virtfn(struct lpfc_hba *phba, int nr_vfn) · 94 unmodified lines
61616241
61626242 max_nr_vfn = lpfc_sli_sriov_nr_virtfn_get(phba);
61636243 if (nr_vfn > max_nr_vfn) {
6164− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6244+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
61656245 "3057 Requested vfs (%d) greater than "
61666246 "supported vfs (%d)", nr_vfn, max_nr_vfn);
61676247 return -EINVAL;
@@ -6200,6 +6280,9 @@ lpfc_setup_driver_resource_phase1(struct lpfc_hba *phba) · 32 unmodified lines
62006280 * Driver resources common to all SLI revisions
62016281 */
62026282 atomic_set(&phba->fast_event_count, 0);
6283+ atomic_set(&phba->dbg_log_idx, 0);
6284+ atomic_set(&phba->dbg_log_cnt, 0);
6285+ atomic_set(&phba->dbg_log_dmping, 0);
62036286 spin_lock_init(&phba->hbalock);
62046287
62056288 /* Initialize ndlp management spinlock */
@@ -6253,6 +6336,9 @@ lpfc_setup_driver_resource_phase1(struct lpfc_hba *phba) · 47 unmodified lines
62536336
62546337 INIT_DELAYED_WORK(&phba->eq_delay_work, lpfc_hb_eq_delay_work);
62556338
6339+ INIT_DELAYED_WORK(&phba->idle_stat_delay_work,
6340+ lpfc_idle_stat_delay_work);
6341+
62566342 return 0;
62576343 }
62586344
@@ -6624,7 +6710,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 365 unmodified lines
66246710 lpfc_read_nv(phba, mboxq);
66256711 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
66266712 if (rc != MBX_SUCCESS) {
6627− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
6713+ lpfc_printf_log(phba, KERN_ERR,
6714+ LOG_TRACE_EVENT,
66286715 "6016 Mailbox failed , mbxCmd x%x "
66296716 "READ_NV, mbxStatus x%x\n",
66306717 bf_get(lpfc_mqe_command, &mboxq->u.mqe),
@@ -6653,11 +6740,13 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 22 unmodified lines
66536740
66546741 phba->nvmet_support = 1; /* a match */
66556742
6656− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6743+ lpfc_printf_log(phba, KERN_ERR,
6744+ LOG_TRACE_EVENT,
66576745 "6017 NVME Target %016llx\n",
66586746 wwn);
66596747 #else
6660− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6748+ lpfc_printf_log(phba, KERN_ERR,
6749+ LOG_TRACE_EVENT,
66616750 "6021 Can't enable NVME Target."
66626751 " NVME_TARGET_FC infrastructure"
66636752 " is not in kernel\n");
@@ -6717,9 +6806,9 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 53 unmodified lines
67176806 &phba->sli4_hba.sli_intf);
67186807 if (phba->sli4_hba.extents_in_use &&
67196808 phba->sli4_hba.rpi_hdrs_in_use) {
6720− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6721− "2999 Unsupported SLI4 Parameters "
6722− "Extents and RPI headers enabled.\n");
6809+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
6810+ "2999 Unsupported SLI4 Parameters "
6811+ "Extents and RPI headers enabled.\n");
67236812 if (if_type == LPFC_SLI_INTF_IF_TYPE_0 &&
67246813 if_fam == LPFC_SLI_INTF_FAMILY_BE2) {
67256814 mempool_free(mboxq, phba->mbox_mem_pool);
@@ -6879,13 +6968,13 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 153 unmodified lines
68796968 /* Allocate and initialize active sgl array */
68806969 rc = lpfc_init_active_sgl_array(phba);
68816970 if (rc) {
6882− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6971+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
68836972 "1430 Failed to initialize sgl list.\n");
68846973 goto out_destroy_cq_event_pool;
68856974 }
68866975 rc = lpfc_sli4_init_rpi_hdrs(phba);
68876976 if (rc) {
6888− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6977+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
68896978 "1432 Failed to initialize rpi headers.\n");
68906979 goto out_free_active_sgl;
68916980 }
@@ -6895,7 +6984,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 3 unmodified lines
68956984 phba->fcf.fcf_rr_bmask = kcalloc(longs, sizeof(unsigned long),
68966985 GFP_KERNEL);
68976986 if (!phba->fcf.fcf_rr_bmask) {
6898− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6987+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
68996988 "2759 Failed allocate memory for FCF round "
69006989 "robin failover bmask\n");
69016990 rc = -ENOMEM;
@@ -6906,7 +6995,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 4 unmodified lines
69066995 sizeof(struct lpfc_hba_eq_hdl),
69076996 GFP_KERNEL);
69086997 if (!phba->sli4_hba.hba_eq_hdl) {
6909− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6998+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
69106999 "2572 Failed allocate memory for "
69117000 "fast-path per-EQ handle array\n");
69127001 rc = -ENOMEM;
@@ -6917,7 +7006,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 4 unmodified lines
69177006 sizeof(struct lpfc_vector_map_info),
69187007 GFP_KERNEL);
69197008 if (!phba->sli4_hba.cpu_map) {
6920− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7009+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
69217010 "3327 Failed allocate memory for msi-x "
69227011 "interrupt vector mapping\n");
69237012 rc = -ENOMEM;
@@ -6926,19 +7015,29 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 2 unmodified lines
69267015
69277016 phba->sli4_hba.eq_info = alloc_percpu(struct lpfc_eq_intr_info);
69287017 if (!phba->sli4_hba.eq_info) {
6929− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7018+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
69307019 "3321 Failed allocation for per_cpu stats\n");
69317020 rc = -ENOMEM;
69327021 goto out_free_hba_cpu_map;
69337022 }
69347023
7024+ phba->sli4_hba.idle_stat = kcalloc(phba->sli4_hba.num_possible_cpu,
7025+ sizeof(*phba->sli4_hba.idle_stat),
7026+ GFP_KERNEL);
7027+ if (!phba->sli4_hba.idle_stat) {
7028+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
7029+ "3390 Failed allocation for idle_stat\n");
7030+ rc = -ENOMEM;
7031+ goto out_free_hba_eq_info;
7032+ }
7033+
69357034 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
69367035 phba->sli4_hba.c_stat = alloc_percpu(struct lpfc_hdwq_stat);
69377036 if (!phba->sli4_hba.c_stat) {
6938− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7037+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
69397038 "3332 Failed allocating per cpu hdwq stats\n");
69407039 rc = -ENOMEM;
6941− goto out_free_hba_eq_info;
7040+ goto out_free_hba_idle_stat;
69427041 }
69437042 #endif
69447043
@@ -6962,9 +7061,11 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 17 unmodified lines
69627061 return 0;
69637062
69647063 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
7064+out_free_hba_idle_stat:
7065+ kfree(phba->sli4_hba.idle_stat);
7066+#endif
69657067 out_free_hba_eq_info:
69667068 free_percpu(phba->sli4_hba.eq_info);
6967−#endif
69687069 out_free_hba_cpu_map:
69697070 kfree(phba->sli4_hba.cpu_map);
69707071 out_free_hba_eq_hdl:
@@ -7006,6 +7107,7 @@ lpfc_sli4_driver_resource_unset(struct lpfc_hba *phba) · 35 unmodified lines
70067107 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
70077108 free_percpu(phba->sli4_hba.c_stat);
70087109 #endif
7110+ kfree(phba->sli4_hba.idle_stat);
70097111
70107112 /* Free memory allocated for msi-x interrupt vector to CPU mapping */
70117113 kfree(phba->sli4_hba.cpu_map);
@@ -7080,7 +7182,7 @@ lpfc_init_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp) · 68 unmodified lines
70807182 phba->lpfc_stop_port = lpfc_stop_port_s4;
70817183 break;
70827184 default:
7083− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7185+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
70847186 "1431 Invalid HBA PCI-device group: 0x%x\n",
70857187 dev_grp);
70867188 return -ENODEV;
@@ -7164,6 +7266,7 @@ lpfc_free_iocb_list(struct lpfc_hba *phba) · 77 unmodified lines
71647266 /**
71657267 * lpfc_init_iocb_list - Allocate and initialize iocb list.
71667268 * @phba: pointer to lpfc hba data structure.
7269+ * @iocb_count: number of requested iocbs
71677270 *
71687271 * This routine is invoked to allocate and initizlize the driver's IOCB
71697272 * list and set up the IOCB tag array accordingly.
@@ -7375,7 +7478,7 @@ lpfc_sli4_init_rpi_hdrs(struct lpfc_hba *phba) · 205 unmodified lines
73757478
73767479 rpi_hdr = lpfc_sli4_create_rpi_hdr(phba);
73777480 if (!rpi_hdr) {
7378− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7481+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
73797482 "0391 Error during rpi post operation\n");
73807483 lpfc_sli4_remove_rpis(phba);
73817484 rc = -ENODEV;
@@ -7687,7 +7790,7 @@ lpfc_setup_bg(struct lpfc_hba *phba, struct Scsi_Host *shost) · 305 unmodified lines
76877790 if (phba->cfg_prot_mask && phba->cfg_prot_guard) {
76887791 if ((old_mask != phba->cfg_prot_mask) ||
76897792 (old_guard != phba->cfg_prot_guard))
7690− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7793+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
76917794 "1475 Registering BlockGuard with the "
76927795 "SCSI layer: mask %d guard %d\n",
76937796 phba->cfg_prot_mask,
@@ -7696,7 +7799,7 @@ lpfc_setup_bg(struct lpfc_hba *phba, struct Scsi_Host *shost) · 2 unmodified lines
76967799 scsi_host_set_prot(shost, phba->cfg_prot_mask);
76977800 scsi_host_set_guard(shost, phba->cfg_prot_guard);
76987801 } else
7699− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7802+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
77007803 "1479 Not Registering BlockGuard with the SCSI "
77017804 "layer, Bad protection parameters: %d %d\n",
77027805 old_mask, old_guard);
@@ -7927,7 +8030,7 @@ lpfc_sli4_post_status_check(struct lpfc_hba *phba) · 224 unmodified lines
79278030 * other register reads as the data may not be valid. Just exit.
79288031 */
79298032 if (port_error) {
7930− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
8033+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
79318034 "1408 Port Failed POST - portsmphr=0x%x, "
79328035 "perr=x%x, sfi=x%x, nip=x%x, ipc=x%x, scr1=x%x, "
79338036 "scr2=x%x, hscratch=x%x, pstatus=x%x\n",
@@ -7976,7 +8079,8 @@ lpfc_sli4_post_status_check(struct lpfc_hba *phba) · 42 unmodified lines
79768079 readl(phba->sli4_hba.u.if_type0.UERRHIregaddr);
79778080 if ((~phba->sli4_hba.ue_mask_lo & uerrlo_reg.word0) ||
79788081 (~phba->sli4_hba.ue_mask_hi & uerrhi_reg.word0)) {
7979− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
8082+ lpfc_printf_log(phba, KERN_ERR,
8083+ LOG_TRACE_EVENT,
79808084 "1422 Unrecoverable Error "
79818085 "Detected during POST "
79828086 "uerr_lo_reg=0x%x, "
@@ -8003,7 +8107,7 @@ lpfc_sli4_post_status_check(struct lpfc_hba *phba) · 20 unmodified lines
80038107 phba->work_status[1] =
80048108 readl(phba->sli4_hba.u.if_type2.
80058109 ERR2regaddr);
8006− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
8110+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
80078111 "2888 Unrecoverable port error "
80088112 "following POST: port status reg "
80098113 "0x%x, port_smphr reg 0x%x, "
@@ -8116,6 +8220,7 @@ lpfc_sli4_bar0_register_memmap(struct lpfc_hba *phba, uint32_t if_type) · 106 unmodified lines
81168220 /**
81178221 * lpfc_sli4_bar1_register_memmap - Set up SLI4 BAR1 register memory map.
81188222 * @phba: pointer to lpfc hba data structure.
8223+ * @if_type: sli if type to operate on.
81198224 *
81208225 * This routine is invoked to set up SLI4 BAR1 register memory map.
81218226 **/
@@ -8297,20 +8402,19 @@ static const char * const lpfc_topo_to_str[] = { · 175 unmodified lines
82978402 "P2P then Loop",
82988403 };
82998404
8405+#define LINK_FLAGS_DEF 0x0
8406+#define LINK_FLAGS_P2P 0x1
8407+#define LINK_FLAGS_LOOP 0x2
83008408 /**
83018409 * lpfc_map_topology - Map the topology read from READ_CONFIG
83028410 * @phba: pointer to lpfc hba data structure.
8303− * @rdconf: pointer to read config data
8411+ * @rd_config: pointer to read config data
83048412 *
83058413 * This routine is invoked to map the topology values as read
83068414 * from the read config mailbox command. If the persistent
83078415 * topology feature is supported, the firmware will provide the
83088416 * saved topology information to be used in INIT_LINK
8309− *
83108417 **/
8311−#define LINK_FLAGS_DEF 0x0
8312−#define LINK_FLAGS_P2P 0x1
8313−#define LINK_FLAGS_LOOP 0x2
83148418 static void
83158419 lpfc_map_topology(struct lpfc_hba *phba, struct lpfc_mbx_read_config *rd_config)
83168420 {
@@ -8397,7 +8501,7 @@ lpfc_sli4_read_config(struct lpfc_hba *phba) · 80 unmodified lines
83978501
83988502 pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
83998503 if (!pmb) {
8400− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
8504+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
84018505 "2011 Unable to allocate memory for issuing "
84028506 "SLI_CONFIG_SPECIAL mailbox command\n");
84038507 return -ENOMEM;
@@ -8407,11 +8511,11 @@ lpfc_sli4_read_config(struct lpfc_hba *phba) · 3 unmodified lines
84078511
84088512 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
84098513 if (rc != MBX_SUCCESS) {
8410− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
8411− "2012 Mailbox failed , mbxCmd x%x "
8412− "READ_CONFIG, mbxStatus x%x\n",
8413− bf_get(lpfc_mqe_command, &pmb->u.mqe),
8414− bf_get(lpfc_mqe_status, &pmb->u.mqe));
8514+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
8515+ "2012 Mailbox failed , mbxCmd x%x "
8516+ "READ_CONFIG, mbxStatus x%x\n",
8517+ bf_get(lpfc_mqe_command, &pmb->u.mqe),
8518+ bf_get(lpfc_mqe_status, &pmb->u.mqe));
84158519 rc = -EIO;
84168520 } else {
84178521 rd_config = &pmb->u.mqe.un.rd_config;
@@ -8521,7 +8625,7 @@ lpfc_sli4_read_config(struct lpfc_hba *phba) · 103 unmodified lines
85218625 /* Check to see if there is enough for NVME */
85228626 if ((phba->cfg_irq_chann > qmin) ||
85238627 (phba->cfg_hdw_queue > qmin)) {
8524− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
8628+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
85258629 "2005 Reducing Queues: "
85268630 "WQ %d CQ %d EQ %d: min %d: "
85278631 "IRQ %d HDWQ %d\n",
@@ -8587,7 +8691,8 @@ lpfc_sli4_read_config(struct lpfc_hba *phba) · 59 unmodified lines
85878691 LPFC_USER_LINK_SPEED_AUTO;
85888692 break;
85898693 default:
8590− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
8694+ lpfc_printf_log(phba, KERN_ERR,
8695+ LOG_TRACE_EVENT,
85918696 "0047 Unrecognized link "
85928697 "speed : %d\n",
85938698 forced_link_speed);
@@ -8624,7 +8729,7 @@ lpfc_sli4_read_config(struct lpfc_hba *phba) · 30 unmodified lines
86248729 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
86258730 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
86268731 if (rc2 || shdr_status || shdr_add_status) {
8627− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
8732+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
86288733 "3026 Mailbox failed , mbxCmd x%x "
86298734 "GET_FUNCTION_CONFIG, mbxStatus x%x\n",
86308735 bf_get(lpfc_mqe_command, &pmb->u.mqe),
@@ -8661,7 +8766,7 @@ lpfc_sli4_read_config(struct lpfc_hba *phba) · 30 unmodified lines
86618766 "vf_number:%d\n", phba->sli4_hba.iov.pf_number,
86628767 phba->sli4_hba.iov.vf_number);
86638768 else
8664− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
8769+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
86658770 "3028 GET_FUNCTION_CONFIG: failed to find "
86668771 "Resource Descriptor:x%x\n",
86678772 LPFC_RSRC_DESC_TYPE_FCFCOE);
@@ -8698,7 +8803,7 @@ lpfc_setup_endian_order(struct lpfc_hba *phba) · 30 unmodified lines
86988803 mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
86998804 GFP_KERNEL);
87008805 if (!mboxq) {
8701− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
8806+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
87028807 "0492 Unable to allocate memory for "
87038808 "issuing SLI_CONFIG_SPECIAL mailbox "
87048809 "command\n");
@@ -8713,7 +8818,7 @@ lpfc_setup_endian_order(struct lpfc_hba *phba) · 8 unmodified lines
87138818 memcpy(&mboxq->u.mqe, &endian_mb_data, sizeof(endian_mb_data));
87148819 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
87158820 if (rc != MBX_SUCCESS) {
8716− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
8821+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
87178822 "0493 SLI_CONFIG_SPECIAL mailbox "
87188823 "failed with status x%x\n",
87198824 rc);
@@ -8793,8 +8898,9 @@ lpfc_alloc_io_wq_cq(struct lpfc_hba *phba, int idx) · 73 unmodified lines
87938898 phba->sli4_hba.cq_esize,
87948899 phba->sli4_hba.cq_ecount, cpu);
87958900 if (!qdesc) {
8796− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
8797− "0499 Failed allocate fast-path IO CQ (%d)\n", idx);
8901+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
8902+ "0499 Failed allocate fast-path IO CQ (%d)\n",
8903+ idx);
87988904 return 1;
87998905 }
88008906 qdesc->qe_valid = 1;
@@ -8816,7 +8922,7 @@ lpfc_alloc_io_wq_cq(struct lpfc_hba *phba, int idx) · 15 unmodified lines
88168922 phba->sli4_hba.wq_ecount, cpu);
88178923
88188924 if (!qdesc) {
8819− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
8925+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
88208926 "0503 Failed allocate fast-path IO WQ (%d)\n",
88218927 idx);
88228928 return 1;
@@ -8872,7 +8978,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 49 unmodified lines
88728978 phba->cfg_hdw_queue, sizeof(struct lpfc_sli4_hdw_queue),
88738979 GFP_KERNEL);
88748980 if (!phba->sli4_hba.hdwq) {
8875− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
8981+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
88768982 "6427 Failed allocate memory for "
88778983 "fast-path Hardware Queue array\n");
88788984 goto out_error;
@@ -8904,7 +9010,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 25 unmodified lines
89049010 sizeof(struct lpfc_queue *),
89059011 GFP_KERNEL);
89069012 if (!phba->sli4_hba.nvmet_cqset) {
8907− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9013+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
89089014 "3121 Fail allocate memory for "
89099015 "fast-path CQ set array\n");
89109016 goto out_error;
@@ -8914,7 +9020,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 3 unmodified lines
89149020 sizeof(struct lpfc_queue *),
89159021 GFP_KERNEL);
89169022 if (!phba->sli4_hba.nvmet_mrq_hdr) {
8917− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9023+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
89189024 "3122 Fail allocate memory for "
89199025 "fast-path RQ set hdr array\n");
89209026 goto out_error;
@@ -8924,7 +9030,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 3 unmodified lines
89249030 sizeof(struct lpfc_queue *),
89259031 GFP_KERNEL);
89269032 if (!phba->sli4_hba.nvmet_mrq_data) {
8927− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9033+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
89289034 "3124 Fail allocate memory for "
89299035 "fast-path RQ set data array\n");
89309036 goto out_error;
@@ -8952,7 +9058,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 21 unmodified lines
89529058 phba->sli4_hba.eq_esize,
89539059 phba->sli4_hba.eq_ecount, cpu);
89549060 if (!qdesc) {
8955− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9061+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
89569062 "0497 Failed allocate EQ (%d)\n",
89579063 cpup->hdwq);
89589064 goto out_error;
@@ -9006,7 +9112,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 47 unmodified lines
90069112 phba->sli4_hba.cq_ecount,
90079113 cpu);
90089114 if (!qdesc) {
9009− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9115+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
90109116 "3142 Failed allocate NVME "
90119117 "CQ Set (%d)\n", idx);
90129118 goto out_error;
@@ -9028,7 +9134,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 15 unmodified lines
90289134 phba->sli4_hba.cq_esize,
90299135 phba->sli4_hba.cq_ecount, cpu);
90309136 if (!qdesc) {
9031− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9137+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
90329138 "0500 Failed allocate slow-path mailbox CQ\n");
90339139 goto out_error;
90349140 }
@@ -9040,7 +9146,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 5 unmodified lines
90409146 phba->sli4_hba.cq_esize,
90419147 phba->sli4_hba.cq_ecount, cpu);
90429148 if (!qdesc) {
9043− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9149+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
90449150 "0501 Failed allocate slow-path ELS CQ\n");
90459151 goto out_error;
90469152 }
@@ -9059,7 +9165,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 12 unmodified lines
90599165 phba->sli4_hba.mq_esize,
90609166 phba->sli4_hba.mq_ecount, cpu);
90619167 if (!qdesc) {
9062− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9168+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
90639169 "0505 Failed allocate slow-path MQ\n");
90649170 goto out_error;
90659171 }
@@ -9075,7 +9181,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 9 unmodified lines
90759181 phba->sli4_hba.wq_esize,
90769182 phba->sli4_hba.wq_ecount, cpu);
90779183 if (!qdesc) {
9078− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9184+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
90799185 "0504 Failed allocate slow-path ELS WQ\n");
90809186 goto out_error;
90819187 }
@@ -9089,7 +9195,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 7 unmodified lines
90899195 phba->sli4_hba.cq_esize,
90909196 phba->sli4_hba.cq_ecount, cpu);
90919197 if (!qdesc) {
9092− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9198+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
90939199 "6079 Failed allocate NVME LS CQ\n");
90949200 goto out_error;
90959201 }
@@ -9102,7 +9208,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 6 unmodified lines
91029208 phba->sli4_hba.wq_esize,
91039209 phba->sli4_hba.wq_ecount, cpu);
91049210 if (!qdesc) {
9105− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9211+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
91069212 "6080 Failed allocate NVME LS WQ\n");
91079213 goto out_error;
91089214 }
@@ -9120,7 +9226,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 11 unmodified lines
91209226 phba->sli4_hba.rq_esize,
91219227 phba->sli4_hba.rq_ecount, cpu);
91229228 if (!qdesc) {
9123− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9229+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
91249230 "0506 Failed allocate receive HRQ\n");
91259231 goto out_error;
91269232 }
@@ -9131,7 +9237,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 4 unmodified lines
91319237 phba->sli4_hba.rq_esize,
91329238 phba->sli4_hba.rq_ecount, cpu);
91339239 if (!qdesc) {
9134− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9240+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
91359241 "0507 Failed allocate receive DRQ\n");
91369242 goto out_error;
91379243 }
@@ -9149,7 +9255,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 11 unmodified lines
91499255 LPFC_NVMET_RQE_DEF_COUNT,
91509256 cpu);
91519257 if (!qdesc) {
9152− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9258+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
91539259 "3146 Failed allocate "
91549260 "receive HRQ\n");
91559261 goto out_error;
@@ -9162,7 +9268,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 6 unmodified lines
91629268 GFP_KERNEL,
91639269 cpu_to_node(cpu));
91649270 if (qdesc->rqbp == NULL) {
9165− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9271+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
91669272 "6131 Failed allocate "
91679273 "Header RQBP\n");
91689274 goto out_error;
@@ -9178,7 +9284,7 @@ lpfc_sli4_queue_create(struct lpfc_hba *phba) · 9 unmodified lines
91789284 LPFC_NVMET_RQE_DEF_COUNT,
91799285 cpu);
91809286 if (!qdesc) {
9181− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9287+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
91829288 "3156 Failed allocate "
91839289 "receive DRQ\n");
91849290 goto out_error;
@@ -9369,7 +9475,7 @@ lpfc_create_wq_cq(struct lpfc_hba *phba, struct lpfc_queue *eq, · 184 unmodified lines
93699475 int rc;
93709476
93719477 if (!eq || !cq || !wq) {
9372− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9478+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
93739479 "6085 Fast-path %s (%d) not allocated\n",
93749480 ((eq) ? ((cq) ? "WQ" : "CQ") : "EQ"), qidx);
93759481 return -ENOMEM;
@@ -9379,9 +9485,9 @@ lpfc_create_wq_cq(struct lpfc_hba *phba, struct lpfc_queue *eq, · 3 unmodified lines
93799485 rc = lpfc_cq_create(phba, cq, eq,
93809486 (qtype == LPFC_MBOX) ? LPFC_MCQ : LPFC_WCQ, qtype);
93819487 if (rc) {
9382− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9383− "6086 Failed setup of CQ (%d), rc = 0x%x\n",
9384− qidx, (uint32_t)rc);
9488+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
9489+ "6086 Failed setup of CQ (%d), rc = 0x%x\n",
9490+ qidx, (uint32_t)rc);
93859491 return rc;
93869492 }
93879493
@@ -9397,7 +9503,7 @@ lpfc_create_wq_cq(struct lpfc_hba *phba, struct lpfc_queue *eq, · 9 unmodified lines
93979503 /* create the wq */
93989504 rc = lpfc_wq_create(phba, wq, cq, qtype);
93999505 if (rc) {
9400− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9506+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
94019507 "4618 Fail setup fastpath WQ (%d), rc = 0x%x\n",
94029508 qidx, (uint32_t)rc);
94039509 /* no need to tear down cq - caller will do so */
@@ -9415,9 +9521,9 @@ lpfc_create_wq_cq(struct lpfc_hba *phba, struct lpfc_queue *eq, · 11 unmodified lines
94159521 } else {
94169522 rc = lpfc_mq_create(phba, wq, cq, LPFC_MBOX);
94179523 if (rc) {
9418− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9419− "0539 Failed setup of slow-path MQ: "
9420− "rc = 0x%x\n", rc);
9524+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
9525+ "0539 Failed setup of slow-path MQ: "
9526+ "rc = 0x%x\n", rc);
94219527 /* no need to tear down cq - caller will do so */
94229528 return rc;
94239529 }
@@ -9490,7 +9596,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 66 unmodified lines
94909596 /* Check for dual-ULP support */
94919597 mboxq = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
94929598 if (!mboxq) {
9493− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9599+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
94949600 "3249 Unable to allocate memory for "
94959601 "QUERY_FW_CFG mailbox command\n");
94969602 return -ENOMEM;
@@ -9508,7 +9614,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 11 unmodified lines
95089614 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
95099615 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
95109616 if (shdr_status || shdr_add_status || rc) {
9511− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9617+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
95129618 "3250 QUERY_FW_CFG mailbox failed with status "
95139619 "x%x add_status x%x, mbx status x%x\n",
95149620 shdr_status, shdr_add_status, rc);
@@ -9539,7 +9645,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 24 unmodified lines
95399645
95409646 /* Set up HBA event queue */
95419647 if (!qp) {
9542− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9648+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
95439649 "3147 Fast-path EQs not allocated\n");
95449650 rc = -ENOMEM;
95459651 goto out_error;
@@ -9563,7 +9669,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 17 unmodified lines
95639669 rc = lpfc_eq_create(phba, qp[cpup->hdwq].hba_eq,
95649670 phba->cfg_fcp_imax);
95659671 if (rc) {
9566− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9672+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
95679673 "0523 Failed setup of fast-path"
95689674 " EQ (%d), rc = 0x%x\n",
95699675 cpup->eq, (uint32_t)rc);
@@ -9595,7 +9701,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 25 unmodified lines
95959701 qidx,
95969702 LPFC_IO);
95979703 if (rc) {
9598− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9704+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
95999705 "0535 Failed to setup fastpath "
96009706 "IO WQ/CQ (%d), rc = 0x%x\n",
96019707 qidx, (uint32_t)rc);
@@ -9610,7 +9716,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 8 unmodified lines
96109716 /* Set up slow-path MBOX CQ/MQ */
96119717
96129718 if (!phba->sli4_hba.mbx_cq || !phba->sli4_hba.mbx_wq) {
9613− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9719+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
96149720 "0528 %s not allocated\n",
96159721 phba->sli4_hba.mbx_cq ?
96169722 "Mailbox WQ" : "Mailbox CQ");
@@ -9623,14 +9729,14 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 6 unmodified lines
96239729 phba->sli4_hba.mbx_wq,
96249730 NULL, 0, LPFC_MBOX);
96259731 if (rc) {
9626− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9732+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
96279733 "0529 Failed setup of mailbox WQ/CQ: rc = 0x%x\n",
96289734 (uint32_t)rc);
96299735 goto out_destroy;
96309736 }
96319737 if (phba->nvmet_support) {
96329738 if (!phba->sli4_hba.nvmet_cqset) {
9633− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9739+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
96349740 "3165 Fast-path NVME CQ Set "
96359741 "array not allocated\n");
96369742 rc = -ENOMEM;
@@ -9642,7 +9748,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 5 unmodified lines
96429748 qp,
96439749 LPFC_WCQ, LPFC_NVMET);
96449750 if (rc) {
9645− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9751+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
96469752 "3164 Failed setup of NVME CQ "
96479753 "Set, rc = 0x%x\n",
96489754 (uint32_t)rc);
@@ -9654,7 +9760,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 5 unmodified lines
96549760 qp[0].hba_eq,
96559761 LPFC_WCQ, LPFC_NVMET);
96569762 if (rc) {
9657− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9763+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
96589764 "6089 Failed setup NVMET CQ: "
96599765 "rc = 0x%x\n", (uint32_t)rc);
96609766 goto out_destroy;
@@ -9671,7 +9777,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 10 unmodified lines
96719777
96729778 /* Set up slow-path ELS WQ/CQ */
96739779 if (!phba->sli4_hba.els_cq || !phba->sli4_hba.els_wq) {
9674− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9780+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
96759781 "0530 ELS %s not allocated\n",
96769782 phba->sli4_hba.els_cq ? "WQ" : "CQ");
96779783 rc = -ENOMEM;
@@ -9682,7 +9788,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 4 unmodified lines
96829788 phba->sli4_hba.els_wq,
96839789 NULL, 0, LPFC_ELS);
96849790 if (rc) {
9685− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9791+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
96869792 "0525 Failed setup of ELS WQ/CQ: rc = 0x%x\n",
96879793 (uint32_t)rc);
96889794 goto out_destroy;
@@ -9695,7 +9801,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 6 unmodified lines
96959801 if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) {
96969802 /* Set up NVME LS Complete Queue */
96979803 if (!phba->sli4_hba.nvmels_cq || !phba->sli4_hba.nvmels_wq) {
9698− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9804+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
96999805 "6091 LS %s not allocated\n",
97009806 phba->sli4_hba.nvmels_cq ? "WQ" : "CQ");
97019807 rc = -ENOMEM;
@@ -9706,7 +9812,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 4 unmodified lines
97069812 phba->sli4_hba.nvmels_wq,
97079813 NULL, 0, LPFC_NVME_LS);
97089814 if (rc) {
9709− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9815+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
97109816 "0526 Failed setup of NVVME LS WQ/CQ: "
97119817 "rc = 0x%x\n", (uint32_t)rc);
97129818 goto out_destroy;
@@ -9726,7 +9832,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 13 unmodified lines
97269832 if ((!phba->sli4_hba.nvmet_cqset) ||
97279833 (!phba->sli4_hba.nvmet_mrq_hdr) ||
97289834 (!phba->sli4_hba.nvmet_mrq_data)) {
9729− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9835+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
97309836 "6130 MRQ CQ Queues not "
97319837 "allocated\n");
97329838 rc = -ENOMEM;
@@ -9739,7 +9845,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 6 unmodified lines
97399845 phba->sli4_hba.nvmet_cqset,
97409846 LPFC_NVMET);
97419847 if (rc) {
9742− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9848+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
97439849 "6098 Failed setup of NVMET "
97449850 "MRQ: rc = 0x%x\n",
97459851 (uint32_t)rc);
@@ -9753,7 +9859,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 7 unmodified lines
97539859 phba->sli4_hba.nvmet_cqset[0],
97549860 LPFC_NVMET);
97559861 if (rc) {
9756− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9862+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
97579863 "6057 Failed setup of NVMET "
97589864 "Receive Queue: rc = 0x%x\n",
97599865 (uint32_t)rc);
@@ -9772,7 +9878,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 12 unmodified lines
97729878 }
97739879
97749880 if (!phba->sli4_hba.hdr_rq || !phba->sli4_hba.dat_rq) {
9775− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9881+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
97769882 "0540 Receive Queue not allocated\n");
97779883 rc = -ENOMEM;
97789884 goto out_destroy;
@@ -9781,7 +9887,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 2 unmodified lines
97819887 rc = lpfc_rq_create(phba, phba->sli4_hba.hdr_rq, phba->sli4_hba.dat_rq,
97829888 phba->sli4_hba.els_cq, LPFC_USOL);
97839889 if (rc) {
9784− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9890+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
97859891 "0541 Failed setup of Receive Queue: "
97869892 "rc = 0x%x\n", (uint32_t)rc);
97879893 goto out_destroy;
@@ -9809,7 +9915,7 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 21 unmodified lines
98099915 phba->sli4_hba.cq_lookup = kcalloc((phba->sli4_hba.cq_max + 1),
98109916 sizeof(struct lpfc_queue *), GFP_KERNEL);
98119917 if (!phba->sli4_hba.cq_lookup) {
9812− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9918+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
98139919 "0549 Failed setup of CQ Lookup table: "
98149920 "size 0x%x\n", phba->sli4_hba.cq_max);
98159921 rc = -ENOMEM;
@@ -10109,7 +10215,7 @@ lpfc_pci_function_reset(struct lpfc_hba *phba) · 293 unmodified lines
1010910215 mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
1011010216 GFP_KERNEL);
1011110217 if (!mboxq) {
10112− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
10218+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1011310219 "0494 Unable to allocate memory for "
1011410220 "issuing SLI_FUNCTION_RESET mailbox "
1011510221 "command\n");
@@ -10129,7 +10235,7 @@ lpfc_pci_function_reset(struct lpfc_hba *phba) · 13 unmodified lines
1012910235 if (rc != MBX_TIMEOUT)
1013010236 mempool_free(mboxq, phba->mbox_mem_pool);
1013110237 if (shdr_status || shdr_add_status || rc) {
10132− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
10238+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1013310239 "0495 SLI_FUNCTION_RESET mailbox "
1013410240 "failed with status x%x add_status x%x,"
1013510241 " mbx status x%x\n",
@@ -10161,7 +10267,7 @@ wait: · 25 unmodified lines
1016110267 phba->sli4_hba.u.if_type2.ERR1regaddr);
1016210268 phba->work_status[1] = readl(
1016310269 phba->sli4_hba.u.if_type2.ERR2regaddr);
10164− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
10270+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1016510271 "2890 Port not ready, port status reg "
1016610272 "0x%x error 1=0x%x, error 2=0x%x\n",
1016710273 reg_data.word0,
@@ -10203,7 +10309,7 @@ wait: · 35 unmodified lines
1020310309 out:
1020410310 /* Catch the not-ready port failure after a port reset. */
1020510311 if (rc) {
10206− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
10312+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1020710313 "3317 HBA not functional: IP Reset Failed "
1020810314 "try: echo fw_reset > board_mode\n");
1020910315 rc = -ENODEV;
@@ -10253,7 +10359,7 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba) · 43 unmodified lines
1025310359 /* There is no SLI3 failback for SLI4 devices. */
1025410360 if (bf_get(lpfc_sli_intf_valid, &phba->sli4_hba.sli_intf) !=
1025510361 LPFC_SLI_INTF_VALID) {
10256− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
10362+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1025710363 "2894 SLI_INTF reg contents invalid "
1025810364 "sli_intf reg 0x%x\n",
1025910365 phba->sli4_hba.sli_intf.word0);
@@ -10528,7 +10634,7 @@ lpfc_sli_enable_msix(struct lpfc_hba *phba) · 268 unmodified lines
1052810634
1052910635 if (!pmb) {
1053010636 rc = -ENOMEM;
10531− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
10637+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1053210638 "0474 Unable to allocate memory for issuing "
1053310639 "MBOX_CONFIG_MSI command\n");
1053410640 goto mem_fail_out;
@@ -10611,6 +10717,7 @@ lpfc_sli_enable_msi(struct lpfc_hba *phba) · 76 unmodified lines
1061110717 /**
1061210718 * lpfc_sli_enable_intr - Enable device interrupt to SLI-3 device.
1061310719 * @phba: pointer to lpfc hba data structure.
10720+ * @cfg_mode: Interrupt configuration mode (INTx, MSI or MSI-X).
1061410721 *
1061510722 * This routine is invoked to enable device interrupt and associate driver's
1061610723 * interrupt handler(s) to interrupt vector(s) to device with SLI-3 interface
@@ -11008,7 +11115,7 @@ found_any: · 391 unmodified lines
1100811115 /* 1 to 1, the first LPFC_CPU_FIRST_IRQ cpus to a unique hdwq */
1100911116 cpup->hdwq = idx;
1101011117 idx++;
11011− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
11118+ lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
1101211119 "3333 Set Affinity: CPU %d (phys %d core %d): "
1101311120 "hdwq %d eq %d flg x%x\n",
1101411121 cpu, cpup->phys_id, cpup->core_id,
@@ -11086,7 +11193,7 @@ found_any: · 71 unmodified lines
1108611193 start_cpu = first_cpu;
1108711194 cpup->hdwq = new_cpup->hdwq;
1108811195 logit:
11089− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
11196+ lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
1109011197 "3335 Set Affinity: CPU %d (phys %d core %d): "
1109111198 "hdwq %d eq %d flg x%x\n",
1109211199 cpu, cpup->phys_id, cpup->core_id,
@@ -11128,7 +11235,7 @@ found_any: · 35 unmodified lines
1112811235 *
1112911236 * @phba: pointer to lpfc hba data structure.
1113011237 * @cpu: cpu going offline
11131− * @eqlist:
11238+ * @eqlist: eq list to append to
1113211239 */
1113311240 static int
1113411241 lpfc_cpuhp_get_eq(struct lpfc_hba *phba, unsigned int cpu,
@@ -11417,9 +11524,9 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba) · 282 unmodified lines
1141711524 char *name;
1141811525 const struct cpumask *aff_mask = NULL;
1141911526 unsigned int cpu = 0, cpu_cnt = 0, cpu_select = nr_cpu_ids;
11527+ struct lpfc_vector_map_info *cpup;
1142011528 struct lpfc_hba_eq_hdl *eqhdl;
1142111529 const struct cpumask *maskp;
11422− bool first;
1142311530 unsigned int flags = PCI_IRQ_MSIX;
1142411531
1142511532 /* Set up MSI-X multi-message vectors */
@@ -11492,24 +11599,34 @@ lpfc_sli4_enable_msix(struct lpfc_hba *phba) · 66 unmodified lines
1149211599 } else {
1149311600 maskp = pci_irq_get_affinity(phba->pcidev, index);
1149411601
11495− first = true;
1149611602 /* Loop through all CPUs associated with vector index */
1149711603 for_each_cpu_and(cpu, maskp, cpu_present_mask) {
11604+ cpup = &phba->sli4_hba.cpu_map[cpu];
11605+
1149811606 /* If this is the first CPU thats assigned to
1149911607 * this vector, set LPFC_CPU_FIRST_IRQ.
11608+ *
11609+ * With certain platforms its possible that irq
11610+ * vectors are affinitized to all the cpu's.
11611+ * This can result in each cpu_map.eq to be set
11612+ * to the last vector, resulting in overwrite
11613+ * of all the previous cpu_map.eq. Ensure that
11614+ * each vector receives a place in cpu_map.
11615+ * Later call to lpfc_cpu_affinity_check will
11616+ * ensure we are nicely balanced out.
1150011617 */
11618+ if (cpup->eq != LPFC_VECTOR_MAP_EMPTY)
11619+ continue;
1150111620 lpfc_assign_eq_map_info(phba, index,
11502− first ?
11503− LPFC_CPU_FIRST_IRQ : 0,
11621+ LPFC_CPU_FIRST_IRQ,
1150411622 cpu);
11505− if (first)
11506− first = false;
11623+ break;
1150711624 }
1150811625 }
1150911626 }
1151011627
1151111628 if (vectors != phba->cfg_irq_chann) {
11512− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
11629+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1151311630 "3238 Reducing IO channels to match number of "
1151411631 "MSI-X vectors, requested %d got %d\n",
1151511632 phba->cfg_irq_chann, vectors);
@@ -11593,6 +11710,7 @@ lpfc_sli4_enable_msi(struct lpfc_hba *phba) · 77 unmodified lines
1159311710 /**
1159411711 * lpfc_sli4_enable_intr - Enable device interrupt to SLI-4 device
1159511712 * @phba: pointer to lpfc hba data structure.
11713+ * @cfg_mode: Interrupt configuration mode (INTx, MSI or MSI-X).
1159611714 *
1159711715 * This routine is invoked to enable device interrupt and associate driver's
1159811716 * interrupt handler(s) to interrupt vector(s) to device with SLI-4
@@ -11782,17 +11900,17 @@ lpfc_sli4_xri_exchange_busy_wait(struct lpfc_hba *phba) · 183 unmodified lines
1178211900 while (!els_xri_cmpl || !io_xri_cmpl || !nvmet_xri_cmpl) {
1178311901 if (wait_time > LPFC_XRI_EXCH_BUSY_WAIT_TMO) {
1178411902 if (!nvmet_xri_cmpl)
11785− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
11903+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1178611904 "6424 NVMET XRI exchange busy "
1178711905 "wait time: %d seconds.\n",
1178811906 wait_time/1000);
1178911907 if (!io_xri_cmpl)
11790− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
11908+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1179111909 "6100 IO XRI exchange busy "
1179211910 "wait time: %d seconds.\n",
1179311911 wait_time/1000);
1179411912 if (!els_xri_cmpl)
11795− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
11913+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1179611914 "2878 ELS XRI exchange busy "
1179711915 "wait time: %d seconds.\n",
1179811916 wait_time/1000);
@@ -12287,14 +12405,14 @@ lpfc_pci_probe_one_s3(struct pci_dev *pdev, const struct pci_device_id *pid) · 488 unmodified lines
1228712405 /* Configure and enable interrupt */
1228812406 intr_mode = lpfc_sli_enable_intr(phba, cfg_mode);
1228912407 if (intr_mode == LPFC_INTR_ERROR) {
12290− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12408+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1229112409 "0431 Failed to enable interrupt.\n");
1229212410 error = -ENODEV;
1229312411 goto out_free_sysfs_attr;
1229412412 }
1229512413 /* SLI-3 HBA setup */
1229612414 if (lpfc_sli_hba_setup(phba)) {
12297− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12415+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1229812416 "1477 Failed to set up hba\n");
1229912417 error = -ENODEV;
1230012418 goto out_remove_device;
@@ -12552,7 +12670,7 @@ lpfc_pci_resume_one_s3(struct pci_dev *pdev) · 251 unmodified lines
1255212670 /* Configure and enable interrupt */
1255312671 intr_mode = lpfc_sli_enable_intr(phba, phba->intr_mode);
1255412672 if (intr_mode == LPFC_INTR_ERROR) {
12555− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12673+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1255612674 "0430 PM resume Failed to enable interrupt\n");
1255712675 return -EIO;
1255812676 } else
@@ -12578,7 +12696,7 @@ lpfc_pci_resume_one_s3(struct pci_dev *pdev) · 19 unmodified lines
1257812696 static void
1257912697 lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba)
1258012698 {
12581− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12699+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1258212700 "2723 PCI channel I/O abort preparing for recovery\n");
1258312701
1258412702 /*
@@ -12599,7 +12717,7 @@ lpfc_sli_prep_dev_for_recover(struct lpfc_hba *phba) · 14 unmodified lines
1259912717 static void
1260012718 lpfc_sli_prep_dev_for_reset(struct lpfc_hba *phba)
1260112719 {
12602− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12720+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1260312721 "2710 PCI channel disable preparing for reset\n");
1260412722
1260512723 /* Block any management I/Os to the device */
@@ -12630,7 +12748,7 @@ lpfc_sli_prep_dev_for_reset(struct lpfc_hba *phba) · 24 unmodified lines
1263012748 static void
1263112749 lpfc_sli_prep_dev_for_perm_failure(struct lpfc_hba *phba)
1263212750 {
12633− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12751+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1263412752 "2711 PCI channel permanent disable for failure\n");
1263512753 /* Block all SCSI devices' I/Os on the host */
1263612754 lpfc_scsi_dev_block(phba);
@@ -12681,7 +12799,7 @@ lpfc_io_error_detected_s3(struct pci_dev *pdev, pci_channel_state_t state) · 44 unmodified lines
1268112799 return PCI_ERS_RESULT_DISCONNECT;
1268212800 default:
1268312801 /* Unknown state, prepare and request slot reset */
12684− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12802+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1268512803 "0472 Unknown PCI error state: x%x\n", state);
1268612804 lpfc_sli_prep_dev_for_reset(phba);
1268712805 return PCI_ERS_RESULT_NEED_RESET;
@@ -12739,7 +12857,7 @@ lpfc_io_slot_reset_s3(struct pci_dev *pdev) · 51 unmodified lines
1273912857 /* Configure and enable interrupt */
1274012858 intr_mode = lpfc_sli_enable_intr(phba, phba->intr_mode);
1274112859 if (intr_mode == LPFC_INTR_ERROR) {
12742− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12860+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1274312861 "0427 Cannot re-enable interrupt after "
1274412862 "slot reset.\n");
1274512863 return PCI_ERS_RESULT_DISCONNECT;
@@ -12842,7 +12960,7 @@ lpfc_log_write_firmware_error(struct lpfc_hba *phba, uint32_t offset, · 96 unmodified lines
1284212960 magic_number != MAGIC_NUMBER_G6) ||
1284312961 (phba->pcidev->device == PCI_DEVICE_ID_LANCER_G7_FC &&
1284412962 magic_number != MAGIC_NUMBER_G7)) {
12845− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12963+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1284612964 "3030 This firmware version is not supported on"
1284712965 " this HBA model. Device:%x Magic:%x Type:%x "
1284812966 "ID:%x Size %d %zd\n",
@@ -12850,7 +12968,7 @@ lpfc_log_write_firmware_error(struct lpfc_hba *phba, uint32_t offset, · 1 unmodified line
1285012968 fsize, fw->size);
1285112969 rc = -EINVAL;
1285212970 } else if (offset == ADD_STATUS_FW_DOWNLOAD_HW_DISABLED) {
12853− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12971+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1285412972 "3021 Firmware downloads have been prohibited "
1285512973 "by a system configuration setting on "
1285612974 "Device:%x Magic:%x Type:%x ID:%x Size %d "
@@ -12859,7 +12977,7 @@ lpfc_log_write_firmware_error(struct lpfc_hba *phba, uint32_t offset, · 2 unmodified lines
1285912977 fsize, fw->size);
1286012978 rc = -EACCES;
1286112979 } else {
12862− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12980+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1286312981 "3022 FW Download failed. Add Status x%x "
1286412982 "Device:%x Magic:%x Type:%x ID:%x Size %d "
1286512983 "%zd\n",
@@ -12874,7 +12992,6 @@ lpfc_log_write_firmware_error(struct lpfc_hba *phba, uint32_t offset, · 8 unmodified lines
1287412992 * lpfc_write_firmware - attempt to write a firmware image to the port
1287512993 * @fw: pointer to firmware image returned from request_firmware.
1287612994 * @context: pointer to firmware image returned from request_firmware.
12877− * @ret: return value this routine provides to the caller.
1287812995 *
1287912996 **/
1288012997 static void
@@ -12904,7 +13021,7 @@ lpfc_write_firmware(const struct firmware *fw, void *context) · 23 unmodified lines
1290413021 INIT_LIST_HEAD(&dma_buffer_list);
1290513022 lpfc_decode_firmware_rev(phba, fwrev, 1);
1290613023 if (strncmp(fwrev, image->revision, strnlen(image->revision, 16))) {
12907− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13024+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1290813025 "3023 Updating Firmware, Current Version:%s "
1290913026 "New Version:%s\n",
1291013027 fwrev, image->revision);
@@ -12954,7 +13071,7 @@ lpfc_write_firmware(const struct firmware *fw, void *context) · 43 unmodified lines
1295413071 }
1295513072 rc = offset;
1295613073 } else
12957− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13074+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1295813075 "3029 Skipped Firmware update, Current "
1295913076 "Version:%s New Version:%s\n",
1296013077 fwrev, image->revision);
@@ -12969,16 +13086,17 @@ release_out: · 8 unmodified lines
1296913086 release_firmware(fw);
1297013087 out:
1297113088 if (rc < 0)
12972− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13089+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1297313090 "3062 Firmware update error, status %d.\n", rc);
1297413091 else
12975− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13092+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1297613093 "3024 Firmware update success: size %d.\n", rc);
1297713094 }
1297813095
1297913096 /**
1298013097 * lpfc_sli4_request_firmware_update - Request linux generic firmware upgrade
1298113098 * @phba: pointer to lpfc hba data structure.
13099+ * @fw_upgrade: which firmware to update.
1298213100 *
1298313101 * This routine is called to perform Linux generic firmware upgrade on device
1298413102 * that supports such feature.
@@ -13101,7 +13219,7 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid) · 116 unmodified lines
1310113219 /* Configure and enable interrupt */
1310213220 intr_mode = lpfc_sli4_enable_intr(phba, cfg_mode);
1310313221 if (intr_mode == LPFC_INTR_ERROR) {
13104− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13222+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1310513223 "0426 Failed to enable interrupt.\n");
1310613224 error = -ENODEV;
1310713225 goto out_unset_driver_resource;
@@ -13136,7 +13254,7 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid) · 28 unmodified lines
1313613254
1313713255 /* Set up SLI-4 HBA */
1313813256 if (lpfc_sli4_hba_setup(phba)) {
13139− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13257+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1314013258 "1421 Failed to set up hba\n");
1314113259 error = -ENODEV;
1314213260 goto out_free_sysfs_attr;
@@ -13161,7 +13279,7 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid) · 18 unmodified lines
1316113279 */
1316213280 error = lpfc_nvme_create_localport(vport);
1316313281 if (error) {
13164− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13282+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1316513283 "6004 NVME registration "
1316613284 "failed, error x%x\n",
1316713285 error);
@@ -13395,7 +13513,7 @@ lpfc_pci_resume_one_s4(struct pci_dev *pdev) · 227 unmodified lines
1339513513 /* Configure and enable interrupt */
1339613514 intr_mode = lpfc_sli4_enable_intr(phba, phba->intr_mode);
1339713515 if (intr_mode == LPFC_INTR_ERROR) {
13398− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13516+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1339913517 "0294 PM resume Failed to enable interrupt\n");
1340013518 return -EIO;
1340113519 } else
@@ -13421,7 +13539,7 @@ lpfc_pci_resume_one_s4(struct pci_dev *pdev) · 19 unmodified lines
1342113539 static void
1342213540 lpfc_sli4_prep_dev_for_recover(struct lpfc_hba *phba)
1342313541 {
13424− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13542+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1342513543 "2828 PCI channel I/O abort preparing for recovery\n");
1342613544 /*
1342713545 * There may be errored I/Os through HBA, abort all I/Os on txcmplq
@@ -13441,7 +13559,7 @@ lpfc_sli4_prep_dev_for_recover(struct lpfc_hba *phba) · 13 unmodified lines
1344113559 static void
1344213560 lpfc_sli4_prep_dev_for_reset(struct lpfc_hba *phba)
1344313561 {
13444− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13562+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1344513563 "2826 PCI channel disable preparing for reset\n");
1344613564
1344713565 /* Block any management I/Os to the device */
@@ -13473,7 +13591,7 @@ lpfc_sli4_prep_dev_for_reset(struct lpfc_hba *phba) · 25 unmodified lines
1347313591 static void
1347413592 lpfc_sli4_prep_dev_for_perm_failure(struct lpfc_hba *phba)
1347513593 {
13476− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13594+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1347713595 "2827 PCI channel permanent disable for failure\n");
1347813596
1347913597 /* Block all SCSI devices' I/Os on the host */
@@ -13523,7 +13641,7 @@ lpfc_io_error_detected_s4(struct pci_dev *pdev, pci_channel_state_t state) · 43 unmodified lines
1352313641 return PCI_ERS_RESULT_DISCONNECT;
1352413642 default:
1352513643 /* Unknown state, prepare and request slot reset */
13526− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13644+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1352713645 "2825 Unknown PCI error state: x%x\n", state);
1352813646 lpfc_sli4_prep_dev_for_reset(phba);
1352913647 return PCI_ERS_RESULT_NEED_RESET;
@@ -13581,7 +13699,7 @@ lpfc_io_slot_reset_s4(struct pci_dev *pdev) · 51 unmodified lines
1358113699 /* Configure and enable interrupt */
1358213700 intr_mode = lpfc_sli4_enable_intr(phba, phba->intr_mode);
1358313701 if (intr_mode == LPFC_INTR_ERROR) {
13584− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13702+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1358513703 "2824 Cannot re-enable interrupt after "
1358613704 "slot reset.\n");
1358713705 return PCI_ERS_RESULT_DISCONNECT;
@@ -13686,7 +13804,7 @@ lpfc_pci_remove_one(struct pci_dev *pdev) · 98 unmodified lines
1368613804 lpfc_pci_remove_one_s4(pdev);
1368713805 break;
1368813806 default:
13689− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13807+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1369013808 "1424 Invalid PCI device group: 0x%x\n",
1369113809 phba->pci_dev_grp);
1369213810 break;
@@ -13723,7 +13841,7 @@ lpfc_pci_suspend_one(struct pci_dev *pdev, pm_message_t msg) · 30 unmodified lines
1372313841 rc = lpfc_pci_suspend_one_s4(pdev, msg);
1372413842 break;
1372513843 default:
13726− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13844+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1372713845 "1425 Invalid PCI device group: 0x%x\n",
1372813846 phba->pci_dev_grp);
1372913847 break;
@@ -13759,7 +13877,7 @@ lpfc_pci_resume_one(struct pci_dev *pdev) · 29 unmodified lines
1375913877 rc = lpfc_pci_resume_one_s4(pdev);
1376013878 break;
1376113879 default:
13762− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13880+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1376313881 "1426 Invalid PCI device group: 0x%x\n",
1376413882 phba->pci_dev_grp);
1376513883 break;
@@ -13797,7 +13915,7 @@ lpfc_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state) · 31 unmodified lines
1379713915 rc = lpfc_io_error_detected_s4(pdev, state);
1379813916 break;
1379913917 default:
13800− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13918+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1380113919 "1427 Invalid PCI device group: 0x%x\n",
1380213920 phba->pci_dev_grp);
1380313921 break;
@@ -13834,7 +13952,7 @@ lpfc_io_slot_reset(struct pci_dev *pdev) · 30 unmodified lines
1383413952 rc = lpfc_io_slot_reset_s4(pdev);
1383513953 break;
1383613954 default:
13837− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13955+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1383813956 "1428 Invalid PCI device group: 0x%x\n",
1383913957 phba->pci_dev_grp);
1384013958 break;
@@ -13866,7 +13984,7 @@ lpfc_io_resume(struct pci_dev *pdev) · 25 unmodified lines
1386613984 lpfc_io_resume_s4(pdev);
1386713985 break;
1386813986 default:
13869− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
13987+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1387013988 "1429 Invalid PCI device group: 0x%x\n",
1387113989 phba->pci_dev_grp);
1387213990 break;
@@ -13974,8 +14092,8 @@ lpfc_init(void) · 101 unmodified lines
1397414092 {
1397514093 int error = 0;
1397614094
13977− printk(LPFC_MODULE_DESC "\n");
13978− printk(LPFC_COPYRIGHT "\n");
14095+ pr_info(LPFC_MODULE_DESC "\n");
14096+ pr_info(LPFC_COPYRIGHT "\n");
1397914097
1398014098 error = misc_register(&lpfc_mgmt_dev);
1398114099 if (error)
@@ -14022,6 +14140,85 @@ cpuhp_failure: · 40 unmodified lines
1402214140 return error;
1402314141 }
1402414142
14143+void lpfc_dmp_dbg(struct lpfc_hba *phba)
14144+{
14145+ unsigned int start_idx;
14146+ unsigned int dbg_cnt;
14147+ unsigned int temp_idx;
14148+ int i;
14149+ int j = 0;
14150+ unsigned long rem_nsec;
14151+
14152+ if (phba->cfg_log_verbose)
14153+ return;
14154+
14155+ if (atomic_cmpxchg(&phba->dbg_log_dmping, 0, 1) != 0)
14156+ return;
14157+
14158+ start_idx = (unsigned int)atomic_read(&phba->dbg_log_idx) % DBG_LOG_SZ;
14159+ dbg_cnt = (unsigned int)atomic_read(&phba->dbg_log_cnt);
14160+ temp_idx = start_idx;
14161+ if (dbg_cnt >= DBG_LOG_SZ) {
14162+ dbg_cnt = DBG_LOG_SZ;
14163+ temp_idx -= 1;
14164+ } else {
14165+ if ((start_idx + dbg_cnt) > (DBG_LOG_SZ - 1)) {
14166+ temp_idx = (start_idx + dbg_cnt) % DBG_LOG_SZ;
14167+ } else {
14168+ if (start_idx < dbg_cnt)
14169+ start_idx = DBG_LOG_SZ - (dbg_cnt - start_idx);
14170+ else
14171+ start_idx -= dbg_cnt;
14172+ }
14173+ }
14174+ dev_info(&phba->pcidev->dev, "start %d end %d cnt %d\n",
14175+ start_idx, temp_idx, dbg_cnt);
14176+
14177+ for (i = 0; i < dbg_cnt; i++) {
14178+ if ((start_idx + i) < DBG_LOG_SZ)
14179+ temp_idx = (start_idx + i) % DBG_LOG_SZ;
14180+ else
14181+ temp_idx = j++;
14182+ rem_nsec = do_div(phba->dbg_log[temp_idx].t_ns, NSEC_PER_SEC);
14183+ dev_info(&phba->pcidev->dev, "%d: [%5lu.%06lu] %s",
14184+ temp_idx,
14185+ (unsigned long)phba->dbg_log[temp_idx].t_ns,
14186+ rem_nsec / 1000,
14187+ phba->dbg_log[temp_idx].log);
14188+ }
14189+ atomic_set(&phba->dbg_log_cnt, 0);
14190+ atomic_set(&phba->dbg_log_dmping, 0);
14191+}
14192+
14193+__printf(2, 3)
14194+void lpfc_dbg_print(struct lpfc_hba *phba, const char *fmt, ...)
14195+{
14196+ unsigned int idx;
14197+ va_list args;
14198+ int dbg_dmping = atomic_read(&phba->dbg_log_dmping);
14199+ struct va_format vaf;
14200+
14201+
14202+ va_start(args, fmt);
14203+ if (unlikely(dbg_dmping)) {
14204+ vaf.fmt = fmt;
14205+ vaf.va = &args;
14206+ dev_info(&phba->pcidev->dev, "%pV", &vaf);
14207+ va_end(args);
14208+ return;
14209+ }
14210+ idx = (unsigned int)atomic_fetch_add(1, &phba->dbg_log_idx) %
14211+ DBG_LOG_SZ;
14212+
14213+ atomic_inc(&phba->dbg_log_cnt);
14214+
14215+ vscnprintf(phba->dbg_log[idx].log,
14216+ sizeof(phba->dbg_log[idx].log), fmt, args);
14217+ va_end(args);
14218+
14219+ phba->dbg_log[idx].t_ns = local_clock();
14220+}
14221+
1402514222 /**
1402614223 * lpfc_exit - lpfc module removal routine
1402714224 *
drivers/scsi/lpfc/lpfc_logmsg.h+19−5
@@ -44,7 +44,11 @@ · 43 unmodified lines
4444 #define LOG_NVME_DISC 0x00200000 /* NVME Discovery/Connect events. */
4545 #define LOG_NVME_ABTS 0x00400000 /* NVME ABTS events. */
4646 #define LOG_NVME_IOERR 0x00800000 /* NVME IO Error events. */
47−#define LOG_ALL_MSG 0xffffffff /* LOG all messages */
47+#define LOG_TRACE_EVENT 0x80000000 /* Dmp the DBG log on this err */
48+#define LOG_ALL_MSG 0x7fffffff /* LOG all messages */
49+
50+void lpfc_dmp_dbg(struct lpfc_hba *phba);
51+void lpfc_dbg_print(struct lpfc_hba *phba, const char *fmt, ...);
4852
4953 /* generate message by verbose log setting or severity */
5054 #define lpfc_vlog_msg(vport, level, mask, fmt, arg...) \
@@ -65,9 +69,15 @@ do { \ · 14 unmodified lines
6569
6670 #define lpfc_printf_vlog(vport, level, mask, fmt, arg...) \
6771 do { \
68− { if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '3')) \
72+ { if (((mask) & (vport)->cfg_log_verbose) || (level[1] <= '3')) { \
73+ if ((mask) & LOG_TRACE_EVENT) \
74+ lpfc_dmp_dbg((vport)->phba); \
6975 dev_printk(level, &((vport)->phba->pcidev)->dev, "%d:(%d):" \
70− fmt, (vport)->phba->brd_no, vport->vpi, ##arg); } \
76+ fmt, (vport)->phba->brd_no, vport->vpi, ##arg); \
77+ } else if (!(vport)->cfg_log_verbose) \
78+ lpfc_dbg_print((vport)->phba, "%d:(%d):" fmt, \
79+ (vport)->phba->brd_no, (vport)->vpi, ##arg); \
80+ } \
7181 } while (0)
7282
7383 #define lpfc_printf_log(phba, level, mask, fmt, arg...) \
@@ -75,8 +85,12 @@ do { \ · 1 unmodified line
7585 { uint32_t log_verbose = (phba)->pport ? \
7686 (phba)->pport->cfg_log_verbose : \
7787 (phba)->cfg_log_verbose; \
78− if (((mask) & log_verbose) || (level[1] <= '3')) \
88+ if (((mask) & log_verbose) || (level[1] <= '3')) { \
89+ if ((mask) & LOG_TRACE_EVENT) \
90+ lpfc_dmp_dbg(phba); \
7991 dev_printk(level, &((phba)->pcidev)->dev, "%d:" \
80− fmt, phba->brd_no, ##arg); \
92+ fmt, phba->brd_no, ##arg); \
93+ } else if (!(phba)->cfg_log_verbose)\
94+ lpfc_dbg_print(phba, "%d:" fmt, phba->brd_no, ##arg); \
8195 } \
8296 } while (0)
drivers/scsi/lpfc/lpfc_mbox.c+7−5
@@ -868,9 +868,7 @@ lpfc_sli4_unreg_all_rpis(struct lpfc_vport *vport) · 867 unmodified lines
868868
869869 /**
870870 * lpfc_reg_vpi - Prepare a mailbox command for registering vport identifier
871− * @phba: pointer to lpfc hba data structure.
872− * @vpi: virtual N_Port identifier.
873− * @sid: Fibre Channel S_ID (N_Port_ID assigned to a virtual N_Port).
871+ * @vport: pointer to a vport object.
874872 * @pmb: pointer to the driver internal queue element for mailbox command.
875873 *
876874 * The registration vport identifier mailbox command is used to activate a
@@ -1199,7 +1197,7 @@ lpfc_config_hbq(struct lpfc_hba *phba, uint32_t id, · 322 unmodified lines
11991197 /**
12001198 * lpfc_config_ring - Prepare a mailbox command for configuring an IOCB ring
12011199 * @phba: pointer to lpfc hba data structure.
1202− * @ring:
1200+ * @ring: ring number/index
12031201 * @pmb: pointer to the driver internal queue element for mailbox command.
12041202 *
12051203 * The configure ring mailbox command is used to configure an IOCB ring. This
@@ -1613,7 +1611,7 @@ lpfc_mbox_dev_check(struct lpfc_hba *phba) · 407 unmodified lines
16131611 /**
16141612 * lpfc_mbox_tmo_val - Retrieve mailbox command timeout value
16151613 * @phba: pointer to lpfc hba data structure.
1616− * @cmd: mailbox command code.
1614+ * @mboxq: pointer to the driver internal queue element for mailbox command.
16171615 *
16181616 * This routine retrieves the proper timeout value according to the mailbox
16191617 * command code.
@@ -1700,6 +1698,7 @@ lpfc_sli4_mbx_sge_set(struct lpfcMboxq *mbox, uint32_t sgentry, · 80 unmodified lines
17001698 * lpfc_sli4_mbx_sge_get - Get a sge entry from non-embedded mailbox command
17011699 * @mbox: pointer to lpfc mbox command.
17021700 * @sgentry: sge entry index.
1701+ * @sge: pointer to lpfc mailbox sge to load into.
17031702 *
17041703 * This routine gets an entry from the non-embedded mailbox command at the sge
17051704 * index location.
@@ -1767,6 +1766,7 @@ lpfc_sli4_mbox_cmd_free(struct lpfc_hba *phba, struct lpfcMboxq *mbox) · 61 unmodified lines
17671766 * @subsystem: The sli4 config sub mailbox subsystem.
17681767 * @opcode: The sli4 config sub mailbox command opcode.
17691768 * @length: Length of the sli4 config mailbox command (including sub-header).
1769+ * @emb: True if embedded mbox command should be setup.
17701770 *
17711771 * This routine sets up the header fields of SLI4 specific mailbox command
17721772 * for sending IOCTL command.
@@ -2012,6 +2012,7 @@ lpfc_sli_config_mbox_opcode_get(struct lpfc_hba *phba, LPFC_MBOXQ_t *mbox) · 239 unmodified lines
20122012 /**
20132013 * lpfc_sli4_mbx_read_fcf_rec - Allocate and construct read fcf mbox cmd
20142014 * @phba: pointer to lpfc hba data structure.
2015+ * @mboxq: pointer to lpfc mbox command.
20152016 * @fcf_index: index to fcf table.
20162017 *
20172018 * This routine routine allocates and constructs non-embedded mailbox command
@@ -2068,6 +2069,7 @@ lpfc_sli4_mbx_read_fcf_rec(struct lpfc_hba *phba, · 50 unmodified lines
20682069
20692070 /**
20702071 * lpfc_request_features: Configure SLI4 REQUEST_FEATURES mailbox
2072+ * @phba: pointer to lpfc hba data structure.
20712073 * @mboxq: pointer to lpfc mbox command.
20722074 *
20732075 * This routine sets up the mailbox for an SLI4 REQUEST_FEATURES
drivers/scsi/lpfc/lpfc_mem.c+3−1
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #define LPFC_MBUF_POOL_SIZE 64 /* max elements in MBUF safety pool */
4646 #define LPFC_MEM_POOL_SIZE 64 /* max elem in non-DMA safety pool */
4747 #define LPFC_DEVICE_DATA_POOL_SIZE 64 /* max elements in device data pool */
48+#define LPFC_RRQ_POOL_SIZE 256 /* max elements in non-DMA pool */
4849
4950 int
5051 lpfc_mem_alloc_active_rrq_pool_s4(struct lpfc_hba *phba) {
@@ -67,6 +68,7 @@ lpfc_mem_alloc_active_rrq_pool_s4(struct lpfc_hba *phba) { · 16 unmodified lines
6768 /**
6869 * lpfc_mem_alloc - create and allocate all PCI and memory pools
6970 * @phba: HBA to allocate pools for
71+ * @align: alignment requirement for blocks; must be a power of two
7072 *
7173 * Description: Creates and allocates PCI pools lpfc_mbuf_pool,
7274 * lpfc_hrb_pool. Creates and allocates kmalloc-backed mempools
@@ -121,7 +123,7 @@ lpfc_mem_alloc(struct lpfc_hba *phba, int align) · 48 unmodified lines
121123
122124 if (phba->sli_rev == LPFC_SLI_REV4) {
123125 phba->rrq_pool =
124− mempool_create_kmalloc_pool(LPFC_MEM_POOL_SIZE,
126+ mempool_create_kmalloc_pool(LPFC_RRQ_POOL_SIZE,
125127 sizeof(struct lpfc_node_rrq));
126128 if (!phba->rrq_pool)
127129 goto fail_free_nlp_mem_pool;
drivers/scsi/lpfc/lpfc_nportdisc.c+38−30
@@ -152,7 +152,7 @@ lpfc_check_sparm(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 151 unmodified lines
152152 memcpy(&ndlp->nlp_portname, &sp->portName, sizeof (struct lpfc_name));
153153 return 1;
154154 bad_service_param:
155− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
155+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
156156 "0207 Device %x "
157157 "(%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x) sent "
158158 "invalid service parameters. Ignoring device.\n",
@@ -301,7 +301,7 @@ lpfc_defer_pt2pt_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *link_mbox) · 142 unmodified lines
301301
302302 /* Check for CONFIG_LINK error */
303303 if (mb->mbxStatus) {
304− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
304+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
305305 "4575 CONFIG_LINK fails pt2pt discovery: %x\n",
306306 mb->mbxStatus);
307307 mempool_free(login_mbox, phba->mbox_mem_pool);
@@ -316,7 +316,7 @@ lpfc_defer_pt2pt_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *link_mbox) · 8 unmodified lines
316316 rc = lpfc_els_rsp_acc(link_mbox->vport, ELS_CMD_PLOGI,
317317 save_iocb, ndlp, login_mbox);
318318 if (rc) {
319− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
319+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
320320 "4576 PLOGI ACC fails pt2pt discovery: %x\n",
321321 rc);
322322 mempool_free(login_mbox, phba->mbox_mem_pool);
@@ -361,7 +361,7 @@ lpfc_defer_acc_rsp(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 38 unmodified lines
361361 lpfc_sli4_unreg_rpi_cmpl_clr(phba, pmb);
362362
363363 if (!piocb) {
364− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY | LOG_ELS,
364+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
365365 "4578 PLOGI ACC fail\n");
366366 if (mbox)
367367 mempool_free(mbox, phba->mbox_mem_pool);
@@ -370,7 +370,7 @@ lpfc_defer_acc_rsp(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 2 unmodified lines
370370
371371 rc = lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, piocb, ndlp, mbox);
372372 if (rc) {
373− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY | LOG_ELS,
373+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
374374 "4579 PLOGI ACC fail %x\n", rc);
375375 if (mbox)
376376 mempool_free(mbox, phba->mbox_mem_pool);
@@ -405,7 +405,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 28 unmodified lines
405405 lp = (uint32_t *) pcmd->virt;
406406 sp = (struct serv_parm *) ((uint8_t *) lp + sizeof (uint32_t));
407407 if (wwn_to_u64(sp->portName.u.wwn) == 0) {
408− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
408+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
409409 "0140 PLOGI Reject: invalid nname\n");
410410 stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;
411411 stat.un.b.lsRjtRsnCodeExp = LSEXP_INVALID_PNAME;
@@ -414,7 +414,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 2 unmodified lines
414414 return 0;
415415 }
416416 if (wwn_to_u64(sp->nodeName.u.wwn) == 0) {
417− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
417+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
418418 "0141 PLOGI Reject: invalid pname\n");
419419 stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC;
420420 stat.un.b.lsRjtRsnCodeExp = LSEXP_INVALID_NNAME;
@@ -481,7 +481,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 60 unmodified lines
481481 }
482482 if (nlp_portwwn != 0 &&
483483 nlp_portwwn != wwn_to_u64(sp->portName.u.wwn))
484− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
484+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
485485 "0143 PLOGI recv'd from DID: x%x "
486486 "WWPN changed: old %llx new %llx\n",
487487 ndlp->nlp_DID,
@@ -689,7 +689,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 201 unmodified lines
689689 return 1;
690690 out:
691691 if (defer_acc)
692− lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY,
692+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
693693 "4577 discovery failure: %p %p %p\n",
694694 save_iocb, link_mbox, login_mbox);
695695 kfree(save_iocb);
@@ -797,11 +797,17 @@ lpfc_rcv_padisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 101 unmodified lines
797797 ndlp, NULL);
798798 }
799799 out:
800− /* If we are authenticated, move to the proper state */
801− if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET))
802− lpfc_nlp_set_state(vport, ndlp, NLP_STE_MAPPED_NODE);
803− else
804− lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE);
800+ /* If we are authenticated, move to the proper state.
801+ * It is possible an ADISC arrived and the remote nport
802+ * is already in MAPPED or UNMAPPED state. Catch this
803+ * condition and don't set the nlp_state again because
804+ * it causes an unnecessary transport unregister/register.
805+ */
806+ if (ndlp->nlp_type & (NLP_FCP_TARGET | NLP_NVME_TARGET)) {
807+ if (ndlp->nlp_state != NLP_STE_MAPPED_NODE)
808+ lpfc_nlp_set_state(vport, ndlp,
809+ NLP_STE_MAPPED_NODE);
810+ }
805811
806812 return 1;
807813 }
@@ -1062,6 +1068,7 @@ lpfc_disc_set_adisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 254 unmodified lines
10621068 * lpfc_release_rpi - Release a RPI by issuing unreg_login mailbox cmd.
10631069 * @phba : Pointer to lpfc_hba structure.
10641070 * @vport: Pointer to lpfc_vport structure.
1071+ * @ndlp: Pointer to lpfc_nodelist structure.
10651072 * @rpi : rpi to be release.
10661073 *
10671074 * This function will send a unreg_login mailbox command to the firmware
@@ -1091,8 +1098,8 @@ lpfc_release_rpi(struct lpfc_hba *phba, struct lpfc_vport *vport, · 23 unmodified lines
10911098 pmb = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
10921099 GFP_KERNEL);
10931100 if (!pmb)
1094− lpfc_printf_vlog(vport, KERN_ERR, LOG_MBOX,
1095− "2796 mailbox memory allocation failed \n");
1101+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1102+ "2796 mailbox memory allocation failed \n");
10961103 else {
10971104 lpfc_unreg_login(phba, vport->vpi, rpi, pmb);
10981105 pmb->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
@@ -1130,7 +1137,7 @@ lpfc_disc_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 31 unmodified lines
11301137 rpi = pmb->u.mb.un.varWords[0];
11311138 lpfc_release_rpi(phba, vport, ndlp, rpi);
11321139 }
1133− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1140+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
11341141 "0271 Illegal State Transition: node x%x "
11351142 "event x%x, state x%x Data: x%x x%x\n",
11361143 ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi,
@@ -1148,11 +1155,11 @@ lpfc_cmpl_plogi_illegal(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 11 unmodified lines
11481155 * to stop it.
11491156 */
11501157 if (!(ndlp->nlp_flag & NLP_RCV_PLOGI)) {
1151− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1152− "0272 Illegal State Transition: node x%x "
1153− "event x%x, state x%x Data: x%x x%x\n",
1154− ndlp->nlp_DID, evt, ndlp->nlp_state, ndlp->nlp_rpi,
1155− ndlp->nlp_flag);
1158+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1159+ "0272 Illegal State Transition: node x%x "
1160+ "event x%x, state x%x Data: x%x x%x\n",
1161+ ndlp->nlp_DID, evt, ndlp->nlp_state,
1162+ ndlp->nlp_rpi, ndlp->nlp_flag);
11561163 }
11571164 return ndlp->nlp_state;
11581165 }
@@ -1372,7 +1379,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, · 213 unmodified lines
13721379 if ((ndlp->nlp_DID != FDMI_DID) &&
13731380 (wwn_to_u64(sp->portName.u.wwn) == 0 ||
13741381 wwn_to_u64(sp->nodeName.u.wwn) == 0)) {
1375− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1382+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
13761383 "0142 PLOGI RSP: Invalid WWN.\n");
13771384 goto out;
13781385 }
@@ -1434,7 +1441,8 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, · 55 unmodified lines
14341441 } else {
14351442 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
14361443 if (!mbox) {
1437− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1444+ lpfc_printf_vlog(vport, KERN_ERR,
1445+ LOG_TRACE_EVENT,
14381446 "0133 PLOGI: no memory "
14391447 "for config_link "
14401448 "Data: x%x x%x x%x x%x\n",
@@ -1459,7 +1467,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, · 18 unmodified lines
14591467
14601468 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
14611469 if (!mbox) {
1462− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1470+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
14631471 "0018 PLOGI: no memory for reg_login "
14641472 "Data: x%x x%x x%x x%x\n",
14651473 ndlp->nlp_DID, ndlp->nlp_state,
@@ -1499,7 +1507,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, · 33 unmodified lines
14991507 kfree(mp);
15001508 mempool_free(mbox, phba->mbox_mem_pool);
15011509
1502− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1510+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
15031511 "0134 PLOGI: cannot issue reg_login "
15041512 "Data: x%x x%x x%x x%x\n",
15051513 ndlp->nlp_DID, ndlp->nlp_state,
@@ -1507,7 +1515,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, · 1 unmodified line
15071515 } else {
15081516 mempool_free(mbox, phba->mbox_mem_pool);
15091517
1510− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1518+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
15111519 "0135 PLOGI: cannot format reg_login "
15121520 "Data: x%x x%x x%x x%x\n",
15131521 ndlp->nlp_DID, ndlp->nlp_state,
@@ -1518,7 +1526,7 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, · 4 unmodified lines
15181526 out:
15191527 if (ndlp->nlp_DID == NameServer_DID) {
15201528 lpfc_vport_set_state(vport, FC_VPORT_FAILED);
1521− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
1529+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
15221530 "0261 Cannot Register NameServer login\n");
15231531 }
15241532
@@ -1940,8 +1948,8 @@ lpfc_cmpl_reglogin_reglogin_issue(struct lpfc_vport *vport, · 415 unmodified lines
19401948
19411949 if (mb->mbxStatus) {
19421950 /* RegLogin failed */
1943− lpfc_printf_vlog(vport, KERN_ERR, LOG_DISCOVERY,
1944− "0246 RegLogin failed Data: x%x x%x x%x x%x "
1951+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1952+ "0246 RegLogin failed Data: x%x x%x x%x x%x "
19451953 "x%x\n",
19461954 did, mb->mbxStatus, vport->port_state,
19471955 mb->un.varRegLogin.vpi,
drivers/scsi/lpfc/lpfc_nvme.c+51−59
@@ -234,8 +234,10 @@ lpfc_nvme_prep_abort_wqe(struct lpfc_iocbq *pwqeq, u16 xritag, u8 opt) · 233 unmodified lines
234234
235235 /**
236236 * lpfc_nvme_create_queue -
237+ * @pnvme_lport: Transport localport that LS is to be issued from
237238 * @lpfc_pnvme: Pointer to the driver's nvme instance data
238239 * @qidx: An cpu index used to affinitize IO queues and MSIX vectors.
240+ * @qsize: Size of the queue in bytes
239241 * @handle: An opaque driver handle used in follow-up calls.
240242 *
241243 * Driver registers this routine to preallocate and initialize any
@@ -292,7 +294,7 @@ lpfc_nvme_create_queue(struct nvme_fc_local_port *pnvme_lport, · 50 unmodified lines
292294
293295 /**
294296 * lpfc_nvme_delete_queue -
295− * @lpfc_pnvme: Pointer to the driver's nvme instance data
297+ * @pnvme_lport: Transport localport that LS is to be issued from
296298 * @qidx: An cpu index used to affinitize IO queues and MSIX vectors.
297299 * @handle: An opaque driver handle from lpfc_nvme_create_queue
298300 *
@@ -498,7 +500,7 @@ __lpfc_nvme_ls_req_cmp(struct lpfc_hba *phba, struct lpfc_vport *vport, · 199 unmodified lines
498500 if (pnvme_lsreq->done)
499501 pnvme_lsreq->done(pnvme_lsreq, status);
500502 else
501− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC,
503+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
502504 "6046 NVMEx cmpl without done call back? "
503505 "Data %px DID %x Xri: %x status %x\n",
504506 pnvme_lsreq, ndlp ? ndlp->nlp_DID : 0,
@@ -647,7 +649,7 @@ lpfc_nvme_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp, · 142 unmodified lines
647649
648650 rc = lpfc_sli4_issue_wqe(phba, &phba->sli4_hba.hdwq[0], genwqe);
649651 if (rc) {
650− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC | LOG_ELS,
652+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
651653 "6045 Issue GEN REQ WQE to NPORT x%x "
652654 "Data: x%x x%x rc x%x\n",
653655 ndlp->nlp_DID, genwqe->iotag,
@@ -672,6 +674,7 @@ lpfc_nvme_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp, · 18 unmodified lines
672674 * @vport: The local port issuing the LS
673675 * @ndlp: The remote port to send the LS to
674676 * @pnvme_lsreq: Pointer to LS request structure from the transport
677+ * @gen_req_cmp: Completion call-back
675678 *
676679 * Routine validates the ndlp, builds buffers and sends a GEN_REQUEST
677680 * WQE to perform the LS operation.
@@ -693,8 +696,7 @@ __lpfc_nvme_ls_req(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 15 unmodified lines
693696 uint16_t ntype, nstate;
694697
695698 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
696− lpfc_printf_vlog(vport, KERN_ERR,
697− LOG_NVME_DISC | LOG_NODE | LOG_NVME_IOERR,
699+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
698700 "6051 NVMEx LS REQ: Bad NDLP x%px, Failing "
699701 "LS Req\n",
700702 ndlp);
@@ -705,8 +707,7 @@ __lpfc_nvme_ls_req(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 4 unmodified lines
705707 nstate = ndlp->nlp_state;
706708 if ((ntype & NLP_NVME_TARGET && nstate != NLP_STE_MAPPED_NODE) ||
707709 (ntype & NLP_NVME_INITIATOR && nstate != NLP_STE_UNMAPPED_NODE)) {
708− lpfc_printf_vlog(vport, KERN_ERR,
709− LOG_NVME_DISC | LOG_NODE | LOG_NVME_IOERR,
710+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
710711 "6088 NVMEx LS REQ: Fail DID x%06x not "
711712 "ready for IO. Type x%x, State x%x\n",
712713 ndlp->nlp_DID, ntype, nstate);
@@ -727,9 +728,7 @@ __lpfc_nvme_ls_req(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 14 unmodified lines
727728
728729 bmp = kmalloc(sizeof(*bmp), GFP_KERNEL);
729730 if (!bmp) {
730−
731− lpfc_printf_vlog(vport, KERN_ERR,
732− LOG_NVME_DISC | LOG_NVME_IOERR,
731+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
733732 "6044 NVMEx LS REQ: Could not alloc LS buf "
734733 "for DID %x\n",
735734 ndlp->nlp_DID);
@@ -738,8 +737,7 @@ __lpfc_nvme_ls_req(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 2 unmodified lines
738737
739738 bmp->virt = lpfc_mbuf_alloc(vport->phba, MEM_PRI, &(bmp->phys));
740739 if (!bmp->virt) {
741− lpfc_printf_vlog(vport, KERN_ERR,
742− LOG_NVME_DISC | LOG_NVME_IOERR,
740+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
743741 "6042 NVMEx LS REQ: Could not alloc mbuf "
744742 "for DID %x\n",
745743 ndlp->nlp_DID);
@@ -774,8 +772,7 @@ __lpfc_nvme_ls_req(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 28 unmodified lines
774772 pnvme_lsreq, gen_req_cmp, ndlp, 2,
775773 LPFC_NVME_LS_TIMEOUT, 0);
776774 if (ret != WQE_SUCCESS) {
777− lpfc_printf_vlog(vport, KERN_ERR,
778− LOG_NVME_DISC | LOG_NVME_IOERR,
775+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
779776 "6052 NVMEx REQ: EXIT. issue ls wqe failed "
780777 "lsreq x%px Status %x DID %x\n",
781778 pnvme_lsreq, ret, ndlp->nlp_DID);
@@ -789,9 +786,9 @@ __lpfc_nvme_ls_req(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 7 unmodified lines
789786
790787 /**
791788 * lpfc_nvme_ls_req - Issue an NVME Link Service request
792− * @lpfc_nvme_lport: Transport localport that LS is to be issued from.
793− * @lpfc_nvme_rport: Transport remoteport that LS is to be sent to.
794− * @pnvme_lsreq - the transport nvme_ls_req structure for the LS
789+ * @pnvme_lport: Transport localport that LS is to be issued from.
790+ * @nvme_rport: Transport remoteport that LS is to be sent to.
791+ * @pnvme_lsreq: the transport nvme_ls_req structure for the LS
795792 *
796793 * Driver registers this routine to handle any link service request
797794 * from the nvme_fc transport to a remote nvme-aware port.
@@ -853,9 +850,7 @@ __lpfc_nvme_ls_abort(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 55 unmodified lines
853850 bool foundit = false;
854851
855852 if (!ndlp) {
856− lpfc_printf_log(phba, KERN_ERR,
857− LOG_NVME_DISC | LOG_NODE |
858− LOG_NVME_IOERR | LOG_NVME_ABTS,
853+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
859854 "6049 NVMEx LS REQ Abort: Bad NDLP x%px DID "
860855 "x%06x, Failing LS Req\n",
861856 ndlp, ndlp ? ndlp->nlp_DID : 0);
@@ -931,9 +926,9 @@ lpfc_nvme_xmt_ls_rsp(struct nvme_fc_local_port *localport, · 69 unmodified lines
931926
932927 /**
933928 * lpfc_nvme_ls_abort - Abort a prior NVME LS request
934− * @lpfc_nvme_lport: Transport localport that LS is to be issued from.
935− * @lpfc_nvme_rport: Transport remoteport that LS is to be sent to.
936− * @pnvme_lsreq - the transport nvme_ls_req structure for the LS
929+ * @pnvme_lport: Transport localport that LS is to be issued from.
930+ * @pnvme_rport: Transport remoteport that LS is to be sent to.
931+ * @pnvme_lsreq: the transport nvme_ls_req structure for the LS
937932 *
938933 * Driver registers this routine to abort a NVME LS request that is
939934 * in progress (from the transports perspective).
@@ -1063,11 +1058,8 @@ lpfc_nvme_adj_fcp_sgls(struct lpfc_vport *vport, · 123 unmodified lines
10631058 }
10641059
10651060
1066−/**
1061+/*
10671062 * lpfc_nvme_io_cmd_wqe_cmpl - Complete an NVME-over-FCP IO
1068− * @lpfc_pnvme: Pointer to the driver's nvme instance data
1069− * @lpfc_nvme_lport: Pointer to the driver's local port data
1070− * @lpfc_nvme_rport: Pointer to the rport getting the @lpfc_nvme_ereq
10711063 *
10721064 * Driver registers this routine as it io request handler. This
10731065 * routine issues an fcp WQE with data from the @lpfc_nvme_fcpreq
@@ -1099,8 +1091,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, · 25 unmodified lines
10991091
11001092 /* Sanity check on return of outstanding command */
11011093 if (!lpfc_ncmd) {
1102− lpfc_printf_vlog(vport, KERN_ERR,
1103− LOG_NODE | LOG_NVME_IOERR,
1094+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
11041095 "6071 Null lpfc_ncmd pointer. No "
11051096 "release, skip completion\n");
11061097 return;
@@ -1111,7 +1102,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, · 4 unmodified lines
11111102
11121103 if (!lpfc_ncmd->nvmeCmd) {
11131104 spin_unlock(&lpfc_ncmd->buf_lock);
1114− lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE | LOG_NVME_IOERR,
1105+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
11151106 "6066 Missing cmpl ptrs: lpfc_ncmd x%px, "
11161107 "nvmeCmd x%px\n",
11171108 lpfc_ncmd, lpfc_ncmd->nvmeCmd);
@@ -1144,7 +1135,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, · 26 unmodified lines
11441135 */
11451136 ndlp = lpfc_ncmd->ndlp;
11461137 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp)) {
1147− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR,
1138+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
11481139 "6062 Ignoring NVME cmpl. No ndlp\n");
11491140 goto out_err;
11501141 }
@@ -1215,7 +1206,7 @@ lpfc_nvme_io_cmd_wqe_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn, · 64 unmodified lines
12151206 /* Sanity check */
12161207 if (nCmd->rcv_rsplen == LPFC_NVME_ERSP_LEN)
12171208 break;
1218− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR,
1209+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
12191210 "6081 NVME Completion Protocol Error: "
12201211 "xri %x status x%x result x%x "
12211212 "placed x%x\n",
@@ -1300,11 +1291,10 @@ out_err: · 78 unmodified lines
13001291
13011292 /**
13021293 * lpfc_nvme_prep_io_cmd - Issue an NVME-over-FCP IO
1303− * @lpfc_pnvme: Pointer to the driver's nvme instance data
1304− * @lpfc_nvme_lport: Pointer to the driver's local port data
1305− * @lpfc_nvme_rport: Pointer to the rport getting the @lpfc_nvme_ereq
1306− * @lpfc_nvme_fcreq: IO request from nvme fc to driver.
1307− * @hw_queue_handle: Driver-returned handle in lpfc_nvme_create_queue
1294+ * @vport: pointer to a host virtual N_Port data structure
1295+ * @lpfcn_cmd: Pointer to lpfc scsi command
1296+ * @pnode: pointer to a node-list data structure
1297+ * @cstat: pointer to the control status structure
13081298 *
13091299 * Driver registers this routine as it io request handler. This
13101300 * routine issues an fcp WQE with data from the @lpfc_nvme_fcpreq
@@ -1409,11 +1399,8 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport, · 98 unmodified lines
14091399
14101400 /**
14111401 * lpfc_nvme_prep_io_dma - Issue an NVME-over-FCP IO
1412− * @lpfc_pnvme: Pointer to the driver's nvme instance data
1413− * @lpfc_nvme_lport: Pointer to the driver's local port data
1414− * @lpfc_nvme_rport: Pointer to the rport getting the @lpfc_nvme_ereq
1415− * @lpfc_nvme_fcreq: IO request from nvme fc to driver.
1416− * @hw_queue_handle: Driver-returned handle in lpfc_nvme_create_queue
1402+ * @vport: pointer to a host virtual N_Port data structure
1403+ * @lpfcn_cmd: Pointer to lpfc scsi command
14171404 *
14181405 * Driver registers this routine as it io request handler. This
14191406 * routine issues an fcp WQE with data from the @lpfc_nvme_fcpreq
@@ -1459,7 +1446,7 @@ lpfc_nvme_prep_io_dma(struct lpfc_vport *vport, · 39 unmodified lines
14591446 first_data_sgl = sgl;
14601447 lpfc_ncmd->seg_cnt = nCmd->sg_cnt;
14611448 if (lpfc_ncmd->seg_cnt > lpfc_nvme_template.max_sgl_segments) {
1462− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
1449+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
14631450 "6058 Too many sg segments from "
14641451 "NVME Transport. Max %d, "
14651452 "nvmeIO sg_cnt %d\n",
@@ -1482,7 +1469,7 @@ lpfc_nvme_prep_io_dma(struct lpfc_vport *vport, · 16 unmodified lines
14821469 j = 2;
14831470 for (i = 0; i < nseg; i++) {
14841471 if (data_sg == NULL) {
1485− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
1472+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
14861473 "6059 dptr err %d, nseg %d\n",
14871474 i, nseg);
14881475 lpfc_ncmd->seg_cnt = 0;
@@ -1583,7 +1570,7 @@ lpfc_nvme_prep_io_dma(struct lpfc_vport *vport, · 94 unmodified lines
15831570 * and sg_cnt must zero.
15841571 */
15851572 if (nCmd->payload_length != 0) {
1586− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
1573+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
15871574 "6063 NVME DMA Prep Err: sg_cnt %d "
15881575 "payload_length x%x\n",
15891576 nCmd->sg_cnt, nCmd->payload_length);
@@ -1946,7 +1933,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, · 356 unmodified lines
19461933 /* driver queued commands are in process of being flushed */
19471934 if (phba->hba_flag & HBA_IOQ_FLUSH) {
19481935 spin_unlock_irqrestore(&phba->hbalock, flags);
1949− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
1936+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
19501937 "6139 Driver in reset cleanup - flushing "
19511938 "NVME Req now. hba_flag x%x\n",
19521939 phba->hba_flag);
@@ -1956,13 +1943,13 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, · 3 unmodified lines
19561943 lpfc_nbuf = freqpriv->nvme_buf;
19571944 if (!lpfc_nbuf) {
19581945 spin_unlock_irqrestore(&phba->hbalock, flags);
1959− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
1946+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
19601947 "6140 NVME IO req has no matching lpfc nvme "
19611948 "io buffer. Skipping abort req.\n");
19621949 return;
19631950 } else if (!lpfc_nbuf->nvmeCmd) {
19641951 spin_unlock_irqrestore(&phba->hbalock, flags);
1965− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
1952+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
19661953 "6141 lpfc NVME IO req has no nvme_fcreq "
19671954 "io buffer. Skipping abort req.\n");
19681955 return;
@@ -1980,7 +1967,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, · 11 unmodified lines
19801967 * has not seen it yet.
19811968 */
19821969 if (lpfc_nbuf->nvmeCmd != pnvme_fcreq) {
1983− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
1970+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
19841971 "6143 NVME req mismatch: "
19851972 "lpfc_nbuf x%px nvmeCmd x%px, "
19861973 "pnvme_fcreq x%px. Skipping Abort xri x%x\n",
@@ -1991,7 +1978,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, · 4 unmodified lines
19911978
19921979 /* Don't abort IOs no longer on the pending queue. */
19931980 if (!(nvmereq_wqe->iocb_flag & LPFC_IO_ON_TXCMPLQ)) {
1994− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
1981+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
19951982 "6142 NVME IO req x%px not queued - skipping "
19961983 "abort req xri x%x\n",
19971984 pnvme_fcreq, nvmereq_wqe->sli4_xritag);
@@ -2005,7 +1992,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, · 7 unmodified lines
20051992
20061993 /* Outstanding abort is in progress */
20071994 if (nvmereq_wqe->iocb_flag & LPFC_DRIVER_ABORTED) {
2008− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
1995+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
20091996 "6144 Outstanding NVME I/O Abort Request "
20101997 "still pending on nvme_fcreq x%px, "
20111998 "lpfc_ncmd %px xri x%x\n",
@@ -2016,7 +2003,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, · 4 unmodified lines
20162003
20172004 abts_buf = __lpfc_sli_get_iocbq(phba);
20182005 if (!abts_buf) {
2019− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
2006+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
20202007 "6136 No available abort wqes. Skipping "
20212008 "Abts req for nvme_fcreq x%px xri x%x\n",
20222009 pnvme_fcreq, nvmereq_wqe->sli4_xritag);
@@ -2037,7 +2024,7 @@ lpfc_nvme_fcp_abort(struct nvme_fc_local_port *pnvme_lport, · 14 unmodified lines
20372024 spin_unlock(&lpfc_nbuf->buf_lock);
20382025 spin_unlock_irqrestore(&phba->hbalock, flags);
20392026 if (ret_val) {
2040− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_ABTS,
2027+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
20412028 "6137 Failed abts issue_wqe with status x%x "
20422029 "for nvme_fcreq x%px.\n",
20432030 ret_val, pnvme_fcreq);
@@ -2310,7 +2297,7 @@ lpfc_nvme_lport_unreg_wait(struct lpfc_vport *vport, · 266 unmodified lines
23102297 if (pring->txcmplq_cnt)
23112298 pending += pring->txcmplq_cnt;
23122299 }
2313− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR,
2300+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
23142301 "6176 Lport x%px Localport x%px wait "
23152302 "timed out. Pending %d. Renewing.\n",
23162303 lport, vport->localport, pending);
@@ -2432,6 +2419,7 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 115 unmodified lines
24322419 struct nvme_fc_remote_port *remote_port;
24332420 struct nvme_fc_port_info rpinfo;
24342421 struct lpfc_nodelist *prev_ndlp = NULL;
2422+ struct fc_rport *srport = ndlp->rport;
24352423
24362424 lpfc_printf_vlog(ndlp->vport, KERN_INFO, LOG_NVME_DISC,
24372425 "6006 Register NVME PORT. DID x%06x nlptype x%x\n",
@@ -2461,6 +2449,10 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 23 unmodified lines
24612449
24622450 rpinfo.port_name = wwn_to_u64(ndlp->nlp_portname.u.wwn);
24632451 rpinfo.node_name = wwn_to_u64(ndlp->nlp_nodename.u.wwn);
2452+ if (srport)
2453+ rpinfo.dev_loss_tmo = srport->dev_loss_tmo;
2454+ else
2455+ rpinfo.dev_loss_tmo = vport->cfg_devloss_tmo;
24642456
24652457 spin_lock_irq(&vport->phba->hbalock);
24662458 oldrport = lpfc_ndlp_get_nrport(ndlp);
@@ -2528,7 +2520,7 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 61 unmodified lines
25282520 ndlp, prev_ndlp);
25292521 } else {
25302522 lpfc_printf_vlog(vport, KERN_ERR,
2531− LOG_NVME_DISC | LOG_NODE,
2523+ LOG_TRACE_EVENT,
25322524 "6031 RemotePort Registration failed "
25332525 "err: %d, DID x%06x\n",
25342526 ret, ndlp->nlp_DID);
@@ -2574,7 +2566,7 @@ lpfc_nvme_rescan_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 39 unmodified lines
25742566 ndlp->nlp_state == NLP_STE_MAPPED_NODE) {
25752567 nvme_fc_rescan_remoteport(remoteport);
25762568
2577− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC,
2569+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
25782570 "6172 NVME rescanned DID x%06x "
25792571 "port_state x%x\n",
25802572 ndlp->nlp_DID, remoteport->port_state);
@@ -2657,7 +2649,7 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 76 unmodified lines
26572649 ret = nvme_fc_unregister_remoteport(remoteport);
26582650 if (ret != 0) {
26592651 lpfc_nlp_put(ndlp);
2660− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC,
2652+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
26612653 "6167 NVME unregister failed %d "
26622654 "port_state x%x\n",
26632655 ret, remoteport->port_state);
@@ -2667,7 +2659,7 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 3 unmodified lines
26672659
26682660 input_err:
26692661 #endif
2670− lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC,
2662+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
26712663 "6168 State error: lport x%px, rport x%px FCID x%06x\n",
26722664 vport->localport, ndlp->rport, ndlp->nlp_DID);
26732665 }
@@ -2752,7 +2744,7 @@ lpfc_nvme_wait_for_io_drain(struct lpfc_hba *phba) · 78 unmodified lines
27522744 * dump a message. Something is wrong.
27532745 */
27542746 if ((wait_cnt % 1000) == 0) {
2755− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2747+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
27562748 "6178 NVME IO not empty, "
27572749 "cnt %d\n", wait_cnt);
27582750 }
drivers/scsi/lpfc/lpfc_nvmet.c+47−49
@@ -303,7 +303,7 @@ __lpfc_nvme_xmt_ls_rsp_cmp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdwqe, · 302 unmodified lines
303303 result = wcqe->parameter;
304304
305305 if (axchg->state != LPFC_NVME_STE_LS_RSP || axchg->entry_cnt != 2) {
306− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC | LOG_NVME_IOERR,
306+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
307307 "6410 NVMEx LS cmpl state mismatch IO x%x: "
308308 "%d %d\n",
309309 axchg->oxid, axchg->state, axchg->entry_cnt);
@@ -395,7 +395,7 @@ lpfc_nvmet_ctxbuf_post(struct lpfc_hba *phba, struct lpfc_nvmet_ctxbuf *ctx_buf) · 85 unmodified lines
395395 unsigned long iflag;
396396
397397 if (ctxp->state == LPFC_NVME_STE_FREE) {
398− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
398+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
399399 "6411 NVMET free, already free IO x%x: %d %d\n",
400400 ctxp->oxid, ctxp->state, ctxp->entry_cnt);
401401 }
@@ -474,7 +474,7 @@ lpfc_nvmet_ctxbuf_post(struct lpfc_hba *phba, struct lpfc_nvmet_ctxbuf *ctx_buf) · 72 unmodified lines
474474
475475 if (!queue_work(phba->wq, &ctx_buf->defer_work)) {
476476 atomic_inc(&tgtp->rcv_fcp_cmd_drop);
477− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
477+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
478478 "6181 Unable to queue deferred work "
479479 "for oxid x%x. "
480480 "FCP Drop IO [x%x x%x x%x]\n",
@@ -879,7 +879,7 @@ __lpfc_nvme_xmt_ls_rsp(struct lpfc_async_xchg_ctx *axchg, · 398 unmodified lines
879879 "6023 NVMEx LS rsp oxid x%x\n", axchg->oxid);
880880
881881 if (axchg->state != LPFC_NVME_STE_LS_RCV || axchg->entry_cnt != 1) {
882− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC | LOG_NVME_IOERR,
882+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
883883 "6412 NVMEx LS rsp state mismatch "
884884 "oxid x%x: %d %d\n",
885885 axchg->oxid, axchg->state, axchg->entry_cnt);
@@ -891,8 +891,7 @@ __lpfc_nvme_xmt_ls_rsp(struct lpfc_async_xchg_ctx *axchg, · 5 unmodified lines
891891 nvmewqeq = lpfc_nvmet_prep_ls_wqe(phba, axchg, ls_rsp->rspdma,
892892 ls_rsp->rsplen);
893893 if (nvmewqeq == NULL) {
894− lpfc_printf_log(phba, KERN_ERR,
895− LOG_NVME_DISC | LOG_NVME_IOERR | LOG_NVME_ABTS,
894+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
896895 "6150 NVMEx LS Drop Rsp x%x: Prep\n",
897896 axchg->oxid);
898897 rc = -ENOMEM;
@@ -936,8 +935,7 @@ __lpfc_nvme_xmt_ls_rsp(struct lpfc_async_xchg_ctx *axchg, · 37 unmodified lines
936935 return 0;
937936 }
938937
939− lpfc_printf_log(phba, KERN_ERR,
940− LOG_NVME_DISC | LOG_NVME_IOERR | LOG_NVME_ABTS,
938+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
941939 "6151 NVMEx LS RSP x%x: failed to transmit %d\n",
942940 axchg->oxid, rc);
943941
@@ -1058,7 +1056,7 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_target_port *tgtport, · 114 unmodified lines
10581056 if ((ctxp->flag & LPFC_NVME_ABTS_RCV) ||
10591057 (ctxp->state == LPFC_NVME_STE_ABORT)) {
10601058 atomic_inc(&lpfc_nvmep->xmt_fcp_drop);
1061− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
1059+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
10621060 "6102 IO oxid x%x aborted\n",
10631061 ctxp->oxid);
10641062 rc = -ENXIO;
@@ -1068,7 +1066,7 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_target_port *tgtport, · 3 unmodified lines
10681066 nvmewqeq = lpfc_nvmet_prep_fcp_wqe(phba, ctxp);
10691067 if (nvmewqeq == NULL) {
10701068 atomic_inc(&lpfc_nvmep->xmt_fcp_drop);
1071− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
1069+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
10721070 "6152 FCP Drop IO x%x: Prep\n",
10731071 ctxp->oxid);
10741072 rc = -ENXIO;
@@ -1116,7 +1114,7 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_target_port *tgtport, · 41 unmodified lines
11161114
11171115 /* Give back resources */
11181116 atomic_inc(&lpfc_nvmep->xmt_fcp_drop);
1119− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
1117+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
11201118 "6153 FCP Drop IO x%x: Issue: %d\n",
11211119 ctxp->oxid, rc);
11221120
@@ -1216,7 +1214,7 @@ lpfc_nvmet_xmt_fcp_release(struct nvmet_fc_target_port *tgtport, · 93 unmodified lines
12161214 ctxp->flag, ctxp->oxid);
12171215 else if (ctxp->state != LPFC_NVME_STE_DONE &&
12181216 ctxp->state != LPFC_NVME_STE_ABORT)
1219− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
1217+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
12201218 "6413 NVMET release bad state %d %d oxid x%x\n",
12211219 ctxp->state, ctxp->entry_cnt, ctxp->oxid);
12221220
@@ -1395,7 +1393,7 @@ lpfc_nvmet_discovery_event(struct nvmet_fc_target_port *tgtport) · 172 unmodified lines
13951393 phba = tgtp->phba;
13961394
13971395 rc = lpfc_issue_els_rscn(phba->pport, 0);
1398− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
1396+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
13991397 "6420 NVMET subsystem change: Notification %s\n",
14001398 (rc) ? "Failed" : "Sent");
14011399 }
@@ -1493,7 +1491,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) · 91 unmodified lines
14931491 phba->sli4_hba.num_possible_cpu * phba->cfg_nvmet_mrq,
14941492 sizeof(struct lpfc_nvmet_ctx_info), GFP_KERNEL);
14951493 if (!phba->sli4_hba.nvmet_ctx_info) {
1496− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1494+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
14971495 "6419 Failed allocate memory for "
14981496 "nvmet context lists\n");
14991497 return -ENOMEM;
@@ -1551,7 +1549,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) · 51 unmodified lines
15511549 for (i = 0; i < phba->sli4_hba.nvmet_xri_cnt; i++) {
15521550 ctx_buf = kzalloc(sizeof(*ctx_buf), GFP_KERNEL);
15531551 if (!ctx_buf) {
1554− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
1552+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
15551553 "6404 Ran out of memory for NVMET\n");
15561554 return -ENOMEM;
15571555 }
@@ -1560,7 +1558,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) · 2 unmodified lines
15601558 GFP_KERNEL);
15611559 if (!ctx_buf->context) {
15621560 kfree(ctx_buf);
1563− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
1561+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
15641562 "6405 Ran out of NVMET "
15651563 "context memory\n");
15661564 return -ENOMEM;
@@ -1572,7 +1570,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) · 5 unmodified lines
15721570 if (!ctx_buf->iocbq) {
15731571 kfree(ctx_buf->context);
15741572 kfree(ctx_buf);
1575− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
1573+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
15761574 "6406 Ran out of NVMET iocb/WQEs\n");
15771575 return -ENOMEM;
15781576 }
@@ -1591,7 +1589,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba) · 12 unmodified lines
15911589 lpfc_sli_release_iocbq(phba, ctx_buf->iocbq);
15921590 kfree(ctx_buf->context);
15931591 kfree(ctx_buf);
1594− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
1592+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
15951593 "6407 Ran out of NVMET XRIs\n");
15961594 return -ENOMEM;
15971595 }
@@ -1670,7 +1668,7 @@ lpfc_nvmet_create_targetport(struct lpfc_hba *phba) · 72 unmodified lines
16701668 error = -ENOENT;
16711669 #endif
16721670 if (error) {
1673− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC,
1671+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
16741672 "6025 Cannot register NVME targetport x%x: "
16751673 "portnm %llx nodenm %llx segs %d qs %d\n",
16761674 error,
@@ -2114,7 +2112,7 @@ lpfc_nvmet_destroy_targetport(struct lpfc_hba *phba) · 437 unmodified lines
21142112 nvmet_fc_unregister_targetport(phba->targetport);
21152113 if (!wait_for_completion_timeout(tgtp->tport_unreg_cmp,
21162114 msecs_to_jiffies(LPFC_NVMET_WAIT_TMO)))
2117− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
2115+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
21182116 "6179 Unreg targetport x%px timeout "
21192117 "reached.\n", phba->targetport);
21202118 lpfc_nvmet_cleanup_io_context(phba);
@@ -2187,7 +2185,7 @@ lpfc_nvmet_process_rcv_fcp_req(struct lpfc_nvmet_ctxbuf *ctx_buf) · 66 unmodified lines
21872185 unsigned long iflags;
21882186
21892187 if (!nvmebuf) {
2190− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2188+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
21912189 "6159 process_rcv_fcp_req, nvmebuf is NULL, "
21922190 "oxid: x%x flg: x%x state: x%x\n",
21932191 ctxp->oxid, ctxp->flag, ctxp->state);
@@ -2200,7 +2198,7 @@ lpfc_nvmet_process_rcv_fcp_req(struct lpfc_nvmet_ctxbuf *ctx_buf) · 6 unmodified lines
22002198 }
22012199
22022200 if (ctxp->flag & LPFC_NVME_ABTS_RCV) {
2203− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2201+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
22042202 "6324 IO oxid x%x aborted\n",
22052203 ctxp->oxid);
22062204 return;
@@ -2264,7 +2262,7 @@ lpfc_nvmet_process_rcv_fcp_req(struct lpfc_nvmet_ctxbuf *ctx_buf) · 57 unmodified lines
22642262 }
22652263 ctxp->flag &= ~LPFC_NVME_TNOTIFY;
22662264 atomic_inc(&tgtp->rcv_fcp_cmd_drop);
2267− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2265+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
22682266 "2582 FCP Drop IO x%x: err x%x: x%x x%x x%x\n",
22692267 ctxp->oxid, rc,
22702268 atomic_read(&tgtp->rcv_fcp_cmd_in),
@@ -2383,7 +2381,7 @@ lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba, · 112 unmodified lines
23832381
23842382 ctx_buf = NULL;
23852383 if (!nvmebuf || !phba->targetport) {
2386− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2384+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
23872385 "6157 NVMET FCP Drop IO\n");
23882386 if (nvmebuf)
23892387 lpfc_rq_buf_free(phba, &nvmebuf->hbuf);
@@ -2456,7 +2454,7 @@ lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba, · 66 unmodified lines
24562454 list_add_tail(&ctxp->list, &phba->sli4_hba.t_active_ctx_list);
24572455 spin_unlock_irqrestore(&phba->sli4_hba.t_active_list_lock, iflag);
24582456 if (ctxp->state != LPFC_NVME_STE_FREE) {
2459− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2457+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
24602458 "6414 NVMET Context corrupt %d %d oxid x%x\n",
24612459 ctxp->state, ctxp->entry_cnt, ctxp->oxid);
24622460 }
@@ -2498,7 +2496,7 @@ lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba, · 35 unmodified lines
24982496
24992497 if (!queue_work(phba->wq, &ctx_buf->defer_work)) {
25002498 atomic_inc(&tgtp->rcv_fcp_cmd_drop);
2501− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
2499+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
25022500 "6325 Unable to queue work for oxid x%x. "
25032501 "FCP Drop IO [x%x x%x x%x]\n",
25042502 ctxp->oxid,
@@ -2535,7 +2533,7 @@ lpfc_nvmet_unsol_fcp_event(struct lpfc_hba *phba, · 30 unmodified lines
25352533 uint8_t cqflag)
25362534 {
25372535 if (!nvmebuf) {
2538− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2536+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
25392537 "3167 NVMET FCP Drop IO\n");
25402538 return;
25412539 }
@@ -2581,7 +2579,7 @@ lpfc_nvmet_prep_ls_wqe(struct lpfc_hba *phba, · 39 unmodified lines
25812579 union lpfc_wqe128 *wqe;
25822580
25832581 if (!lpfc_is_link_up(phba)) {
2584− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC,
2582+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
25852583 "6104 NVMET prep LS wqe: link err: "
25862584 "NPORT x%x oxid:x%x ste %d\n",
25872585 ctxp->sid, ctxp->oxid, ctxp->state);
@@ -2591,7 +2589,7 @@ lpfc_nvmet_prep_ls_wqe(struct lpfc_hba *phba, · 3 unmodified lines
25912589 /* Allocate buffer for command wqe */
25922590 nvmewqe = lpfc_sli_get_iocbq(phba);
25932591 if (nvmewqe == NULL) {
2594− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC,
2592+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
25952593 "6105 NVMET prep LS wqe: No WQE: "
25962594 "NPORT x%x oxid x%x ste %d\n",
25972595 ctxp->sid, ctxp->oxid, ctxp->state);
@@ -2602,7 +2600,7 @@ lpfc_nvmet_prep_ls_wqe(struct lpfc_hba *phba, · 4 unmodified lines
26022600 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) ||
26032601 ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
26042602 (ndlp->nlp_state != NLP_STE_MAPPED_NODE))) {
2605− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC,
2603+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
26062604 "6106 NVMET prep LS wqe: No ndlp: "
26072605 "NPORT x%x oxid x%x ste %d\n",
26082606 ctxp->sid, ctxp->oxid, ctxp->state);
@@ -2711,7 +2709,7 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba *phba, · 102 unmodified lines
27112709 int xc = 1;
27122710
27132711 if (!lpfc_is_link_up(phba)) {
2714− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2712+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
27152713 "6107 NVMET prep FCP wqe: link err:"
27162714 "NPORT x%x oxid x%x ste %d\n",
27172715 ctxp->sid, ctxp->oxid, ctxp->state);
@@ -2722,7 +2720,7 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba *phba, · 4 unmodified lines
27222720 if (!ndlp || !NLP_CHK_NODE_ACT(ndlp) ||
27232721 ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
27242722 (ndlp->nlp_state != NLP_STE_MAPPED_NODE))) {
2725− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2723+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
27262724 "6108 NVMET prep FCP wqe: no ndlp: "
27272725 "NPORT x%x oxid x%x ste %d\n",
27282726 ctxp->sid, ctxp->oxid, ctxp->state);
@@ -2730,7 +2728,7 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba *phba, · 1 unmodified line
27302728 }
27312729
27322730 if (rsp->sg_cnt > lpfc_tgttemplate.max_sgl_segments) {
2733− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2731+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
27342732 "6109 NVMET prep FCP wqe: seg cnt err: "
27352733 "NPORT x%x oxid x%x ste %d cnt %d\n",
27362734 ctxp->sid, ctxp->oxid, ctxp->state,
@@ -2745,7 +2743,7 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba *phba, · 8 unmodified lines
27452743 /* Allocate buffer for command wqe */
27462744 nvmewqe = ctxp->ctxbuf->iocbq;
27472745 if (nvmewqe == NULL) {
2748− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2746+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
27492747 "6110 NVMET prep FCP wqe: No "
27502748 "WQE: NPORT x%x oxid x%x ste %d\n",
27512749 ctxp->sid, ctxp->oxid, ctxp->state);
@@ -2763,7 +2761,7 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba *phba, · 11 unmodified lines
27632761 (ctxp->state == LPFC_NVME_STE_DATA)) {
27642762 wqe = &nvmewqe->wqe;
27652763 } else {
2766− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
2764+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
27672765 "6111 Wrong state NVMET FCP: %d cnt %d\n",
27682766 ctxp->state, ctxp->entry_cnt);
27692767 return NULL;
@@ -3136,7 +3134,7 @@ lpfc_nvmet_unsol_fcp_abort_cmp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdwqe, · 366 unmodified lines
31363134
31373135 /* Sanity check */
31383136 if (ctxp->state != LPFC_NVME_STE_ABORT) {
3139− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS,
3137+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
31403138 "6112 ABTS Wrong state:%d oxid x%x\n",
31413139 ctxp->state, ctxp->oxid);
31423140 }
@@ -3210,7 +3208,7 @@ lpfc_nvmet_xmt_ls_abort_cmp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdwqe, · 67 unmodified lines
32103208 result, wcqe->word3);
32113209
32123210 if (!ctxp) {
3213− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS,
3211+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
32143212 "6415 NVMET LS Abort No ctx: WCQE: "
32153213 "%08x %08x %08x %08x\n",
32163214 wcqe->word0, wcqe->total_data_placed,
@@ -3221,7 +3219,7 @@ lpfc_nvmet_xmt_ls_abort_cmp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdwqe, · 4 unmodified lines
32213219 }
32223220
32233221 if (ctxp->state != LPFC_NVME_STE_LS_ABORT) {
3224− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
3222+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
32253223 "6416 NVMET LS abort cmpl state mismatch: "
32263224 "oxid x%x: %d %d\n",
32273225 ctxp->oxid, ctxp->state, ctxp->entry_cnt);
@@ -3256,7 +3254,7 @@ lpfc_nvmet_unsol_issue_abort(struct lpfc_hba *phba, · 28 unmodified lines
32563254 (ndlp->nlp_state != NLP_STE_MAPPED_NODE))) {
32573255 if (tgtp)
32583256 atomic_inc(&tgtp->xmt_abort_rsp_error);
3259− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS,
3257+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
32603258 "6134 Drop ABTS - wrong NDLP state x%x.\n",
32613259 (ndlp) ? ndlp->nlp_state : NLP_STE_MAX_STATE);
32623260
@@ -3353,7 +3351,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lpfc_hba *phba, · 90 unmodified lines
33533351 ((ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
33543352 (ndlp->nlp_state != NLP_STE_MAPPED_NODE))) {
33553353 atomic_inc(&tgtp->xmt_abort_rsp_error);
3356− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS,
3354+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
33573355 "6160 Drop ABORT - wrong NDLP state x%x.\n",
33583356 (ndlp) ? ndlp->nlp_state : NLP_STE_MAX_STATE);
33593357
@@ -3369,7 +3367,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lpfc_hba *phba, · 9 unmodified lines
33693367 spin_lock_irqsave(&ctxp->ctxlock, flags);
33703368 if (!ctxp->abort_wqeq) {
33713369 atomic_inc(&tgtp->xmt_abort_rsp_error);
3372− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS,
3370+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
33733371 "6161 ABORT failed: No wqeqs: "
33743372 "xri: x%x\n", ctxp->oxid);
33753373 /* No failure to an ABTS request. */
@@ -3396,7 +3394,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lpfc_hba *phba, · 20 unmodified lines
33963394 if (phba->hba_flag & HBA_IOQ_FLUSH) {
33973395 spin_unlock_irqrestore(&phba->hbalock, flags);
33983396 atomic_inc(&tgtp->xmt_abort_rsp_error);
3399− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
3397+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
34003398 "6163 Driver in reset cleanup - flushing "
34013399 "NVME Req now. hba_flag x%x oxid x%x\n",
34023400 phba->hba_flag, ctxp->oxid);
@@ -3411,7 +3409,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lpfc_hba *phba, · 8 unmodified lines
34113409 if (abts_wqeq->iocb_flag & LPFC_DRIVER_ABORTED) {
34123410 spin_unlock_irqrestore(&phba->hbalock, flags);
34133411 atomic_inc(&tgtp->xmt_abort_rsp_error);
3414− lpfc_printf_log(phba, KERN_ERR, LOG_NVME,
3412+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
34153413 "6164 Outstanding NVME I/O Abort Request "
34163414 "still pending on oxid x%x\n",
34173415 ctxp->oxid);
@@ -3449,7 +3447,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lpfc_hba *phba, · 31 unmodified lines
34493447 ctxp->flag &= ~LPFC_NVME_ABORT_OP;
34503448 spin_unlock_irqrestore(&ctxp->ctxlock, flags);
34513449 lpfc_sli_release_iocbq(phba, abts_wqeq);
3452− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS,
3450+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
34533451 "6166 Failed ABORT issue_wqe with status x%x "
34543452 "for oxid x%x.\n",
34553453 rc, ctxp->oxid);
@@ -3474,7 +3472,7 @@ lpfc_nvmet_unsol_fcp_issue_abort(struct lpfc_hba *phba, · 18 unmodified lines
34743472 }
34753473
34763474 if (ctxp->state == LPFC_NVME_STE_FREE) {
3477− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
3475+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
34783476 "6417 NVMET ABORT ctx freed %d %d oxid x%x\n",
34793477 ctxp->state, ctxp->entry_cnt, ctxp->oxid);
34803478 rc = WQE_BUSY;
@@ -3512,7 +3510,7 @@ aerr: · 31 unmodified lines
35123510 spin_unlock_irqrestore(&ctxp->ctxlock, flags);
35133511
35143512 atomic_inc(&tgtp->xmt_abort_rsp_error);
3515− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS,
3513+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
35163514 "6135 Failed to Issue ABTS for oxid x%x. Status x%x "
35173515 "(%x)\n",
35183516 ctxp->oxid, rc, released);
@@ -3544,7 +3542,7 @@ lpfc_nvme_unsol_ls_issue_abort(struct lpfc_hba *phba, · 25 unmodified lines
35443542 ctxp->state = LPFC_NVME_STE_LS_ABORT;
35453543 ctxp->entry_cnt++;
35463544 } else {
3547− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
3545+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
35483546 "6418 NVMET LS abort state mismatch "
35493547 "IO x%x: %d %d\n",
35503548 ctxp->oxid, ctxp->state, ctxp->entry_cnt);
@@ -3558,7 +3556,7 @@ lpfc_nvme_unsol_ls_issue_abort(struct lpfc_hba *phba, · 7 unmodified lines
35583556 /* Issue ABTS for this WQE based on iotag */
35593557 ctxp->wqeq = lpfc_sli_get_iocbq(phba);
35603558 if (!ctxp->wqeq) {
3561− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS,
3559+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
35623560 "6068 Abort failed: No wqeqs: "
35633561 "xri: x%x\n", xri);
35643562 /* No failure to an ABTS request. */
@@ -3590,7 +3588,7 @@ out: · 25 unmodified lines
35903588 abts_wqeq->context2 = NULL;
35913589 abts_wqeq->context3 = NULL;
35923590 lpfc_sli_release_iocbq(phba, abts_wqeq);
3593− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_ABTS,
3591+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
35943592 "6056 Failed to Issue ABTS. Status x%x\n", rc);
35953593 return 1;
35963594 }
drivers/scsi/lpfc/lpfc_scsi.c+64−61
@@ -867,11 +867,11 @@ lpfc_scsi_prep_dma_buf_s3(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) · 866 unmodified lines
867867
868868 lpfc_cmd->seg_cnt = nseg;
869869 if (lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) {
870− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
871− "9064 BLKGRD: %s: Too many sg segments from "
872− "dma_map_sg. Config %d, seg_cnt %d\n",
873− __func__, phba->cfg_sg_seg_cnt,
874− lpfc_cmd->seg_cnt);
870+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
871+ "9064 BLKGRD: %s: Too many sg segments"
872+ " from dma_map_sg. Config %d, seg_cnt"
873+ " %d\n", __func__, phba->cfg_sg_seg_cnt,
874+ lpfc_cmd->seg_cnt);
875875 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt);
876876 lpfc_cmd->seg_cnt = 0;
877877 scsi_dma_unmap(scsi_cmnd);
@@ -1061,7 +1061,8 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 183 unmodified lines
10611061 * inserted in middle of the IO.
10621062 */
10631063
1064− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1064+ lpfc_printf_log(phba, KERN_ERR,
1065+ LOG_TRACE_EVENT,
10651066 "9076 BLKGRD: Injecting reftag error: "
10661067 "write lba x%lx + x%x oldrefTag x%x\n",
10671068 (unsigned long)lba, blockoff,
@@ -1111,7 +1112,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 43 unmodified lines
11111112 }
11121113 rc = BG_ERR_TGT | BG_ERR_CHECK;
11131114
1114− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1115+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
11151116 "9078 BLKGRD: Injecting reftag error: "
11161117 "write lba x%lx\n", (unsigned long)lba);
11171118 break;
@@ -1132,7 +1133,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 14 unmodified lines
11321133 }
11331134 rc = BG_ERR_INIT;
11341135
1135− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1136+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
11361137 "9077 BLKGRD: Injecting reftag error: "
11371138 "write lba x%lx\n", (unsigned long)lba);
11381139 break;
@@ -1159,7 +1160,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 20 unmodified lines
11591160 }
11601161 rc = BG_ERR_INIT;
11611162
1162− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1163+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
11631164 "9079 BLKGRD: Injecting reftag error: "
11641165 "read lba x%lx\n", (unsigned long)lba);
11651166 break;
@@ -1181,7 +1182,8 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 15 unmodified lines
11811182 * inserted in middle of the IO.
11821183 */
11831184
1184− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1185+ lpfc_printf_log(phba, KERN_ERR,
1186+ LOG_TRACE_EVENT,
11851187 "9080 BLKGRD: Injecting apptag error: "
11861188 "write lba x%lx + x%x oldappTag x%x\n",
11871189 (unsigned long)lba, blockoff,
@@ -1230,7 +1232,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 42 unmodified lines
12301232 }
12311233 rc = BG_ERR_TGT | BG_ERR_CHECK;
12321234
1233− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1235+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
12341236 "0813 BLKGRD: Injecting apptag error: "
12351237 "write lba x%lx\n", (unsigned long)lba);
12361238 break;
@@ -1251,7 +1253,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 14 unmodified lines
12511253 }
12521254 rc = BG_ERR_INIT;
12531255
1254− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1256+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
12551257 "0812 BLKGRD: Injecting apptag error: "
12561258 "write lba x%lx\n", (unsigned long)lba);
12571259 break;
@@ -1278,7 +1280,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 20 unmodified lines
12781280 }
12791281 rc = BG_ERR_INIT;
12801282
1281− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1283+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
12821284 "0814 BLKGRD: Injecting apptag error: "
12831285 "read lba x%lx\n", (unsigned long)lba);
12841286 break;
@@ -1313,7 +1315,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 28 unmodified lines
13131315 rc |= BG_ERR_TGT | BG_ERR_SWAP;
13141316 /* Signals the caller to swap CRC->CSUM */
13151317
1316− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1318+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
13171319 "0817 BLKGRD: Injecting guard error: "
13181320 "write lba x%lx\n", (unsigned long)lba);
13191321 break;
@@ -1335,7 +1337,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 15 unmodified lines
13351337 rc = BG_ERR_INIT | BG_ERR_SWAP;
13361338 /* Signals the caller to swap CRC->CSUM */
13371339
1338− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1340+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
13391341 "0816 BLKGRD: Injecting guard error: "
13401342 "write lba x%lx\n", (unsigned long)lba);
13411343 break;
@@ -1363,7 +1365,7 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 21 unmodified lines
13631365 rc = BG_ERR_INIT | BG_ERR_SWAP;
13641366 /* Signals the caller to swap CRC->CSUM */
13651367
1366− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1368+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
13671369 "0818 BLKGRD: Injecting guard error: "
13681370 "read lba x%lx\n", (unsigned long)lba);
13691371 }
@@ -1413,7 +1415,7 @@ lpfc_sc_to_bg_opcodes(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 43 unmodified lines
14131415
14141416 case SCSI_PROT_NORMAL:
14151417 default:
1416− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1418+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
14171419 "9063 BLKGRD: Bad op/guard:%d/IP combination\n",
14181420 scsi_get_prot_op(sc));
14191421 ret = 1;
@@ -1442,7 +1444,7 @@ lpfc_sc_to_bg_opcodes(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 22 unmodified lines
14421444
14431445 case SCSI_PROT_NORMAL:
14441446 default:
1445− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1447+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
14461448 "9075 BLKGRD: Bad op/guard:%d/CRC combination\n",
14471449 scsi_get_prot_op(sc));
14481450 ret = 1;
@@ -1728,7 +1730,7 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 279 unmodified lines
17281730 sgde = scsi_sglist(sc);
17291731
17301732 if (!sgpe || !sgde) {
1731− lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
1733+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
17321734 "9020 Invalid s/g entry: data=x%px prot=x%px\n",
17331735 sgpe, sgde);
17341736 return 0;
@@ -1840,7 +1842,7 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 105 unmodified lines
18401842 return num_bde + 1;
18411843
18421844 if (!sgde) {
1843− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1845+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
18441846 "9065 BLKGRD:%s Invalid data segment\n",
18451847 __func__);
18461848 return 0;
@@ -1903,8 +1905,8 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 56 unmodified lines
19031905 reftag += protgrp_blks;
19041906 } else {
19051907 /* if we're here, we have a bug */
1906− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
1907− "9054 BLKGRD: bug in %s\n", __func__);
1908+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1909+ "9054 BLKGRD: bug in %s\n", __func__);
19081910 }
19091911
19101912 } while (!alldone);
@@ -2154,7 +2156,7 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 243 unmodified lines
21542156 sgde = scsi_sglist(sc);
21552157
21562158 if (!sgpe || !sgde) {
2157− lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
2159+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
21582160 "9082 Invalid s/g entry: data=x%px prot=x%px\n",
21592161 sgpe, sgde);
21602162 return 0;
@@ -2307,7 +2309,7 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 146 unmodified lines
23072309 return num_sge + 1;
23082310
23092311 if (!sgde) {
2310− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
2312+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
23112313 "9086 BLKGRD:%s Invalid data segment\n",
23122314 __func__);
23132315 return 0;
@@ -2412,8 +2414,8 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, · 98 unmodified lines
24122414 reftag += protgrp_blks;
24132415 } else {
24142416 /* if we're here, we have a bug */
2415− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
2416− "9085 BLKGRD: bug in %s\n", __func__);
2417+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
2418+ "9085 BLKGRD: bug in %s\n", __func__);
24172419 }
24182420
24192421 } while (!alldone);
@@ -2453,7 +2455,7 @@ lpfc_prot_group_type(struct lpfc_hba *phba, struct scsi_cmnd *sc) · 33 unmodified lines
24532455 break;
24542456 default:
24552457 if (phba)
2456− lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
2458+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
24572459 "9021 Unsupported protection op:%d\n",
24582460 op);
24592461 break;
@@ -2617,7 +2619,7 @@ lpfc_bg_scsi_prep_dma_buf_s3(struct lpfc_hba *phba, · 157 unmodified lines
26172619 scsi_dma_unmap(scsi_cmnd);
26182620 lpfc_cmd->seg_cnt = 0;
26192621
2620− lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
2622+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
26212623 "9022 Unexpected protection group %i\n",
26222624 prot_group_type);
26232625 return 2;
@@ -2661,7 +2663,7 @@ err: · 37 unmodified lines
26612663 scsi_prot_sg_count(scsi_cmnd),
26622664 scsi_cmnd->sc_data_direction);
26632665
2664− lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
2666+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
26652667 "9023 Cannot setup S/G List for HBA"
26662668 "IO segs %d/%d BPL %d SCSI %d: %d %d\n",
26672669 lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt,
@@ -3085,11 +3087,12 @@ lpfc_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) · 417 unmodified lines
30853087 lpfc_cmd->seg_cnt = nseg;
30863088 if (!phba->cfg_xpsgl &&
30873089 lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt) {
3088− lpfc_printf_log(phba, KERN_ERR, LOG_BG, "9074 BLKGRD:"
3089− " %s: Too many sg segments from "
3090− "dma_map_sg. Config %d, seg_cnt %d\n",
3091− __func__, phba->cfg_sg_seg_cnt,
3092− lpfc_cmd->seg_cnt);
3090+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
3091+ "9074 BLKGRD:"
3092+ " %s: Too many sg segments from "
3093+ "dma_map_sg. Config %d, seg_cnt %d\n",
3094+ __func__, phba->cfg_sg_seg_cnt,
3095+ lpfc_cmd->seg_cnt);
30933096 WARN_ON_ONCE(lpfc_cmd->seg_cnt > phba->cfg_sg_seg_cnt);
30943097 lpfc_cmd->seg_cnt = 0;
30953098 scsi_dma_unmap(scsi_cmnd);
@@ -3366,7 +3369,7 @@ lpfc_bg_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, · 270 unmodified lines
33663369 scsi_dma_unmap(scsi_cmnd);
33673370 lpfc_cmd->seg_cnt = 0;
33683371
3369− lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
3372+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
33703373 "9083 Unexpected protection group %i\n",
33713374 prot_group_type);
33723375 return 2;
@@ -3422,7 +3425,7 @@ err: · 49 unmodified lines
34223425 scsi_prot_sg_count(scsi_cmnd),
34233426 scsi_cmnd->sc_data_direction);
34243427
3425− lpfc_printf_log(phba, KERN_ERR, LOG_FCP,
3428+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
34263429 "9084 Cannot setup S/G List for HBA"
34273430 "IO segs %d/%d SGL %d SCSI %d: %d %d\n",
34283431 lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt,
@@ -3632,17 +3635,17 @@ lpfc_handle_fcp_err(struct lpfc_vport *vport, struct lpfc_io_buf *lpfc_cmd, · 203 unmodified lines
36323635 if (resp_info & RSP_LEN_VALID) {
36333636 rsplen = be32_to_cpu(fcprsp->rspRspLen);
36343637 if (rsplen != 0 && rsplen != 4 && rsplen != 8) {
3635− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
3636− "2719 Invalid response length: "
3637− "tgt x%x lun x%llx cmnd x%x rsplen x%x\n",
3638− cmnd->device->id,
3639− cmnd->device->lun, cmnd->cmnd[0],
3640− rsplen);
3638+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
3639+ "2719 Invalid response length: "
3640+ "tgt x%x lun x%llx cmnd x%x rsplen "
3641+ "x%x\n", cmnd->device->id,
3642+ cmnd->device->lun, cmnd->cmnd[0],
3643+ rsplen);
36413644 host_status = DID_ERROR;
36423645 goto out;
36433646 }
36443647 if (fcprsp->rspInfo3 != RSP_NO_FAILURE) {
3645− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
3648+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
36463649 "2757 Protocol failure detected during "
36473650 "processing of FCP I/O op: "
36483651 "tgt x%x lun x%llx cmnd x%x rspInfo3 x%x\n",
@@ -3812,7 +3815,7 @@ lpfc_scsi_cmd_iocb_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *pIocbIn, · 163 unmodified lines
38123815 /* Sanity check on return of outstanding command */
38133816 cmd = lpfc_cmd->pCmd;
38143817 if (!cmd || !phba) {
3815− lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
3818+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
38163819 "2621 IO completion: Not an active IO\n");
38173820 spin_unlock(&lpfc_cmd->buf_lock);
38183821 return;
@@ -4277,7 +4280,7 @@ lpfc_scsi_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp) · 458 unmodified lines
42774280 phba->lpfc_get_scsi_buf = lpfc_get_scsi_buf_s4;
42784281 break;
42794282 default:
4280− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
4283+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
42814284 "1418 Invalid HBA PCI-device group: 0x%x\n",
42824285 dev_grp);
42834286 return -ENODEV;
@@ -4324,7 +4327,7 @@ lpfc_tskmgmt_def_cmpl(struct lpfc_hba *phba, · 40 unmodified lines
43244327 * 0, successful
43254328 */
43264329 int
4327−lpfc_check_pci_resettable(const struct lpfc_hba *phba)
4330+lpfc_check_pci_resettable(struct lpfc_hba *phba)
43284331 {
43294332 const struct pci_dev *pdev = phba->pcidev;
43304333 struct pci_dev *ptr = NULL;
@@ -4528,7 +4531,7 @@ lpfc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmnd) · 197 unmodified lines
45284531 if ((scsi_get_prot_op(cmnd) != SCSI_PROT_NORMAL) &&
45294532 (!(phba->sli3_options & LPFC_SLI3_BG_ENABLED))) {
45304533
4531− lpfc_printf_log(phba, KERN_ERR, LOG_BG,
4534+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
45324535 "9058 BLKGRD: ERROR: rcvd protected cmd:%02x"
45334536 " op:%02x str=%s without registering for"
45344537 " BlockGuard - Rejecting command\n",
@@ -4887,7 +4890,7 @@ wait_for_cmpl: · 352 unmodified lines
48874890
48884891 if (lpfc_cmd->pCmd == cmnd) {
48894892 ret = FAILED;
4890− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
4893+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
48914894 "0748 abort handler timed out waiting "
48924895 "for aborting I/O (xri:x%x) to complete: "
48934896 "ret %#x, ID %d, LUN %llu\n",
@@ -5080,7 +5083,7 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct scsi_cmnd *cmnd, · 186 unmodified lines
50805083 (iocbqrsp->iocb.ulpStatus != IOSTAT_SUCCESS)) {
50815084 if (status != IOCB_SUCCESS ||
50825085 iocbqrsp->iocb.ulpStatus != IOSTAT_FCP_RSP_ERROR)
5083− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5086+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
50845087 "0727 TMF %s to TGT %d LUN %llu "
50855088 "failed (%d, %d) iocb_flag x%x\n",
50865089 lpfc_taskmgmt_name(task_mgmt_cmd),
@@ -5195,7 +5198,7 @@ lpfc_reset_flush_io_context(struct lpfc_vport *vport, uint16_t tgt_id, · 108 unmodified lines
51955198 cnt = lpfc_sli_sum_iocb(vport, tgt_id, lun_id, context);
51965199 }
51975200 if (cnt) {
5198− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5201+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
51995202 "0724 I/O flush failure for context %s : cnt x%x\n",
52005203 ((context == LPFC_CTX_LUN) ? "LUN" :
52015204 ((context == LPFC_CTX_TGT) ? "TGT" :
@@ -5231,7 +5234,7 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) · 29 unmodified lines
52315234
52325235 rdata = lpfc_rport_data_from_scsi_device(cmnd->device);
52335236 if (!rdata || !rdata->pnode) {
5234− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5237+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
52355238 "0798 Device Reset rdata failure: rdata x%px\n",
52365239 rdata);
52375240 return FAILED;
@@ -5243,7 +5246,7 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) · 5 unmodified lines
52435246
52445247 status = lpfc_chk_tgt_mapped(vport, cmnd);
52455248 if (status == FAILED) {
5246− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5249+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
52475250 "0721 Device Reset rport failure: rdata x%px\n", rdata);
52485251 return FAILED;
52495252 }
@@ -5260,7 +5263,7 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd) · 10 unmodified lines
52605263 status = lpfc_send_taskmgmt(vport, cmnd, tgt_id, lun_id,
52615264 FCP_LUN_RESET);
52625265
5263− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5266+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
52645267 "0713 SCSI layer issued Device Reset (%d, %llu) "
52655268 "return x%x\n", tgt_id, lun_id, status);
52665269
@@ -5302,7 +5305,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) · 35 unmodified lines
53025305
53035306 rdata = lpfc_rport_data_from_scsi_device(cmnd->device);
53045307 if (!rdata || !rdata->pnode) {
5305− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5308+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
53065309 "0799 Target Reset rdata failure: rdata x%px\n",
53075310 rdata);
53085311 return FAILED;
@@ -5314,7 +5317,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) · 5 unmodified lines
53145317
53155318 status = lpfc_chk_tgt_mapped(vport, cmnd);
53165319 if (status == FAILED) {
5317− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5320+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
53185321 "0722 Target Reset rport failure: rdata x%px\n", rdata);
53195322 if (pnode) {
53205323 spin_lock_irq(shost->host_lock);
@@ -5339,7 +5342,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) · 18 unmodified lines
53395342 status = lpfc_send_taskmgmt(vport, cmnd, tgt_id, lun_id,
53405343 FCP_TARGET_RESET);
53415344
5342− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5345+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
53435346 "0723 SCSI layer issued Target Reset (%d, %llu) "
53445347 "return x%x\n", tgt_id, lun_id, status);
53455348
@@ -5420,7 +5423,7 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd) · 74 unmodified lines
54205423 i, 0, FCP_TARGET_RESET);
54215424
54225425 if (status != SUCCESS) {
5423− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5426+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
54245427 "0700 Bus Reset on target %d failed\n",
54255428 i);
54265429 ret = FAILED;
@@ -5437,7 +5440,7 @@ lpfc_bus_reset_handler(struct scsi_cmnd *cmnd) · 10 unmodified lines
54375440 if (status != SUCCESS)
54385441 ret = FAILED;
54395442
5440− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5443+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
54415444 "0714 SCSI layer issued Bus Reset Data: x%x\n", ret);
54425445 return ret;
54435446 }
@@ -5466,7 +5469,7 @@ lpfc_host_reset_handler(struct scsi_cmnd *cmnd) · 22 unmodified lines
54665469 struct lpfc_hba *phba = vport->phba;
54675470 int rc, ret = SUCCESS;
54685471
5469− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5472+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
54705473 "3172 SCSI layer issued Host Reset Data:\n");
54715474
54725475 lpfc_offline_prep(phba, LPFC_MBX_WAIT);
@@ -5483,7 +5486,7 @@ lpfc_host_reset_handler(struct scsi_cmnd *cmnd) · 10 unmodified lines
54835486
54845487 return ret;
54855488 error:
5486− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5489+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
54875490 "3323 Failed host reset\n");
54885491 lpfc_unblock_mgmt_io(phba);
54895492 return FAILED;
@@ -5594,7 +5597,7 @@ lpfc_slave_alloc(struct scsi_device *sdev) · 104 unmodified lines
55945597 }
55955598 num_allocated = lpfc_new_scsi_buf_s3(vport, num_to_alloc);
55965599 if (num_to_alloc != num_allocated) {
5597− lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP,
5600+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
55985601 "0708 Allocation request of %d "
55995602 "command buffers did not succeed. "
56005603 "Allocated %d buffers.\n",
drivers/scsi/lpfc/lpfc_sli.c+425−258
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 #include <scsi/scsi_transport_fc.h>
3636 #include <scsi/fc/fc_fs.h>
3737 #include <linux/aer.h>
38+#include <linux/crash_dump.h>
3839 #ifdef CONFIG_X86
3940 #include <asm/set_memory.h>
4041 #endif
@@ -242,7 +243,7 @@ lpfc_sli4_wq_release(struct lpfc_queue *q, uint32_t index) · 201 unmodified lines
242243 /**
243244 * lpfc_sli4_mq_put - Put a Mailbox Queue Entry on an Mailbox Queue
244245 * @q: The Mailbox Queue to operate on.
245− * @wqe: The Mailbox Queue Entry to put on the Work queue.
246+ * @mqe: The Mailbox Queue Entry to put on the Work queue.
246247 *
247248 * This routine will copy the contents of @mqe to the next available entry on
248249 * the @q. This function will then ring the Work Queue Doorbell to signal the
@@ -656,10 +657,8 @@ lpfc_sli4_if6_write_cq_db(struct lpfc_hba *phba, struct lpfc_queue *q, · 407 unmodified lines
656657 writel(doorbell.word0, q->phba->sli4_hba.CQDBregaddr);
657658 }
658659
659−/**
660+/*
660661 * lpfc_sli4_rq_put - Put a Receive Buffer Queue Entry on a Receive Queue
661− * @q: The Header Receive Queue to operate on.
662− * @wqe: The Receive Queue Entry to put on the Receive queue.
663662 *
664663 * This routine will copy the contents of @wqe to the next available entry on
665664 * the @q. This function will then ring the Receive Queue Doorbell to signal the
@@ -722,9 +721,8 @@ lpfc_sli4_rq_put(struct lpfc_queue *hq, struct lpfc_queue *dq, · 56 unmodified lines
722721 return hq_put_index;
723722 }
724723
725−/**
724+/*
726725 * lpfc_sli4_rq_release - Updates internal hba index for RQ
727− * @q: The Header Receive Queue to operate on.
728726 *
729727 * This routine will update the HBA index of a queue to reflect consumption of
730728 * one Receive Queue Entry by the HBA. When the HBA indicates that it has
@@ -1008,7 +1006,7 @@ lpfc_cleanup_vports_rrqs(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 277 unmodified lines
10081006 * lpfc_test_rrq_active - Test RRQ bit in xri_bitmap.
10091007 * @phba: Pointer to HBA context object.
10101008 * @ndlp: Targets nodelist pointer for this exchange.
1011− * @xritag the xri in the bitmap to test.
1009+ * @xritag: the xri in the bitmap to test.
10121010 *
10131011 * This function returns:
10141012 * 0 = rrq not active for this xri
@@ -1079,7 +1077,7 @@ lpfc_set_rrq_active(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, · 64 unmodified lines
10791077 goto out;
10801078
10811079 spin_unlock_irqrestore(&phba->hbalock, iflags);
1082− rrq = mempool_alloc(phba->rrq_pool, GFP_KERNEL);
1080+ rrq = mempool_alloc(phba->rrq_pool, GFP_ATOMIC);
10831081 if (!rrq) {
10841082 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
10851083 "3155 Unable to allocate RRQ xri:0x%x rxid:0x%x"
@@ -1118,7 +1116,7 @@ out: · 32 unmodified lines
11181116 /**
11191117 * __lpfc_sli_get_els_sglq - Allocates an iocb object from sgl pool
11201118 * @phba: Pointer to HBA context object.
1121− * @piocb: Pointer to the iocbq.
1119+ * @piocbq: Pointer to the iocbq.
11221120 *
11231121 * The driver calls this function with either the nvme ls ring lock
11241122 * or the fc els ring lock held depending on the iocb usage. This function
@@ -1194,7 +1192,7 @@ __lpfc_sli_get_els_sglq(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq) · 69 unmodified lines
11941192 /**
11951193 * __lpfc_sli_get_nvmet_sglq - Allocates an iocb object from sgl pool
11961194 * @phba: Pointer to HBA context object.
1197− * @piocb: Pointer to the iocbq.
1195+ * @piocbq: Pointer to the iocbq.
11981196 *
11991197 * This function is called with the sgl_list lock held. This function
12001198 * gets a new driver sglq object from the sglq list. If the
@@ -1491,6 +1489,7 @@ lpfc_sli_iocb_cmd_type(uint8_t iocb_cmnd) · 290 unmodified lines
14911489 case DSSCMD_IWRITE64_CX:
14921490 case DSSCMD_IREAD64_CR:
14931491 case DSSCMD_IREAD64_CX:
1492+ case CMD_SEND_FRAME:
14941493 type = LPFC_SOL_IOCB;
14951494 break;
14961495 case CMD_ABORT_XRI_CN:
@@ -1565,7 +1564,7 @@ lpfc_sli_ring_map(struct lpfc_hba *phba) · 68 unmodified lines
15651564 lpfc_config_ring(phba, i, pmb);
15661565 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_POLL);
15671566 if (rc != MBX_SUCCESS) {
1568− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
1567+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
15691568 "0446 Adapter failed to init (%d), "
15701569 "mbxCmd x%x CFG_RING, mbxStatus x%x, "
15711570 "ring %d\n",
@@ -1674,7 +1673,7 @@ lpfc_sli_next_iocb_slot (struct lpfc_hba *phba, struct lpfc_sli_ring *pring) · 102 unmodified lines
16741673 pring->sli.sli3.local_getidx = le32_to_cpu(pgp->cmdGetInx);
16751674
16761675 if (unlikely(pring->sli.sli3.local_getidx >= max_cmd_idx)) {
1677− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1676+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
16781677 "0315 Ring %d issue: portCmdGet %d "
16791678 "is bigger than cmd ring %d\n",
16801679 pring->ringno,
@@ -1960,8 +1959,7 @@ lpfc_sli_next_hbq_slot(struct lpfc_hba *phba, uint32_t hbqno) · 279 unmodified lines
19601959 hbqp->local_hbqGetIdx = getidx;
19611960
19621961 if (unlikely(hbqp->local_hbqGetIdx >= hbqp->entry_count)) {
1963− lpfc_printf_log(phba, KERN_ERR,
1964− LOG_SLI | LOG_VPORT,
1962+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
19651963 "1802 HBQ %d: local_hbqGetIdx "
19661964 "%u is > than hbqp->entry_count %u\n",
19671965 hbqno, hbqp->local_hbqGetIdx,
@@ -2229,10 +2227,8 @@ lpfc_sli_hbqbuf_init_hbqs(struct lpfc_hba *phba, uint32_t qno) · 261 unmodified lines
22292227 lpfc_hbq_defs[qno]->init_count);
22302228 }
22312229
2232−/**
2230+/*
22332231 * lpfc_sli_hbqbuf_get - Remove the first hbq off of an hbq list
2234− * @phba: Pointer to HBA context object.
2235− * @hbqno: HBQ number.
22362232 *
22372233 * This function removes the first hbq buffer on an hbq list and returns a
22382234 * pointer to that buffer. If it finds no buffers on the list it returns NULL.
@@ -2251,7 +2247,7 @@ lpfc_sli_hbqbuf_get(struct list_head *rb_list) · 12 unmodified lines
22512247 /**
22522248 * lpfc_sli_rqbuf_get - Remove the first dma buffer off of an RQ list
22532249 * @phba: Pointer to HBA context object.
2254− * @hbqno: HBQ number.
2250+ * @hrq: HBQ number.
22552251 *
22562252 * This function removes the first RQ buffer on an RQ buffer list and returns a
22572253 * pointer to that buffer. If it finds no buffers on the list it returns NULL.
@@ -2300,7 +2296,7 @@ lpfc_sli_hbqbuf_find(struct lpfc_hba *phba, uint32_t tag) · 42 unmodified lines
23002296 }
23012297 }
23022298 spin_unlock_irq(&phba->hbalock);
2303− lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_VPORT,
2299+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
23042300 "1803 Bad hbq tag. Data: x%x x%x\n",
23052301 tag, phba->hbqs[tag >> 16].buffer_count);
23062302 return NULL;
@@ -2554,7 +2550,7 @@ lpfc_sli_def_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 247 unmodified lines
25542550 /* Check security permission status on INIT_LINK mailbox command */
25552551 if ((pmb->u.mb.mbxCommand == MBX_INIT_LINK) &&
25562552 (pmb->u.mb.mbxStatus == MBXERR_SEC_NO_PERMISSION))
2557− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
2553+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
25582554 "2860 SLI authentication is required "
25592555 "for INIT_LINK but has not done yet\n");
25602556
@@ -2690,7 +2686,7 @@ lpfc_sli_handle_mb_event(struct lpfc_hba *phba) · 129 unmodified lines
26902686 if (lpfc_sli_chk_mbx_command(pmbox->mbxCommand) ==
26912687 MBX_SHUTDOWN) {
26922688 /* Unknown mailbox command compl */
2693− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
2689+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
26942690 "(%d):0323 Unknown Mailbox command "
26952691 "x%x (x%x/x%x) Cmpl\n",
26962692 pmb->vport ? pmb->vport->vpi :
@@ -2848,7 +2844,7 @@ lpfc_nvme_unsol_ls_handler(struct lpfc_hba *phba, struct lpfc_iocbq *piocb) · 151 unmodified lines
28482844 }
28492845
28502846 if (unlikely(failwhy)) {
2851− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC | LOG_NVME_IOERR,
2847+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
28522848 "6154 Drop NVME LS: SID %06X OXID x%X: %s\n",
28532849 sid, oxid, failwhy);
28542850 goto out_fail;
@@ -2888,7 +2884,7 @@ lpfc_nvme_unsol_ls_handler(struct lpfc_hba *phba, struct lpfc_iocbq *piocb) · 33 unmodified lines
28882884 if (!ret)
28892885 return;
28902886
2891− lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC | LOG_NVME_IOERR,
2887+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
28922888 "6155 Drop NVME LS from DID %06X: SID %06X OXID x%X "
28932889 "NVMe%s handler failed %d\n",
28942890 did, sid, oxid,
@@ -3171,7 +3167,7 @@ lpfc_sli_iocbq_lookup(struct lpfc_hba *phba, · 276 unmodified lines
31713167 }
31723168
31733169 spin_unlock_irqrestore(temp_lock, iflag);
3174− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3170+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
31753171 "0317 iotag x%x is out of "
31763172 "range: max iotag x%x wd0 x%x\n",
31773173 iotag, phba->sli.last_iotag,
@@ -3218,7 +3214,7 @@ lpfc_sli_iocbq_lookup_by_tag(struct lpfc_hba *phba, · 40 unmodified lines
32183214 }
32193215
32203216 spin_unlock_irqrestore(temp_lock, iflag);
3221− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3217+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
32223218 "0372 iotag x%x lookup error: max iotag (x%x) "
32233219 "iocb_flag x%x\n",
32243220 iotag, phba->sli.last_iotag,
@@ -3394,7 +3390,7 @@ lpfc_sli_rsp_pointers_error(struct lpfc_hba *phba, struct lpfc_sli_ring *pring) · 169 unmodified lines
33943390 * Ring <ringno> handler: portRspPut <portRspPut> is bigger than
33953391 * rsp ring <portRspMax>
33963392 */
3397− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3393+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
33983394 "0312 Ring %d handler: portRspPut %d "
33993395 "is bigger than rsp ring %d\n",
34003396 pring->ringno, le32_to_cpu(pgp->rspPutInx),
@@ -3416,7 +3412,7 @@ lpfc_sli_rsp_pointers_error(struct lpfc_hba *phba, struct lpfc_sli_ring *pring) · 15 unmodified lines
34163412
34173413 /**
34183414 * lpfc_poll_eratt - Error attention polling timer timeout handler
3419− * @ptr: Pointer to address of HBA context object.
3415+ * @t: Context to fetch pointer to address of HBA context object from.
34203416 *
34213417 * This function is invoked by the Error Attention polling timer when the
34223418 * timer times out. It will check the SLI Error Attention register for
@@ -3613,7 +3609,7 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba *phba, · 190 unmodified lines
36133609 phba->brd_no, adaptermsg);
36143610 } else {
36153611 /* Unknown IOCB command */
3616− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3612+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
36173613 "0334 Unknown IOCB command "
36183614 "Data: x%x, x%x x%x x%x x%x\n",
36193615 type, irsp->ulpCommand,
@@ -3811,7 +3807,7 @@ lpfc_sli_sp_handle_rspiocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, · 191 unmodified lines
38113807 phba->brd_no, adaptermsg);
38123808 } else {
38133809 /* Unknown IOCB command */
3814− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3810+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
38153811 "0335 Unknown IOCB "
38163812 "command Data: x%x "
38173813 "x%x x%x x%x\n",
@@ -3891,7 +3887,7 @@ lpfc_sli_handle_slow_ring_event_s3(struct lpfc_hba *phba, · 73 unmodified lines
38913887 * Ring <ringno> handler: portRspPut <portRspPut> is bigger than
38923888 * rsp ring <portRspMax>
38933889 */
3894− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3890+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
38953891 "0303 Ring %d handler: portRspPut %d "
38963892 "is bigger than rsp ring %d\n",
38973893 pring->ringno, portRspPut, portRspMax);
@@ -4102,7 +4098,6 @@ lpfc_sli_abort_iocb_ring(struct lpfc_hba *phba, struct lpfc_sli_ring *pring) · 204 unmodified lines
41024098 /**
41034099 * lpfc_sli_abort_fcp_rings - Abort all iocbs in all FCP rings
41044100 * @phba: Pointer to HBA context object.
4105− * @pring: Pointer to driver SLI ring object.
41064101 *
41074102 * This function aborts all iocbs in FCP rings and frees all the iocb
41084103 * objects in txq. This function issues an abort iocb for all the iocb commands
@@ -4263,7 +4258,7 @@ lpfc_sli_brdready_s3(struct lpfc_hba *phba, uint32_t mask) · 154 unmodified lines
42634258
42644259 /* Check to see if any errors occurred during init */
42654260 if ((status & HS_FFERM) || (i >= 20)) {
4266− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
4261+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
42674262 "2751 Adapter failed to restart, "
42684263 "status reg x%x, FW Data: A8 x%x AC x%x\n",
42694264 status,
@@ -4485,7 +4480,7 @@ lpfc_sli_brdkill(struct lpfc_hba *phba) · 215 unmodified lines
44854480 if (retval != MBX_SUCCESS) {
44864481 if (retval != MBX_BUSY)
44874482 mempool_free(pmb, phba->mbox_mem_pool);
4488− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
4483+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
44894484 "2752 KILL_BOARD command failed retval %d\n",
44904485 retval);
44914486 spin_lock_irq(&phba->hbalock);
@@ -4837,7 +4832,7 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba) · 345 unmodified lines
48374832 if (i++ >= 200) {
48384833 /* Adapter failed to init, timeout, status reg
48394834 <status> */
4840− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
4835+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
48414836 "0436 Adapter failed to init, "
48424837 "timeout, status reg x%x, "
48434838 "FW Data: A8 x%x AC x%x\n", status,
@@ -4852,7 +4847,7 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba) · 8 unmodified lines
48524847 /* ERROR: During chipset initialization */
48534848 /* Adapter failed to init, chipset, status reg
48544849 <status> */
4855− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
4850+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
48564851 "0437 Adapter failed to init, "
48574852 "chipset, status reg x%x, "
48584853 "FW Data: A8 x%x AC x%x\n", status,
@@ -4883,7 +4878,7 @@ lpfc_sli_chipset_init(struct lpfc_hba *phba) · 24 unmodified lines
48834878 if (status & HS_FFERM) {
48844879 /* ERROR: During chipset initialization */
48854880 /* Adapter failed to init, chipset, status reg <status> */
4886− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
4881+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
48874882 "0438 Adapter failed to init, chipset, "
48884883 "status reg x%x, "
48894884 "FW Data: A8 x%x AC x%x\n", status,
@@ -5106,7 +5101,7 @@ lpfc_sli_config_port(struct lpfc_hba *phba, int sli_mode) · 216 unmodified lines
51065101 LPFC_SLI3_CRP_ENABLED |
51075102 LPFC_SLI3_DSS_ENABLED);
51085103 if (rc != MBX_SUCCESS) {
5109− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
5104+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
51105105 "0442 Adapter failed to init, mbxCmd x%x "
51115106 "CONFIG_PORT, mbxStatus x%x Data: x%x\n",
51125107 pmb->u.mb.mbxCommand, pmb->u.mb.mbxStatus, 0);
@@ -5156,7 +5151,7 @@ lpfc_sli_config_port(struct lpfc_hba *phba, int sli_mode) · 43 unmodified lines
51565151 if (pmb->u.mb.un.varCfgPort.gbg == 0) {
51575152 phba->cfg_enable_bg = 0;
51585153 phba->sli3_options &= ~LPFC_SLI3_BG_ENABLED;
5159− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
5154+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
51605155 "0443 Adapter did not grant "
51615156 "BlockGuard\n");
51625157 }
@@ -5195,7 +5190,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) · 32 unmodified lines
51955190 switch (phba->cfg_sli_mode) {
51965191 case 2:
51975192 if (phba->cfg_enable_npiv) {
5198− lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT,
5193+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
51995194 "1824 NPIV enabled: Override sli_mode "
52005195 "parameter (%d) to auto (0).\n",
52015196 phba->cfg_sli_mode);
@@ -5207,7 +5202,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) · 5 unmodified lines
52075202 case 3:
52085203 break;
52095204 default:
5210− lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT,
5205+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
52115206 "1819 Unrecognized sli_mode parameter: %d.\n",
52125207 phba->cfg_sli_mode);
52135208
@@ -5218,7 +5213,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) · 4 unmodified lines
52185213 rc = lpfc_sli_config_port(phba, mode);
52195214
52205215 if (rc && phba->cfg_sli_mode == 3)
5221− lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_VPORT,
5216+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
52225217 "1820 Unable to select SLI-3. "
52235218 "Not supported by adapter.\n");
52245219 if (rc && mode != 2)
@@ -5312,7 +5307,7 @@ lpfc_sli_hba_setup(struct lpfc_hba *phba) · 87 unmodified lines
53125307
53135308 lpfc_sli_hba_setup_error:
53145309 phba->link_state = LPFC_HBA_ERROR;
5315− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
5310+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
53165311 "0445 Firmware initialization failed\n");
53175312 return rc;
53185313 }
@@ -5320,7 +5315,7 @@ lpfc_sli_hba_setup_error: · 1 unmodified line
53205315 /**
53215316 * lpfc_sli4_read_fcoe_params - Read fcoe params from conf region
53225317 * @phba: Pointer to HBA context object.
5323− * @mboxq: mailbox pointer.
5318+ *
53245319 * This function issue a dump mailbox command to read config region
53255320 * 23 and parse the records in the region and populate driver
53265321 * data structure.
@@ -5509,7 +5504,7 @@ lpfc_sli4_get_ctl_attr(struct lpfc_hba *phba) · 182 unmodified lines
55095504 LPFC_SLI4_MBX_NEMBED);
55105505
55115506 if (alloclen < reqlen) {
5512− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
5507+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
55135508 "3084 Allocated DMA memory size (%d) is "
55145509 "less than the requested DMA memory size "
55155510 "(%d)\n", alloclen, reqlen);
@@ -5769,7 +5764,7 @@ lpfc_sli4_get_avail_extnt_rsrc(struct lpfc_hba *phba, uint16_t type, · 253 unmodified lines
57695764 rsrc_info = &mbox->u.mqe.un.rsrc_extent_info;
57705765 if (bf_get(lpfc_mbox_hdr_status,
57715766 &rsrc_info->header.cfg_shdr.response)) {
5772− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_INIT,
5767+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
57735768 "2930 Failed to get resource extents "
57745769 "Status 0x%x Add'l Status 0x%x\n",
57755770 bf_get(lpfc_mbox_hdr_status,
@@ -5858,10 +5853,10 @@ lpfc_sli4_chk_avail_extnt_rsrc(struct lpfc_hba *phba, uint16_t type) · 82 unmodified lines
58585853 /**
58595854 * lpfc_sli4_cfg_post_extnts -
58605855 * @phba: Pointer to HBA context object.
5861− * @extnt_cnt - number of available extents.
5862− * @type - the extent type (rpi, xri, vfi, vpi).
5863− * @emb - buffer to hold either MBX_EMBED or MBX_NEMBED operation.
5864− * @mbox - pointer to the caller's allocated mailbox structure.
5856+ * @extnt_cnt: number of available extents.
5857+ * @type: the extent type (rpi, xri, vfi, vpi).
5858+ * @emb: buffer to hold either MBX_EMBED or MBX_NEMBED operation.
5859+ * @mbox: pointer to the caller's allocated mailbox structure.
58655860 *
58665861 * This function executes the extents allocation request. It also
58675862 * takes care of the amount of memory needed to allocate or get the
@@ -5907,7 +5902,7 @@ lpfc_sli4_cfg_post_extnts(struct lpfc_hba *phba, uint16_t extnt_cnt, · 39 unmodified lines
59075902 LPFC_MBOX_OPCODE_ALLOC_RSRC_EXTENT,
59085903 req_len, *emb);
59095904 if (alloc_len < req_len) {
5910− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
5905+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
59115906 "2982 Allocated DMA memory size (x%x) is "
59125907 "less than the requested DMA memory "
59135908 "size (x%x)\n", alloc_len, req_len);
@@ -5963,7 +5958,7 @@ lpfc_sli4_alloc_extent(struct lpfc_hba *phba, uint16_t type) · 49 unmodified lines
59635958 return -EIO;
59645959
59655960 if ((rsrc_cnt == 0) || (rsrc_size == 0)) {
5966− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_INIT,
5961+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
59675962 "3009 No available Resource Extents "
59685963 "for resource type 0x%x: Count: 0x%x, "
59695964 "Size 0x%x\n", type, rsrc_cnt,
@@ -6214,7 +6209,7 @@ lpfc_sli4_dealloc_extent(struct lpfc_hba *phba, uint16_t type) · 244 unmodified lines
62146209 dealloc_rsrc = &mbox->u.mqe.un.dealloc_rsrc_extents;
62156210 if (bf_get(lpfc_mbox_hdr_status,
62166211 &dealloc_rsrc->header.cfg_shdr.response)) {
6217− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_INIT,
6212+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
62186213 "2919 Failed to release resource extents "
62196214 "for type %d - Status 0x%x Add'l Status 0x%x. "
62206215 "Resource memory not released.\n",
@@ -6408,7 +6403,7 @@ lpfc_sli4_ras_dma_alloc(struct lpfc_hba *phba, · 187 unmodified lines
64086403 &ras_fwlog->lwpd.phys,
64096404 GFP_KERNEL);
64106405 if (!ras_fwlog->lwpd.virt) {
6411− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6406+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
64126407 "6185 LWPD Memory Alloc Failed\n");
64136408
64146409 return -ENOMEM;
@@ -6449,7 +6444,7 @@ free_mem: · 34 unmodified lines
64496444 /**
64506445 * lpfc_sli4_ras_mbox_cmpl: Completion handler for RAS MBX command
64516446 * @phba: pointer to lpfc hba data structure.
6452− * @pmboxq: pointer to the driver internal queue element for mailbox command.
6447+ * @pmb: pointer to the driver internal queue element for mailbox command.
64536448 *
64546449 * Completion handler for driver's RAS MBX command to the device.
64556450 **/
@@ -6469,7 +6464,7 @@ lpfc_sli4_ras_mbox_cmpl(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 13 unmodified lines
64696464 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
64706465
64716466 if (mb->mbxStatus != MBX_SUCCESS || shdr_status) {
6472− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
6467+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
64736468 "6188 FW LOG mailbox "
64746469 "completed with status x%x add_status x%x,"
64756470 " mbx status x%x\n",
@@ -6537,7 +6532,7 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba *phba, · 61 unmodified lines
65376532 /* Setup Mailbox command */
65386533 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
65396534 if (!mbox) {
6540− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6535+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
65416536 "6190 RAS MBX Alloc Failed");
65426537 rc = -ENOMEM;
65436538 goto mem_free;
@@ -6585,7 +6580,7 @@ lpfc_sli4_ras_fwlog_init(struct lpfc_hba *phba, · 41 unmodified lines
65856580 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
65866581
65876582 if (rc == MBX_NOT_FINISHED) {
6588− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6583+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
65896584 "6191 FW-Log Mailbox failed. "
65906585 "status %d mbxStatus : x%x", rc,
65916586 bf_get(lpfc_mqe_status, &mbox->u.mqe));
@@ -6721,7 +6716,7 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba) · 129 unmodified lines
67216716 /* RPIs. */
67226717 count = phba->sli4_hba.max_cfg_param.max_rpi;
67236718 if (count <= 0) {
6724− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
6719+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
67256720 "3279 Invalid provisioning of "
67266721 "rpi:%d\n", count);
67276722 rc = -EINVAL;
@@ -6749,7 +6744,7 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba) · 21 unmodified lines
67496744 /* VPIs. */
67506745 count = phba->sli4_hba.max_cfg_param.max_vpi;
67516746 if (count <= 0) {
6752− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
6747+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
67536748 "3280 Invalid provisioning of "
67546749 "vpi:%d\n", count);
67556750 rc = -EINVAL;
@@ -6776,7 +6771,7 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba) · 20 unmodified lines
67766771 /* XRIs. */
67776772 count = phba->sli4_hba.max_cfg_param.max_xri;
67786773 if (count <= 0) {
6779− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
6774+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
67806775 "3281 Invalid provisioning of "
67816776 "xri:%d\n", count);
67826777 rc = -EINVAL;
@@ -6805,7 +6800,7 @@ lpfc_sli4_alloc_resource_identifiers(struct lpfc_hba *phba) · 22 unmodified lines
68056800 /* VFIs. */
68066801 count = phba->sli4_hba.max_cfg_param.max_vfi;
68076802 if (count <= 0) {
6808− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
6803+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
68096804 "3282 Invalid provisioning of "
68106805 "vfi:%d\n", count);
68116806 rc = -EINVAL;
@@ -6899,7 +6894,7 @@ lpfc_sli4_dealloc_resource_identifiers(struct lpfc_hba *phba) · 87 unmodified lines
68996894 * lpfc_sli4_get_allocated_extnts - Get the port's allocated extents.
69006895 * @phba: Pointer to HBA context object.
69016896 * @type: The resource extent type.
6902− * @extnt_count: buffer to hold port extent count response
6897+ * @extnt_cnt: buffer to hold port extent count response
69036898 * @extnt_size: buffer to hold port extent size response.
69046899 *
69056900 * This function calls the port to read the host allocated extents
@@ -6983,7 +6978,7 @@ lpfc_sli4_get_allocated_extnts(struct lpfc_hba *phba, uint16_t type, · 77 unmodified lines
69836978 LPFC_MBOX_OPCODE_GET_ALLOC_RSRC_EXTENT,
69846979 req_len, emb);
69856980 if (alloc_len < req_len) {
6986− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
6981+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
69876982 "2983 Allocated DMA memory size (x%x) is "
69886983 "less than the requested DMA memory "
69896984 "size (x%x)\n", alloc_len, req_len);
@@ -7026,7 +7021,7 @@ lpfc_sli4_get_allocated_extnts(struct lpfc_hba *phba, uint16_t type, · 36 unmodified lines
70267021 }
70277022
70287023 if (bf_get(lpfc_mbox_hdr_status, &shdr->response)) {
7029− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_INIT,
7024+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
70307025 "2984 Failed to read allocated resources "
70317026 "for type %d - Status 0x%x Add'l Status 0x%x.\n",
70327027 type,
@@ -7043,7 +7038,6 @@ lpfc_sli4_get_allocated_extnts(struct lpfc_hba *phba, uint16_t type, · 10 unmodified lines
70437038 /**
70447039 * lpfc_sli4_repost_sgl_list - Repost the buffers sgl pages as block
70457040 * @phba: pointer to lpfc hba data structure.
7046− * @pring: Pointer to driver SLI ring object.
70477041 * @sgl_list: linked link of sgl buffers to post
70487042 * @cnt: number of linked list buffers
70497043 *
@@ -7181,7 +7175,7 @@ lpfc_sli4_repost_sgl_list(struct lpfc_hba *phba, · 131 unmodified lines
71817175 spin_unlock(&phba->sli4_hba.sgl_list_lock);
71827176 spin_unlock_irq(&phba->hbalock);
71837177 } else {
7184− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
7178+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
71857179 "3161 Failure to post sgl to port.\n");
71867180 return -EIO;
71877181 }
@@ -7278,7 +7272,7 @@ lpfc_post_rq_buffer(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 90 unmodified lines
72787272 drqe.address_hi = putPaddrHigh(rqb_buffer->dbuf.phys);
72797273 rc = lpfc_sli4_rq_put(hrq, drq, &hrqe, &drqe);
72807274 if (rc < 0) {
7281− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7275+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
72827276 "6421 Cannot post to HRQ %d: %x %x %x "
72837277 "DRQ %x %x\n",
72847278 hrq->queue_id,
@@ -7298,6 +7292,68 @@ lpfc_post_rq_buffer(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 13 unmodified lines
72987292 return 1;
72997293 }
73007294
7295+/**
7296+ * lpfc_init_idle_stat_hb - Initialize idle_stat tracking
7297+ * @phba: pointer to lpfc hba data structure.
7298+ *
7299+ * This routine initializes the per-cq idle_stat to dynamically dictate
7300+ * polling decisions.
7301+ *
7302+ * Return codes:
7303+ * None
7304+ **/
7305+static void lpfc_init_idle_stat_hb(struct lpfc_hba *phba)
7306+{
7307+ int i;
7308+ struct lpfc_sli4_hdw_queue *hdwq;
7309+ struct lpfc_queue *cq;
7310+ struct lpfc_idle_stat *idle_stat;
7311+ u64 wall;
7312+
7313+ for_each_present_cpu(i) {
7314+ hdwq = &phba->sli4_hba.hdwq[phba->sli4_hba.cpu_map[i].hdwq];
7315+ cq = hdwq->io_cq;
7316+
7317+ /* Skip if we've already handled this cq's primary CPU */
7318+ if (cq->chann != i)
7319+ continue;
7320+
7321+ idle_stat = &phba->sli4_hba.idle_stat[i];
7322+
7323+ idle_stat->prev_idle = get_cpu_idle_time(i, &wall, 1);
7324+ idle_stat->prev_wall = wall;
7325+
7326+ if (phba->nvmet_support)
7327+ cq->poll_mode = LPFC_QUEUE_WORK;
7328+ else
7329+ cq->poll_mode = LPFC_IRQ_POLL;
7330+ }
7331+
7332+ if (!phba->nvmet_support)
7333+ schedule_delayed_work(&phba->idle_stat_delay_work,
7334+ msecs_to_jiffies(LPFC_IDLE_STAT_DELAY));
7335+}
7336+
7337+static void lpfc_sli4_dip(struct lpfc_hba *phba)
7338+{
7339+ uint32_t if_type;
7340+
7341+ if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf);
7342+ if (if_type == LPFC_SLI_INTF_IF_TYPE_2 ||
7343+ if_type == LPFC_SLI_INTF_IF_TYPE_6) {
7344+ struct lpfc_register reg_data;
7345+
7346+ if (lpfc_readl(phba->sli4_hba.u.if_type2.STATUSregaddr,
7347+ &reg_data.word0))
7348+ return;
7349+
7350+ if (bf_get(lpfc_sliport_status_dip, &reg_data))
7351+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
7352+ "2904 Firmware Dump Image Present"
7353+ " on Adapter");
7354+ }
7355+}
7356+
73017357 /**
73027358 * lpfc_sli4_hba_setup - SLI4 device initialization PCI function
73037359 * @phba: Pointer to HBA context object.
@@ -7336,6 +7392,8 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 32 unmodified lines
73367392 spin_unlock_irq(&phba->hbalock);
73377393 }
73387394
7395+ lpfc_sli4_dip(phba);
7396+
73397397 /*
73407398 * Allocate a single mailbox container for initializing the
73417399 * port.
@@ -7376,7 +7434,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 34 unmodified lines
73767434 phba->hba_flag &= ~HBA_IOQ_FLUSH;
73777435
73787436 if (phba->sli_rev != LPFC_SLI_REV4) {
7379− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7437+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
73807438 "0376 READ_REV Error. SLI Level %d "
73817439 "FCoE enabled %d\n",
73827440 phba->sli_rev, phba->hba_flag & HBA_FCOE_MODE);
@@ -7418,7 +7476,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 35 unmodified lines
74187476 */
74197477 rc = lpfc_parse_vpd(phba, vpd, vpd_size);
74207478 if (unlikely(!rc)) {
7421− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7479+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
74227480 "0377 Error %d parsing vpd. "
74237481 "Using defaults.\n", rc);
74247482 rc = 0;
@@ -7557,7 +7615,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 132 unmodified lines
75577615 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
75587616 dd = bf_get(lpfc_mbx_set_feature_dd, &mboxq->u.mqe.un.set_feature);
75597617 if ((rc == MBX_SUCCESS) && (dd == LPFC_ENABLE_DUAL_DUMP))
7560− lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_INIT,
7618+ lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
75617619 "6448 Dual Dump is enabled\n");
75627620 else
75637621 lpfc_printf_log(phba, KERN_INFO, LOG_SLI | LOG_INIT,
@@ -7575,7 +7633,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 11 unmodified lines
75757633 */
75767634 rc = lpfc_sli4_alloc_resource_identifiers(phba);
75777635 if (rc) {
7578− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7636+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
75797637 "2920 Failed to alloc Resource IDs "
75807638 "rc = x%x\n", rc);
75817639 goto out_free_mbox;
@@ -7614,7 +7672,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 32 unmodified lines
76147672 kfree(mp);
76157673 mboxq->ctx_buf = NULL;
76167674 if (unlikely(rc)) {
7617− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7675+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
76187676 "0382 READ_SPARAM command failed "
76197677 "status %d, mbxStatus x%x\n",
76207678 rc, bf_get(lpfc_mqe_status, mqe));
@@ -7632,7 +7690,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 11 unmodified lines
76327690 /* Create all the SLI4 queues */
76337691 rc = lpfc_sli4_queue_create(phba);
76347692 if (rc) {
7635− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7693+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
76367694 "3089 Failed to allocate queues\n");
76377695 rc = -ENODEV;
76387696 goto out_free_mbox;
@@ -7640,7 +7698,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 1 unmodified line
76407698 /* Set up all the queues to the device */
76417699 rc = lpfc_sli4_queue_setup(phba);
76427700 if (unlikely(rc)) {
7643− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7701+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
76447702 "0381 Error %d during queue setup.\n ", rc);
76457703 goto out_stop_timers;
76467704 }
@@ -7651,7 +7709,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 4 unmodified lines
76517709 /* update host els xri-sgl sizes and mappings */
76527710 rc = lpfc_sli4_els_sgl_update(phba);
76537711 if (unlikely(rc)) {
7654− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7712+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
76557713 "1400 Failed to update xri-sgl size and "
76567714 "mapping: %d\n", rc);
76577715 goto out_destroy_queue;
@@ -7661,7 +7719,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 3 unmodified lines
76617719 rc = lpfc_sli4_repost_sgl_list(phba, &phba->sli4_hba.lpfc_els_sgl_list,
76627720 phba->sli4_hba.els_xri_cnt);
76637721 if (unlikely(rc < 0)) {
7664− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7722+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
76657723 "0582 Error %d during els sgl post "
76667724 "operation\n", rc);
76677725 rc = -ENODEV;
@@ -7673,7 +7731,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 5 unmodified lines
76737731 /* update host nvmet xri-sgl sizes and mappings */
76747732 rc = lpfc_sli4_nvmet_sgl_update(phba);
76757733 if (unlikely(rc)) {
7676− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7734+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
76777735 "6308 Failed to update nvmet-sgl size "
76787736 "and mapping: %d\n", rc);
76797737 goto out_destroy_queue;
@@ -7685,7 +7743,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 5 unmodified lines
76857743 &phba->sli4_hba.lpfc_nvmet_sgl_list,
76867744 phba->sli4_hba.nvmet_xri_cnt);
76877745 if (unlikely(rc < 0)) {
7688− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7746+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
76897747 "3117 Error %d during nvmet "
76907748 "sgl post\n", rc);
76917749 rc = -ENODEV;
@@ -7702,7 +7760,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 10 unmodified lines
77027760 /* update host common xri-sgl sizes and mappings */
77037761 rc = lpfc_sli4_io_sgl_update(phba);
77047762 if (unlikely(rc)) {
7705− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7763+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
77067764 "6082 Failed to update nvme-sgl size "
77077765 "and mapping: %d\n", rc);
77087766 goto out_destroy_queue;
@@ -7711,7 +7769,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 2 unmodified lines
77117769 /* register the allocated common sgl pool to the port */
77127770 rc = lpfc_sli4_repost_io_sgl_list(phba);
77137771 if (unlikely(rc)) {
7714− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7772+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
77157773 "6116 Error %d during nvme sgl post "
77167774 "operation\n", rc);
77177775 /* Some NVME buffers were moved to abort nvme list */
@@ -7732,7 +7790,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 14 unmodified lines
77327790 cnt);
77337791 rc = lpfc_init_iocb_list(phba, cnt);
77347792 if (rc) {
7735− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
7793+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
77367794 "1413 Failed to init iocb list.\n");
77377795 goto out_destroy_queue;
77387796 }
@@ -7761,7 +7819,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 22 unmodified lines
77617819 /* Post the rpi header region to the device. */
77627820 rc = lpfc_sli4_post_all_rpi_hdrs(phba);
77637821 if (unlikely(rc)) {
7764− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
7822+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
77657823 "0393 Error %d during rpi post operation\n",
77667824 rc);
77677825 rc = -ENODEV;
@@ -7853,6 +7911,9 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 85 unmodified lines
78537911 queue_delayed_work(phba->wq, &phba->eq_delay_work,
78547912 msecs_to_jiffies(LPFC_EQ_DELAY_MSECS));
78557913
7914+ /* start per phba idle_stat_delay heartbeat */
7915+ lpfc_init_idle_stat_hb(phba);
7916+
78567917 /* Start error attention (ERATT) polling timer */
78577918 mod_timer(&phba->eratt_poll,
78587919 jiffies + msecs_to_jiffies(1000 * phba->eratt_poll_interval));
@@ -7902,12 +7963,12 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) · 43 unmodified lines
79027963
79037964 if (!(phba->hba_flag & HBA_FCOE_MODE) &&
79047965 (phba->hba_flag & LINK_DISABLED)) {
7905− lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_SLI,
7966+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
79067967 "3103 Adapter Link is disabled.\n");
79077968 lpfc_down_link(phba, mboxq);
79087969 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
79097970 if (rc != MBX_SUCCESS) {
7910− lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_SLI,
7971+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
79117972 "3104 Adapter failed to issue "
79127973 "DOWN_LINK mbox cmd, rc:x%x\n", rc);
79137974 goto out_io_buff_free;
@@ -7940,7 +8001,7 @@ out_free_mbox: · 26 unmodified lines
79408001
79418002 /**
79428003 * lpfc_mbox_timeout - Timeout call back function for mbox timer
7943− * @ptr: context object - pointer to hba structure.
8004+ * @t: Context to fetch pointer to hba structure from.
79448005 *
79458006 * This is the callback function for mailbox timer. The mailbox
79468007 * timer is armed when a new mailbox command is issued and the timer
@@ -8114,7 +8175,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) · 167 unmodified lines
81148175 }
81158176
81168177 /* Mbox cmd <mbxCommand> timeout */
8117− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8178+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
81188179 "0310 Mailbox command x%x timeout Data: x%x x%x x%px\n",
81198180 mb->mbxCommand,
81208181 phba->pport->port_state,
@@ -8136,7 +8197,7 @@ lpfc_mbox_timeout_handler(struct lpfc_hba *phba) · 15 unmodified lines
81368197
81378198 lpfc_sli_abort_fcp_rings(phba);
81388199
8139− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8200+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
81408201 "0345 Resetting board due to mailbox timeout\n");
81418202
81428203 /* Reset the HBA device */
@@ -8234,7 +8295,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, · 91 unmodified lines
82348295 spin_unlock_irqrestore(&phba->hbalock, drvr_flag);
82358296
82368297 /* Mbox command <mbxCommand> cannot issue */
8237− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8298+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
82388299 "(%d):0311 Mailbox command x%x cannot "
82398300 "issue Data: x%x x%x\n",
82408301 pmbox->vport ? pmbox->vport->vpi : 0,
@@ -8246,7 +8307,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, · 5 unmodified lines
82468307 if (lpfc_readl(phba->HCregaddr, &hc_copy) ||
82478308 !(hc_copy & HC_MBINT_ENA)) {
82488309 spin_unlock_irqrestore(&phba->hbalock, drvr_flag);
8249− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8310+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
82508311 "(%d):2528 Mailbox command x%x cannot "
82518312 "issue Data: x%x x%x\n",
82528313 pmbox->vport ? pmbox->vport->vpi : 0,
@@ -8265,7 +8326,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, · 12 unmodified lines
82658326 spin_unlock_irqrestore(&phba->hbalock, drvr_flag);
82668327
82678328 /* Mbox command <mbxCommand> cannot issue */
8268− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8329+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
82698330 "(%d):2529 Mailbox command x%x "
82708331 "cannot issue Data: x%x x%x\n",
82718332 pmbox->vport ? pmbox->vport->vpi : 0,
@@ -8277,7 +8338,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, · 5 unmodified lines
82778338 if (!(psli->sli_flag & LPFC_SLI_ACTIVE)) {
82788339 spin_unlock_irqrestore(&phba->hbalock, drvr_flag);
82798340 /* Mbox command <mbxCommand> cannot issue */
8280− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8341+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
82818342 "(%d):2530 Mailbox command x%x "
82828343 "cannot issue Data: x%x x%x\n",
82838344 pmbox->vport ? pmbox->vport->vpi : 0,
@@ -8330,7 +8391,7 @@ lpfc_sli_issue_mbox_s3(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmbox, · 46 unmodified lines
83308391 psli->sli_flag &= ~LPFC_SLI_MBOX_ACTIVE;
83318392 spin_unlock_irqrestore(&phba->hbalock, drvr_flag);
83328393 /* Mbox command <mbxCommand> cannot issue */
8333− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8394+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
83348395 "(%d):2531 Mailbox command x%x "
83358396 "cannot issue Data: x%x x%x\n",
83368397 pmbox->vport ? pmbox->vport->vpi : 0,
@@ -8721,7 +8782,7 @@ lpfc_sli4_post_sync_mbox(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 384 unmodified lines
87218782 spin_lock_irqsave(&phba->hbalock, iflag);
87228783 if (psli->sli_flag & LPFC_SLI_MBOX_ACTIVE) {
87238784 spin_unlock_irqrestore(&phba->hbalock, iflag);
8724− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8785+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
87258786 "(%d):2532 Mailbox command x%x (x%x/x%x) "
87268787 "cannot issue Data: x%x x%x\n",
87278788 mboxq->vport ? mboxq->vport->vpi : 0,
@@ -8820,7 +8881,7 @@ exit: · 92 unmodified lines
88208881 /**
88218882 * lpfc_sli_issue_mbox_s4 - Issue an SLI4 mailbox command to firmware
88228883 * @phba: Pointer to HBA context object.
8823− * @pmbox: Pointer to mailbox object.
8884+ * @mboxq: Pointer to mailbox object.
88248885 * @flag: Flag indicating how the mailbox need to be processed.
88258886 *
88268887 * This function is called by discovery code and HBA management code to submit
@@ -8842,7 +8903,7 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, · 15 unmodified lines
88428903
88438904 rc = lpfc_mbox_dev_check(phba);
88448905 if (unlikely(rc)) {
8845− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8906+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
88468907 "(%d):2544 Mailbox command x%x (x%x/x%x) "
88478908 "cannot issue Data: x%x x%x\n",
88488909 mboxq->vport ? mboxq->vport->vpi : 0,
@@ -8919,7 +8980,7 @@ lpfc_sli_issue_mbox_s4(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq, · 70 unmodified lines
89198980 /* Now, interrupt mode asynchronous mailbox command */
89208981 rc = lpfc_mbox_cmd_check(phba, mboxq);
89218982 if (rc) {
8922− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
8983+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
89238984 "(%d):2543 Mailbox command x%x (x%x/x%x) "
89248985 "cannot issue Data: x%x x%x\n",
89258986 mboxq->vport ? mboxq->vport->vpi : 0,
@@ -8987,7 +9048,7 @@ lpfc_sli4_post_async_mbox(struct lpfc_hba *phba) · 61 unmodified lines
89879048 }
89889049 if (unlikely(phba->sli.mbox_active)) {
89899050 spin_unlock_irqrestore(&phba->hbalock, iflags);
8990− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
9051+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
89919052 "0384 There is pending active mailbox cmd\n");
89929053 return MBX_NOT_FINISHED;
89939054 }
@@ -9048,7 +9109,7 @@ lpfc_sli4_post_async_mbox(struct lpfc_hba *phba) · 54 unmodified lines
90489109 /* Post the mailbox command to the port */
90499110 rc = lpfc_sli4_mq_put(phba->sli4_hba.mbx_wq, mqe);
90509111 if (rc != MBX_SUCCESS) {
9051− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI,
9112+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
90529113 "(%d):2533 Mailbox command x%x (x%x/x%x) "
90539114 "cannot issue Data: x%x x%x\n",
90549115 mboxq->vport ? mboxq->vport->vpi : 0,
@@ -9124,7 +9185,7 @@ lpfc_mbox_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp) · 69 unmodified lines
91249185 phba->lpfc_sli_brdready = lpfc_sli_brdready_s4;
91259186 break;
91269187 default:
9127− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
9188+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
91289189 "1420 Invalid HBA PCI-device group: 0x%x\n",
91299190 dev_grp);
91309191 return -ENODEV;
@@ -9225,8 +9286,7 @@ __lpfc_sli_issue_iocb_s3(struct lpfc_hba *phba, uint32_t ring_number, · 94 unmodified lines
92259286 if (piocb->iocb_cmpl && (!piocb->vport) &&
92269287 (piocb->iocb.ulpCommand != CMD_ABORT_XRI_CN) &&
92279288 (piocb->iocb.ulpCommand != CMD_CLOSE_XRI_CN)) {
9228− lpfc_printf_log(phba, KERN_ERR,
9229− LOG_SLI | LOG_VPORT,
9289+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
92309290 "1807 IOCB x%x failed. No vport\n",
92319291 piocb->iocb.ulpCommand);
92329292 dump_stack();
@@ -9327,7 +9387,7 @@ __lpfc_sli_issue_iocb_s3(struct lpfc_hba *phba, uint32_t ring_number, · 94 unmodified lines
93279387 /**
93289388 * lpfc_sli4_bpl2sgl - Convert the bpl/bde to a sgl.
93299389 * @phba: Pointer to HBA context object.
9330− * @piocb: Pointer to command iocb.
9390+ * @piocbq: Pointer to command iocb.
93319391 * @sglq: Pointer to the scatter gather queue object.
93329392 *
93339393 * This routine converts the bpl or bde that is in the IOCB
@@ -9435,7 +9495,7 @@ lpfc_sli4_bpl2sgl(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq, · 101 unmodified lines
94359495 /**
94369496 * lpfc_sli_iocb2wqe - Convert the IOCB to a work queue entry.
94379497 * @phba: Pointer to HBA context object.
9438− * @piocb: Pointer to command iocb.
9498+ * @iocbq: Pointer to command iocb.
94399499 * @wqe: Pointer to the work queue entry.
94409500 *
94419501 * This routine converts the iocb command to its Work Queue Entry
@@ -9521,7 +9581,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, · 79 unmodified lines
95219581 else
95229582 ndlp = (struct lpfc_nodelist *)iocbq->context1;
95239583 if (!iocbq->iocb.ulpLe) {
9524− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
9584+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
95259585 "2007 Only Limited Edition cmd Format"
95269586 " supported 0x%x\n",
95279587 iocbq->iocb.ulpCommand);
@@ -9829,7 +9889,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, · 301 unmodified lines
98299889 /* word6 context tag copied in memcpy */
98309890 if (iocbq->iocb.ulpCt_h || iocbq->iocb.ulpCt_l) {
98319891 ct = ((iocbq->iocb.ulpCt_h << 1) | iocbq->iocb.ulpCt_l);
9832− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
9892+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
98339893 "2015 Invalid CT %x command 0x%x\n",
98349894 ct, iocbq->iocb.ulpCommand);
98359895 return IOCB_ERROR;
@@ -10008,7 +10068,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, · 172 unmodified lines
1000810068 case CMD_FCP_TRSP64_CX: /* Target mode rcv */
1000910069 case CMD_FCP_AUTO_TRSP_CX: /* Auto target rsp */
1001010070 default:
10011− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
10071+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1001210072 "2014 Invalid command 0x%x\n",
1001310073 iocbq->iocb.ulpCommand);
1001410074 return IOCB_ERROR;
@@ -10129,7 +10189,7 @@ __lpfc_sli_issue_iocb_s4(struct lpfc_hba *phba, uint32_t ring_number, · 114 unmodified lines
1012910189 return 0;
1013010190 }
1013110191
10132−/**
10192+/*
1013310193 * __lpfc_sli_issue_iocb - Wrapper func of lockless version for issuing iocb
1013410194 *
1013510195 * This routine wraps the actual lockless version for issusing IOCB function
@@ -10170,7 +10230,7 @@ lpfc_sli_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp) · 34 unmodified lines
1017010230 phba->__lpfc_sli_release_iocbq = __lpfc_sli_release_iocbq_s4;
1017110231 break;
1017210232 default:
10173− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
10233+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1017410234 "1419 Invalid HBA PCI-device group: 0x%x\n",
1017510235 dev_grp);
1017610236 return -ENODEV;
@@ -10218,7 +10278,7 @@ lpfc_sli4_calc_ring(struct lpfc_hba *phba, struct lpfc_iocbq *piocb) · 41 unmodified lines
1021810278 /**
1021910279 * lpfc_sli_issue_iocb - Wrapper function for __lpfc_sli_issue_iocb
1022010280 * @phba: Pointer to HBA context object.
10221− * @pring: Pointer to driver SLI ring object.
10281+ * @ring_number: Ring number
1022210282 * @piocb: Pointer to command iocb.
1022310283 * @flag: Flag indicating if this command can be put into txq.
1022410284 *
@@ -10430,13 +10490,13 @@ lpfc_sli_async_event_handler(struct lpfc_hba * phba, · 205 unmodified lines
1043010490 temp_event_data.event_type = FC_REG_TEMPERATURE_EVENT;
1043110491 if (evt_code == ASYNC_TEMP_WARN) {
1043210492 temp_event_data.event_code = LPFC_THRESHOLD_TEMP;
10433− lpfc_printf_log(phba, KERN_ERR, LOG_TEMP,
10493+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1043410494 "0347 Adapter is very hot, please take "
1043510495 "corrective action. temperature : %d Celsius\n",
1043610496 (uint32_t) icmd->ulpContext);
1043710497 } else {
1043810498 temp_event_data.event_code = LPFC_NORMAL_TEMP;
10439− lpfc_printf_log(phba, KERN_ERR, LOG_TEMP,
10499+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1044010500 "0340 Adapter temperature is OK now. "
1044110501 "temperature : %d Celsius\n",
1044210502 (uint32_t) icmd->ulpContext);
@@ -10453,7 +10513,7 @@ lpfc_sli_async_event_handler(struct lpfc_hba * phba, · 10 unmodified lines
1045310513 break;
1045410514 default:
1045510515 iocb_w = (uint32_t *) icmd;
10456− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
10516+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1045710517 "0346 Ring %d handler: unexpected ASYNC_STATUS"
1045810518 " evt_code 0x%x\n"
1045910519 "W0 0x%08x W1 0x%08x W2 0x%08x W3 0x%08x\n"
@@ -11127,7 +11187,7 @@ lpfc_sli_ring_taggedbuf_get(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, · 667 unmodified lines
1112711187 }
1112811188
1112911189 spin_unlock_irq(&phba->hbalock);
11130− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
11190+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1113111191 "0402 Cannot find virtual addr for buffer tag on "
1113211192 "ring %d Data x%lx x%px x%px x%x\n",
1113311193 pring->ringno, (unsigned long) tag,
@@ -11171,7 +11231,7 @@ lpfc_sli_ringpostbuf_get(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, · 37 unmodified lines
1117111231 }
1117211232
1117311233 spin_unlock_irq(&phba->hbalock);
11174− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
11234+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1117511235 "0410 Cannot find virtual addr for mapped buf on "
1117611236 "ring %d Data x%llx x%px x%px x%x\n",
1117711237 pring->ringno, (unsigned long long)phys,
@@ -11719,7 +11779,7 @@ lpfc_sli_abort_iocb(struct lpfc_vport *vport, struct lpfc_sli_ring *pring, · 541 unmodified lines
1171911779 * @pring: Pointer to driver SLI ring object.
1172011780 * @tgt_id: SCSI ID of the target.
1172111781 * @lun_id: LUN ID of the scsi device.
11722− * @taskmgmt_cmd: LPFC_CTX_LUN/LPFC_CTX_TGT/LPFC_CTX_HOST.
11782+ * @cmd: LPFC_CTX_LUN/LPFC_CTX_TGT/LPFC_CTX_HOST.
1172311783 *
1172411784 * This function sends an abort command for every SCSI command
1172511785 * associated with the given virtual port pending on the ring
@@ -11959,7 +12019,7 @@ lpfc_chk_iocb_flg(struct lpfc_hba *phba, · 233 unmodified lines
1195912019 /**
1196012020 * lpfc_sli_issue_iocb_wait - Synchronous function to issue iocb commands
1196112021 * @phba: Pointer to HBA context object..
11962− * @pring: Pointer to sli ring.
12022+ * @ring_number: Ring number
1196312023 * @piocb: Pointer to command iocb.
1196412024 * @prspiocbq: Pointer to response iocb.
1196512025 * @timeout: Timeout in number of seconds.
@@ -12065,12 +12125,12 @@ lpfc_sli_issue_iocb_wait(struct lpfc_hba *phba, · 99 unmodified lines
1206512125 * completed. Not that it completed successfully.
1206612126 * */
1206712127 } else if (timeleft == 0) {
12068− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
12128+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1206912129 "0338 IOCB wait timeout error - no "
1207012130 "wake response Data x%x\n", timeout);
1207112131 retval = IOCB_TIMEDOUT;
1207212132 } else {
12073− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
12133+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1207412134 "0330 IOCB wake NOT set, "
1207512135 "Data x%x x%lx\n",
1207612136 timeout, (timeleft / jiffies));
@@ -12179,6 +12239,7 @@ lpfc_sli_issue_mbox_wait(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmboxq, · 102 unmodified lines
1217912239 /**
1218012240 * lpfc_sli_mbox_sys_shutdown - shutdown mailbox command sub-system
1218112241 * @phba: Pointer to HBA context.
12242+ * @mbx_action: Mailbox shutdown options.
1218212243 *
1218312244 * This function is called to shutdown the driver's mailbox sub-system.
1218412245 * It first marks the mailbox sub-system is in a block state to prevent
@@ -12332,7 +12393,7 @@ lpfc_sli4_eratt_read(struct lpfc_hba *phba) · 147 unmodified lines
1233212393 }
1233312394 if ((~phba->sli4_hba.ue_mask_lo & uerr_sta_lo) ||
1233412395 (~phba->sli4_hba.ue_mask_hi & uerr_sta_hi)) {
12335− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12396+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1233612397 "1423 HBA Unrecoverable error: "
1233712398 "uerr_lo_reg=0x%x, uerr_hi_reg=0x%x, "
1233812399 "ue_mask_lo_reg=0x%x, "
@@ -12363,7 +12424,7 @@ lpfc_sli4_eratt_read(struct lpfc_hba *phba) · 24 unmodified lines
1236312424 readl(phba->sli4_hba.u.if_type2.ERR1regaddr);
1236412425 phba->work_status[1] =
1236512426 readl(phba->sli4_hba.u.if_type2.ERR2regaddr);
12366− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12427+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1236712428 "2885 Port Status Event: "
1236812429 "port status reg 0x%x, "
1236912430 "port smphr reg 0x%x, "
@@ -12379,7 +12440,7 @@ lpfc_sli4_eratt_read(struct lpfc_hba *phba) · 9 unmodified lines
1237912440 break;
1238012441 case LPFC_SLI_INTF_IF_TYPE_1:
1238112442 default:
12382− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12443+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1238312444 "2886 HBA Error Attention on unsupported "
1238412445 "if type %d.", if_type);
1238512446 return 1;
@@ -12443,7 +12504,7 @@ lpfc_sli_check_eratt(struct lpfc_hba *phba) · 57 unmodified lines
1244312504 ha_copy = lpfc_sli4_eratt_read(phba);
1244412505 break;
1244512506 default:
12446− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
12507+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1244712508 "0299 Invalid SLI revision (%d)\n",
1244812509 phba->sli_rev);
1244912510 ha_copy = 0;
@@ -12676,8 +12737,7 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id) · 226 unmodified lines
1267612737 * Stray Mailbox Interrupt, mbxCommand <cmd>
1267712738 * mbxStatus <status>
1267812739 */
12679− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX |
12680− LOG_SLI,
12740+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1268112741 "(%d):0304 Stray Mailbox "
1268212742 "Interrupt mbxCommand x%x "
1268312743 "mbxStatus x%x\n",
@@ -12737,7 +12797,7 @@ lpfc_sli_sp_intr_handler(int irq, void *dev_id) · 53 unmodified lines
1273712797 if (rc != MBX_BUSY)
1273812798 lpfc_printf_log(phba,
1273912799 KERN_ERR,
12740− LOG_MBOX | LOG_SLI,
12800+ LOG_TRACE_EVENT,
1274112801 "0350 rc should have"
1274212802 "been MBX_BUSY\n");
1274312803 if (rc != MBX_NOT_FINISHED)
@@ -12766,8 +12826,9 @@ send_current_mbox: · 22 unmodified lines
1276612826 MBX_NOWAIT);
1276712827 } while (rc == MBX_NOT_FINISHED);
1276812828 if (rc != MBX_SUCCESS)
12769− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX |
12770− LOG_SLI, "0349 rc should be "
12829+ lpfc_printf_log(phba, KERN_ERR,
12830+ LOG_TRACE_EVENT,
12831+ "0349 rc should be "
1277112832 "MBX_SUCCESS\n");
1277212833 }
1277312834
@@ -13139,7 +13200,7 @@ lpfc_sli4_iocb_param_transfer(struct lpfc_hba *phba, · 365 unmodified lines
1313913200 /**
1314013201 * lpfc_sli4_els_wcqe_to_rspiocbq - Get response iocbq from els wcqe
1314113202 * @phba: Pointer to HBA context object.
13142− * @wcqe: Pointer to work-queue completion queue entry.
13203+ * @irspiocbq: Pointer to work-queue completion queue entry.
1314313204 *
1314413205 * This routine handles an ELS work-queue completion event and construct
1314513206 * a pseudo response ELS IODBQ from the SLI4 ELS WCQE for the common
@@ -13194,7 +13255,7 @@ lpfc_cq_event_setup(struct lpfc_hba *phba, void *entry, int size) · 48 unmodified lines
1319413255 /* Allocate a new internal CQ_EVENT entry */
1319513256 cq_event = lpfc_sli4_cq_event_alloc(phba);
1319613257 if (!cq_event) {
13197− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
13258+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1319813259 "0602 Failed to alloc CQ_EVENT entry\n");
1319913260 return NULL;
1320013261 }
@@ -13207,7 +13268,7 @@ lpfc_cq_event_setup(struct lpfc_hba *phba, void *entry, int size) · 6 unmodified lines
1320713268 /**
1320813269 * lpfc_sli4_sp_handle_async_event - Handle an asynchronous event
1320913270 * @phba: Pointer to HBA context object.
13210− * @cqe: Pointer to mailbox completion queue entry.
13271+ * @mcqe: Pointer to mailbox completion queue entry.
1321113272 *
1321213273 * This routine process a mailbox completion queue entry with asynchronous
1321313274 * event.
@@ -13240,7 +13301,7 @@ lpfc_sli4_sp_handle_async_event(struct lpfc_hba *phba, struct lpfc_mcqe *mcqe) · 26 unmodified lines
1324013301 /**
1324113302 * lpfc_sli4_sp_handle_mbox_event - Handle a mailbox completion event
1324213303 * @phba: Pointer to HBA context object.
13243− * @cqe: Pointer to mailbox completion queue entry.
13304+ * @mcqe: Pointer to mailbox completion queue entry.
1324413305 *
1324513306 * This routine process a mailbox completion queue entry with mailbox
1324613307 * completion event.
@@ -13269,7 +13330,7 @@ lpfc_sli4_sp_handle_mbox_event(struct lpfc_hba *phba, struct lpfc_mcqe *mcqe) · 22 unmodified lines
1326913330 spin_lock_irqsave(&phba->hbalock, iflags);
1327013331 pmb = phba->sli.mbox_active;
1327113332 if (unlikely(!pmb)) {
13272− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX,
13333+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1327313334 "1832 No pending MBOX command to handle\n");
1327413335 spin_unlock_irqrestore(&phba->hbalock, iflags);
1327513336 goto out_no_mqe_complete;
@@ -13318,8 +13379,9 @@ lpfc_sli4_sp_handle_mbox_event(struct lpfc_hba *phba, struct lpfc_mcqe *mcqe) · 42 unmodified lines
1331813379 pmb->vport = vport;
1331913380 rc = lpfc_sli_issue_mbox(phba, pmb, MBX_NOWAIT);
1332013381 if (rc != MBX_BUSY)
13321− lpfc_printf_log(phba, KERN_ERR, LOG_MBOX |
13322− LOG_SLI, "0385 rc should "
13382+ lpfc_printf_log(phba, KERN_ERR,
13383+ LOG_TRACE_EVENT,
13384+ "0385 rc should "
1332313385 "have been MBX_BUSY\n");
1332413386 if (rc != MBX_NOT_FINISHED)
1332513387 goto send_current_mbox;
@@ -13360,6 +13422,7 @@ out_no_mqe_complete: · 34 unmodified lines
1336013422 /**
1336113423 * lpfc_sli4_sp_handle_mcqe - Process a mailbox completion queue entry
1336213424 * @phba: Pointer to HBA context object.
13425+ * @cq: Pointer to associated CQ
1336313426 * @cqe: Pointer to mailbox completion queue entry.
1336413427 *
1336513428 * This routine process a mailbox completion queue entry, it invokes the
@@ -13426,7 +13489,7 @@ lpfc_sli4_sp_handle_els_wcqe(struct lpfc_hba *phba, struct lpfc_queue *cq, · 60 unmodified lines
1342613489 txq_cnt++;
1342713490 if (!list_empty(&pring->txcmplq))
1342813491 txcmplq_cnt++;
13429− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
13492+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1343013493 "0387 NO IOCBQ data: txq_cnt=%d iocb_cnt=%d "
1343113494 "els_txcmplq_cnt=%d\n",
1343213495 txq_cnt, phba->iocb_cnt,
@@ -13517,7 +13580,7 @@ lpfc_sli4_sp_handle_abort_xri_wcqe(struct lpfc_hba *phba, · 84 unmodified lines
1351713580 workposted = true;
1351813581 break;
1351913582 default:
13520− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
13583+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1352113584 "0603 Invalid CQ subtype %d: "
1352213585 "%08x %08x %08x %08x\n",
1352313586 cq->subtype, wcqe->word0, wcqe->parameter,
@@ -13565,7 +13628,7 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba *phba, struct lpfc_rcqe *rcqe) · 41 unmodified lines
1356513628 status = bf_get(lpfc_rcqe_status, rcqe);
1356613629 switch (status) {
1356713630 case FC_STATUS_RQ_BUF_LEN_EXCEEDED:
13568− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
13631+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1356913632 "2537 Receive Frame Truncated!!\n");
1357013633 /* fall through */
1357113634 case FC_STATUS_RQ_SUCCESS:
@@ -13602,7 +13665,7 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba *phba, struct lpfc_rcqe *rcqe) · 30 unmodified lines
1360213665 case FC_STATUS_INSUFF_BUF_FRM_DISC:
1360313666 if (phba->nvmet_support) {
1360413667 tgtp = phba->targetport->private;
13605− lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_NVME,
13668+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1360613669 "6402 RQE Error x%x, posted %d err_cnt "
1360713670 "%d: %x %x %x\n",
1360813671 status, hrq->RQ_buf_posted,
@@ -13674,7 +13737,7 @@ lpfc_sli4_sp_handle_cqe(struct lpfc_hba *phba, struct lpfc_queue *cq, · 65 unmodified lines
1367413737 (struct lpfc_rcqe *)&cqevt);
1367513738 break;
1367613739 default:
13677− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
13740+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1367813741 "0388 Not a valid WCQE code: x%x\n",
1367913742 bf_get(lpfc_cqe_code, &cqevt));
1368013743 break;
@@ -13686,6 +13749,7 @@ lpfc_sli4_sp_handle_cqe(struct lpfc_hba *phba, struct lpfc_queue *cq, · 5 unmodified lines
1368613749 * lpfc_sli4_sp_handle_eqe - Process a slow-path event queue entry
1368713750 * @phba: Pointer to HBA context object.
1368813751 * @eqe: Pointer to fast-path event queue entry.
13752+ * @speq: Pointer to slow-path event queue.
1368913753 *
1369013754 * This routine process a event queue entry from the slow-path event queue.
1369113755 * It will check the MajorCode and MinorCode to determine this is for a
@@ -13701,6 +13765,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, · 9 unmodified lines
1370113765 {
1370213766 struct lpfc_queue *cq = NULL, *childq;
1370313767 uint16_t cqid;
13768+ int ret = 0;
1370413769
1370513770 /* Get the reference to the corresponding CQ */
1370613771 cqid = bf_get_le32(lpfc_eqe_resource_id, eqe);
@@ -13713,7 +13778,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, · 6 unmodified lines
1371313778 }
1371413779 if (unlikely(!cq)) {
1371513780 if (phba->sli.sli_flag & LPFC_SLI_ACTIVE)
13716− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
13781+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1371713782 "0365 Slow-path CQ identifier "
1371813783 "(%d) does not exist\n", cqid);
1371913784 return;
@@ -13722,9 +13787,14 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, · 2 unmodified lines
1372213787 /* Save EQ associated with this CQ */
1372313788 cq->assoc_qp = speq;
1372413789
13725− if (!queue_work_on(cq->chann, phba->wq, &cq->spwork))
13726− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
13727− "0390 Cannot schedule soft IRQ "
13790+ if (is_kdump_kernel())
13791+ ret = queue_work(phba->wq, &cq->spwork);
13792+ else
13793+ ret = queue_work_on(cq->chann, phba->wq, &cq->spwork);
13794+
13795+ if (!ret)
13796+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
13797+ "0390 Cannot schedule queue work "
1372813798 "for CQ eqcqid=%d, cqid=%d on CPU %d\n",
1372913799 cqid, cq->queue_id, raw_smp_processor_id());
1373013800 }
@@ -13735,6 +13805,7 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, · 4 unmodified lines
1373513805 * @cq: Pointer to CQ to be processed
1373613806 * @handler: Routine to process each cqe
1373713807 * @delay: Pointer to usdelay to set in case of rescheduling of the handler
13808+ * @poll_mode: Polling mode we were called from
1373813809 *
1373913810 * This routine processes completion queue entries in a CQ. While a valid
1374013811 * queue element is found, the handler is called. During processing checks
@@ -13752,7 +13823,8 @@ lpfc_sli4_sp_handle_eqe(struct lpfc_hba *phba, struct lpfc_eqe *eqe, · 11 unmodified lines
1375213823 static bool
1375313824 __lpfc_sli4_process_cq(struct lpfc_hba *phba, struct lpfc_queue *cq,
1375413825 bool (*handler)(struct lpfc_hba *, struct lpfc_queue *,
13755− struct lpfc_cqe *), unsigned long *delay)
13826+ struct lpfc_cqe *), unsigned long *delay,
13827+ enum lpfc_poll_mode poll_mode)
1375613828 {
1375713829 struct lpfc_cqe *cqe;
1375813830 bool workposted = false;
@@ -13793,6 +13865,10 @@ __lpfc_sli4_process_cq(struct lpfc_hba *phba, struct lpfc_queue *cq, · 34 unmodified lines
1379313865 arm = false;
1379413866 }
1379513867
13868+ /* Note: complete the irq_poll softirq before rearming CQ */
13869+ if (poll_mode == LPFC_IRQ_POLL)
13870+ irq_poll_complete(&cq->iop);
13871+
1379613872 /* Track the max number of CQEs processed in 1 EQ */
1379713873 if (count > cq->CQ_max_cqe)
1379813874 cq->CQ_max_cqe = count;
@@ -13835,36 +13911,42 @@ __lpfc_sli4_sp_process_cq(struct lpfc_queue *cq) · 36 unmodified lines
1383513911 struct lpfc_hba *phba = cq->phba;
1383613912 unsigned long delay;
1383713913 bool workposted = false;
13914+ int ret = 0;
1383813915
1383913916 /* Process and rearm the CQ */
1384013917 switch (cq->type) {
1384113918 case LPFC_MCQ:
1384213919 workposted |= __lpfc_sli4_process_cq(phba, cq,
1384313920 lpfc_sli4_sp_handle_mcqe,
13844− &delay);
13921+ &delay, LPFC_QUEUE_WORK);
1384513922 break;
1384613923 case LPFC_WCQ:
1384713924 if (cq->subtype == LPFC_IO)
1384813925 workposted |= __lpfc_sli4_process_cq(phba, cq,
1384913926 lpfc_sli4_fp_handle_cqe,
13850− &delay);
13927+ &delay, LPFC_QUEUE_WORK);
1385113928 else
1385213929 workposted |= __lpfc_sli4_process_cq(phba, cq,
1385313930 lpfc_sli4_sp_handle_cqe,
13854− &delay);
13931+ &delay, LPFC_QUEUE_WORK);
1385513932 break;
1385613933 default:
13857− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
13934+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1385813935 "0370 Invalid completion queue type (%d)\n",
1385913936 cq->type);
1386013937 return;
1386113938 }
1386213939
1386313940 if (delay) {
13864− if (!queue_delayed_work_on(cq->chann, phba->wq,
13865− &cq->sched_spwork, delay))
13866− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
13867− "0394 Cannot schedule soft IRQ "
13941+ if (is_kdump_kernel())
13942+ ret = queue_delayed_work(phba->wq, &cq->sched_spwork,
13943+ delay);
13944+ else
13945+ ret = queue_delayed_work_on(cq->chann, phba->wq,
13946+ &cq->sched_spwork, delay);
13947+ if (!ret)
13948+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
13949+ "0394 Cannot schedule queue work "
1386813950 "for cqid=%d on CPU %d\n",
1386913951 cq->queue_id, cq->chann);
1387013952 }
@@ -13933,9 +14015,9 @@ lpfc_sli4_fp_handle_fcp_wcqe(struct lpfc_hba *phba, struct lpfc_queue *cq, · 62 unmodified lines
1393314015 IOERR_NO_RESOURCES))
1393414016 phba->lpfc_rampdown_queue_depth(phba);
1393514017
13936− /* Log the error status */
14018+ /* Log the cmpl status */
1393714019 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
13938− "0373 FCP CQE error: status=x%x: "
14020+ "0373 FCP CQE cmpl: status=x%x: "
1393914021 "CQE: %08x %08x %08x %08x\n",
1394014022 bf_get(lpfc_wcqe_c_status, wcqe),
1394114023 wcqe->word0, wcqe->total_data_placed,
@@ -14029,6 +14111,7 @@ lpfc_sli4_fp_handle_rel_wcqe(struct lpfc_hba *phba, struct lpfc_queue *cq, · 87 unmodified lines
1402914111 /**
1403014112 * lpfc_sli4_nvmet_handle_rcqe - Process a receive-queue completion queue entry
1403114113 * @phba: Pointer to HBA context object.
14114+ * @cq: Pointer to completion queue.
1403214115 * @rcqe: Pointer to receive-queue completion queue entry.
1403314116 *
1403414117 * This routine process a receive-queue completion queue entry.
@@ -14073,7 +14156,7 @@ lpfc_sli4_nvmet_handle_rcqe(struct lpfc_hba *phba, struct lpfc_queue *cq, · 38 unmodified lines
1407314156 status = bf_get(lpfc_rcqe_status, rcqe);
1407414157 switch (status) {
1407514158 case FC_STATUS_RQ_BUF_LEN_EXCEEDED:
14076− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
14159+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1407714160 "6126 Receive Frame Truncated!!\n");
1407814161 /* fall through */
1407914162 case FC_STATUS_RQ_SUCCESS:
@@ -14113,7 +14196,7 @@ drop: · 33 unmodified lines
1411314196 case FC_STATUS_INSUFF_BUF_FRM_DISC:
1411414197 if (phba->nvmet_support) {
1411514198 tgtp = phba->targetport->private;
14116− lpfc_printf_log(phba, KERN_ERR, LOG_SLI | LOG_NVME,
14199+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1411714200 "6401 RQE Error x%x, posted %d err_cnt "
1411814201 "%d: %x %x %x\n",
1411914202 status, hrq->RQ_buf_posted,
@@ -14137,7 +14220,7 @@ out: · 17 unmodified lines
1413714220 * lpfc_sli4_fp_handle_cqe - Process fast-path work queue completion entry
1413814221 * @phba: adapter with cq
1413914222 * @cq: Pointer to the completion queue.
14140− * @eqe: Pointer to fast-path completion queue entry.
14223+ * @cqe: Pointer to fast-path completion queue entry.
1414114224 *
1414214225 * This routine process a fast-path work queue completion entry from fast-path
1414314226 * event queue for FCP command response completion.
@@ -14187,7 +14270,7 @@ lpfc_sli4_fp_handle_cqe(struct lpfc_hba *phba, struct lpfc_queue *cq, · 43 unmodified lines
1418714270 }
1418814271 break;
1418914272 default:
14190− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
14273+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1419114274 "0144 Not a valid CQE code: x%x\n",
1419214275 bf_get(lpfc_wcqe_c_code, &wcqe));
1419314276 break;
@@ -14195,9 +14278,48 @@ lpfc_sli4_fp_handle_cqe(struct lpfc_hba *phba, struct lpfc_queue *cq, · 1 unmodified line
1419514278 return workposted;
1419614279 }
1419714280
14281+/**
14282+ * lpfc_sli4_sched_cq_work - Schedules cq work
14283+ * @phba: Pointer to HBA context object.
14284+ * @cq: Pointer to CQ
14285+ * @cqid: CQ ID
14286+ *
14287+ * This routine checks the poll mode of the CQ corresponding to
14288+ * cq->chann, then either schedules a softirq or queue_work to complete
14289+ * cq work.
14290+ *
14291+ * queue_work path is taken if in NVMET mode, or if poll_mode is in
14292+ * LPFC_QUEUE_WORK mode. Otherwise, softirq path is taken.
14293+ *
14294+ **/
14295+static void lpfc_sli4_sched_cq_work(struct lpfc_hba *phba,
14296+ struct lpfc_queue *cq, uint16_t cqid)
14297+{
14298+ int ret = 0;
14299+
14300+ switch (cq->poll_mode) {
14301+ case LPFC_IRQ_POLL:
14302+ irq_poll_sched(&cq->iop);
14303+ break;
14304+ case LPFC_QUEUE_WORK:
14305+ default:
14306+ if (is_kdump_kernel())
14307+ ret = queue_work(phba->wq, &cq->irqwork);
14308+ else
14309+ ret = queue_work_on(cq->chann, phba->wq, &cq->irqwork);
14310+ if (!ret)
14311+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
14312+ "0383 Cannot schedule queue work "
14313+ "for CQ eqcqid=%d, cqid=%d on CPU %d\n",
14314+ cqid, cq->queue_id,
14315+ raw_smp_processor_id());
14316+ }
14317+}
14318+
1419814319 /**
1419914320 * lpfc_sli4_hba_handle_eqe - Process a fast-path event queue entry
1420014321 * @phba: Pointer to HBA context object.
14322+ * @eq: Pointer to the queue structure.
1420114323 * @eqe: Pointer to fast-path event queue entry.
1420214324 *
1420314325 * This routine process a event queue entry from the fast-path event queue.
@@ -14216,7 +14338,7 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_queue *eq, · 12 unmodified lines
1421614338 uint16_t cqid, id;
1421714339
1421814340 if (unlikely(bf_get_le32(lpfc_eqe_major_code, eqe) != 0)) {
14219− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
14341+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1422014342 "0366 Not a valid completion "
1422114343 "event: majorcode=x%x, minorcode=x%x\n",
1422214344 bf_get_le32(lpfc_eqe_major_code, eqe),
@@ -14259,7 +14381,7 @@ lpfc_sli4_hba_handle_eqe(struct lpfc_hba *phba, struct lpfc_queue *eq, · 36 unmodified lines
1425914381
1426014382 process_cq:
1426114383 if (unlikely(cqid != cq->queue_id)) {
14262− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
14384+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1426314385 "0368 Miss-matched fast-path completion "
1426414386 "queue identifier: eqcqid=%d, fcpcqid=%d\n",
1426514387 cqid, cq->queue_id);
@@ -14273,16 +14395,13 @@ work_cq: · 7 unmodified lines
1427314395 else
1427414396 cq->isr_timestamp = 0;
1427514397 #endif
14276− if (!queue_work_on(cq->chann, phba->wq, &cq->irqwork))
14277− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
14278− "0363 Cannot schedule soft IRQ "
14279− "for CQ eqcqid=%d, cqid=%d on CPU %d\n",
14280− cqid, cq->queue_id, raw_smp_processor_id());
14398+ lpfc_sli4_sched_cq_work(phba, cq, cqid);
1428114399 }
1428214400
1428314401 /**
1428414402 * __lpfc_sli4_hba_process_cq - Process a fast-path event queue entry
1428514403 * @cq: Pointer to CQ to be processed
14404+ * @poll_mode: Enum lpfc_poll_state to determine poll mode
1428614405 *
1428714406 * This routine calls the cq processing routine with the handler for
1428814407 * fast path CQEs.
@@ -14296,23 +14415,30 @@ work_cq: · 7 unmodified lines
1429614415 * the delay indicates when to reschedule it.
1429714416 **/
1429814417 static void
14299−__lpfc_sli4_hba_process_cq(struct lpfc_queue *cq)
14418+__lpfc_sli4_hba_process_cq(struct lpfc_queue *cq,
14419+ enum lpfc_poll_mode poll_mode)
1430014420 {
1430114421 struct lpfc_hba *phba = cq->phba;
1430214422 unsigned long delay;
1430314423 bool workposted = false;
14424+ int ret = 0;
1430414425
1430514426 /* process and rearm the CQ */
1430614427 workposted |= __lpfc_sli4_process_cq(phba, cq, lpfc_sli4_fp_handle_cqe,
14307− &delay);
14428+ &delay, poll_mode);
1430814429
1430914430 if (delay) {
14310− if (!queue_delayed_work_on(cq->chann, phba->wq,
14311− &cq->sched_irqwork, delay))
14312− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
14313− "0367 Cannot schedule soft IRQ "
14314− "for cqid=%d on CPU %d\n",
14315− cq->queue_id, cq->chann);
14431+ if (is_kdump_kernel())
14432+ ret = queue_delayed_work(phba->wq, &cq->sched_irqwork,
14433+ delay);
14434+ else
14435+ ret = queue_delayed_work_on(cq->chann, phba->wq,
14436+ &cq->sched_irqwork, delay);
14437+ if (!ret)
14438+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
14439+ "0367 Cannot schedule queue work "
14440+ "for cqid=%d on CPU %d\n",
14441+ cq->queue_id, cq->chann);
1431614442 }
1431714443
1431814444 /* wake up worker thread if there are works to be done */
@@ -14332,7 +14458,7 @@ lpfc_sli4_hba_process_cq(struct work_struct *work) · 13 unmodified lines
1433214458 {
1433314459 struct lpfc_queue *cq = container_of(work, struct lpfc_queue, irqwork);
1433414460
14335− __lpfc_sli4_hba_process_cq(cq);
14461+ __lpfc_sli4_hba_process_cq(cq, LPFC_QUEUE_WORK);
1433614462 }
1433714463
1433814464 /**
@@ -14347,7 +14473,7 @@ lpfc_sli4_dly_hba_process_cq(struct work_struct *work) · 8 unmodified lines
1434714473 struct lpfc_queue *cq = container_of(to_delayed_work(work),
1434814474 struct lpfc_queue, sched_irqwork);
1434914475
14350− __lpfc_sli4_hba_process_cq(cq);
14476+ __lpfc_sli4_hba_process_cq(cq, LPFC_QUEUE_WORK);
1435114477 }
1435214478
1435314479 /**
@@ -14668,7 +14794,7 @@ lpfc_sli4_queue_free(struct lpfc_queue *queue) · 314 unmodified lines
1466814794 * @phba: The HBA that this queue is being created on.
1466914795 * @page_size: The size of a queue page
1467014796 * @entry_size: The size of each queue entry for this queue.
14671− * @entry count: The number of entries that this queue will handle.
14797+ * @entry_count: The number of entries that this queue will handle.
1467214798 * @cpu: The cpu that will primarily utilize this queue.
1467314799 *
1467414800 * This function allocates a queue structure and the DMAable memory used for
@@ -14840,7 +14966,7 @@ lpfc_modify_hba_eq_delay(struct lpfc_hba *phba, uint32_t startq, · 165 unmodified lines
1484014966
1484114967 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
1484214968 if (!mbox) {
14843− lpfc_printf_log(phba, KERN_ERR, LOG_INIT | LOG_FCP | LOG_NVME,
14969+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1484414970 "6428 Failed allocating mailbox cmd buffer."
1484514971 " EQ delay was not set.\n");
1484614972 return;
@@ -14882,7 +15008,7 @@ lpfc_modify_hba_eq_delay(struct lpfc_hba *phba, uint32_t startq, · 35 unmodified lines
1488215008 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1488315009 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1488415010 if (shdr_status || shdr_add_status || rc) {
14885− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15011+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1488615012 "2512 MODIFY_EQ_DELAY mailbox failed with "
1488715013 "status x%x add_status x%x, mbx status x%x\n",
1488815014 shdr_status, shdr_add_status, rc);
@@ -14959,7 +15085,7 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax) · 70 unmodified lines
1495915085 dmult);
1496015086 switch (eq->entry_count) {
1496115087 default:
14962− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
15088+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1496315089 "0360 Unsupported EQ count. (%d)\n",
1496415090 eq->entry_count);
1496515091 if (eq->entry_count < 256) {
@@ -15003,7 +15129,7 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax) · 37 unmodified lines
1500315129 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1500415130 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1500515131 if (shdr_status || shdr_add_status || rc) {
15006− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15132+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1500715133 "2500 EQ_CREATE mailbox failed with "
1500815134 "status x%x add_status x%x, mbx status x%x\n",
1500915135 shdr_status, shdr_add_status, rc);
@@ -15022,11 +15148,22 @@ out: · 12 unmodified lines
1502215148 return status;
1502315149 }
1502415150
15151+static int lpfc_cq_poll_hdler(struct irq_poll *iop, int budget)
15152+{
15153+ struct lpfc_queue *cq = container_of(iop, struct lpfc_queue, iop);
15154+
15155+ __lpfc_sli4_hba_process_cq(cq, LPFC_IRQ_POLL);
15156+
15157+ return 1;
15158+}
15159+
1502515160 /**
1502615161 * lpfc_cq_create - Create a Completion Queue on the HBA
1502715162 * @phba: HBA structure that indicates port to create a queue on.
1502815163 * @cq: The queue structure to use to create the completion queue.
1502915164 * @eq: The event queue to bind this completion queue to.
15165+ * @type: Type of queue (EQ, GCQ, MCQ, WCQ, etc).
15166+ * @subtype: Functional purpose of the queue (MBOX, IO, ELS, NVMET, etc).
1503015167 *
1503115168 * This function creates a completion queue, as detailed in @wq, on a port,
1503215169 * described by @phba by sending a CQ_CREATE mailbox command to the HBA.
@@ -15099,7 +15236,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq, · 66 unmodified lines
1509915236 }
1510015237 /* fall through */
1510115238 default:
15102− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
15239+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1510315240 "0361 Unsupported CQ count: "
1510415241 "entry cnt %d sz %d pg cnt %d\n",
1510515242 cq->entry_count, cq->entry_size,
@@ -15135,7 +15272,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq, · 29 unmodified lines
1513515272 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1513615273 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1513715274 if (shdr_status || shdr_add_status || rc) {
15138− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15275+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1513915276 "2501 CQ_CREATE mailbox failed with "
1514015277 "status x%x add_status x%x, mbx status x%x\n",
1514115278 shdr_status, shdr_add_status, rc);
@@ -15161,6 +15298,8 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq, · 19 unmodified lines
1516115298
1516215299 if (cq->queue_id > phba->sli4_hba.cq_max)
1516315300 phba->sli4_hba.cq_max = cq->queue_id;
15301+
15302+ irq_poll_init(&cq->iop, LPFC_IRQ_POLL_WEIGHT, lpfc_cq_poll_hdler);
1516415303 out:
1516515304 mempool_free(mbox, phba->mbox_mem_pool);
1516615305 return status;
@@ -15171,6 +15310,8 @@ out: · 4 unmodified lines
1517115310 * @phba: HBA structure that indicates port to create a queue on.
1517215311 * @cqp: The queue structure array to use to create the completion queues.
1517315312 * @hdwq: The hardware queue array with the EQ to bind completion queues to.
15313+ * @type: Type of queue (EQ, GCQ, MCQ, WCQ, etc).
15314+ * @subtype: Functional purpose of the queue (MBOX, IO, ELS, NVMET, etc).
1517415315 *
1517515316 * This function creates a set of completion queue, s to support MRQ
1517615317 * as detailed in @cqp, on a port,
@@ -15220,7 +15361,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp, · 43 unmodified lines
1522015361 LPFC_MBOX_OPCODE_FCOE_CQ_CREATE_SET, length,
1522115362 LPFC_SLI4_MBX_NEMBED);
1522215363 if (alloclen < length) {
15223− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
15364+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1522415365 "3098 Allocated DMA memory size (%d) is "
1522515366 "less than the requested DMA memory size "
1522615367 "(%d)\n", alloclen, length);
@@ -15274,7 +15415,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp, · 47 unmodified lines
1527415415 }
1527515416 /* fall through */
1527615417 default:
15277− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
15418+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1527815419 "3118 Bad CQ count. (%d)\n",
1527915420 cq->entry_count);
1528015421 if (cq->entry_count < 256) {
@@ -15392,7 +15533,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp, · 111 unmodified lines
1539215533 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1539315534 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1539415535 if (shdr_status || shdr_add_status || rc) {
15395− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15536+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1539615537 "3119 CQ_CREATE_SET mailbox failed with "
1539715538 "status x%x add_status x%x, mbx status x%x\n",
1539815539 shdr_status, shdr_add_status, rc);
@@ -15550,7 +15691,7 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq, · 151 unmodified lines
1555015691 cq->queue_id);
1555115692 switch (mq->entry_count) {
1555215693 default:
15553− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
15694+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1555415695 "0362 Unsupported MQ count. (%d)\n",
1555515696 mq->entry_count);
1555615697 if (mq->entry_count < 16) {
@@ -15606,7 +15747,7 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq, · 49 unmodified lines
1560615747 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1560715748 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1560815749 if (shdr_status || shdr_add_status || rc) {
15609− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15750+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1561015751 "2502 MQ_CREATE mailbox failed with "
1561115752 "status x%x add_status x%x, mbx status x%x\n",
1561215753 shdr_status, shdr_add_status, rc);
@@ -15669,8 +15810,10 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, · 56 unmodified lines
1566915810 uint16_t pci_barset;
1567015811 uint8_t dpp_barset;
1567115812 uint32_t dpp_offset;
15672− unsigned long pg_addr;
1567315813 uint8_t wq_create_version;
15814+#ifdef CONFIG_X86
15815+ unsigned long pg_addr;
15816+#endif
1567415817
1567515818 /* sanity check on queue memory */
1567615819 if (!wq || !cq)
@@ -15755,7 +15898,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, · 78 unmodified lines
1575515898 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1575615899 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1575715900 if (shdr_status || shdr_add_status || rc) {
15758− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15901+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1575915902 "2503 WQ_CREATE mailbox failed with "
1576015903 "status x%x add_status x%x, mbx status x%x\n",
1576115904 shdr_status, shdr_add_status, rc);
@@ -15782,7 +15925,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, · 20 unmodified lines
1578215925 &wq_create->u.response);
1578315926 if ((wq->db_format != LPFC_DB_LIST_FORMAT) &&
1578415927 (wq->db_format != LPFC_DB_RING_FORMAT)) {
15785− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15928+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1578615929 "3265 WQ[%d] doorbell format "
1578715930 "not supported: x%x\n",
1578815931 wq->queue_id, wq->db_format);
@@ -15794,7 +15937,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, · 5 unmodified lines
1579415937 bar_memmap_p = lpfc_dual_chute_pci_bar_map(phba,
1579515938 pci_barset);
1579615939 if (!bar_memmap_p) {
15797− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15940+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1579815941 "3263 WQ[%d] failed to memmap "
1579915942 "pci barset:x%x\n",
1580015943 wq->queue_id, pci_barset);
@@ -15804,7 +15947,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, · 3 unmodified lines
1580415947 db_offset = wq_create->u.response.doorbell_offset;
1580515948 if ((db_offset != LPFC_ULP0_WQ_DOORBELL) &&
1580615949 (db_offset != LPFC_ULP1_WQ_DOORBELL)) {
15807− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15950+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1580815951 "3252 WQ[%d] doorbell offset "
1580915952 "not supported: x%x\n",
1581015953 wq->queue_id, db_offset);
@@ -15828,7 +15971,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, · 17 unmodified lines
1582815971 bar_memmap_p = lpfc_dual_chute_pci_bar_map(phba,
1582915972 pci_barset);
1583015973 if (!bar_memmap_p) {
15831− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15974+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1583215975 "3267 WQ[%d] failed to memmap "
1583315976 "pci barset:x%x\n",
1583415977 wq->queue_id, pci_barset);
@@ -15844,7 +15987,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, · 9 unmodified lines
1584415987 bar_memmap_p = lpfc_dual_chute_pci_bar_map(phba,
1584515988 dpp_barset);
1584615989 if (!bar_memmap_p) {
15847− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
15990+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1584815991 "3268 WQ[%d] failed to memmap "
1584915992 "pci barset:x%x\n",
1585015993 wq->queue_id, dpp_barset);
@@ -15860,9 +16003,9 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, · 9 unmodified lines
1586016003 wq->queue_id, pci_barset, db_offset,
1586116004 wq->dpp_id, dpp_barset, dpp_offset);
1586216005
16006+#ifdef CONFIG_X86
1586316007 /* Enable combined writes for DPP aperture */
1586416008 pg_addr = (unsigned long)(wq->dpp_regaddr) & PAGE_MASK;
15865−#ifdef CONFIG_X86
1586616009 rc = set_memory_wc(pg_addr, 1);
1586716010 if (rc) {
1586816011 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
@@ -15902,6 +16045,7 @@ out: · 33 unmodified lines
1590216045 * @hrq: The queue structure to use to create the header receive queue.
1590316046 * @drq: The queue structure to use to create the data receive queue.
1590416047 * @cq: The completion queue to bind this work queue to.
16048+ * @subtype: The subtype of the work queue indicating its functionality.
1590516049 *
1590616050 * This function creates a receive buffer queue pair , as detailed in @hrq and
1590716051 * @drq, on a port, described by @phba by sending a RQ_CREATE mailbox command
@@ -15968,7 +16112,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 60 unmodified lines
1596816112 } else {
1596916113 switch (hrq->entry_count) {
1597016114 default:
15971− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
16115+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1597216116 "2535 Unsupported RQ count. (%d)\n",
1597316117 hrq->entry_count);
1597416118 if (hrq->entry_count < 512) {
@@ -16019,7 +16163,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 44 unmodified lines
1601916163 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1602016164 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1602116165 if (shdr_status || shdr_add_status || rc) {
16022− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16166+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1602316167 "2504 RQ_CREATE mailbox failed with "
1602416168 "status x%x add_status x%x, mbx status x%x\n",
1602516169 shdr_status, shdr_add_status, rc);
@@ -16037,7 +16181,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 11 unmodified lines
1603716181 &rq_create->u.response);
1603816182 if ((hrq->db_format != LPFC_DB_LIST_FORMAT) &&
1603916183 (hrq->db_format != LPFC_DB_RING_FORMAT)) {
16040− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16184+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1604116185 "3262 RQ [%d] doorbell format not "
1604216186 "supported: x%x\n", hrq->queue_id,
1604316187 hrq->db_format);
@@ -16049,7 +16193,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 5 unmodified lines
1604916193 &rq_create->u.response);
1605016194 bar_memmap_p = lpfc_dual_chute_pci_bar_map(phba, pci_barset);
1605116195 if (!bar_memmap_p) {
16052− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16196+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1605316197 "3269 RQ[%d] failed to memmap pci "
1605416198 "barset:x%x\n", hrq->queue_id,
1605516199 pci_barset);
@@ -16060,7 +16204,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 4 unmodified lines
1606016204 db_offset = rq_create->u.response.doorbell_offset;
1606116205 if ((db_offset != LPFC_ULP0_RQ_DOORBELL) &&
1606216206 (db_offset != LPFC_ULP1_RQ_DOORBELL)) {
16063− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16207+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1606416208 "3270 RQ[%d] doorbell offset not "
1606516209 "supported: x%x\n", hrq->queue_id,
1606616210 db_offset);
@@ -16105,7 +16249,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 38 unmodified lines
1610516249 } else {
1610616250 switch (drq->entry_count) {
1610716251 default:
16108− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
16252+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1610916253 "2536 Unsupported RQ count. (%d)\n",
1611016254 drq->entry_count);
1611116255 if (drq->entry_count < 512) {
@@ -16191,6 +16335,7 @@ out: · 79 unmodified lines
1619116335 * @hrqp: The queue structure array to use to create the header receive queues.
1619216336 * @drqp: The queue structure array to use to create the data receive queues.
1619316337 * @cqp: The completion queue array to bind these receive queues to.
16338+ * @subtype: Functional purpose of the queue (MBOX, IO, ELS, NVMET, etc).
1619416339 *
1619516340 * This function creates a receive buffer queue pair , as detailed in @hrq and
1619616341 * @drq, on a port, described by @phba by sending a RQ_CREATE mailbox command
@@ -16242,7 +16387,7 @@ lpfc_mrq_create(struct lpfc_hba *phba, struct lpfc_queue **hrqp, · 45 unmodified lines
1624216387 LPFC_MBOX_OPCODE_FCOE_RQ_CREATE, length,
1624316388 LPFC_SLI4_MBX_NEMBED);
1624416389 if (alloclen < length) {
16245− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
16390+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1624616391 "3099 Allocated DMA memory size (%d) is "
1624716392 "less than the requested DMA memory size "
1624816393 "(%d)\n", alloclen, length);
@@ -16352,7 +16497,7 @@ lpfc_mrq_create(struct lpfc_hba *phba, struct lpfc_queue **hrqp, · 103 unmodified lines
1635216497 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1635316498 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1635416499 if (shdr_status || shdr_add_status || rc) {
16355− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16500+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1635616501 "3120 RQ_CREATE mailbox failed with "
1635716502 "status x%x add_status x%x, mbx status x%x\n",
1635816503 shdr_status, shdr_add_status, rc);
@@ -16380,6 +16525,7 @@ out: · 21 unmodified lines
1638016525
1638116526 /**
1638216527 * lpfc_eq_destroy - Destroy an event Queue on the HBA
16528+ * @phba: HBA structure that indicates port to destroy a queue on.
1638316529 * @eq: The queue structure associated with the queue to destroy.
1638416530 *
1638516531 * This function destroys a queue, as detailed in @eq by sending an mailbox
@@ -16422,7 +16568,7 @@ lpfc_eq_destroy(struct lpfc_hba *phba, struct lpfc_queue *eq) · 36 unmodified lines
1642216568 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1642316569 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1642416570 if (shdr_status || shdr_add_status || rc) {
16425− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16571+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1642616572 "2505 EQ_DESTROY mailbox failed with "
1642716573 "status x%x add_status x%x, mbx status x%x\n",
1642816574 shdr_status, shdr_add_status, rc);
@@ -16437,6 +16583,7 @@ lpfc_eq_destroy(struct lpfc_hba *phba, struct lpfc_queue *eq) · 8 unmodified lines
1643716583
1643816584 /**
1643916585 * lpfc_cq_destroy - Destroy a Completion Queue on the HBA
16586+ * @phba: HBA structure that indicates port to destroy a queue on.
1644016587 * @cq: The queue structure associated with the queue to destroy.
1644116588 *
1644216589 * This function destroys a queue, as detailed in @cq by sending an mailbox
@@ -16477,7 +16624,7 @@ lpfc_cq_destroy(struct lpfc_hba *phba, struct lpfc_queue *cq) · 34 unmodified lines
1647716624 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1647816625 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1647916626 if (shdr_status || shdr_add_status || rc) {
16480− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16627+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1648116628 "2506 CQ_DESTROY mailbox failed with "
1648216629 "status x%x add_status x%x, mbx status x%x\n",
1648316630 shdr_status, shdr_add_status, rc);
@@ -16491,7 +16638,8 @@ lpfc_cq_destroy(struct lpfc_hba *phba, struct lpfc_queue *cq) · 7 unmodified lines
1649116638
1649216639 /**
1649316640 * lpfc_mq_destroy - Destroy a Mailbox Queue on the HBA
16494− * @qm: The queue structure associated with the queue to destroy.
16641+ * @phba: HBA structure that indicates port to destroy a queue on.
16642+ * @mq: The queue structure associated with the queue to destroy.
1649516643 *
1649616644 * This function destroys a queue, as detailed in @mq by sending an mailbox
1649716645 * command, specific to the type of queue, to the HBA.
@@ -16531,7 +16679,7 @@ lpfc_mq_destroy(struct lpfc_hba *phba, struct lpfc_queue *mq) · 33 unmodified lines
1653116679 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1653216680 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1653316681 if (shdr_status || shdr_add_status || rc) {
16534− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16682+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1653516683 "2507 MQ_DESTROY mailbox failed with "
1653616684 "status x%x add_status x%x, mbx status x%x\n",
1653716685 shdr_status, shdr_add_status, rc);
@@ -16545,6 +16693,7 @@ lpfc_mq_destroy(struct lpfc_hba *phba, struct lpfc_queue *mq) · 7 unmodified lines
1654516693
1654616694 /**
1654716695 * lpfc_wq_destroy - Destroy a Work Queue on the HBA
16696+ * @phba: HBA structure that indicates port to destroy a queue on.
1654816697 * @wq: The queue structure associated with the queue to destroy.
1654916698 *
1655016699 * This function destroys a queue, as detailed in @wq by sending an mailbox
@@ -16584,7 +16733,7 @@ lpfc_wq_destroy(struct lpfc_hba *phba, struct lpfc_queue *wq) · 33 unmodified lines
1658416733 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1658516734 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1658616735 if (shdr_status || shdr_add_status || rc) {
16587− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16736+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1658816737 "2508 WQ_DESTROY mailbox failed with "
1658916738 "status x%x add_status x%x, mbx status x%x\n",
1659016739 shdr_status, shdr_add_status, rc);
@@ -16600,7 +16749,9 @@ lpfc_wq_destroy(struct lpfc_hba *phba, struct lpfc_queue *wq) · 9 unmodified lines
1660016749
1660116750 /**
1660216751 * lpfc_rq_destroy - Destroy a Receive Queue on the HBA
16603− * @rq: The queue structure associated with the queue to destroy.
16752+ * @phba: HBA structure that indicates port to destroy a queue on.
16753+ * @hrq: The queue structure associated with the queue to destroy.
16754+ * @drq: The queue structure associated with the queue to destroy.
1660416755 *
1660516756 * This function destroys a queue, as detailed in @rq by sending an mailbox
1660616757 * command, specific to the type of queue, to the HBA.
@@ -16641,7 +16792,7 @@ lpfc_rq_destroy(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 34 unmodified lines
1664116792 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1664216793 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1664316794 if (shdr_status || shdr_add_status || rc) {
16644− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16795+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1664516796 "2509 RQ_DESTROY mailbox failed with "
1664616797 "status x%x add_status x%x, mbx status x%x\n",
1664716798 shdr_status, shdr_add_status, rc);
@@ -16657,7 +16808,7 @@ lpfc_rq_destroy(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 9 unmodified lines
1665716808 shdr_status = bf_get(lpfc_mbox_hdr_status, &shdr->response);
1665816809 shdr_add_status = bf_get(lpfc_mbox_hdr_add_status, &shdr->response);
1665916810 if (shdr_status || shdr_add_status || rc) {
16660− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16811+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1666116812 "2510 RQ_DESTROY mailbox failed with "
1666216813 "status x%x add_status x%x, mbx status x%x\n",
1666316814 shdr_status, shdr_add_status, rc);
@@ -16705,7 +16856,7 @@ lpfc_sli4_post_sgl(struct lpfc_hba *phba, · 41 unmodified lines
1670516856 union lpfc_sli4_cfg_shdr *shdr;
1670616857
1670716858 if (xritag == NO_XRI) {
16708− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
16859+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1670916860 "0364 Invalid param:\n");
1671016861 return -EINVAL;
1671116862 }
@@ -16746,7 +16897,7 @@ lpfc_sli4_post_sgl(struct lpfc_hba *phba, · 34 unmodified lines
1674616897 if (rc != MBX_TIMEOUT)
1674716898 mempool_free(mbox, phba->mbox_mem_pool);
1674816899 if (shdr_status || shdr_add_status || rc) {
16749− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
16900+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1675016901 "2511 POST_SGL mailbox failed with "
1675116902 "status x%x add_status x%x, mbx status x%x\n",
1675216903 shdr_status, shdr_add_status, rc);
@@ -16793,6 +16944,7 @@ lpfc_sli4_alloc_xri(struct lpfc_hba *phba) · 40 unmodified lines
1679316944 /**
1679416945 * lpfc_sli4_free_xri - Release an xri for reuse.
1679516946 * @phba: pointer to lpfc hba data structure.
16947+ * @xri: xri to release.
1679616948 *
1679716949 * This routine is invoked to release an xri to the pool of
1679816950 * available rpis maintained by the driver.
@@ -16808,6 +16960,7 @@ __lpfc_sli4_free_xri(struct lpfc_hba *phba, int xri) · 9 unmodified lines
1680816960 /**
1680916961 * lpfc_sli4_free_xri - Release an xri for reuse.
1681016962 * @phba: pointer to lpfc hba data structure.
16963+ * @xri: xri to release.
1681116964 *
1681216965 * This routine is invoked to release an xri to the pool of
1681316966 * available rpis maintained by the driver.
@@ -16850,7 +17003,7 @@ lpfc_sli4_next_xritag(struct lpfc_hba *phba) · 36 unmodified lines
1685017003 * lpfc_sli4_post_sgl_list - post a block of ELS sgls to the port.
1685117004 * @phba: pointer to lpfc hba data structure.
1685217005 * @post_sgl_list: pointer to els sgl entry list.
16853− * @count: number of els sgl entries on the list.
17006+ * @post_cnt: number of els sgl entries on the list.
1685417007 *
1685517008 * This routine is invoked to post a block of driver's sgl pages to the
1685617009 * HBA using non-embedded mailbox command. No Lock is held. This routine
@@ -16877,7 +17030,7 @@ lpfc_sli4_post_sgl_list(struct lpfc_hba *phba, · 20 unmodified lines
1687717030 reqlen = post_cnt * sizeof(struct sgl_page_pairs) +
1687817031 sizeof(union lpfc_sli4_cfg_shdr) + sizeof(uint32_t);
1687917032 if (reqlen > SLI4_PAGE_SIZE) {
16880− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
17033+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1688117034 "2559 Block sgl registration required DMA "
1688217035 "size (%d) great than a page\n", reqlen);
1688317036 return -ENOMEM;
@@ -16893,7 +17046,7 @@ lpfc_sli4_post_sgl_list(struct lpfc_hba *phba, · 9 unmodified lines
1689317046 LPFC_SLI4_MBX_NEMBED);
1689417047
1689517048 if (alloclen < reqlen) {
16896− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
17049+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1689717050 "0285 Allocated DMA memory size (%d) is "
1689817051 "less than the requested DMA memory "
1689917052 "size (%d)\n", alloclen, reqlen);
@@ -16941,7 +17094,7 @@ lpfc_sli4_post_sgl_list(struct lpfc_hba *phba, · 41 unmodified lines
1694117094 if (rc != MBX_TIMEOUT)
1694217095 lpfc_sli4_mbox_cmd_free(phba, mbox);
1694317096 if (shdr_status || shdr_add_status || rc) {
16944− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
17097+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1694517098 "2513 POST_SGL_BLOCK mailbox command failed "
1694617099 "status x%x add_status x%x mbx status x%x\n",
1694717100 shdr_status, shdr_add_status, rc);
@@ -16989,7 +17142,7 @@ lpfc_sli4_post_io_sgl_block(struct lpfc_hba *phba, struct list_head *nblist, · 41 unmodified lines
1698917142 }
1699017143 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
1699117144 if (!mbox) {
16992− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
17145+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1699317146 "6119 Failed to allocate mbox cmd memory\n");
1699417147 return -ENOMEM;
1699517148 }
@@ -17000,7 +17153,7 @@ lpfc_sli4_post_io_sgl_block(struct lpfc_hba *phba, struct list_head *nblist, · 4 unmodified lines
1700017153 reqlen, LPFC_SLI4_MBX_NEMBED);
1700117154
1700217155 if (alloclen < reqlen) {
17003− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
17156+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1700417157 "6120 Allocated DMA memory size (%d) is "
1700517158 "less than the requested DMA memory "
1700617159 "size (%d)\n", alloclen, reqlen);
@@ -17054,7 +17207,7 @@ lpfc_sli4_post_io_sgl_block(struct lpfc_hba *phba, struct list_head *nblist, · 47 unmodified lines
1705417207 if (rc != MBX_TIMEOUT)
1705517208 lpfc_sli4_mbox_cmd_free(phba, mbox);
1705617209 if (shdr_status || shdr_add_status || rc) {
17057− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
17210+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1705817211 "6125 POST_SGL_BLOCK mailbox command failed "
1705917212 "status x%x add_status x%x mbx status x%x\n",
1706017213 shdr_status, shdr_add_status, rc);
@@ -17067,6 +17220,7 @@ lpfc_sli4_post_io_sgl_block(struct lpfc_hba *phba, struct list_head *nblist, · 6 unmodified lines
1706717220 * lpfc_sli4_post_io_sgl_list - Post blocks of nvme buffer sgls from a list
1706817221 * @phba: pointer to lpfc hba data structure.
1706917222 * @post_nblist: pointer to the nvme buffer list.
17223+ * @sb_count: number of nvme buffers.
1707017224 *
1707117225 * This routine walks a list of nvme buffers that was passed in. It attempts
1707217226 * to construct blocks of nvme buffer sgls which contains contiguous xris and
@@ -17300,6 +17454,7 @@ lpfc_fc_hdr_get_vfi(struct fc_frame_header *fc_hdr) · 227 unmodified lines
1730017454 * @phba: Pointer to the HBA structure to search for the vport on
1730117455 * @fc_hdr: A pointer to the FC Header data (In Big Endian Format)
1730217456 * @fcfi: The FC Fabric ID that the frame came from
17457+ * @did: Destination ID to match against
1730317458 *
1730417459 * This function searches the @phba for a vport that matches the content of the
1730517460 * @fc_hdr passed in and the @fcfi. This function uses the @fc_hdr to fetch the
@@ -17437,6 +17592,7 @@ lpfc_rcv_seq_check_edtov(struct lpfc_vport *vport) · 131 unmodified lines
1743717592
1743817593 /**
1743917594 * lpfc_fc_frame_add - Adds a frame to the vport's list of received sequences
17595+ * @vport: pointer to a vitural port
1744017596 * @dmabuf: pointer to a dmabuf that describes the hdr and data of the FC frame
1744117597 *
1744217598 * This function searches through the existing incomplete sequences that have
@@ -17638,7 +17794,7 @@ lpfc_sli4_seq_abort_rsp_cmpl(struct lpfc_hba *phba, · 195 unmodified lines
1763817794
1763917795 /* Failure means BLS ABORT RSP did not get delivered to remote node*/
1764017796 if (rsp_iocbq && rsp_iocbq->iocb.ulpStatus)
17641− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
17797+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1764217798 "3154 BLS ABORT RSP failed, data: x%x/x%x\n",
1764317799 rsp_iocbq->iocb.ulpStatus,
1764417800 rsp_iocbq->iocb.un.ulpWord[4]);
@@ -17667,8 +17823,9 @@ lpfc_sli4_xri_inrange(struct lpfc_hba *phba, · 22 unmodified lines
1766717823
1766817824 /**
1766917825 * lpfc_sli4_seq_abort_rsp - bls rsp to sequence abort
17670− * @phba: Pointer to HBA context object.
17826+ * @vport: pointer to a vitural port.
1767117827 * @fc_hdr: pointer to a FC frame header.
17828+ * @aborted: was the partially assembled receive sequence successfully aborted
1767217829 *
1767317830 * This function sends a basic response to a previous unsol sequence abort
1767417831 * event after aborting the sequence handling.
@@ -17800,7 +17957,7 @@ lpfc_sli4_seq_abort_rsp(struct lpfc_vport *vport, · 125 unmodified lines
1780017957
1780117958 rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, ctiocb, 0);
1780217959 if (rc == IOCB_ERROR) {
17803− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
17960+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1780417961 "2925 Failed to issue CT ABTS RSP x%x on "
1780517962 "xri x%x, Data x%x\n",
1780617963 icmd->un.xseq64.w5.hcsw.Rctl, oxid,
@@ -17820,7 +17977,7 @@ lpfc_sli4_seq_abort_rsp(struct lpfc_vport *vport, · 13 unmodified lines
1782017977 * receive sequence is only partially assembed by the driver, it shall abort
1782117978 * the partially assembled frames for the sequence. Otherwise, if the
1782217979 * unsolicited receive sequence has been completely assembled and passed to
17823− * the Upper Layer Protocol (UPL), it then mark the per oxid status for the
17980+ * the Upper Layer Protocol (ULP), it then mark the per oxid status for the
1782417981 * unsolicited sequence has been aborted. After that, it will issue a basic
1782517982 * accept to accept the abort.
1782617983 **/
@@ -17907,7 +18064,7 @@ lpfc_seq_complete(struct hbq_dmabuf *dmabuf) · 80 unmodified lines
1790718064 /**
1790818065 * lpfc_prep_seq - Prep sequence for ULP processing
1790918066 * @vport: Pointer to the vport on which this sequence was received
17910− * @dmabuf: pointer to a dmabuf that describes the FC sequence
18067+ * @seq_dmabuf: pointer to a dmabuf that describes the FC sequence
1791118068 *
1791218069 * This function takes a sequence, described by a list of frames, and creates
1791318070 * a list of iocbq structures to describe the sequence. This iocbq list will be
@@ -18050,7 +18207,7 @@ lpfc_sli4_send_seq_to_ulp(struct lpfc_vport *vport, · 136 unmodified lines
1805018207 fc_hdr = (struct fc_frame_header *)seq_dmabuf->hbuf.virt;
1805118208 iocbq = lpfc_prep_seq(vport, seq_dmabuf);
1805218209 if (!iocbq) {
18053− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
18210+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1805418211 "2707 Ring %d handler: Failed to allocate "
1805518212 "iocb Rctl x%x Type x%x received\n",
1805618213 LPFC_ELS_RING,
@@ -18061,7 +18218,7 @@ lpfc_sli4_send_seq_to_ulp(struct lpfc_vport *vport, · 4 unmodified lines
1806118218 phba->sli4_hba.els_wq->pring,
1806218219 iocbq, fc_hdr->fh_r_ctl,
1806318220 fc_hdr->fh_type))
18064− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
18221+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1806518222 "2540 Ring %d handler: unexpected Rctl "
1806618223 "x%x Type x%x received\n",
1806718224 LPFC_ELS_RING,
@@ -18180,6 +18337,7 @@ exit: · 112 unmodified lines
1818018337 /**
1818118338 * lpfc_sli4_handle_received_buffer - Handle received buffers from firmware
1818218339 * @phba: Pointer to HBA context object.
18340+ * @dmabuf: Pointer to a dmabuf that describes the FC sequence.
1818318341 *
1818418342 * This function is called with no lock held. This function processes all
1818518343 * the received buffers and gives it to upper layers when a received buffer
@@ -18326,7 +18484,7 @@ lpfc_sli4_post_all_rpi_hdrs(struct lpfc_hba *phba) · 140 unmodified lines
1832618484
1832718485 rc = lpfc_sli4_post_rpi_hdr(phba, rpi_page);
1832818486 if (rc != MBX_SUCCESS) {
18329− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
18487+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1833018488 "2008 Error %d posting all rpi "
1833118489 "headers\n", rc);
1833218490 rc = -EIO;
@@ -18372,7 +18530,7 @@ lpfc_sli4_post_rpi_hdr(struct lpfc_hba *phba, struct lpfc_rpi_hdr *rpi_page) · 39 unmodified lines
1837218530 /* The port is notified of the header region via a mailbox command. */
1837318531 mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
1837418532 if (!mboxq) {
18375− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
18533+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1837618534 "2001 Unable to allocate memory for issuing "
1837718535 "SLI_CONFIG_SPECIAL mailbox command\n");
1837818536 return -ENOMEM;
@@ -18402,7 +18560,7 @@ lpfc_sli4_post_rpi_hdr(struct lpfc_hba *phba, struct lpfc_rpi_hdr *rpi_page) · 23 unmodified lines
1840218560 if (rc != MBX_TIMEOUT)
1840318561 mempool_free(mboxq, phba->mbox_mem_pool);
1840418562 if (shdr_status || shdr_add_status || rc) {
18405− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
18563+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1840618564 "2514 POST_RPI_HDR mailbox failed with "
1840718565 "status x%x add_status x%x, mbx status x%x\n",
1840818566 shdr_status, shdr_add_status, rc);
@@ -18492,7 +18650,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) · 83 unmodified lines
1849218650 if (rpi_remaining < LPFC_RPI_LOW_WATER_MARK) {
1849318651 rpi_hdr = lpfc_sli4_create_rpi_hdr(phba);
1849418652 if (!rpi_hdr) {
18495− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
18653+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1849618654 "2002 Error Could not grow rpi "
1849718655 "count\n");
1849818656 } else {
@@ -18508,6 +18666,7 @@ lpfc_sli4_alloc_rpi(struct lpfc_hba *phba) · 9 unmodified lines
1850818666 /**
1850918667 * lpfc_sli4_free_rpi - Release an rpi for reuse.
1851018668 * @phba: pointer to lpfc hba data structure.
18669+ * @rpi: rpi to free
1851118670 *
1851218671 * This routine is invoked to release an rpi to the pool of
1851318672 * available rpis maintained by the driver.
@@ -18536,6 +18695,7 @@ __lpfc_sli4_free_rpi(struct lpfc_hba *phba, int rpi) · 22 unmodified lines
1853618695 /**
1853718696 * lpfc_sli4_free_rpi - Release an rpi for reuse.
1853818697 * @phba: pointer to lpfc hba data structure.
18698+ * @rpi: rpi to free
1853918699 *
1854018700 * This routine is invoked to release an rpi to the pool of
1854118701 * available rpis maintained by the driver.
@@ -18565,7 +18725,9 @@ lpfc_sli4_remove_rpis(struct lpfc_hba *phba) · 23 unmodified lines
1856518725
1856618726 /**
1856718727 * lpfc_sli4_resume_rpi - Remove the rpi bitmask region
18568− * @phba: pointer to lpfc hba data structure.
18728+ * @ndlp: pointer to lpfc nodelist data structure.
18729+ * @cmpl: completion call-back.
18730+ * @arg: data to load as MBox 'caller buffer information'
1856918731 *
1857018732 * This routine is invoked to remove the memory region that
1857118733 * provided rpi via a bitmask.
@@ -18594,7 +18756,7 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, · 22 unmodified lines
1859418756 mboxq->vport = ndlp->vport;
1859518757 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT);
1859618758 if (rc == MBX_NOT_FINISHED) {
18597− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
18759+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1859818760 "2010 Resume RPI Mailbox failed "
1859918761 "status %d, mbxStatus x%x\n", rc,
1860018762 bf_get(lpfc_mqe_status, &mboxq->u.mqe));
@@ -18629,7 +18791,7 @@ lpfc_sli4_init_vpi(struct lpfc_vport *vport) · 28 unmodified lines
1862918791 mbox_tmo = lpfc_mbox_tmo_val(phba, mboxq);
1863018792 rc = lpfc_sli_issue_mbox_wait(phba, mboxq, mbox_tmo);
1863118793 if (rc != MBX_SUCCESS) {
18632− lpfc_printf_vlog(vport, KERN_ERR, LOG_SLI,
18794+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
1863318795 "2022 INIT VPI Mailbox failed "
1863418796 "status %d, mbxStatus x%x\n", rc,
1863518797 bf_get(lpfc_mqe_status, &mboxq->u.mqe));
@@ -18665,7 +18827,7 @@ lpfc_mbx_cmpl_add_fcf_record(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 29 unmodified lines
1866518827
1866618828 if ((shdr_status || shdr_add_status) &&
1866718829 (shdr_status != STATUS_FCF_IN_USE))
18668− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
18830+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1866918831 "2558 ADD_FCF_RECORD mailbox failed with "
1867018832 "status x%x add_status x%x\n",
1867118833 shdr_status, shdr_add_status);
@@ -18695,7 +18857,7 @@ lpfc_sli4_add_fcf_record(struct lpfc_hba *phba, struct fcf_record *fcf_record) · 23 unmodified lines
1869518857
1869618858 mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
1869718859 if (!mboxq) {
18698− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
18860+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1869918861 "2009 Failed to allocate mbox for ADD_FCF cmd\n");
1870018862 return -ENOMEM;
1870118863 }
@@ -18708,7 +18870,7 @@ lpfc_sli4_add_fcf_record(struct lpfc_hba *phba, struct fcf_record *fcf_record) · 6 unmodified lines
1870818870 LPFC_MBOX_OPCODE_FCOE_ADD_FCF,
1870918871 req_len, LPFC_SLI4_MBX_NEMBED);
1871018872 if (alloc_len < req_len) {
18711− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
18873+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1871218874 "2523 Allocated DMA memory size (x%x) is "
1871318875 "less than the requested DMA memory "
1871418876 "size (x%x)\n", alloc_len, req_len);
@@ -18741,7 +18903,7 @@ lpfc_sli4_add_fcf_record(struct lpfc_hba *phba, struct fcf_record *fcf_record) · 26 unmodified lines
1874118903 mboxq->mbox_cmpl = lpfc_mbx_cmpl_add_fcf_record;
1874218904 rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_NOWAIT);
1874318905 if (rc == MBX_NOT_FINISHED) {
18744− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
18906+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1874518907 "2515 ADD_FCF_RECORD mailbox failed with "
1874618908 "status 0x%x\n", rc);
1874718909 lpfc_sli4_mbox_cmd_free(phba, mboxq);
@@ -18814,7 +18976,7 @@ lpfc_sli4_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, uint16_t fcf_index) · 66 unmodified lines
1881418976 phba->fcoe_cvl_eventtag_attn = phba->fcoe_cvl_eventtag;
1881518977 mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
1881618978 if (!mboxq) {
18817− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
18979+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1881818980 "2000 Failed to allocate mbox for "
1881918981 "READ_FCF cmd\n");
1882018982 error = -ENOMEM;
@@ -18949,7 +19111,7 @@ fail_fcf_read: · 128 unmodified lines
1894919111
1895019112 /**
1895119113 * lpfc_check_next_fcf_pri_level
18952− * phba pointer to the lpfc_hba struct for this port.
19114+ * @phba: pointer to the lpfc_hba struct for this port.
1895319115 * This routine is called from the lpfc_sli4_fcf_rr_next_index_get
1895419116 * routine when the rr_bmask is empty. The FCF indecies are put into the
1895519117 * rr_bmask based on their priority level. Starting from the highest priority
@@ -19114,6 +19276,7 @@ next_priority: · 158 unmodified lines
1911419276 /**
1911519277 * lpfc_sli4_fcf_rr_index_set - Set bmask with eligible fcf record index
1911619278 * @phba: pointer to lpfc hba data structure.
19279+ * @fcf_index: index into the FCF table to 'set'
1911719280 *
1911819281 * This routine sets the FCF record index in to the eligible bmask for
1911919282 * roundrobin failover search. It checks to make sure that the index
@@ -19146,6 +19309,7 @@ lpfc_sli4_fcf_rr_index_set(struct lpfc_hba *phba, uint16_t fcf_index) · 26 unmodified lines
1914619309 /**
1914719310 * lpfc_sli4_fcf_rr_index_clear - Clear bmask from eligible fcf record index
1914819311 * @phba: pointer to lpfc hba data structure.
19312+ * @fcf_index: index into the FCF table to 'clear'
1914919313 *
1915019314 * This routine clears the FCF record index from the eligible bmask for
1915119315 * roundrobin failover search. It checks to make sure that the index
@@ -19183,6 +19347,7 @@ lpfc_sli4_fcf_rr_index_clear(struct lpfc_hba *phba, uint16_t fcf_index) · 31 unmodified lines
1918319347 /**
1918419348 * lpfc_mbx_cmpl_redisc_fcf_table - completion routine for rediscover FCF table
1918519349 * @phba: pointer to lpfc hba data structure.
19350+ * @mbox: An allocated pointer to type LPFC_MBOXQ_t
1918619351 *
1918719352 * This routine is the completion routine for the rediscover FCF table mailbox
1918819353 * command. If the mailbox command returned failure, it will try to stop the
@@ -19257,7 +19422,7 @@ lpfc_sli4_redisc_fcf_table(struct lpfc_hba *phba) · 68 unmodified lines
1925719422
1925819423 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
1925919424 if (!mbox) {
19260− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
19425+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1926119426 "2745 Failed to allocate mbox for "
1926219427 "requesting FCF rediscover.\n");
1926319428 return -ENOMEM;
@@ -19325,14 +19490,14 @@ lpfc_sli_get_config_region23(struct lpfc_hba *phba, char *rgn23_data) · 61 unmodified lines
1932519490 LPFC_MBOXQ_t *pmb = NULL;
1932619491 MAILBOX_t *mb;
1932719492 uint32_t offset = 0;
19328− int rc;
19493+ int i, rc;
1932919494
1933019495 if (!rgn23_data)
1933119496 return 0;
1933219497
1933319498 pmb = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
1933419499 if (!pmb) {
19335− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
19500+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1933619501 "2600 failed to allocate mailbox memory\n");
1933719502 return 0;
1933819503 }
@@ -19355,14 +19520,14 @@ lpfc_sli_get_config_region23(struct lpfc_hba *phba, char *rgn23_data) · 16 unmodified lines
1935519520 */
1935619521 if (mb->un.varDmp.word_cnt == 0)
1935719522 break;
19358− if (mb->un.varDmp.word_cnt > DMP_RGN23_SIZE - offset)
19359− mb->un.varDmp.word_cnt = DMP_RGN23_SIZE - offset;
1936019523
19524+ i = mb->un.varDmp.word_cnt * sizeof(uint32_t);
19525+ if (offset + i > DMP_RGN23_SIZE)
19526+ i = DMP_RGN23_SIZE - offset;
1936119527 lpfc_sli_pcimem_bcopy(((uint8_t *)mb) + DMP_RSP_OFFSET,
19362− rgn23_data + offset,
19363− mb->un.varDmp.word_cnt);
19364− offset += mb->un.varDmp.word_cnt;
19365− } while (mb->un.varDmp.word_cnt && offset < DMP_RGN23_SIZE);
19528+ rgn23_data + offset, i);
19529+ offset += i;
19530+ } while (offset < DMP_RGN23_SIZE);
1936619531
1936719532 mempool_free(pmb, phba->mbox_mem_pool);
1936819533 return offset;
@@ -19391,7 +19556,7 @@ lpfc_sli4_get_config_region23(struct lpfc_hba *phba, char *rgn23_data) · 22 unmodified lines
1939119556
1939219557 mboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
1939319558 if (!mboxq) {
19394− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
19559+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1939519560 "3105 failed to allocate mailbox memory\n");
1939619561 return 0;
1939719562 }
@@ -19455,7 +19620,7 @@ lpfc_sli_read_link_ste(struct lpfc_hba *phba) · 57 unmodified lines
1945519620
1945619621 /* Check the region signature first */
1945719622 if (memcmp(&rgn23_data[offset], LPFC_REGION23_SIGNATURE, 4)) {
19458− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
19623+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1945919624 "2619 Config region 23 has bad signature\n");
1946019625 goto out;
1946119626 }
@@ -19463,7 +19628,7 @@ lpfc_sli_read_link_ste(struct lpfc_hba *phba) · 1 unmodified line
1946319628
1946419629 /* Check the data structure version */
1946519630 if (rgn23_data[offset] != LPFC_REGION23_VERSION) {
19466− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
19631+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1946719632 "2620 Config region 23 has bad version\n");
1946819633 goto out;
1946919634 }
@@ -19640,7 +19805,7 @@ lpfc_wr_object(struct lpfc_hba *phba, struct list_head *dmabuf_list, · 170 unmodified lines
1964019805 if (rc != MBX_TIMEOUT)
1964119806 mempool_free(mbox, phba->mbox_mem_pool);
1964219807 if (shdr_status || shdr_add_status || rc) {
19643− lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
19808+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1964419809 "3025 Write Object mailbox failed with "
1964519810 "status x%x add_status x%x, mbx status x%x\n",
1964619811 shdr_status, shdr_add_status, rc);
@@ -19820,7 +19985,7 @@ lpfc_drain_txq(struct lpfc_hba *phba) · 173 unmodified lines
1982019985 piocbq = lpfc_sli_ringtx_get(phba, pring);
1982119986 if (!piocbq) {
1982219987 spin_unlock_irqrestore(&pring->ring_lock, iflags);
19823− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
19988+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1982419989 "2823 txq empty and txq_cnt is %d\n ",
1982519990 txq_cnt);
1982619991 break;
@@ -19849,7 +20014,7 @@ lpfc_drain_txq(struct lpfc_hba *phba) · 22 unmodified lines
1984920014
1985020015 if (fail_msg) {
1985120016 /* Failed means we can't issue and need to cancel */
19852− lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
20017+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
1985320018 "2822 IOCB failed %s iotag 0x%x "
1985420019 "xri 0x%x\n",
1985520020 fail_msg,
@@ -19869,7 +20034,7 @@ lpfc_drain_txq(struct lpfc_hba *phba) · 13 unmodified lines
1986920034 /**
1987020035 * lpfc_wqe_bpl2sgl - Convert the bpl/bde to a sgl.
1987120036 * @phba: Pointer to HBA context object.
19872− * @pwqe: Pointer to command WQE.
20037+ * @pwqeq: Pointer to command WQE.
1987320038 * @sglq: Pointer to the scatter gather queue object.
1987420039 *
1987520040 * This routine converts the bpl or bde that is in the WQE
@@ -19994,7 +20159,7 @@ lpfc_wqe_bpl2sgl(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeq, · 118 unmodified lines
1999420159 /**
1999520160 * lpfc_sli4_issue_wqe - Issue an SLI4 Work Queue Entry (WQE)
1999620161 * @phba: Pointer to HBA context object.
19997− * @ring_number: Base sli ring number
20162+ * @qp: Pointer to HDW queue.
1999820163 * @pwqe: Pointer to command WQE.
1999920164 **/
2000020165 int
@@ -20276,6 +20441,7 @@ void lpfc_move_xri_pvt_to_pbl(struct lpfc_hba *phba, u32 hwqid) · 275 unmodified lines
2027620441 /**
2027720442 * _lpfc_move_xri_pbl_to_pvt - Move some XRIs from public to private pool
2027820443 * @phba: pointer to lpfc hba data structure
20444+ * @qp: pointer to HDW queue
2027920445 * @pbl_pool: specified public free XRI pool
2028020446 * @pvt_pool: specified private free XRI pool
2028120447 * @count: number of XRIs to move
@@ -20405,7 +20571,7 @@ void lpfc_move_xri_pbl_to_pvt(struct lpfc_hba *phba, u32 hwqid, u32 count) · 123 unmodified lines
2040520571 /**
2040620572 * lpfc_keep_pvt_pool_above_lowwm - Keep pvt_pool above low watermark
2040720573 * @phba: pointer to lpfc hba data structure.
20408− * @qp: belong to which HWQ.
20574+ * @hwqid: belong to which HWQ.
2040920575 *
2041020576 * This routine get a batch of XRIs from pbl_pool if pvt_pool is less than
2041120577 * low watermark.
@@ -20527,6 +20693,7 @@ void lpfc_release_io_buf(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_ncmd, · 115 unmodified lines
2052720693 /**
2052820694 * lpfc_get_io_buf_from_private_pool - Get one free IO buf from private pool
2052920695 * @phba: pointer to lpfc hba data structure.
20696+ * @qp: pointer to HDW queue
2053020697 * @pvt_pool: pointer to private pool data structure.
2053120698 * @ndlp: pointer to lpfc nodelist data structure.
2053220699 *
drivers/scsi/lpfc/lpfc_sli4.h+18−0
@@ -20,6 +20,9 @@ · 19 unmodified lines
2020 * included with this package. *
2121 *******************************************************************/
2222
23+#include <linux/irq_poll.h>
24+#include <linux/cpufreq.h>
25+
2326 #if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_SCSI_LPFC_DEBUG_FS)
2427 #define CONFIG_SCSI_LPFC_DEBUG_FS
2528 #endif
@@ -135,6 +138,16 @@ struct lpfc_rqb { · 109 unmodified lines
135138 struct rqb_dmabuf *);
136139 };
137140
141+enum lpfc_poll_mode {
142+ LPFC_QUEUE_WORK,
143+ LPFC_IRQ_POLL
144+};
145+
146+struct lpfc_idle_stat {
147+ u64 prev_idle;
148+ u64 prev_wall;
149+};
150+
138151 struct lpfc_queue {
139152 struct list_head list;
140153 struct list_head wq_list;
@@ -265,6 +278,10 @@ struct lpfc_queue { · 124 unmodified lines
265278 struct lpfc_queue *assoc_qp;
266279 struct list_head _poll_list;
267280 void **q_pgs; /* array to index entries per page */
281+
282+#define LPFC_IRQ_POLL_WEIGHT 256
283+ struct irq_poll iop;
284+ enum lpfc_poll_mode poll_mode;
268285 };
269286
270287 struct lpfc_sli4_link {
@@ -926,6 +943,7 @@ struct lpfc_sli4_hba { · 655 unmodified lines
926943 #ifdef CONFIG_SCSI_LPFC_DEBUG_FS
927944 struct lpfc_hdwq_stat __percpu *c_stat;
928945 #endif
946+ struct lpfc_idle_stat *idle_stat;
929947 uint32_t conf_trunk;
930948 #define lpfc_conf_trunk_port0_WORD conf_trunk
931949 #define lpfc_conf_trunk_port0_SHIFT 0
drivers/scsi/lpfc/lpfc_version.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 * included with this package. *
2121 *******************************************************************/
2222
23−#define LPFC_DRIVER_VERSION "12.8.0.1"
23+#define LPFC_DRIVER_VERSION "12.8.0.2"
2424 #define LPFC_DRIVER_NAME "lpfc"
2525
2626 /* Used for SLI 2/3 */
drivers/scsi/lpfc/lpfc_vport.c+39−47
@@ -145,7 +145,7 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport) · 144 unmodified lines
145145 rc = lpfc_sli_issue_mbox_wait(phba, pmb, phba->fc_ratov * 2);
146146 if (rc != MBX_SUCCESS) {
147147 if (signal_pending(current)) {
148− lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT | LOG_VPORT,
148+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
149149 "1830 Signal aborted mbxCmd x%x\n",
150150 mb->mbxCommand);
151151 lpfc_mbuf_free(phba, mp->virt, mp->phys);
@@ -154,7 +154,7 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport) · 2 unmodified lines
154154 mempool_free(pmb, phba->mbox_mem_pool);
155155 return -EINTR;
156156 } else {
157− lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT | LOG_VPORT,
157+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
158158 "1818 VPort failed init, mbxCmd x%x "
159159 "READ_SPARM mbxStatus x%x, rc = x%x\n",
160160 mb->mbxCommand, mb->mbxStatus, rc);
@@ -190,7 +190,7 @@ lpfc_valid_wwn_format(struct lpfc_hba *phba, struct lpfc_name *wwn, · 29 unmodified lines
190190 ((wwn->u.wwn[0] & 0xf) != 0 || (wwn->u.wwn[1] & 0xf) != 0)))
191191 return 1;
192192
193− lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
193+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
194194 "1822 Invalid %s: %02x:%02x:%02x:%02x:"
195195 "%02x:%02x:%02x:%02x\n",
196196 name_type,
@@ -284,11 +284,11 @@ static void lpfc_discovery_wait(struct lpfc_vport *vport) · 87 unmodified lines
284284 }
285285
286286 if (time_after(jiffies, wait_time_max))
287− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
288− "1835 Vport discovery quiesce failed:"
289− " state x%x fc_flags x%x wait msecs x%x\n",
290− vport->port_state, vport->fc_flag,
291− jiffies_to_msecs(jiffies - start_time));
287+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
288+ "1835 Vport discovery quiesce failed:"
289+ " state x%x fc_flags x%x wait msecs x%x\n",
290+ vport->port_state, vport->fc_flag,
291+ jiffies_to_msecs(jiffies - start_time));
292292 }
293293
294294 int
@@ -305,7 +305,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 10 unmodified lines
305305 int status;
306306
307307 if ((phba->sli_rev < 3) || !(phba->cfg_enable_npiv)) {
308− lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
308+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
309309 "1808 Create VPORT failed: "
310310 "NPIV is not enabled: SLImode:%d\n",
311311 phba->sli_rev);
@@ -315,7 +315,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 3 unmodified lines
315315
316316 /* NPIV is not supported if HBA has NVME Target enabled */
317317 if (phba->nvmet_support) {
318− lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
318+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
319319 "3189 Create VPORT failed: "
320320 "NPIV is not supported on NVME Target\n");
321321 rc = VPORT_INVAL;
@@ -324,7 +324,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 2 unmodified lines
324324
325325 vpi = lpfc_alloc_vpi(phba);
326326 if (vpi == 0) {
327− lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
327+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
328328 "1809 Create VPORT failed: "
329329 "Max VPORTs (%d) exceeded\n",
330330 phba->max_vpi);
@@ -334,7 +334,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 3 unmodified lines
334334
335335 /* Assign an unused board number */
336336 if ((instance = lpfc_get_instance()) < 0) {
337− lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
337+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
338338 "1810 Create VPORT failed: Cannot get "
339339 "instance number\n");
340340 lpfc_free_vpi(phba, vpi);
@@ -344,7 +344,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 3 unmodified lines
344344
345345 vport = lpfc_create_port(phba, instance, &fc_vport->dev);
346346 if (!vport) {
347− lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
347+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
348348 "1811 Create VPORT failed: vpi x%x\n", vpi);
349349 lpfc_free_vpi(phba, vpi);
350350 rc = VPORT_NORESOURCES;
@@ -356,11 +356,11 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 5 unmodified lines
356356
357357 if ((status = lpfc_vport_sparm(phba, vport))) {
358358 if (status == -EINTR) {
359− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
359+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
360360 "1831 Create VPORT Interrupted.\n");
361361 rc = VPORT_ERROR;
362362 } else {
363− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
363+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
364364 "1813 Create VPORT failed. "
365365 "Cannot get sparam\n");
366366 rc = VPORT_NORESOURCES;
@@ -378,7 +378,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 11 unmodified lines
378378
379379 if (!lpfc_valid_wwn_format(phba, &vport->fc_sparam.nodeName, "WWNN") ||
380380 !lpfc_valid_wwn_format(phba, &vport->fc_sparam.portName, "WWPN")) {
381− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
381+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
382382 "1821 Create VPORT failed. "
383383 "Invalid WWN format\n");
384384 lpfc_free_vpi(phba, vpi);
@@ -388,7 +388,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 3 unmodified lines
388388 }
389389
390390 if (!lpfc_unique_wwpn(phba, vport)) {
391− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
391+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
392392 "1823 Create VPORT failed. "
393393 "Duplicate WWN on HBA\n");
394394 lpfc_free_vpi(phba, vpi);
@@ -426,7 +426,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 31 unmodified lines
426426 (pport->fc_flag & FC_VFI_REGISTERED)) {
427427 rc = lpfc_sli4_init_vpi(vport);
428428 if (rc) {
429− lpfc_printf_log(phba, KERN_ERR, LOG_VPORT,
429+ lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
430430 "1838 Failed to INIT_VPI on vpi %d "
431431 "status %d\n", vpi, rc);
432432 rc = VPORT_NORESOURCES;
@@ -469,7 +469,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 36 unmodified lines
469469 lpfc_initial_fdisc(vport);
470470 } else {
471471 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
472− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
472+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
473473 "0262 No NPIV Fabric support\n");
474474 }
475475 } else {
@@ -478,8 +478,8 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) · 2 unmodified lines
478478 rc = VPORT_OK;
479479
480480 out:
481− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
482− "1825 Vport Created.\n");
481+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
482+ "1825 Vport Created.\n");
483483 lpfc_host_attrib_init(lpfc_shost_from_vport(vport));
484484 error_out:
485485 return rc;
@@ -534,7 +534,7 @@ disable_vport(struct fc_vport *fc_vport) · 48 unmodified lines
534534 }
535535
536536 lpfc_vport_set_state(vport, FC_VPORT_DISABLED);
537− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
537+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
538538 "1826 Vport Disabled.\n");
539539 return VPORT_OK;
540540 }
@@ -575,7 +575,7 @@ enable_vport(struct fc_vport *fc_vport) · 34 unmodified lines
575575 lpfc_initial_fdisc(vport);
576576 } else {
577577 lpfc_vport_set_state(vport, FC_VPORT_NO_FABRIC_SUPP);
578− lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS,
578+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
579579 "0264 No NPIV Fabric support\n");
580580 }
581581 } else {
@@ -583,7 +583,7 @@ enable_vport(struct fc_vport *fc_vport) · 1 unmodified line
583583 }
584584
585585 out:
586− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
586+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
587587 "1827 Vport Enabled.\n");
588588 return VPORT_OK;
589589 }
@@ -609,7 +609,7 @@ lpfc_vport_delete(struct fc_vport *fc_vport) · 19 unmodified lines
609609 bool ns_ndlp_referenced = false;
610610
611611 if (vport->port_type == LPFC_PHYSICAL_PORT) {
612− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
612+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
613613 "1812 vport_delete failed: Cannot delete "
614614 "physical host\n");
615615 return VPORT_ERROR;
@@ -618,7 +618,7 @@ lpfc_vport_delete(struct fc_vport *fc_vport) · 2 unmodified lines
618618 /* If the vport is a static vport fail the deletion. */
619619 if ((vport->vport_flag & STATIC_VPORT) &&
620620 !(phba->pport->load_flag & FC_UNLOADING)) {
621− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
621+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
622622 "1837 vport_delete failed: Cannot delete "
623623 "static vport.\n");
624624 return VPORT_ERROR;
@@ -642,27 +642,16 @@ lpfc_vport_delete(struct fc_vport *fc_vport) · 17 unmodified lines
642642 vport->port_state < LPFC_VPORT_READY)
643643 return -EAGAIN;
644644 }
645+
645646 /*
646− * This is a bit of a mess. We want to ensure the shost doesn't get
647− * torn down until we're done with the embedded lpfc_vport structure.
648− *
649− * Beyond holding a reference for this function, we also need a
650− * reference for outstanding I/O requests we schedule during delete
651− * processing. But once we scsi_remove_host() we can no longer obtain
652− * a reference through scsi_host_get().
653− *
654− * So we take two references here. We release one reference at the
655− * bottom of the function -- after delinking the vport. And we
656− * release the other at the completion of the unreg_vpi that get's
657− * initiated after we've disposed of all other resources associated
658− * with the port.
647+ * Take early refcount for outstanding I/O requests we schedule during
648+ * delete processing for unreg_vpi. Always keep this before
649+ * scsi_remove_host() as we can no longer obtain a reference through
650+ * scsi_host_get() after scsi_host_remove as shost is set to SHOST_DEL.
659651 */
660652 if (!scsi_host_get(shost))
661653 return VPORT_INVAL;
662− if (!scsi_host_get(shost)) {
663− scsi_host_put(shost);
664− return VPORT_INVAL;
665− }
654+
666655 lpfc_free_sysfs_attr(vport);
667656
668657 lpfc_debugfs_terminate(vport);
@@ -809,15 +798,16 @@ skip_logo: · 140 unmodified lines
809798 if (!(vport->vpi_state & LPFC_VPI_REGISTERED) ||
810799 lpfc_mbx_unreg_vpi(vport))
811800 scsi_host_put(shost);
812− } else
801+ } else {
813802 scsi_host_put(shost);
803+ }
814804
815805 lpfc_free_vpi(phba, vport->vpi);
816806 vport->work_port_events = 0;
817807 spin_lock_irq(&phba->port_list_lock);
818808 list_del_init(&vport->listentry);
819809 spin_unlock_irq(&phba->port_list_lock);
820− lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT,
810+ lpfc_printf_vlog(vport, KERN_ERR, LOG_TRACE_EVENT,
821811 "1828 Vport Deleted.\n");
822812 scsi_host_put(shost);
823813 return VPORT_OK;
@@ -838,7 +828,8 @@ lpfc_create_vport_work_array(struct lpfc_hba *phba) · 14 unmodified lines
838828 if (port_iterator->load_flag & FC_UNLOADING)
839829 continue;
840830 if (!scsi_host_get(lpfc_shost_from_vport(port_iterator))) {
841− lpfc_printf_vlog(port_iterator, KERN_ERR, LOG_VPORT,
831+ lpfc_printf_vlog(port_iterator, KERN_ERR,
832+ LOG_TRACE_EVENT,
842833 "1801 Create vport work array FAILED: "
843834 "cannot do scsi_host_get\n");
844835 continue;
@@ -908,7 +899,8 @@ lpfc_alloc_bucket(struct lpfc_vport *vport) · 63 unmodified lines
908899 GFP_ATOMIC);
909900
910901 if (!ndlp->lat_data)
911− lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE,
902+ lpfc_printf_vlog(vport, KERN_ERR,
903+ LOG_TRACE_EVENT,
912904 "0287 lpfc_alloc_bucket failed to "
913905 "allocate statistical data buffer DID "
914906 "0x%x\n", ndlp->nlp_DID);
drivers/scsi/megaraid.c+109−113
@@ -124,7 +124,7 @@ static int trace_level; · 123 unmodified lines
124124
125125 /**
126126 * mega_setup_mailbox()
127− * @adapter - pointer to our soft state
127+ * @adapter: pointer to our soft state
128128 *
129129 * Allocates a 8 byte aligned memory for the handshake mailbox.
130130 */
@@ -347,7 +347,7 @@ mega_query_adapter(adapter_t *adapter) · 216 unmodified lines
347347
348348 /**
349349 * mega_runpendq()
350− * @adapter - pointer to our soft state
350+ * @adapter: pointer to our soft state
351351 *
352352 * Runs through the list of pending requests.
353353 */
@@ -413,8 +413,8 @@ static DEF_SCSI_QCMD(megaraid_queue) · 59 unmodified lines
413413
414414 /**
415415 * mega_allocate_scb()
416− * @adapter - pointer to our soft state
417− * @cmd - scsi command from the mid-layer
416+ * @adapter: pointer to our soft state
417+ * @cmd: scsi command from the mid-layer
418418 *
419419 * Allocate a SCB structure. This is the central structure for controller
420420 * commands.
@@ -444,9 +444,9 @@ mega_allocate_scb(adapter_t *adapter, struct scsi_cmnd *cmd) · 23 unmodified lines
444444
445445 /**
446446 * mega_get_ldrv_num()
447− * @adapter - pointer to our soft state
448− * @cmd - scsi mid layer command
449− * @channel - channel on the controller
447+ * @adapter: pointer to our soft state
448+ * @cmd: scsi mid layer command
449+ * @channel: channel on the controller
450450 *
451451 * Calculate the logical drive number based on the information in scsi command
452452 * and the channel number.
@@ -503,9 +503,9 @@ mega_get_ldrv_num(adapter_t *adapter, struct scsi_cmnd *cmd, int channel) · 50 unmodified lines
503503
504504 /**
505505 * mega_build_cmd()
506− * @adapter - pointer to our soft state
507− * @cmd - Prepare using this scsi command
508− * @busy - busy flag if no resources
506+ * @adapter: pointer to our soft state
507+ * @cmd: Prepare using this scsi command
508+ * @busy: busy flag if no resources
509509 *
510510 * Prepares a command and scatter gather list for the controller. This routine
511511 * also finds out if the commands is intended for a logical drive or a
@@ -517,7 +517,6 @@ mega_get_ldrv_num(adapter_t *adapter, struct scsi_cmnd *cmd, int channel) · 5 unmodified lines
517517 static scb_t *
518518 mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy)
519519 {
520− mega_ext_passthru *epthru;
521520 mega_passthru *pthru;
522521 scb_t *scb;
523522 mbox_t *mbox;
@@ -905,7 +904,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) · 381 unmodified lines
905904
906905 if( adapter->support_ext_cdb ) {
907906
908− epthru = mega_prepare_extpassthru(adapter, scb, cmd,
907+ mega_prepare_extpassthru(adapter, scb, cmd,
909908 channel, target);
910909
911910 mbox->m_out.cmd = MEGA_MBOXCMD_EXTPTHRU;
@@ -937,11 +936,11 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) · 25 unmodified lines
937936
938937 /**
939938 * mega_prepare_passthru()
940− * @adapter - pointer to our soft state
941− * @scb - our scsi control block
942− * @cmd - scsi command from the mid-layer
943− * @channel - actual channel on the controller
944− * @target - actual id on the controller.
939+ * @adapter: pointer to our soft state
940+ * @scb: our scsi control block
941+ * @cmd: scsi command from the mid-layer
942+ * @channel: actual channel on the controller
943+ * @target: actual id on the controller.
945944 *
946945 * prepare a command for the scsi physical devices.
947946 */
@@ -1000,11 +999,11 @@ mega_prepare_passthru(adapter_t *adapter, scb_t *scb, struct scsi_cmnd *cmd, · 52 unmodified lines
1000999
10011000 /**
10021001 * mega_prepare_extpassthru()
1003− * @adapter - pointer to our soft state
1004− * @scb - our scsi control block
1005− * @cmd - scsi command from the mid-layer
1006− * @channel - actual channel on the controller
1007− * @target - actual id on the controller.
1002+ * @adapter: pointer to our soft state
1003+ * @scb: our scsi control block
1004+ * @cmd: scsi command from the mid-layer
1005+ * @channel: actual channel on the controller
1006+ * @target: actual id on the controller.
10081007 *
10091008 * prepare a command for the scsi physical devices. This rountine prepares
10101009 * commands for devices which can take extended CDBs (>10 bytes)
@@ -1085,8 +1084,8 @@ __mega_runpendq(adapter_t *adapter) · 74 unmodified lines
10851084
10861085 /**
10871086 * issue_scb()
1088− * @adapter - pointer to our soft state
1089− * @scb - scsi control block
1087+ * @adapter: pointer to our soft state
1088+ * @scb: scsi control block
10901089 *
10911090 * Post a command to the card if the mailbox is available, otherwise return
10921091 * busy. We also take the scb from the pending list if the mailbox is
@@ -1166,8 +1165,8 @@ mega_busywait_mbox (adapter_t *adapter) · 73 unmodified lines
11661165
11671166 /**
11681167 * issue_scb_block()
1169− * @adapter - pointer to our soft state
1170− * @raw_mbox - the mailbox
1168+ * @adapter: pointer to our soft state
1169+ * @raw_mbox: the mailbox
11711170 *
11721171 * Issue a scb in synchronous and non-interrupt mode
11731172 */
@@ -1247,8 +1246,8 @@ bug_blocked_mailbox: · 73 unmodified lines
12471246
12481247 /**
12491248 * megaraid_isr_iomapped()
1250− * @irq - irq
1251− * @devp - pointer to our soft state
1249+ * @irq: irq
1250+ * @devp: pointer to our soft state
12521251 *
12531252 * Interrupt service routine for io-mapped controllers.
12541253 * Find out if our device is interrupting. If yes, acknowledge the interrupt
@@ -1323,8 +1322,8 @@ megaraid_isr_iomapped(int irq, void *devp) · 68 unmodified lines
13231322
13241323 /**
13251324 * megaraid_isr_memmapped()
1326− * @irq - irq
1327− * @devp - pointer to our soft state
1325+ * @irq: irq
1326+ * @devp: pointer to our soft state
13281327 *
13291328 * Interrupt service routine for memory-mapped controllers.
13301329 * Find out if our device is interrupting. If yes, acknowledge the interrupt
@@ -1401,10 +1400,10 @@ megaraid_isr_memmapped(int irq, void *devp) · 70 unmodified lines
14011400 }
14021401 /**
14031402 * mega_cmd_done()
1404− * @adapter - pointer to our soft state
1405− * @completed - array of ids of completed commands
1406− * @nstatus - number of completed commands
1407− * @status - status of the last command completed
1403+ * @adapter: pointer to our soft state
1404+ * @completed: array of ids of completed commands
1405+ * @nstatus: number of completed commands
1406+ * @status: status of the last command completed
14081407 *
14091408 * Complete the commands and call the scsi mid-layer callback hooks.
14101409 */
@@ -1921,9 +1920,9 @@ megaraid_reset(struct scsi_cmnd *cmd) · 510 unmodified lines
19211920
19221921 /**
19231922 * megaraid_abort_and_reset()
1924− * @adapter - megaraid soft state
1925− * @cmd - scsi command to be aborted or reset
1926− * @aor - abort or reset flag
1923+ * @adapter: megaraid soft state
1924+ * @cmd: scsi command to be aborted or reset
1925+ * @aor: abort or reset flag
19271926 *
19281927 * Try to locate the scsi command in the pending queue. If found and is not
19291928 * issued to the controller, abort/reset it. Otherwise return failure
@@ -2021,8 +2020,8 @@ free_local_pdev(struct pci_dev *pdev) · 91 unmodified lines
20212020
20222021 /**
20232022 * mega_allocate_inquiry()
2024− * @dma_handle - handle returned for dma address
2025− * @pdev - handle to pci device
2023+ * @dma_handle: handle returned for dma address
2024+ * @pdev: handle to pci device
20262025 *
20272026 * allocates memory for inquiry structure
20282027 */
@@ -2045,8 +2044,8 @@ mega_free_inquiry(void *inquiry, dma_addr_t dma_handle, struct pci_dev *pdev) · 16 unmodified lines
20452044
20462045 /**
20472046 * proc_show_config()
2048− * @m - Synthetic file construction data
2049− * @v - File iterator
2047+ * @m: Synthetic file construction data
2048+ * @v: File iterator
20502049 *
20512050 * Display configuration information about the controller.
20522051 */
@@ -2109,8 +2108,8 @@ proc_show_config(struct seq_file *m, void *v) · 56 unmodified lines
21092108
21102109 /**
21112110 * proc_show_stat()
2112− * @m - Synthetic file construction data
2113− * @v - File iterator
2111+ * @m: Synthetic file construction data
2112+ * @v: File iterator
21142113 *
21152114 * Display statistical information about the I/O activity.
21162115 */
@@ -2143,8 +2142,8 @@ proc_show_stat(struct seq_file *m, void *v) · 26 unmodified lines
21432142
21442143 /**
21452144 * proc_show_mbox()
2146− * @m - Synthetic file construction data
2147− * @v - File iterator
2145+ * @m: Synthetic file construction data
2146+ * @v: File iterator
21482147 *
21492148 * Display mailbox information for the last command issued. This information
21502149 * is good for debugging.
@@ -2171,8 +2170,8 @@ proc_show_mbox(struct seq_file *m, void *v) · 20 unmodified lines
21712170
21722171 /**
21732172 * proc_show_rebuild_rate()
2174− * @m - Synthetic file construction data
2175− * @v - File iterator
2173+ * @m: Synthetic file construction data
2174+ * @v: File iterator
21762175 *
21772176 * Display current rebuild rate
21782177 */
@@ -2214,8 +2213,8 @@ free_pdev: · 35 unmodified lines
22142213
22152214 /**
22162215 * proc_show_battery()
2217− * @m - Synthetic file construction data
2218− * @v - File iterator
2216+ * @m: Synthetic file construction data
2217+ * @v: File iterator
22192218 *
22202219 * Display information about the battery module on the controller.
22212220 */
@@ -2317,9 +2316,9 @@ mega_print_inquiry(struct seq_file *m, char *scsi_inq) · 95 unmodified lines
23172316
23182317 /**
23192318 * proc_show_pdrv()
2320− * @m - Synthetic file construction data
2321− * @page - buffer to write the data in
2322− * @adapter - pointer to our soft state
2319+ * @m: Synthetic file construction data
2320+ * @adapter: pointer to our soft state
2321+ * @channel: channel
23232322 *
23242323 * Display information about the physical drives.
23252324 */
@@ -2433,8 +2432,8 @@ free_pdev: · 107 unmodified lines
24332432
24342433 /**
24352434 * proc_show_pdrv_ch0()
2436− * @m - Synthetic file construction data
2437− * @v - File iterator
2435+ * @m: Synthetic file construction data
2436+ * @v: File iterator
24382437 *
24392438 * Display information about the physical drives on physical channel 0.
24402439 */
@@ -2447,8 +2446,8 @@ proc_show_pdrv_ch0(struct seq_file *m, void *v) · 6 unmodified lines
24472446
24482447 /**
24492448 * proc_show_pdrv_ch1()
2450− * @m - Synthetic file construction data
2451− * @v - File iterator
2449+ * @m: Synthetic file construction data
2450+ * @v: File iterator
24522451 *
24532452 * Display information about the physical drives on physical channel 1.
24542453 */
@@ -2461,8 +2460,8 @@ proc_show_pdrv_ch1(struct seq_file *m, void *v) · 6 unmodified lines
24612460
24622461 /**
24632462 * proc_show_pdrv_ch2()
2464− * @m - Synthetic file construction data
2465− * @v - File iterator
2463+ * @m: Synthetic file construction data
2464+ * @v: File iterator
24662465 *
24672466 * Display information about the physical drives on physical channel 2.
24682467 */
@@ -2475,8 +2474,8 @@ proc_show_pdrv_ch2(struct seq_file *m, void *v) · 6 unmodified lines
24752474
24762475 /**
24772476 * proc_show_pdrv_ch3()
2478− * @m - Synthetic file construction data
2479− * @v - File iterator
2477+ * @m: Synthetic file construction data
2478+ * @v: File iterator
24802479 *
24812480 * Display information about the physical drives on physical channel 3.
24822481 */
@@ -2489,10 +2488,10 @@ proc_show_pdrv_ch3(struct seq_file *m, void *v) · 6 unmodified lines
24892488
24902489 /**
24912490 * proc_show_rdrv()
2492− * @m - Synthetic file construction data
2493− * @adapter - pointer to our soft state
2494− * @start - starting logical drive to display
2495− * @end - ending logical drive to display
2491+ * @m: Synthetic file construction data
2492+ * @adapter: pointer to our soft state
2493+ * @start: starting logical drive to display
2494+ * @end: ending logical drive to display
24962495 *
24972496 * We do not print the inquiry information since its already available through
24982497 * /proc/scsi/scsi interface
@@ -2674,8 +2673,8 @@ free_pdev: · 175 unmodified lines
26742673
26752674 /**
26762675 * proc_show_rdrv_10()
2677− * @m - Synthetic file construction data
2678− * @v - File iterator
2676+ * @m: Synthetic file construction data
2677+ * @v: File iterator
26792678 *
26802679 * Display real time information about the logical drives 0 through 9.
26812680 */
@@ -2688,8 +2687,8 @@ proc_show_rdrv_10(struct seq_file *m, void *v) · 6 unmodified lines
26882687
26892688 /**
26902689 * proc_show_rdrv_20()
2691− * @m - Synthetic file construction data
2692− * @v - File iterator
2690+ * @m: Synthetic file construction data
2691+ * @v: File iterator
26932692 *
26942693 * Display real time information about the logical drives 0 through 9.
26952694 */
@@ -2702,8 +2701,8 @@ proc_show_rdrv_20(struct seq_file *m, void *v) · 6 unmodified lines
27022701
27032702 /**
27042703 * proc_show_rdrv_30()
2705− * @m - Synthetic file construction data
2706− * @v - File iterator
2704+ * @m: Synthetic file construction data
2705+ * @v: File iterator
27072706 *
27082707 * Display real time information about the logical drives 0 through 9.
27092708 */
@@ -2716,8 +2715,8 @@ proc_show_rdrv_30(struct seq_file *m, void *v) · 6 unmodified lines
27162715
27172716 /**
27182717 * proc_show_rdrv_40()
2719− * @m - Synthetic file construction data
2720− * @v - File iterator
2718+ * @m: Synthetic file construction data
2719+ * @v: File iterator
27212720 *
27222721 * Display real time information about the logical drives 0 through 9.
27232722 */
@@ -2729,8 +2728,8 @@ proc_show_rdrv_40(struct seq_file *m, void *v) · 5 unmodified lines
27292728
27302729 /**
27312730 * mega_create_proc_entry()
2732− * @index - index in soft state array
2733− * @parent - parent node for this /proc entry
2731+ * @index: index in soft state array
2732+ * @parent: parent node for this /proc entry
27342733 *
27352734 * Creates /proc entries for our controllers.
27362735 */
@@ -2785,7 +2784,7 @@ static inline void mega_create_proc_entry(int index, struct proc_dir_entry *pare · 48 unmodified lines
27852784 #endif
27862785
27872786
2788−/**
2787+/*
27892788 * megaraid_biosparam()
27902789 *
27912790 * Return the disk geometry for a particular disk
@@ -2854,7 +2853,7 @@ megaraid_biosparam(struct scsi_device *sdev, struct block_device *bdev, · 62 unmodified lines
28542853
28552854 /**
28562855 * mega_init_scb()
2857− * @adapter - pointer to our soft state
2856+ * @adapter: pointer to our soft state
28582857 *
28592858 * Allocate memory for the various pointers in the scb structures:
28602859 * scatter-gather list pointer, passthru and extended passthru structure
@@ -2934,8 +2933,8 @@ mega_init_scb(adapter_t *adapter) · 73 unmodified lines
29342933
29352934 /**
29362935 * megadev_open()
2937− * @inode - unused
2938− * @filep - unused
2936+ * @inode: unused
2937+ * @filep: unused
29392938 *
29402939 * Routines for the character/ioctl interface to the driver. Find out if this
29412940 * is a valid open.
@@ -2954,10 +2953,9 @@ megadev_open (struct inode *inode, struct file *filep) · 12 unmodified lines
29542953
29552954 /**
29562955 * megadev_ioctl()
2957− * @inode - Our device inode
2958− * @filep - unused
2959− * @cmd - ioctl command
2960− * @arg - user buffer
2956+ * @filep: Our device file
2957+ * @cmd: ioctl command
2958+ * @arg: user buffer
29612959 *
29622960 * ioctl entry point for our private ioctl interface. We move the data in from
29632961 * the user space, prepare the command (if necessary, convert the old MIMD
@@ -2977,14 +2975,13 @@ megadev_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) · 13 unmodified lines
29772975 void *data = NULL; /* data to be transferred */
29782976 dma_addr_t data_dma_hndl; /* dma handle for data xfer area */
29792977 megacmd_t mc;
2980− megastat_t __user *ustats;
2981− int num_ldrv;
2978+#if MEGA_HAVE_STATS
2979+ megastat_t __user *ustats = NULL;
2980+ int num_ldrv = 0;
2981+#endif
29822982 u32 uxferaddr = 0;
29832983 struct pci_dev *pdev;
29842984
2985− ustats = NULL; /* avoid compilation warnings */
2986− num_ldrv = 0;
2987−
29882985 /*
29892986 * Make sure only USCSICMD are issued through this interface.
29902987 * MIMD application would still fire different command.
@@ -3370,8 +3367,8 @@ megadev_unlocked_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) · 379 unmodified lines
33703367
33713368 /**
33723369 * mega_m_to_n()
3373− * @arg - user address
3374− * @uioc - new ioctl structure
3370+ * @arg: user address
3371+ * @uioc: new ioctl structure
33753372 *
33763373 * A thin layer to convert older mimd interface ioctl structure to NIT ioctl
33773374 * structure
@@ -3498,8 +3495,8 @@ mega_m_to_n(void __user *arg, nitioctl_t *uioc) · 120 unmodified lines
34983495
34993496 /*
35003497 * mega_n_to_m()
3501− * @arg - user address
3502− * @mc - mailbox command
3498+ * @arg: user address
3499+ * @mc: mailbox command
35033500 *
35043501 * Updates the status information to the application, depending on application
35053502 * conforms to older mimd ioctl interface or newer NIT ioctl interface
@@ -3565,7 +3562,7 @@ mega_n_to_m(void __user *arg, megacmd_t *mc) · 59 unmodified lines
35653562
35663563 /**
35673564 * mega_is_bios_enabled()
3568− * @adapter - pointer to our soft state
3565+ * @adapter: pointer to our soft state
35693566 *
35703567 * issue command to find out if the BIOS is enabled for this controller
35713568 */
@@ -3574,7 +3571,6 @@ mega_is_bios_enabled(adapter_t *adapter) · 2 unmodified lines
35743571 {
35753572 unsigned char raw_mbox[sizeof(struct mbox_out)];
35763573 mbox_t *mbox;
3577− int ret;
35783574
35793575 mbox = (mbox_t *)raw_mbox;
35803576
@@ -3587,8 +3583,7 @@ mega_is_bios_enabled(adapter_t *adapter) · 6 unmodified lines
35873583 raw_mbox[0] = IS_BIOS_ENABLED;
35883584 raw_mbox[2] = GET_BIOS;
35893585
3590−
3591− ret = issue_scb_block(adapter, raw_mbox);
3586+ issue_scb_block(adapter, raw_mbox);
35923587
35933588 return *(char *)adapter->mega_buffer;
35943589 }
@@ -3596,7 +3591,7 @@ mega_is_bios_enabled(adapter_t *adapter) · 1 unmodified line
35963591
35973592 /**
35983593 * mega_enum_raid_scsi()
3599− * @adapter - pointer to our soft state
3594+ * @adapter: pointer to our soft state
36003595 *
36013596 * Find out what channels are RAID/SCSI. This information is used to
36023597 * differentiate the virtual channels and physical channels and to support
@@ -3651,7 +3646,7 @@ mega_enum_raid_scsi(adapter_t *adapter) · 48 unmodified lines
36513646
36523647 /**
36533648 * mega_get_boot_drv()
3654− * @adapter - pointer to our soft state
3649+ * @adapter: pointer to our soft state
36553650 *
36563651 * Find out which device is the boot device. Note, any logical drive or any
36573652 * phyical device (e.g., a CDROM) can be designated as a boot device.
@@ -3718,7 +3713,7 @@ mega_get_boot_drv(adapter_t *adapter) · 60 unmodified lines
37183713
37193714 /**
37203715 * mega_support_random_del()
3721− * @adapter - pointer to our soft state
3716+ * @adapter: pointer to our soft state
37223717 *
37233718 * Find out if this controller supports random deletion and addition of
37243719 * logical drives
@@ -3748,7 +3743,7 @@ mega_support_random_del(adapter_t *adapter) · 23 unmodified lines
37483743
37493744 /**
37503745 * mega_support_ext_cdb()
3751− * @adapter - pointer to our soft state
3746+ * @adapter: pointer to our soft state
37523747 *
37533748 * Find out if this firmware support cdblen > 10
37543749 */
@@ -3776,8 +3771,8 @@ mega_support_ext_cdb(adapter_t *adapter) · 21 unmodified lines
37763771
37773772 /**
37783773 * mega_del_logdrv()
3779− * @adapter - pointer to our soft state
3780− * @logdrv - logical drive to be deleted
3774+ * @adapter: pointer to our soft state
3775+ * @logdrv: logical drive to be deleted
37813776 *
37823777 * Delete the specified logical drive. It is the responsibility of the user
37833778 * app to let the OS know about this operation.
@@ -3862,7 +3857,7 @@ mega_do_del_logdrv(adapter_t *adapter, int logdrv) · 78 unmodified lines
38623857
38633858 /**
38643859 * mega_get_max_sgl()
3865− * @adapter - pointer to our soft state
3860+ * @adapter: pointer to our soft state
38663861 *
38673862 * Find out the maximum number of scatter-gather elements supported by this
38683863 * version of the firmware
@@ -3908,7 +3903,7 @@ mega_get_max_sgl(adapter_t *adapter) · 39 unmodified lines
39083903
39093904 /**
39103905 * mega_support_cluster()
3911− * @adapter - pointer to our soft state
3906+ * @adapter: pointer to our soft state
39123907 *
39133908 * Find out if this firmware support cluster calls.
39143909 */
@@ -3950,8 +3945,8 @@ mega_support_cluster(adapter_t *adapter) · 35 unmodified lines
39503945 #ifdef CONFIG_PROC_FS
39513946 /**
39523947 * mega_adapinq()
3953− * @adapter - pointer to our soft state
3954− * @dma_handle - DMA address of the buffer
3948+ * @adapter: pointer to our soft state
3949+ * @dma_handle: DMA address of the buffer
39553950 *
39563951 * Issue internal commands while interrupts are available.
39573952 * We only issue direct mailbox commands from within the driver. ioctl()
@@ -3983,11 +3978,12 @@ mega_adapinq(adapter_t *adapter, dma_addr_t dma_handle) · 25 unmodified lines
39833978 }
39843979
39853980
3986−/** mega_internal_dev_inquiry()
3987− * @adapter - pointer to our soft state
3988− * @ch - channel for this device
3989− * @tgt - ID of this device
3990− * @buf_dma_handle - DMA address of the buffer
3981+/**
3982+ * mega_internal_dev_inquiry()
3983+ * @adapter: pointer to our soft state
3984+ * @ch: channel for this device
3985+ * @tgt: ID of this device
3986+ * @buf_dma_handle: DMA address of the buffer
39913987 *
39923988 * Issue the scsi inquiry for the specified device.
39933989 */
@@ -4056,9 +4052,9 @@ mega_internal_dev_inquiry(adapter_t *adapter, u8 ch, u8 tgt, · 62 unmodified lines
40564052
40574053 /**
40584054 * mega_internal_command()
4059− * @adapter - pointer to our soft state
4060− * @mc - the mailbox command
4061− * @pthru - Passthru structure for DCDB commands
4055+ * @adapter: pointer to our soft state
4056+ * @mc: the mailbox command
4057+ * @pthru: Passthru structure for DCDB commands
40624058 *
40634059 * Issue the internal commands in interrupt mode.
40644060 * The last argument is the address of the passthru structure if the command
drivers/scsi/megaraid/megaraid_mbox.c+2−2
@@ -3304,7 +3304,6 @@ blocked_mailbox: · 3303 unmodified lines
33043304 * megaraid_mbox_display_scb - display SCB information, mostly debug purposes
33053305 * @adapter : controller's soft state
33063306 * @scb : SCB to be displayed
3307− * @level : debug level for console print
33083307 *
33093308 * Diplay information about the given SCB iff the current debug level is
33103309 * verbose.
@@ -3972,7 +3971,8 @@ megaraid_sysfs_get_ldmap(adapter_t *adapter) · 661 unmodified lines
39723971
39733972 /**
39743973 * megaraid_sysfs_show_app_hndl - display application handle for this adapter
3975− * @cdev : class device object representation for the host
3974+ * @dev : class device object representation for the host
3975+ * @attr : device attribute (unused)
39763976 * @buf : buffer to send data to
39773977 *
39783978 * Display the handle used by the applications while executing management
drivers/scsi/megaraid/megaraid_mm.c+0−1
@@ -95,7 +95,6 @@ mraid_mm_open(struct inode *inode, struct file *filep) · 94 unmodified lines
9595
9696 /**
9797 * mraid_mm_ioctl - module entry-point for ioctls
98− * @inode : inode (ignored)
9998 * @filep : file operations pointer (ignored)
10099 * @cmd : ioctl command
101100 * @arg : user ioctl packet
drivers/scsi/megaraid/megaraid_sas.h+20−0
@@ -2709,4 +2709,24 @@ int megasas_adp_reset_wait_for_ready(struct megasas_instance *instance, · 2708 unmodified lines
27092709 int ocr_context);
27102710 int megasas_irqpoll(struct irq_poll *irqpoll, int budget);
27112711 void megasas_dump_fusion_io(struct scsi_cmnd *scmd);
2712+u32 megasas_readl(struct megasas_instance *instance,
2713+ const volatile void __iomem *addr);
2714+struct megasas_cmd *megasas_get_cmd(struct megasas_instance *instance);
2715+void megasas_return_cmd(struct megasas_instance *instance,
2716+ struct megasas_cmd *cmd);
2717+int megasas_issue_polled(struct megasas_instance *instance,
2718+ struct megasas_cmd *cmd);
2719+void megaraid_sas_kill_hba(struct megasas_instance *instance);
2720+void megasas_check_and_restore_queue_depth(struct megasas_instance *instance);
2721+void megasas_start_timer(struct megasas_instance *instance);
2722+int megasas_sriov_start_heartbeat(struct megasas_instance *instance,
2723+ int initial);
2724+int megasas_alloc_cmds(struct megasas_instance *instance);
2725+void megasas_free_cmds(struct megasas_instance *instance);
2726+
2727+void megasas_init_debugfs(void);
2728+void megasas_exit_debugfs(void);
2729+void megasas_setup_debugfs(struct megasas_instance *instance);
2730+void megasas_destroy_debugfs(struct megasas_instance *instance);
2731+
27122732 #endif /*LSI_MEGARAID_SAS_H */
drivers/scsi/megaraid/megaraid_sas_base.c+105−79
@@ -202,10 +202,6 @@ static bool support_pci_lane_margining; · 201 unmodified lines
202202 static spinlock_t poll_aen_lock;
203203
204204 extern struct dentry *megasas_debugfs_root;
205−extern void megasas_init_debugfs(void);
206−extern void megasas_exit_debugfs(void);
207−extern void megasas_setup_debugfs(struct megasas_instance *instance);
208−extern void megasas_destroy_debugfs(struct megasas_instance *instance);
209205
210206 void
211207 megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
@@ -427,14 +423,14 @@ megasas_decode_evt(struct megasas_instance *instance) · 215 unmodified lines
427423 evt_detail->description);
428424 }
429425
430−/**
431−* The following functions are defined for xscale
432−* (deviceid : 1064R, PERC5) controllers
433−*/
426+/*
427+ * The following functions are defined for xscale
428+ * (deviceid : 1064R, PERC5) controllers
429+ */
434430
435431 /**
436432 * megasas_enable_intr_xscale - Enables interrupts
437− * @regs: MFI register set
433+ * @instance: Adapter soft state
438434 */
439435 static inline void
440436 megasas_enable_intr_xscale(struct megasas_instance *instance)
@@ -450,7 +446,7 @@ megasas_enable_intr_xscale(struct megasas_instance *instance) · 9 unmodified lines
450446
451447 /**
452448 * megasas_disable_intr_xscale -Disables interrupt
453− * @regs: MFI register set
449+ * @instance: Adapter soft state
454450 */
455451 static inline void
456452 megasas_disable_intr_xscale(struct megasas_instance *instance)
@@ -466,7 +462,7 @@ megasas_disable_intr_xscale(struct megasas_instance *instance) · 9 unmodified lines
466462
467463 /**
468464 * megasas_read_fw_status_reg_xscale - returns the current FW status value
469− * @regs: MFI register set
465+ * @instance: Adapter soft state
470466 */
471467 static u32
472468 megasas_read_fw_status_reg_xscale(struct megasas_instance *instance)
@@ -475,7 +471,7 @@ megasas_read_fw_status_reg_xscale(struct megasas_instance *instance) · 2 unmodified lines
475471 }
476472 /**
477473 * megasas_clear_interrupt_xscale - Check & clear interrupt
478− * @regs: MFI register set
474+ * @instance: Adapter soft state
479475 */
480476 static int
481477 megasas_clear_intr_xscale(struct megasas_instance *instance)
@@ -509,9 +505,10 @@ megasas_clear_intr_xscale(struct megasas_instance *instance) · 27 unmodified lines
509505
510506 /**
511507 * megasas_fire_cmd_xscale - Sends command to the FW
512− * @frame_phys_addr : Physical address of cmd
513− * @frame_count : Number of frames for the command
514− * @regs : MFI register set
508+ * @instance: Adapter soft state
509+ * @frame_phys_addr : Physical address of cmd
510+ * @frame_count : Number of frames for the command
511+ * @regs : MFI register set
515512 */
516513 static inline void
517514 megasas_fire_cmd_xscale(struct megasas_instance *instance,
@@ -529,7 +526,8 @@ megasas_fire_cmd_xscale(struct megasas_instance *instance, · 11 unmodified lines
529526
530527 /**
531528 * megasas_adp_reset_xscale - For controller reset
532− * @regs: MFI register set
529+ * @instance: Adapter soft state
530+ * @regs: MFI register set
533531 */
534532 static int
535533 megasas_adp_reset_xscale(struct megasas_instance *instance,
@@ -570,7 +568,8 @@ megasas_adp_reset_xscale(struct megasas_instance *instance, · 34 unmodified lines
570568
571569 /**
572570 * megasas_check_reset_xscale - For controller reset check
573− * @regs: MFI register set
571+ * @instance: Adapter soft state
572+ * @regs: MFI register set
574573 */
575574 static int
576575 megasas_check_reset_xscale(struct megasas_instance *instance,
@@ -599,19 +598,19 @@ static struct megasas_instance_template megasas_instance_template_xscale = { · 22 unmodified lines
599598 .issue_dcmd = megasas_issue_dcmd,
600599 };
601600
602−/**
603−* This is the end of set of functions & definitions specific
604−* to xscale (deviceid : 1064R, PERC5) controllers
605−*/
601+/*
602+ * This is the end of set of functions & definitions specific
603+ * to xscale (deviceid : 1064R, PERC5) controllers
604+ */
606605
607−/**
608−* The following functions are defined for ppc (deviceid : 0x60)
609−* controllers
610−*/
606+/*
607+ * The following functions are defined for ppc (deviceid : 0x60)
608+ * controllers
609+ */
611610
612611 /**
613612 * megasas_enable_intr_ppc - Enables interrupts
614− * @regs: MFI register set
613+ * @instance: Adapter soft state
615614 */
616615 static inline void
617616 megasas_enable_intr_ppc(struct megasas_instance *instance)
@@ -629,7 +628,7 @@ megasas_enable_intr_ppc(struct megasas_instance *instance) · 11 unmodified lines
629628
630629 /**
631630 * megasas_disable_intr_ppc - Disable interrupt
632− * @regs: MFI register set
631+ * @instance: Adapter soft state
633632 */
634633 static inline void
635634 megasas_disable_intr_ppc(struct megasas_instance *instance)
@@ -645,7 +644,7 @@ megasas_disable_intr_ppc(struct megasas_instance *instance) · 9 unmodified lines
645644
646645 /**
647646 * megasas_read_fw_status_reg_ppc - returns the current FW status value
648− * @regs: MFI register set
647+ * @instance: Adapter soft state
649648 */
650649 static u32
651650 megasas_read_fw_status_reg_ppc(struct megasas_instance *instance)
@@ -655,7 +654,7 @@ megasas_read_fw_status_reg_ppc(struct megasas_instance *instance) · 3 unmodified lines
655654
656655 /**
657656 * megasas_clear_interrupt_ppc - Check & clear interrupt
658− * @regs: MFI register set
657+ * @instance: Adapter soft state
659658 */
660659 static int
661660 megasas_clear_intr_ppc(struct megasas_instance *instance)
@@ -688,9 +687,10 @@ megasas_clear_intr_ppc(struct megasas_instance *instance) · 26 unmodified lines
688687
689688 /**
690689 * megasas_fire_cmd_ppc - Sends command to the FW
691− * @frame_phys_addr : Physical address of cmd
692− * @frame_count : Number of frames for the command
693− * @regs : MFI register set
690+ * @instance: Adapter soft state
691+ * @frame_phys_addr: Physical address of cmd
692+ * @frame_count: Number of frames for the command
693+ * @regs: MFI register set
694694 */
695695 static inline void
696696 megasas_fire_cmd_ppc(struct megasas_instance *instance,
@@ -708,7 +708,8 @@ megasas_fire_cmd_ppc(struct megasas_instance *instance, · 11 unmodified lines
708708
709709 /**
710710 * megasas_check_reset_ppc - For controller reset check
711− * @regs: MFI register set
711+ * @instance: Adapter soft state
712+ * @regs: MFI register set
712713 */
713714 static int
714715 megasas_check_reset_ppc(struct megasas_instance *instance,
@@ -738,7 +739,7 @@ static struct megasas_instance_template megasas_instance_template_ppc = { · 23 unmodified lines
738739
739740 /**
740741 * megasas_enable_intr_skinny - Enables interrupts
741− * @regs: MFI register set
742+ * @instance: Adapter soft state
742743 */
743744 static inline void
744745 megasas_enable_intr_skinny(struct megasas_instance *instance)
@@ -756,7 +757,7 @@ megasas_enable_intr_skinny(struct megasas_instance *instance) · 11 unmodified lines
756757
757758 /**
758759 * megasas_disable_intr_skinny - Disables interrupt
759− * @regs: MFI register set
760+ * @instance: Adapter soft state
760761 */
761762 static inline void
762763 megasas_disable_intr_skinny(struct megasas_instance *instance)
@@ -772,7 +773,7 @@ megasas_disable_intr_skinny(struct megasas_instance *instance) · 9 unmodified lines
772773
773774 /**
774775 * megasas_read_fw_status_reg_skinny - returns the current FW status value
775− * @regs: MFI register set
776+ * @instance: Adapter soft state
776777 */
777778 static u32
778779 megasas_read_fw_status_reg_skinny(struct megasas_instance *instance)
@@ -782,7 +783,7 @@ megasas_read_fw_status_reg_skinny(struct megasas_instance *instance) · 3 unmodified lines
782783
783784 /**
784785 * megasas_clear_interrupt_skinny - Check & clear interrupt
785− * @regs: MFI register set
786+ * @instance: Adapter soft state
786787 */
787788 static int
788789 megasas_clear_intr_skinny(struct megasas_instance *instance)
@@ -825,9 +826,10 @@ megasas_clear_intr_skinny(struct megasas_instance *instance) · 36 unmodified lines
825826
826827 /**
827828 * megasas_fire_cmd_skinny - Sends command to the FW
828− * @frame_phys_addr : Physical address of cmd
829− * @frame_count : Number of frames for the command
830− * @regs : MFI register set
829+ * @instance: Adapter soft state
830+ * @frame_phys_addr: Physical address of cmd
831+ * @frame_count: Number of frames for the command
832+ * @regs: MFI register set
831833 */
832834 static inline void
833835 megasas_fire_cmd_skinny(struct megasas_instance *instance,
@@ -847,7 +849,8 @@ megasas_fire_cmd_skinny(struct megasas_instance *instance, · 13 unmodified lines
847849
848850 /**
849851 * megasas_check_reset_skinny - For controller reset check
850− * @regs: MFI register set
852+ * @instance: Adapter soft state
853+ * @regs: MFI register set
851854 */
852855 static int
853856 megasas_check_reset_skinny(struct megasas_instance *instance,
@@ -876,14 +879,14 @@ static struct megasas_instance_template megasas_instance_template_skinny = { · 22 unmodified lines
876879 };
877880
878881
879−/**
880−* The following functions are defined for gen2 (deviceid : 0x78 0x79)
881−* controllers
882−*/
882+/*
883+ * The following functions are defined for gen2 (deviceid : 0x78 0x79)
884+ * controllers
885+ */
883886
884887 /**
885888 * megasas_enable_intr_gen2 - Enables interrupts
886− * @regs: MFI register set
889+ * @instance: Adapter soft state
887890 */
888891 static inline void
889892 megasas_enable_intr_gen2(struct megasas_instance *instance)
@@ -902,7 +905,7 @@ megasas_enable_intr_gen2(struct megasas_instance *instance) · 12 unmodified lines
902905
903906 /**
904907 * megasas_disable_intr_gen2 - Disables interrupt
905− * @regs: MFI register set
908+ * @instance: Adapter soft state
906909 */
907910 static inline void
908911 megasas_disable_intr_gen2(struct megasas_instance *instance)
@@ -918,7 +921,7 @@ megasas_disable_intr_gen2(struct megasas_instance *instance) · 9 unmodified lines
918921
919922 /**
920923 * megasas_read_fw_status_reg_gen2 - returns the current FW status value
921− * @regs: MFI register set
924+ * @instance: Adapter soft state
922925 */
923926 static u32
924927 megasas_read_fw_status_reg_gen2(struct megasas_instance *instance)
@@ -928,7 +931,7 @@ megasas_read_fw_status_reg_gen2(struct megasas_instance *instance) · 3 unmodified lines
928931
929932 /**
930933 * megasas_clear_interrupt_gen2 - Check & clear interrupt
931− * @regs: MFI register set
934+ * @instance: Adapter soft state
932935 */
933936 static int
934937 megasas_clear_intr_gen2(struct megasas_instance *instance)
@@ -961,11 +964,13 @@ megasas_clear_intr_gen2(struct megasas_instance *instance) · 26 unmodified lines
961964
962965 return mfiStatus;
963966 }
967+
964968 /**
965969 * megasas_fire_cmd_gen2 - Sends command to the FW
966− * @frame_phys_addr : Physical address of cmd
967− * @frame_count : Number of frames for the command
968− * @regs : MFI register set
970+ * @instance: Adapter soft state
971+ * @frame_phys_addr: Physical address of cmd
972+ * @frame_count: Number of frames for the command
973+ * @regs: MFI register set
969974 */
970975 static inline void
971976 megasas_fire_cmd_gen2(struct megasas_instance *instance,
@@ -983,7 +988,8 @@ megasas_fire_cmd_gen2(struct megasas_instance *instance, · 11 unmodified lines
983988
984989 /**
985990 * megasas_adp_reset_gen2 - For controller reset
986− * @regs: MFI register set
991+ * @instance: Adapter soft state
992+ * @reg_set: MFI register set
987993 */
988994 static int
989995 megasas_adp_reset_gen2(struct megasas_instance *instance,
@@ -1043,7 +1049,8 @@ megasas_adp_reset_gen2(struct megasas_instance *instance, · 53 unmodified lines
10431049
10441050 /**
10451051 * megasas_check_reset_gen2 - For controller reset check
1046− * @regs: MFI register set
1052+ * @instance: Adapter soft state
1053+ * @regs: MFI register set
10471054 */
10481055 static int
10491056 megasas_check_reset_gen2(struct megasas_instance *instance,
@@ -1071,10 +1078,10 @@ static struct megasas_instance_template megasas_instance_template_gen2 = { · 21 unmodified lines
10711078 .issue_dcmd = megasas_issue_dcmd,
10721079 };
10731080
1074−/**
1075−* This is the end of set of functions & definitions
1076−* specific to gen2 (deviceid : 0x78, 0x79) controllers
1077−*/
1081+/*
1082+ * This is the end of set of functions & definitions
1083+ * specific to gen2 (deviceid : 0x78, 0x79) controllers
1084+ */
10781085
10791086 /*
10801087 * Template added for TB (Fusion)
@@ -1609,7 +1616,7 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp, · 528 unmodified lines
16091616 /**
16101617 * megasas_cmd_type - Checks if the cmd is for logical drive/sysPD
16111618 * and whether it's RW or non RW
1612− * @scmd: SCSI command
1619+ * @cmd: SCSI command
16131620 *
16141621 */
16151622 inline int megasas_cmd_type(struct scsi_cmnd *cmd)
@@ -1749,8 +1756,8 @@ out_return_cmd: · 133 unmodified lines
17491756
17501757 /**
17511758 * megasas_queue_command - Queue entry point
1759+ * @shost: adapter SCSI host
17521760 * @scmd: SCSI command to be queued
1753− * @done: Callback entry point
17541761 */
17551762 static int
17561763 megasas_queue_command(struct Scsi_Host *shost, struct scsi_cmnd *scmd)
@@ -2916,11 +2923,7 @@ megasas_dump(void *buf, int sz, int format) · 1159 unmodified lines
29162923
29172924 /**
29182925 * megasas_dump_reg_set - This function will print hexdump of register set
2919− * @buf: Buffer to be dumped
2920− * @sz: Size in bytes
2921− * @format: Different formats of dumping e.g. format=n will
2922− * cause only 'n' 32 bit words to be dumped in a
2923− * single line.
2926+ * @reg_set: Register set to be dumped
29242927 */
29252928 inline void
29262929 megasas_dump_reg_set(void __iomem *reg_set)
@@ -2997,6 +3000,7 @@ megasas_dump_sys_regs(void __iomem *reg_set, char *buf) · 70 unmodified lines
29973000
29983001 /**
29993002 * megasas_reset_bus_host - Bus & host reset handler entry point
3003+ * @scmd: Mid-layer SCSI command
30003004 */
30013005 static int megasas_reset_bus_host(struct scsi_cmnd *scmd)
30023006 {
@@ -3777,7 +3781,7 @@ megasas_issue_pending_cmds_again(struct megasas_instance *instance) · 774 unmodified lines
37773781 megasas_register_aen(instance, seq_num, class_locale.word);
37783782 }
37793783
3780−/**
3784+/*
37813785 * Move the internal reset pending commands to a deferred queue.
37823786 *
37833787 * We move the commands pending at internal reset time to a
@@ -3785,7 +3789,7 @@ megasas_issue_pending_cmds_again(struct megasas_instance *instance) · 1 unmodified line
37853789 * completion of the internal reset sequence. if the internal reset
37863790 * did not complete in time, the kernel reset handler would flush
37873791 * these commands.
3788− **/
3792+ */
37893793 static void
37903794 megasas_internal_reset_defer_cmds(struct megasas_instance *instance)
37913795 {
@@ -3963,8 +3967,11 @@ megasas_deplete_reply_queue(struct megasas_instance *instance, · 171 unmodified lines
39633967 tasklet_schedule(&instance->isr_tasklet);
39643968 return IRQ_HANDLED;
39653969 }
3970+
39663971 /**
39673972 * megasas_isr - isr entry point
3973+ * @irq: IRQ number
3974+ * @devp: IRQ context address
39683975 */
39693976 static irqreturn_t megasas_isr(int irq, void *devp)
39703977 {
@@ -3986,6 +3993,7 @@ static irqreturn_t megasas_isr(int irq, void *devp) · 15 unmodified lines
39863993 /**
39873994 * megasas_transition_to_ready - Move the FW to READY state
39883995 * @instance: Adapter soft state
3996+ * @ocr: Adapter reset state
39893997 *
39903998 * During the initialization, FW passes can potentially be in any one of
39913999 * several possible states. If the FW in operational, waiting-for-handshake
@@ -4743,7 +4751,7 @@ megasas_get_ld_list(struct megasas_instance *instance) · 751 unmodified lines
47434751 /**
47444752 * megasas_ld_list_query - Returns FW's ld_list structure
47454753 * @instance: Adapter soft state
4746− * @ld_list: ld_list structure
4754+ * @query_type: ld_list structure type
47474755 *
47484756 * Issues an internal command (DCMD) to get the FW's controller PD
47494757 * list structure. This information is mainly used to find out SYSTEM
@@ -5602,9 +5610,13 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe) · 852 unmodified lines
56025610 &instance->irq_context[i])) {
56035611 dev_err(&instance->pdev->dev,
56045612 "Failed to register IRQ for vector %d.\n", i);
5605− for (j = 0; j < i; j++)
5613+ for (j = 0; j < i; j++) {
5614+ if (j < instance->low_latency_index_start)
5615+ irq_set_affinity_hint(
5616+ pci_irq_vector(pdev, j), NULL);
56065617 free_irq(pci_irq_vector(pdev, j),
56075618 &instance->irq_context[j]);
5619+ }
56085620 /* Retry irq register for IO_APIC*/
56095621 instance->msix_vectors = 0;
56105622 instance->msix_load_balance = false;
@@ -5642,6 +5654,9 @@ megasas_destroy_irqs(struct megasas_instance *instance) { · 31 unmodified lines
56425654
56435655 if (instance->msix_vectors)
56445656 for (i = 0; i < instance->msix_vectors; i++) {
5657+ if (i < instance->low_latency_index_start)
5658+ irq_set_affinity_hint(
5659+ pci_irq_vector(instance->pdev, i), NULL);
56455660 free_irq(pci_irq_vector(instance->pdev, i),
56465661 &instance->irq_context[i]);
56475662 }
@@ -5653,7 +5668,6 @@ megasas_destroy_irqs(struct megasas_instance *instance) { · 5 unmodified lines
56535668 /**
56545669 * megasas_setup_jbod_map - setup jbod map for FP seq_number.
56555670 * @instance: Adapter soft state
5656− * @is_probe: Driver probe check
56575671 *
56585672 * Return 0 on success.
56595673 */
@@ -6494,7 +6508,7 @@ dcmd_failed: · 834 unmodified lines
64946508 * megasas_register_aen - Registers for asynchronous event notification
64956509 * @instance: Adapter soft state
64966510 * @seq_num: The starting sequence number
6497− * @class_locale: Class of the event
6511+ * @class_locale_word: Class of the event
64986512 *
64996513 * This function subscribes for AEN for events beyond the @seq_num. It requests
65006514 * to be notified if and only if the event is of type @class_locale
@@ -7014,8 +7028,9 @@ static inline void megasas_free_ctrl_mem(struct megasas_instance *instance) · 513 unmodified lines
70147028 * megasas_alloc_ctrl_dma_buffers - Allocate consistent DMA buffers during
70157029 * driver load time
70167030 *
7017− * @instance- Adapter soft instance
7018− * @return- O for SUCCESS
7031+ * @instance: Adapter soft instance
7032+ *
7033+ * @return: O for SUCCESS
70197034 */
70207035 static inline
70217036 int megasas_alloc_ctrl_dma_buffers(struct megasas_instance *instance)
@@ -7931,7 +7946,7 @@ skip_firing_dcmds: · 909 unmodified lines
79317946
79327947 /**
79337948 * megasas_shutdown - Shutdown entry point
7934− * @device: Generic device structure
7949+ * @pdev: Generic device structure
79357950 */
79367951 static void megasas_shutdown(struct pci_dev *pdev)
79377952 {
@@ -7956,8 +7971,10 @@ skip_firing_dcmds: · 18 unmodified lines
79567971 pci_free_irq_vectors(instance->pdev);
79577972 }
79587973
7959−/**
7974+/*
79607975 * megasas_mgmt_open - char node "open" entry point
7976+ * @inode: char node inode
7977+ * @filep: char node file
79617978 */
79627979 static int megasas_mgmt_open(struct inode *inode, struct file *filep)
79637980 {
@@ -7970,8 +7987,11 @@ static int megasas_mgmt_open(struct inode *inode, struct file *filep) · 6 unmodified lines
79707987 return 0;
79717988 }
79727989
7973−/**
7990+/*
79747991 * megasas_mgmt_fasync - Async notifier registration from applications
7992+ * @fd: char node file descriptor number
7993+ * @filep: char node file
7994+ * @mode: notifier on/off
79757995 *
79767996 * This function adds the calling process to a driver global queue. When an
79777997 * event occurs, SIGIO will be sent to all processes in this queue.
@@ -7997,9 +8017,11 @@ static int megasas_mgmt_fasync(int fd, struct file *filep, int mode) · 19 unmodified lines
79978017 return rc;
79988018 }
79998019
8000−/**
8020+/*
80018021 * megasas_mgmt_poll - char node "poll" entry point
8002− * */
8022+ * @filep: char node file
8023+ * @wait: Events to poll for
8024+ */
80038025 static __poll_t megasas_mgmt_poll(struct file *file, poll_table *wait)
80048026 {
80058027 __poll_t mask;
@@ -8057,7 +8079,8 @@ static int megasas_set_crash_dump_params_ioctl(struct megasas_cmd *cmd) · 51 unmodified lines
80578079 /**
80588080 * megasas_mgmt_fw_ioctl - Issues management ioctls to FW
80598081 * @instance: Adapter soft state
8060− * @argp: User's ioctl packet
8082+ * @user_ioc: User's ioctl packet
8083+ * @ioc: ioctl packet
80618084 */
80628085 static int
80638086 megasas_mgmt_fw_ioctl(struct megasas_instance *instance,
@@ -8397,6 +8420,9 @@ static int megasas_mgmt_ioctl_aen(struct file *file, unsigned long arg) · 333 unmodified lines
83978420
83988421 /**
83998422 * megasas_mgmt_ioctl - char node ioctl entry point
8423+ * @file: char device file pointer
8424+ * @cmd: ioctl command
8425+ * @arg: ioctl command arguments address
84008426 */
84018427 static long
84028428 megasas_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
drivers/scsi/megaraid/megaraid_sas_fp.c+5−6
@@ -80,21 +80,20 @@ u32 mega_mod64(u64 dividend, u32 divisor) · 79 unmodified lines
8080 }
8181
8282 /**
83− * @param dividend : Dividend
84− * @param divisor : Divisor
83+ * mega_div64_32 - Do a 64-bit division
84+ * @dividend: Dividend
85+ * @divisor: Divisor
8586 *
8687 * @return quotient
8788 **/
8889 static u64 mega_div64_32(uint64_t dividend, uint32_t divisor)
8990 {
90− u32 remainder;
91− u64 d;
91+ u64 d = dividend;
9292
9393 if (!divisor)
9494 printk(KERN_ERR "megasas : DIVISOR is zero in mod fn\n");
9595
96− d = dividend;
97− remainder = do_div(d, divisor);
96+ do_div(d, divisor);
9897
9998 return d;
10099 }
drivers/scsi/megaraid/megaraid_sas_fusion.c+48−45
@@ -48,9 +48,6 @@ · 47 unmodified lines
4848 #include "megaraid_sas.h"
4949
5050
51−extern void megasas_free_cmds(struct megasas_instance *instance);
52−extern struct megasas_cmd *megasas_get_cmd(struct megasas_instance
53− *instance);
5451 extern void
5552 megasas_complete_cmd(struct megasas_instance *instance,
5653 struct megasas_cmd *cmd, u8 alt_status);
@@ -58,24 +55,14 @@ int · 1 unmodified line
5855 wait_and_poll(struct megasas_instance *instance, struct megasas_cmd *cmd,
5956 int seconds);
6057
61−void
62−megasas_return_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd);
63−int megasas_alloc_cmds(struct megasas_instance *instance);
6458 int
6559 megasas_clear_intr_fusion(struct megasas_instance *instance);
66−int
67−megasas_issue_polled(struct megasas_instance *instance,
68− struct megasas_cmd *cmd);
69−void
70−megasas_check_and_restore_queue_depth(struct megasas_instance *instance);
7160
7261 int megasas_transition_to_ready(struct megasas_instance *instance, int ocr);
73−void megaraid_sas_kill_hba(struct megasas_instance *instance);
7462
7563 extern u32 megasas_dbg_lvl;
7664 int megasas_sriov_start_heartbeat(struct megasas_instance *instance,
7765 int initial);
78−void megasas_start_timer(struct megasas_instance *instance);
7966 extern struct megasas_mgmt_info megasas_mgmt_info;
8067 extern unsigned int resetwaittime;
8168 extern unsigned int dual_qdepth_disable;
@@ -84,15 +71,13 @@ static void megasas_free_reply_fusion(struct megasas_instance *instance); · 2 unmodified lines
8471 static inline
8572 void megasas_configure_queue_sizes(struct megasas_instance *instance);
8673 static void megasas_fusion_crash_dump(struct megasas_instance *instance);
87−extern u32 megasas_readl(struct megasas_instance *instance,
88− const volatile void __iomem *addr);
8974
9075 /**
9176 * megasas_adp_reset_wait_for_ready - initiate chip reset and wait for
9277 * controller to come to ready state
93− * @instance - adapter's soft state
94− * @do_adp_reset - If true, do a chip reset
95− * @ocr_context - If called from OCR context this will
78+ * @instance: adapter's soft state
79+ * @do_adp_reset: If true, do a chip reset
80+ * @ocr_context: If called from OCR context this will
9681 * be set to 1, else 0
9782 *
9883 * This function initates a chip reset followed by a wait for controller to
@@ -146,10 +131,10 @@ out: · 47 unmodified lines
146131 /**
147132 * megasas_check_same_4gb_region - check if allocation
148133 * crosses same 4GB boundary or not
149− * @instance - adapter's soft instance
150− * start_addr - start address of DMA allocation
151− * size - size of allocation in bytes
152− * return - true : allocation does not cross same
134+ * @instance: adapter's soft instance
135+ * @start_addr: start address of DMA allocation
136+ * @size: size of allocation in bytes
137+ * @return: true : allocation does not cross same
153138 * 4GB boundary
154139 * false: allocation crosses same
155140 * 4GB boundary
@@ -174,7 +159,7 @@ static inline bool megasas_check_same_4gb_region · 18 unmodified lines
174159
175160 /**
176161 * megasas_enable_intr_fusion - Enables interrupts
177− * @regs: MFI register set
162+ * @instance: adapter's soft instance
178163 */
179164 static void
180165 megasas_enable_intr_fusion(struct megasas_instance *instance)
@@ -196,7 +181,7 @@ megasas_enable_intr_fusion(struct megasas_instance *instance) · 15 unmodified lines
196181
197182 /**
198183 * megasas_disable_intr_fusion - Disables interrupt
199− * @regs: MFI register set
184+ * @instance: adapter's soft instance
200185 */
201186 static void
202187 megasas_disable_intr_fusion(struct megasas_instance *instance)
@@ -238,6 +223,7 @@ megasas_clear_intr_fusion(struct megasas_instance *instance) · 35 unmodified lines
238223 /**
239224 * megasas_get_cmd_fusion - Get a command from the free pool
240225 * @instance: Adapter soft state
226+ * @blk_tag: Command tag
241227 *
242228 * Returns a blk_tag indexed mpt frame
243229 */
@@ -309,8 +295,8 @@ megasas_fire_cmd_fusion(struct megasas_instance *instance, · 65 unmodified lines
309295
310296 /**
311297 * megasas_fusion_update_can_queue - Do all Adapter Queue depth related calculations here
312− * @instance: Adapter soft state
313− * fw_boot_context: Whether this function called during probe or after OCR
298+ * @instance: Adapter soft state
299+ * @fw_boot_context: Whether this function called during probe or after OCR
314300 *
315301 * This function is only for fusion controllers.
316302 * Update host can queue, if firmware downgrade max supported firmware commands.
@@ -1016,6 +1002,7 @@ fail_exit: · 699 unmodified lines
10161002 * wait_and_poll - Issues a polling command
10171003 * @instance: Adapter soft state
10181004 * @cmd: Command packet to be issued
1005+ * @seconds: Maximum poll time
10191006 *
10201007 * For polling, MFI requires the cmd_status to be set to 0xFF before posting.
10211008 */
@@ -1906,6 +1893,7 @@ fail_alloc_mfi_cmds: · 884 unmodified lines
19061893 /**
19071894 * megasas_fault_detect_work - Worker function of
19081895 * FW fault handling workqueue.
1896+ * @work: FW fault work struct
19091897 */
19101898 static void
19111899 megasas_fault_detect_work(struct work_struct *work)
@@ -1989,11 +1977,13 @@ megasas_fusion_stop_watchdog(struct megasas_instance *instance) · 77 unmodified lines
19891977
19901978 /**
19911979 * map_cmd_status - Maps FW cmd status to OS cmd status
1992− * @cmd : Pointer to cmd
1993− * @status : status of cmd returned by FW
1994− * @ext_status : ext status of cmd returned by FW
1980+ * @fusion: fusion context
1981+ * @scmd: Pointer to cmd
1982+ * @status: status of cmd returned by FW
1983+ * @ext_status: ext status of cmd returned by FW
1984+ * @data_length: command data length
1985+ * @sense: command sense data
19951986 */
1996−
19971987 static void
19981988 map_cmd_status(struct fusion_context *fusion,
19991989 struct scsi_cmnd *scmd, u8 status, u8 ext_status,
@@ -2234,7 +2224,7 @@ megasas_make_prp_nvme(struct megasas_instance *instance, struct scsi_cmnd *scmd, · 234 unmodified lines
22342224 * @scp: SCSI command from the mid-layer
22352225 * @sgl_ptr: SGL to be filled in
22362226 * @cmd: cmd we are working on
2237− * @sge_count sge count
2227+ * @sge_count: sge count
22382228 *
22392229 */
22402230 static void
@@ -2343,9 +2333,12 @@ int megasas_make_sgl(struct megasas_instance *instance, struct scsi_cmnd *scp, · 102 unmodified lines
23432333
23442334 /**
23452335 * megasas_set_pd_lba - Sets PD LBA
2346− * @cdb: CDB
2336+ * @io_request: IO request
23472337 * @cdb_len: cdb length
2348− * @start_blk: Start block of IO
2338+ * @io_info: IO information
2339+ * @scp: SCSI command
2340+ * @local_map_ptr: Raid map
2341+ * @ref_tag: Primary reference tag
23492342 *
23502343 * Used to set the PD LBA in CDB for FP IOs
23512344 */
@@ -2603,10 +2596,12 @@ static void megasas_stream_detect(struct megasas_instance *instance, · 251 unmodified lines
26032596 * affinity (cpu of the controller) and raid_flags in the raid context
26042597 * based on IO type.
26052598 *
2599+ * @fusion: Fusion context
26062600 * @praid_context: IO RAID context
26072601 * @raid: LD raid map
26082602 * @fp_possible: Is fast path possible?
26092603 * @is_read: Is read IO?
2604+ * @scsi_buff_len: SCSI command buffer length
26102605 *
26112606 */
26122607 static void
@@ -2940,7 +2935,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, · 327 unmodified lines
29402935 /**
29412936 * megasas_build_ld_nonrw_fusion - prepares non rw ios for virtual disk
29422937 * @instance: Adapter soft state
2943− * @scp: SCSI command
2938+ * @scmd: SCSI command
29442939 * @cmd: Command to be prepared
29452940 *
29462941 * Prepares the io_request frame for non-rw io cmds for vd.
@@ -3028,7 +3023,7 @@ static void megasas_build_ld_nonrw_fusion(struct megasas_instance *instance, · 81 unmodified lines
30283023 /**
30293024 * megasas_build_syspd_fusion - prepares rw/non-rw ios for syspd
30303025 * @instance: Adapter soft state
3031− * @scp: SCSI command
3026+ * @scmd: SCSI command
30323027 * @cmd: Command to be prepared
30333028 * @fp_possible: parameter to detect fast path or firmware path io.
30343029 *
@@ -3405,7 +3400,7 @@ megasas_build_and_issue_cmd_fusion(struct megasas_instance *instance, · 370 unmodified lines
34053400 * megasas_complete_r1_command -
34063401 * completes R1 FP write commands which has valid peer smid
34073402 * @instance: Adapter soft state
3408− * @cmd_fusion: MPT command frame
3403+ * @cmd: MPT command frame
34093404 *
34103405 */
34113406 static inline void
@@ -3459,6 +3454,9 @@ megasas_complete_r1_command(struct megasas_instance *instance, · 47 unmodified lines
34593454 /**
34603455 * complete_cmd_fusion - Completes command
34613456 * @instance: Adapter soft state
3457+ * @MSIxIndex: MSI number
3458+ * @irq_context: IRQ context
3459+ *
34623460 * Completes all commands that is in reply descriptor queue
34633461 */
34643462 static int
@@ -3634,6 +3632,7 @@ complete_cmd_fusion(struct megasas_instance *instance, u32 MSIxIndex, · 169 unmodified lines
36343632
36353633 /**
36363634 * megasas_enable_irq_poll() - enable irqpoll
3635+ * @instance: Adapter soft state
36373636 */
36383637 static void megasas_enable_irq_poll(struct megasas_instance *instance)
36393638 {
@@ -3650,7 +3649,7 @@ static void megasas_enable_irq_poll(struct megasas_instance *instance) · 10 unmodified lines
36503649
36513650 /**
36523651 * megasas_sync_irqs - Synchronizes all IRQs owned by adapter
3653− * @instance: Adapter soft state
3652+ * @instance_addr: Adapter soft state address
36543653 */
36553654 static void megasas_sync_irqs(unsigned long instance_addr)
36563655 {
@@ -3706,7 +3705,7 @@ int megasas_irqpoll(struct irq_poll *irqpoll, int budget) · 49 unmodified lines
37063705
37073706 /**
37083707 * megasas_complete_cmd_dpc_fusion - Completes command
3709− * @instance: Adapter soft state
3708+ * @instance_addr: Adapter soft state address
37103709 *
37113710 * Tasklet to complete cmds
37123711 */
@@ -3729,6 +3728,8 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr) · 16 unmodified lines
37293728
37303729 /**
37313730 * megasas_isr_fusion - isr entry point
3731+ * @irq: IRQ number
3732+ * @devp: IRQ context
37323733 */
37333734 static irqreturn_t megasas_isr_fusion(int irq, void *devp)
37343735 {
@@ -3761,7 +3762,7 @@ static irqreturn_t megasas_isr_fusion(int irq, void *devp) · 26 unmodified lines
37613762 /**
37623763 * build_mpt_mfi_pass_thru - builds a cmd fo MFI Pass thru
37633764 * @instance: Adapter soft state
3764− * mfi_cmd: megasas_cmd pointer
3765+ * @mfi_cmd: megasas_cmd pointer
37653766 *
37663767 */
37673768 static void
@@ -3878,7 +3879,7 @@ megasas_release_fusion(struct megasas_instance *instance) · 110 unmodified lines
38783879
38793880 /**
38803881 * megasas_read_fw_status_reg_fusion - returns the current FW status value
3881− * @regs: MFI register set
3882+ * @instance: Adapter soft state
38823883 */
38833884 static u32
38843885 megasas_read_fw_status_reg_fusion(struct megasas_instance *instance)
@@ -3889,7 +3890,7 @@ megasas_read_fw_status_reg_fusion(struct megasas_instance *instance) · 4 unmodified lines
38893890 /**
38903891 * megasas_alloc_host_crash_buffer - Host buffers for Crash dump collection from Firmware
38913892 * @instance: Controller's soft instance
3892− * return: Number of allocated host crash buffers
3893+ * @return: Number of allocated host crash buffers
38933894 */
38943895 static void
38953896 megasas_alloc_host_crash_buffer(struct megasas_instance *instance)
@@ -3927,6 +3928,7 @@ megasas_free_host_crash_buffer(struct megasas_instance *instance) · 31 unmodified lines
39273928
39283929 /**
39293930 * megasas_adp_reset_fusion - For controller reset
3931+ * @instance: Controller's soft instance
39303932 * @regs: MFI register set
39313933 */
39323934 static int
@@ -4004,6 +4006,7 @@ megasas_adp_reset_fusion(struct megasas_instance *instance, · 71 unmodified lines
40044006
40054007 /**
40064008 * megasas_check_reset_fusion - For controller reset check
4009+ * @instance: Controller's soft instance
40074010 * @regs: MFI register set
40084011 */
40094012 static int
@@ -4333,8 +4336,8 @@ static int megasas_track_scsiio(struct megasas_instance *instance, · 323 unmodified lines
43334336
43344337 /**
43354338 * megasas_tm_response_code - translation of device response code
4336− * @ioc: per adapter object
4337− * @mpi_reply: MPI reply returned by firmware
4339+ * @instance: Controller's soft instance
4340+ * @mpi_reply: MPI reply returned by firmware
43384341 *
43394342 * Return nothing.
43404343 */
@@ -4389,9 +4392,9 @@ megasas_tm_response_code(struct megasas_instance *instance, · 48 unmodified lines
43894392 * @device_handle: device handle
43904393 * @channel: the channel assigned by the OS
43914394 * @id: the id assigned by the OS
4392− * @type: MPI2_SCSITASKMGMT_TASKTYPE__XXX (defined in megaraid_sas_fusion.c)
43934395 * @smid_task: smid assigned to the task
4394− * @m_type: TM_MUTEX_ON or TM_MUTEX_OFF
4396+ * @type: MPI2_SCSITASKMGMT_TASKTYPE__XXX (defined in megaraid_sas_fusion.c)
4397+ * @mr_device_priv_data: private data
43954398 * Context: user
43964399 *
43974400 * MegaRaid use MPT interface for Task Magement request.
drivers/scsi/mesh.c+7−1
@@ -1045,6 +1045,8 @@ static void handle_error(struct mesh_state *ms) · 1044 unmodified lines
10451045 while ((in_8(&mr->bus_status1) & BS1_RST) != 0)
10461046 udelay(1);
10471047 printk("done\n");
1048+ if (ms->dma_started)
1049+ halt_dma(ms);
10481050 handle_reset(ms);
10491051 /* request_q is empty, no point in mesh_start() */
10501052 return;
@@ -1357,7 +1359,8 @@ static void halt_dma(struct mesh_state *ms) · 306 unmodified lines
13571359 ms->conn_tgt, ms->data_ptr, scsi_bufflen(cmd),
13581360 ms->tgts[ms->conn_tgt].data_goes_out);
13591361 }
1360− scsi_dma_unmap(cmd);
1362+ if (cmd)
1363+ scsi_dma_unmap(cmd);
13611364 ms->dma_started = 0;
13621365 }
13631366
@@ -1712,6 +1715,9 @@ static int mesh_host_reset(struct scsi_cmnd *cmd) · 348 unmodified lines
17121715
17131716 spin_lock_irqsave(ms->host->host_lock, flags);
17141717
1718+ if (ms->dma_started)
1719+ halt_dma(ms);
1720+
17151721 /* Reset the controller & dbdma channel */
17161722 out_le32(&md->control, (RUN|PAUSE|FLUSH|WAKE) << 16); /* stop dma */
17171723 out_8(&mr->exception, 0xff); /* clear all exception bits */
drivers/scsi/mpt3sas/mpt3sas_base.c+8−6
@@ -190,7 +190,7 @@ module_param_call(mpt3sas_fwfault_debug, _scsih_set_fwfault_debug, · 189 unmodified lines
190190
191191 /**
192192 * _base_readl_aero - retry readl for max three times.
193− * @addr - MPT Fusion system interface register address
193+ * @addr: MPT Fusion system interface register address
194194 *
195195 * Retry the readl() for max three times if it gets zero value
196196 * while reading the system interface register.
@@ -817,6 +817,7 @@ mpt3sas_base_coredump_info(struct MPT3SAS_ADAPTER *ioc, u16 fault_code) · 620 unmodified lines
817817 * mpt3sas_base_wait_for_coredump_completion - Wait until coredump
818818 * completes or times out
819819 * @ioc: per adapter object
820+ * @caller: caller function name
820821 *
821822 * Returns 0 for success, non-zero for failure.
822823 */
@@ -1718,8 +1719,8 @@ _base_interrupt(int irq, void *bus_id) · 895 unmodified lines
17181719
17191720 /**
17201721 * _base_irqpoll - IRQ poll callback handler
1721− * @irqpoll - irq_poll object
1722− * @budget - irq poll weight
1722+ * @irqpoll: irq_poll object
1723+ * @budget: irq poll weight
17231724 *
17241725 * returns number of reply descriptors processed
17251726 */
@@ -3048,8 +3049,8 @@ fall_back: · 1322 unmodified lines
30483049
30493050 /**
30503051 * _base_check_and_enable_high_iops_queues - enable high iops mode
3051− * @ ioc - per adapter object
3052− * @ hba_msix_vector_count - msix vectors supported by HBA
3052+ * @ioc: per adapter object
3053+ * @hba_msix_vector_count: msix vectors supported by HBA
30533054 *
30543055 * Enable high iops queues only if
30553056 * - HBA is a SEA/AERO controller and
@@ -5621,6 +5622,7 @@ _base_wait_on_iocstate(struct MPT3SAS_ADAPTER *ioc, u32 ioc_state, int timeout) · 2565 unmodified lines
56215622 * _base_wait_for_doorbell_int - waiting for controller interrupt(generated by
56225623 * a write to the doorbell)
56235624 * @ioc: per adapter object
5625+ * @timeout: timeout in seconds
56245626 *
56255627 * Return: 0 for success, non-zero for failure.
56265628 *
@@ -5833,7 +5835,7 @@ _base_send_ioc_reset(struct MPT3SAS_ADAPTER *ioc, u8 reset_type, int timeout) · 206 unmodified lines
58335835 /**
58345836 * mpt3sas_wait_for_ioc - IOC's operational state is checked here.
58355837 * @ioc: per adapter object
5836− * @wait_count: timeout in seconds
5838+ * @timeout: timeout in seconds
58375839 *
58385840 * Return: Waits up to timeout seconds for the IOC to
58395841 * become operational. Returns 0 if IOC is present
drivers/scsi/mpt3sas/mpt3sas_base.h+1−1
@@ -1770,7 +1770,7 @@ void mpt3sas_send_trigger_data_event(struct MPT3SAS_ADAPTER *ioc, · 1769 unmodified lines
17701770 void mpt3sas_process_trigger_data(struct MPT3SAS_ADAPTER *ioc,
17711771 struct SL_WH_TRIGGERS_EVENT_DATA_T *event_data);
17721772 void mpt3sas_trigger_master(struct MPT3SAS_ADAPTER *ioc,
1773− u32 tigger_bitmask);
1773+ u32 trigger_bitmask);
17741774 void mpt3sas_trigger_event(struct MPT3SAS_ADAPTER *ioc, u16 event,
17751775 u16 log_entry_qualifier);
17761776 void mpt3sas_trigger_scsi(struct MPT3SAS_ADAPTER *ioc, u8 sense_key,
drivers/scsi/mpt3sas/mpt3sas_config.c+3−4
@@ -303,7 +303,6 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t · 302 unmodified lines
303303 u8 retry_count, issue_host_reset = 0;
304304 struct config_request mem;
305305 u32 ioc_status = UINT_MAX;
306− u8 issue_reset = 0;
307306
308307 mutex_lock(&ioc->config_cmds.mutex);
309308 if (ioc->config_cmds.status != MPT3_CMD_NOT_USED) {
@@ -386,9 +385,9 @@ _config_request(struct MPT3SAS_ADAPTER *ioc, Mpi2ConfigRequest_t · 76 unmodified lines
386385 if (!(ioc->logging_level & MPT_DEBUG_CONFIG))
387386 _config_display_some_debug(ioc,
388387 smid, "config_request", NULL);
389− mpt3sas_check_cmd_timeout(ioc,
390− ioc->config_cmds.status, mpi_request,
391− sizeof(Mpi2ConfigRequest_t)/4, issue_reset);
388+ ioc_err(ioc, "%s: command timeout\n", __func__);
389+ mpt3sas_base_check_cmd_timeout(ioc, ioc->config_cmds.status,
390+ mpi_request, sizeof(Mpi2ConfigRequest_t) / 4);
392391 retry_count++;
393392 if (ioc->config_cmds.smid == smid)
394393 mpt3sas_base_free_smid(ioc, smid);
drivers/scsi/mpt3sas/mpt3sas_ctl.c+10−6
@@ -3662,8 +3662,9 @@ static DEVICE_ATTR_RW(diag_trigger_mpi); · 3661 unmodified lines
36623662
36633663 /**
36643664 * drv_support_bitmap_show - driver supported feature bitmap
3665− * @cdev - pointer to embedded class device
3666− * @buf - the buffer returned
3665+ * @cdev: pointer to embedded class device
3666+ * @attr: unused
3667+ * @buf: the buffer returned
36673668 *
36683669 * A sysfs 'read-only' shost attribute.
36693670 */
@@ -3680,8 +3681,9 @@ static DEVICE_ATTR_RO(drv_support_bitmap); · 10 unmodified lines
36803681
36813682 /**
36823683 * enable_sdev_max_qd_show - display whether sdev max qd is enabled/disabled
3683− * @cdev - pointer to embedded class device
3684− * @buf - the buffer returned
3684+ * @cdev: pointer to embedded class device
3685+ * @attr: unused
3686+ * @buf: the buffer returned
36853687 *
36863688 * A sysfs read/write shost attribute. This attribute is used to set the
36873689 * targets queue depth to HBA IO queue depth if this attribute is enabled.
@@ -3698,8 +3700,10 @@ enable_sdev_max_qd_show(struct device *cdev, · 10 unmodified lines
36983700
36993701 /**
37003702 * enable_sdev_max_qd_store - Enable/disable sdev max qd
3701− * @cdev - pointer to embedded class device
3702− * @buf - the buffer returned
3703+ * @cdev: pointer to embedded class device
3704+ * @attr: unused
3705+ * @buf: the buffer returned
3706+ * @count: unused
37033707 *
37043708 * A sysfs read/write shost attribute. This attribute is used to set the
37053709 * targets queue depth to HBA IO queue depth if this attribute is enabled.
drivers/scsi/mpt3sas/mpt3sas_trigger_diag.h+1−1
@@ -69,7 +69,7 @@ · 68 unmodified lines
6969 #define MASTER_TRIGGER_TASK_MANAGMENT (0x00000004)
7070 #define MASTER_TRIGGER_DEVICE_REMOVAL (0x00000008)
7171
72−/* fake firmware event for tigger */
72+/* fake firmware event for trigger */
7373 #define MPI3_EVENT_DIAGNOSTIC_TRIGGER_FIRED (0x6E)
7474
7575 /**
drivers/scsi/mvsas/mv_init.c+4−4
@@ -177,15 +177,16 @@ out: · 176 unmodified lines
177177
178178 static irqreturn_t mvs_interrupt(int irq, void *opaque)
179179 {
180− u32 core_nr;
181180 u32 stat;
182181 struct mvs_info *mvi;
183182 struct sas_ha_struct *sha = opaque;
184183 #ifndef CONFIG_SCSI_MVSAS_TASKLET
185184 u32 i;
186−#endif
185+ u32 core_nr;
187186
188187 core_nr = ((struct mvs_prv_info *)sha->lldd_ha)->n_host;
188+#endif
189+
189190 mvi = ((struct mvs_prv_info *)sha->lldd_ha)->mvi[0];
190191
191192 if (unlikely(!mvi))
@@ -299,7 +300,7 @@ err_out: · 107 unmodified lines
299300
300301 int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex)
301302 {
302− unsigned long res_start, res_len, res_flag, res_flag_ex = 0;
303+ unsigned long res_start, res_len, res_flag_ex = 0;
303304 struct pci_dev *pdev = mvi->pdev;
304305 if (bar_ex != -1) {
305306 /*
@@ -327,7 +328,6 @@ int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex) · 21 unmodified lines
327328 goto err_out;
328329 }
329330
330− res_flag = pci_resource_flags(pdev, bar);
331331 mvi->regs = ioremap(res_start, res_len);
332332
333333 if (!mvi->regs) {
drivers/scsi/myrs.c+17−17
@@ -87,7 +87,7 @@ static char *myrs_raid_level_name(enum myrs_raid_level level) · 86 unmodified lines
8787 return NULL;
8888 }
8989
90−/**
90+/*
9191 * myrs_reset_cmd - clears critical fields in struct myrs_cmdblk
9292 */
9393 static inline void myrs_reset_cmd(struct myrs_cmdblk *cmd_blk)
@@ -98,7 +98,7 @@ static inline void myrs_reset_cmd(struct myrs_cmdblk *cmd_blk) · 4 unmodified lines
9898 cmd_blk->status = 0;
9999 }
100100
101−/**
101+/*
102102 * myrs_qcmd - queues Command for DAC960 V2 Series Controllers.
103103 */
104104 static void myrs_qcmd(struct myrs_hba *cs, struct myrs_cmdblk *cmd_blk)
@@ -122,7 +122,7 @@ static void myrs_qcmd(struct myrs_hba *cs, struct myrs_cmdblk *cmd_blk) · 17 unmodified lines
122122 cs->next_cmd_mbox = next_mbox;
123123 }
124124
125−/**
125+/*
126126 * myrs_exec_cmd - executes V2 Command and waits for completion.
127127 */
128128 static void myrs_exec_cmd(struct myrs_hba *cs,
@@ -140,7 +140,7 @@ static void myrs_exec_cmd(struct myrs_hba *cs, · 11 unmodified lines
140140 wait_for_completion(&complete);
141141 }
142142
143−/**
143+/*
144144 * myrs_report_progress - prints progress message
145145 */
146146 static void myrs_report_progress(struct myrs_hba *cs, unsigned short ldev_num,
@@ -153,7 +153,7 @@ static void myrs_report_progress(struct myrs_hba *cs, unsigned short ldev_num, · 6 unmodified lines
153153 (100 * (int)(blocks >> 7)) / (int)(size >> 7));
154154 }
155155
156−/**
156+/*
157157 * myrs_get_ctlr_info - executes a Controller Information IOCTL Command
158158 */
159159 static unsigned char myrs_get_ctlr_info(struct myrs_hba *cs)
@@ -214,7 +214,7 @@ static unsigned char myrs_get_ctlr_info(struct myrs_hba *cs) · 54 unmodified lines
214214 return status;
215215 }
216216
217−/**
217+/*
218218 * myrs_get_ldev_info - executes a Logical Device Information IOCTL Command
219219 */
220220 static unsigned char myrs_get_ldev_info(struct myrs_hba *cs,
@@ -301,7 +301,7 @@ static unsigned char myrs_get_ldev_info(struct myrs_hba *cs, · 80 unmodified lines
301301 return status;
302302 }
303303
304−/**
304+/*
305305 * myrs_get_pdev_info - executes a "Read Physical Device Information" Command
306306 */
307307 static unsigned char myrs_get_pdev_info(struct myrs_hba *cs,
@@ -345,7 +345,7 @@ static unsigned char myrs_get_pdev_info(struct myrs_hba *cs, · 37 unmodified lines
345345 return status;
346346 }
347347
348−/**
348+/*
349349 * myrs_dev_op - executes a "Device Operation" Command
350350 */
351351 static unsigned char myrs_dev_op(struct myrs_hba *cs,
@@ -369,7 +369,7 @@ static unsigned char myrs_dev_op(struct myrs_hba *cs, · 17 unmodified lines
369369 return status;
370370 }
371371
372−/**
372+/*
373373 * myrs_translate_pdev - translates a Physical Device Channel and
374374 * TargetID into a Logical Device.
375375 */
@@ -414,7 +414,7 @@ static unsigned char myrs_translate_pdev(struct myrs_hba *cs, · 38 unmodified lines
414414 return status;
415415 }
416416
417−/**
417+/*
418418 * myrs_get_event - executes a Get Event Command
419419 */
420420 static unsigned char myrs_get_event(struct myrs_hba *cs,
@@ -476,7 +476,7 @@ static unsigned char myrs_get_fwstatus(struct myrs_hba *cs) · 55 unmodified lines
476476 return status;
477477 }
478478
479−/**
479+/*
480480 * myrs_enable_mmio_mbox - enables the Memory Mailbox Interface
481481 */
482482 static bool myrs_enable_mmio_mbox(struct myrs_hba *cs,
@@ -577,7 +577,7 @@ out_free: · 94 unmodified lines
577577 return (status == MYRS_STATUS_SUCCESS);
578578 }
579579
580−/**
580+/*
581581 * myrs_get_config - reads the Configuration Information
582582 */
583583 static int myrs_get_config(struct myrs_hba *cs)
@@ -682,7 +682,7 @@ static int myrs_get_config(struct myrs_hba *cs) · 98 unmodified lines
682682 return 0;
683683 }
684684
685−/**
685+/*
686686 * myrs_log_event - prints a Controller Event message
687687 */
688688 static struct {
@@ -2338,11 +2338,11 @@ Failure: · 1649 unmodified lines
23382338 return NULL;
23392339 }
23402340
2341−/**
2341+/*
23422342 * myrs_err_status reports Controller BIOS Messages passed through
2343− the Error Status Register when the driver performs the BIOS handshaking.
2344− It returns true for fatal errors and false otherwise.
2345−*/
2343+ * the Error Status Register when the driver performs the BIOS handshaking.
2344+ * It returns true for fatal errors and false otherwise.
2345+ */
23462346
23472347 static bool myrs_err_status(struct myrs_hba *cs, unsigned char status,
23482348 unsigned char parm0, unsigned char parm1)
drivers/scsi/pcmcia/nsp_cs.c+3−2
@@ -134,6 +134,7 @@ static inline void nsp_inc_resid(struct scsi_cmnd *SCpnt, int residInc) · 133 unmodified lines
134134 scsi_set_resid(SCpnt, scsi_get_resid(SCpnt) + residInc);
135135 }
136136
137+__printf(4, 5)
137138 static void nsp_cs_message(const char *func, int line, char *type, char *fmt, ...)
138139 {
139140 va_list args;
@@ -689,14 +690,14 @@ static int nsp_fifo_count(struct scsi_cmnd *SCpnt) · 549 unmodified lines
689690 {
690691 unsigned int base = SCpnt->device->host->io_port;
691692 unsigned int count;
692− unsigned int l, m, h, dummy;
693+ unsigned int l, m, h;
693694
694695 nsp_index_write(base, POINTERCLR, POINTER_CLEAR | ACK_COUNTER);
695696
696697 l = nsp_index_read(base, TRANSFERCOUNT);
697698 m = nsp_index_read(base, TRANSFERCOUNT);
698699 h = nsp_index_read(base, TRANSFERCOUNT);
699− dummy = nsp_index_read(base, TRANSFERCOUNT); /* required this! */
700+ nsp_index_read(base, TRANSFERCOUNT); /* required this! */
700701
701702 count = (h << 16) | (m << 8) | (l << 0);
702703
drivers/scsi/pm8001/pm8001_ctl.c+22−1
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747 /**
4848 * pm8001_ctl_mpi_interface_rev_show - MPI interface revision number
4949 * @cdev: pointer to embedded class device
50+ * @attr: device attribute (unused)
5051 * @buf: the buffer returned
5152 *
5253 * A sysfs 'read-only' shost attribute.
@@ -72,6 +73,7 @@ DEVICE_ATTR(interface_rev, S_IRUGO, pm8001_ctl_mpi_interface_rev_show, NULL); · 19 unmodified lines
7273 /**
7374 * controller_fatal_error_show - check controller is under fatal err
7475 * @cdev: pointer to embedded class device
76+ * @attr: device attribute (unused)
7577 * @buf: the buffer returned
7678 *
7779 * A sysfs 'read only' shost attribute.
@@ -91,6 +93,7 @@ static DEVICE_ATTR_RO(controller_fatal_error); · 13 unmodified lines
9193 /**
9294 * pm8001_ctl_fw_version_show - firmware version
9395 * @cdev: pointer to embedded class device
96+ * @attr: device attribute (unused)
9497 * @buf: the buffer returned
9598 *
9699 * A sysfs 'read-only' shost attribute.
@@ -121,6 +124,7 @@ static DEVICE_ATTR(fw_version, S_IRUGO, pm8001_ctl_fw_version_show, NULL); · 24 unmodified lines
121124 /**
122125 * pm8001_ctl_ila_version_show - ila version
123126 * @cdev: pointer to embedded class device
127+ * @attr: device attribute (unused)
124128 * @buf: the buffer returned
125129 *
126130 * A sysfs 'read-only' shost attribute.
@@ -146,6 +150,7 @@ static DEVICE_ATTR(ila_version, 0444, pm8001_ctl_ila_version_show, NULL); · 19 unmodified lines
146150 /**
147151 * pm8001_ctl_inactive_fw_version_show - Inacative firmware version number
148152 * @cdev: pointer to embedded class device
153+ * @attr: device attribute (unused)
149154 * @buf: the buffer returned
150155 *
151156 * A sysfs 'read-only' shost attribute.
@@ -172,6 +177,7 @@ DEVICE_ATTR(inc_fw_ver, 0444, pm8001_ctl_inactive_fw_version_show, NULL); · 20 unmodified lines
172177 /**
173178 * pm8001_ctl_max_out_io_show - max outstanding io supported
174179 * @cdev: pointer to embedded class device
180+ * @attr: device attribute (unused)
175181 * @buf: the buffer returned
176182 *
177183 * A sysfs 'read-only' shost attribute.
@@ -195,6 +201,7 @@ static DEVICE_ATTR(max_out_io, S_IRUGO, pm8001_ctl_max_out_io_show, NULL); · 17 unmodified lines
195201 /**
196202 * pm8001_ctl_max_devices_show - max devices support
197203 * @cdev: pointer to embedded class device
204+ * @attr: device attribute (unused)
198205 * @buf: the buffer returned
199206 *
200207 * A sysfs 'read-only' shost attribute.
@@ -221,6 +228,7 @@ static DEVICE_ATTR(max_devices, S_IRUGO, pm8001_ctl_max_devices_show, NULL); · 20 unmodified lines
221228 * pm8001_ctl_max_sg_list_show - max sg list supported iff not 0.0 for no
222229 * hardware limitation
223230 * @cdev: pointer to embedded class device
231+ * @attr: device attribute (unused)
224232 * @buf: the buffer returned
225233 *
226234 * A sysfs 'read-only' shost attribute.
@@ -265,6 +273,7 @@ show_sas_spec_support_status(unsigned int mode, char *buf) · 38 unmodified lines
265273 /**
266274 * pm8001_ctl_sas_spec_support_show - sas spec supported
267275 * @cdev: pointer to embedded class device
276+ * @attr: device attribute (unused)
268277 * @buf: the buffer returned
269278 *
270279 * A sysfs 'read-only' shost attribute.
@@ -292,6 +301,7 @@ static DEVICE_ATTR(sas_spec_support, S_IRUGO, · 21 unmodified lines
292301 /**
293302 * pm8001_ctl_sas_address_show - sas address
294303 * @cdev: pointer to embedded class device
304+ * @attr: device attribute (unused)
295305 * @buf: the buffer returned
296306 *
297307 * This is the controller sas address
@@ -313,6 +323,7 @@ static DEVICE_ATTR(host_sas_address, S_IRUGO, · 15 unmodified lines
313323 /**
314324 * pm8001_ctl_logging_level_show - logging level
315325 * @cdev: pointer to embedded class device
326+ * @attr: device attribute (unused)
316327 * @buf: the buffer returned
317328 *
318329 * A sysfs 'read/write' shost attribute.
@@ -326,6 +337,7 @@ static ssize_t pm8001_ctl_logging_level_show(struct device *cdev, · 7 unmodified lines
326337
327338 return snprintf(buf, PAGE_SIZE, "%08xh\n", pm8001_ha->logging_level);
328339 }
340+
329341 static ssize_t pm8001_ctl_logging_level_store(struct device *cdev,
330342 struct device_attribute *attr, const char *buf, size_t count)
331343 {
@@ -346,6 +358,7 @@ static DEVICE_ATTR(logging_level, S_IRUGO | S_IWUSR, · 14 unmodified lines
346358 /**
347359 * pm8001_ctl_aap_log_show - aap1 event log
348360 * @cdev: pointer to embedded class device
361+ * @attr: device attribute (unused)
349362 * @buf: the buffer returned
350363 *
351364 * A sysfs 'read-only' shost attribute.
@@ -382,6 +395,7 @@ static DEVICE_ATTR(aap_log, S_IRUGO, pm8001_ctl_aap_log_show, NULL); · 30 unmodified lines
382395 /**
383396 * pm8001_ctl_ib_queue_log_show - Out bound Queue log
384397 * @cdev:pointer to embedded class device
398+ * @attr: device attribute (unused)
385399 * @buf: the buffer returned
386400 * A sysfs 'read-only' shost attribute.
387401 */
@@ -414,6 +428,7 @@ static DEVICE_ATTR(ib_log, S_IRUGO, pm8001_ctl_ib_queue_log_show, NULL); · 26 unmodified lines
414428 /**
415429 * pm8001_ctl_ob_queue_log_show - Out bound Queue log
416430 * @cdev:pointer to embedded class device
431+ * @attr: device attribute (unused)
417432 * @buf: the buffer returned
418433 * A sysfs 'read-only' shost attribute.
419434 */
@@ -446,6 +461,7 @@ static DEVICE_ATTR(ob_log, S_IRUGO, pm8001_ctl_ob_queue_log_show, NULL); · 26 unmodified lines
446461 /**
447462 * pm8001_ctl_bios_version_show - Bios version Display
448463 * @cdev:pointer to embedded class device
464+ * @attr: device attribute (unused)
449465 * @buf:the buffer returned
450466 * A sysfs 'read-only' shost attribute.
451467 */
@@ -483,6 +499,7 @@ static DEVICE_ATTR(bios_version, S_IRUGO, pm8001_ctl_bios_version_show, NULL); · 31 unmodified lines
483499 /**
484500 * event_log_size_show - event log size
485501 * @cdev: pointer to embedded class device
502+ * @attr: device attribute (unused)
486503 * @buf: the buffer returned
487504 *
488505 * A sysfs read shost attribute.
@@ -501,6 +518,7 @@ static DEVICE_ATTR_RO(event_log_size); · 12 unmodified lines
501518 /**
502519 * pm8001_ctl_aap_log_show - IOP event log
503520 * @cdev: pointer to embedded class device
521+ * @attr: device attribute (unused)
504522 * @buf: the buffer returned
505523 *
506524 * A sysfs 'read-only' shost attribute.
@@ -538,6 +556,7 @@ static DEVICE_ATTR(iop_log, S_IRUGO, pm8001_ctl_iop_log_show, NULL); · 31 unmodified lines
538556 /**
539557 ** pm8001_ctl_fatal_log_show - fatal error logging
540558 ** @cdev:pointer to embedded class device
559+ ** @attr: device attribute
541560 ** @buf: the buffer returned
542561 **
543562 ** A sysfs 'read-only' shost attribute.
@@ -557,6 +576,7 @@ static DEVICE_ATTR(fatal_log, S_IRUGO, pm8001_ctl_fatal_log_show, NULL); · 13 unmodified lines
557576 /**
558577 ** non_fatal_log_show - non fatal error logging
559578 ** @cdev:pointer to embedded class device
579+ ** @attr: device attribute
560580 ** @buf: the buffer returned
561581 **
562582 ** A sysfs 'read-only' shost attribute.
@@ -601,8 +621,9 @@ static DEVICE_ATTR_RW(non_fatal_count); · 38 unmodified lines
601621 /**
602622 ** pm8001_ctl_gsm_log_show - gsm dump collection
603623 ** @cdev:pointer to embedded class device
624+ ** @attr: device attribute (unused)
604625 ** @buf: the buffer returned
605− **A sysfs 'read-only' shost attribute.
626+ ** A sysfs 'read-only' shost attribute.
606627 **/
607628 static ssize_t pm8001_ctl_gsm_log_show(struct device *cdev,
608629 struct device_attribute *attr, char *buf)
drivers/scsi/pm8001/pm8001_hwi.c+14−13
@@ -333,6 +333,7 @@ static void update_main_config_table(struct pm8001_hba_info *pm8001_ha) · 332 unmodified lines
333333 /**
334334 * update_inbnd_queue_table - update the inbound queue table to the HBA.
335335 * @pm8001_ha: our hba card information
336+ * @number: entry in the queue
336337 */
337338 static void update_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha,
338339 int number)
@@ -354,6 +355,7 @@ static void update_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha, · 15 unmodified lines
354355 /**
355356 * update_outbnd_queue_table - update the outbound queue table to the HBA.
356357 * @pm8001_ha: our hba card information
358+ * @number: entry in the queue
357359 */
358360 static void update_outbnd_queue_table(struct pm8001_hba_info *pm8001_ha,
359361 int number)
@@ -473,7 +475,7 @@ static void mpi_set_phys_g3_with_ssc(struct pm8001_hba_info *pm8001_ha, · 113 unmodified lines
473475 /**
474476 * mpi_set_open_retry_interval_reg
475477 * @pm8001_ha: our hba card information
476− * @interval - interval time for each OPEN_REJECT (RETRY). The units are in 1us.
478+ * @interval: interval time for each OPEN_REJECT (RETRY). The units are in 1us.
477479 */
478480 static void mpi_set_open_retry_interval_reg(struct pm8001_hba_info *pm8001_ha,
479481 u32 interval)
@@ -1231,6 +1233,7 @@ pm8001_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha) · 751 unmodified lines
12311233 /**
12321234 * pm8001_chip_msix_interrupt_enable - enable PM8001 chip interrupt
12331235 * @pm8001_ha: our hba card information
1236+ * @int_vec_idx: interrupt number to enable
12341237 */
12351238 static void
12361239 pm8001_chip_msix_interrupt_enable(struct pm8001_hba_info *pm8001_ha,
@@ -1249,6 +1252,7 @@ pm8001_chip_msix_interrupt_enable(struct pm8001_hba_info *pm8001_ha, · 12 unmodified lines
12491252 /**
12501253 * pm8001_chip_msix_interrupt_disable - disable PM8001 chip interrupt
12511254 * @pm8001_ha: our hba card information
1255+ * @int_vec_idx: interrupt number to disable
12521256 */
12531257 static void
12541258 pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha,
@@ -1264,6 +1268,7 @@ pm8001_chip_msix_interrupt_disable(struct pm8001_hba_info *pm8001_ha, · 9 unmodified lines
12641268 /**
12651269 * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
12661270 * @pm8001_ha: our hba card information
1271+ * @vec: unused
12671272 */
12681273 static void
12691274 pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
@@ -1278,6 +1283,7 @@ pm8001_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec) · 8 unmodified lines
12781283 /**
12791284 * pm8001_chip_intx_interrupt_disable- disable PM8001 chip interrupt
12801285 * @pm8001_ha: our hba card information
1286+ * @vec: unused
12811287 */
12821288 static void
12831289 pm8001_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
@@ -4500,7 +4506,6 @@ static int pm8001_chip_sata_req(struct pm8001_hba_info *pm8001_ha, · 3216 unmodified lines
45004506 /**
45014507 * pm8001_chip_phy_start_req - start phy via PHY_START COMMAND
45024508 * @pm8001_ha: our hba card information.
4503− * @num: the inbound queue number
45044509 * @phy_id: the phy id which we wanted to start up.
45054510 */
45064511 static int
@@ -4536,7 +4541,6 @@ pm8001_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) · 29 unmodified lines
45364541 /**
45374542 * pm8001_chip_phy_stop_req - start phy via PHY_STOP COMMAND
45384543 * @pm8001_ha: our hba card information.
4539− * @num: the inbound queue number
45404544 * @phy_id: the phy id which we wanted to start up.
45414545 */
45424546 static int pm8001_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha,
@@ -4556,7 +4560,7 @@ static int pm8001_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha, · 13 unmodified lines
45564560 return ret;
45574561 }
45584562
4559−/**
4563+/*
45604564 * see comments on pm8001_mpi_reg_resp.
45614565 */
45624566 static int pm8001_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha,
@@ -4616,7 +4620,7 @@ static int pm8001_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha, · 53 unmodified lines
46164620 return rc;
46174621 }
46184622
4619−/**
4623+/*
46204624 * see comments on pm8001_mpi_reg_resp.
46214625 */
46224626 int pm8001_chip_dereg_dev_req(struct pm8001_hba_info *pm8001_ha,
@@ -4641,9 +4645,8 @@ int pm8001_chip_dereg_dev_req(struct pm8001_hba_info *pm8001_ha, · 18 unmodified lines
46414645 /**
46424646 * pm8001_chip_phy_ctl_req - support the local phy operation
46434647 * @pm8001_ha: our hba card information.
4644− * @num: the inbound queue number
4645− * @phy_id: the phy id which we wanted to operate
4646− * @phy_op:
4648+ * @phyId: the phy id which we wanted to operate
4649+ * @phy_op: the phy operation to request
46474650 */
46484651 static int pm8001_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
46494652 u32 phyId, u32 phy_op)
@@ -4679,8 +4682,7 @@ static u32 pm8001_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha) · 29 unmodified lines
46794682 /**
46804683 * pm8001_chip_isr - PM8001 isr handler.
46814684 * @pm8001_ha: our hba card information.
4682− * @irq: irq number.
4683− * @stat: stat.
4685+ * @vec: IRQ number
46844686 */
46854687 static irqreturn_t
46864688 pm8001_chip_isr(struct pm8001_hba_info *pm8001_ha, u8 vec)
@@ -4717,10 +4719,8 @@ static int send_task_abort(struct pm8001_hba_info *pm8001_ha, u32 opc, · 30 unmodified lines
47174719 return ret;
47184720 }
47194721
4720−/**
4722+/*
47214723 * pm8001_chip_abort_task - SAS abort task when error or exception happened.
4722− * @task: the task we wanted to aborted.
4723− * @flag: the abort flag.
47244724 */
47254725 int pm8001_chip_abort_task(struct pm8001_hba_info *pm8001_ha,
47264726 struct pm8001_device *pm8001_dev, u8 flag, u32 task_tag, u32 cmd_tag)
@@ -4959,6 +4959,7 @@ int pm8001_chip_set_nvmd_req(struct pm8001_hba_info *pm8001_ha, · 232 unmodified lines
49594959 * pm8001_chip_fw_flash_update_build - support the firmware update operation
49604960 * @pm8001_ha: our hba card information.
49614961 * @fw_flash_updata_info: firmware flash update param
4962+ * @tag: Tag to apply to the payload
49624963 */
49634964 int
49644965 pm8001_chip_fw_flash_update_build(struct pm8001_hba_info *pm8001_ha,
drivers/scsi/pm8001/pm8001_init.c+15−15
@@ -57,7 +57,7 @@ MODULE_PARM_DESC(link_rate, "Enable link rate.\n" · 56 unmodified lines
5757
5858 static struct scsi_transport_template *pm8001_stt;
5959
60−/**
60+/*
6161 * chip info structure to identify chip key functionality as
6262 * encryption available/not, no of ports, hw specific function ref
6363 */
@@ -80,7 +80,7 @@ LIST_HEAD(hba_list); · 16 unmodified lines
8080
8181 struct workqueue_struct *pm8001_wq;
8282
83−/**
83+/*
8484 * The main structure which LLDD must register for scsi core.
8585 */
8686 static struct scsi_host_template pm8001_sht = {
@@ -109,7 +109,7 @@ static struct scsi_host_template pm8001_sht = { · 22 unmodified lines
109109 .track_queue_depth = 1,
110110 };
111111
112−/**
112+/*
113113 * Sas layer call this function to execute specific task.
114114 */
115115 static struct sas_domain_function_template pm8001_transport_ops = {
@@ -129,9 +129,9 @@ static struct sas_domain_function_template pm8001_transport_ops = { · 13 unmodified lines
129129 };
130130
131131 /**
132− *pm8001_phy_init - initiate our adapter phys
133− *@pm8001_ha: our hba structure.
134− *@phy_id: phy id.
132+ * pm8001_phy_init - initiate our adapter phys
133+ * @pm8001_ha: our hba structure.
134+ * @phy_id: phy id.
135135 */
136136 static void pm8001_phy_init(struct pm8001_hba_info *pm8001_ha, int phy_id)
137137 {
@@ -155,9 +155,8 @@ static void pm8001_phy_init(struct pm8001_hba_info *pm8001_ha, int phy_id) · 17 unmodified lines
155155 }
156156
157157 /**
158− *pm8001_free - free hba
159− *@pm8001_ha: our hba structure.
160− *
158+ * pm8001_free - free hba
159+ * @pm8001_ha: our hba structure.
161160 */
162161 static void pm8001_free(struct pm8001_hba_info *pm8001_ha)
163162 {
@@ -205,6 +204,7 @@ static void pm8001_tasklet(unsigned long opaque) · 41 unmodified lines
205204 * pm8001_interrupt_handler_msix - main MSIX interrupt handler.
206205 * It obtains the vector number and calls the equivalent bottom
207206 * half or services directly.
207+ * @irq: interrupt number
208208 * @opaque: the passed outbound queue/vector. Host structure is
209209 * retrieved from the same.
210210 */
@@ -230,6 +230,7 @@ static irqreturn_t pm8001_interrupt_handler_msix(int irq, void *opaque) · 19 unmodified lines
230230
231231 /**
232232 * pm8001_interrupt_handler_intx - main INTx interrupt handler.
233+ * @irq: interrupt number
233234 * @dev_id: sas_ha structure. The HBA is retrieved from sas_has structure.
234235 */
235236
@@ -257,8 +258,8 @@ static u32 pm8001_request_irq(struct pm8001_hba_info *pm8001_ha); · 21 unmodified lines
257258
258259 /**
259260 * pm8001_alloc - initiate our hba structure and 6 DMAs area.
260− * @pm8001_ha:our hba structure.
261− *
261+ * @pm8001_ha: our hba structure.
262+ * @ent: PCI device ID structure to match on
262263 */
263264 static int pm8001_alloc(struct pm8001_hba_info *pm8001_ha,
264265 const struct pci_device_id *ent)
@@ -615,7 +616,7 @@ static void pm8001_post_sas_ha_init(struct Scsi_Host *shost, · 350 unmodified lines
615616
616617 /**
617618 * pm8001_init_sas_add - initialize sas address
618− * @chip_info: our ha struct.
619+ * @pm8001_ha: our ha struct.
619620 *
620621 * Currently we just set the fixed SAS address to our HBA,for manufacture,
621622 * it should read from the EEPROM
@@ -893,8 +894,7 @@ static int pm8001_configure_phy_settings(struct pm8001_hba_info *pm8001_ha) · 271 unmodified lines
893894 #ifdef PM8001_USE_MSIX
894895 /**
895896 * pm8001_setup_msix - enable MSI-X interrupt
896− * @chip_info: our ha struct.
897− * @irq_handler: irq_handler
897+ * @pm8001_ha: our ha struct.
898898 */
899899 static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha)
900900 {
@@ -975,7 +975,7 @@ static u32 pm8001_setup_irq(struct pm8001_hba_info *pm8001_ha) · 74 unmodified lines
975975
976976 /**
977977 * pm8001_request_irq - register interrupt
978− * @chip_info: our ha struct.
978+ * @pm8001_ha: our ha struct.
979979 */
980980 static u32 pm8001_request_irq(struct pm8001_hba_info *pm8001_ha)
981981 {
drivers/scsi/pm8001/pm8001_sas.c+5−4
@@ -129,6 +129,7 @@ int pm8001_mem_alloc(struct pci_dev *pdev, void **virt_addr, · 128 unmodified lines
129129 *pphys_addr_lo = lower_32_bits(phys_align);
130130 return 0;
131131 }
132+
132133 /**
133134 * pm8001_find_ha_by_dev - from domain device which come from sas layer to
134135 * find out our hba struct.
@@ -366,17 +367,15 @@ static int sas_find_local_port_id(struct domain_device *dev) · 231 unmodified lines
366367 return 0;
367368 }
368369
370+#define DEV_IS_GONE(pm8001_dev) \
371+ ((!pm8001_dev || (pm8001_dev->dev_type == SAS_PHY_UNUSED)))
369372 /**
370373 * pm8001_task_exec - queue the task(ssp, smp && ata) to the hardware.
371374 * @task: the task to be execute.
372− * @num: if can_queue great than 1, the task can be queued up. for SMP task,
373− * we always execute one one time.
374375 * @gfp_flags: gfp_flags.
375376 * @is_tmf: if it is task management task.
376377 * @tmf: the task management IU
377378 */
378−#define DEV_IS_GONE(pm8001_dev) \
379− ((!pm8001_dev || (pm8001_dev->dev_type == SAS_PHY_UNUSED)))
380379 static int pm8001_task_exec(struct sas_task *task,
381380 gfp_t gfp_flags, int is_tmf, struct pm8001_tmf_task *tmf)
382381 {
@@ -577,6 +576,7 @@ static struct pm8001_device *pm8001_alloc_dev(struct pm8001_hba_info *pm8001_ha) · 194 unmodified lines
577576 /**
578577 * pm8001_find_dev - find a matching pm8001_device
579578 * @pm8001_ha: our hba card information
579+ * @device_id: device ID to match against
580580 */
581581 struct pm8001_device *pm8001_find_dev(struct pm8001_hba_info *pm8001_ha,
582582 u32 device_id)
@@ -995,6 +995,7 @@ void pm8001_open_reject_retry( · 412 unmodified lines
995995 /**
996996 * Standard mandates link reset for ATA (type 0) and hard reset for
997997 * SSP (type 1) , only for RECOVERY
998+ * @dev: the device structure for the device to reset.
998999 */
9991000 int pm8001_I_T_nexus_reset(struct domain_device *dev)
10001001 {
drivers/scsi/pm8001/pm80xx_hwi.c+12−11
@@ -66,7 +66,7 @@ int pm80xx_bar4_shift(struct pm8001_hba_info *pm8001_ha, u32 shift_value) · 65 unmodified lines
6666 return 0;
6767 }
6868
69−void pm80xx_pci_mem_copy(struct pm8001_hba_info *pm8001_ha, u32 soffset,
69+static void pm80xx_pci_mem_copy(struct pm8001_hba_info *pm8001_ha, u32 soffset,
7070 const void *destination,
7171 u32 dw_count, u32 bus_base_number)
7272 {
@@ -912,6 +912,7 @@ static void update_main_config_table(struct pm8001_hba_info *pm8001_ha) · 839 unmodified lines
912912 /**
913913 * update_inbnd_queue_table - update the inbound queue table to the HBA.
914914 * @pm8001_ha: our hba card information
915+ * @number: entry in the queue
915916 */
916917 static void update_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha,
917918 int number)
@@ -948,6 +949,7 @@ static void update_inbnd_queue_table(struct pm8001_hba_info *pm8001_ha, · 30 unmodified lines
948949 /**
949950 * update_outbnd_queue_table - update the outbound queue table to the HBA.
950951 * @pm8001_ha: our hba card information
952+ * @number: entry in the queue
951953 */
952954 static void update_outbnd_queue_table(struct pm8001_hba_info *pm8001_ha,
953955 int number)
@@ -1711,6 +1713,7 @@ pm80xx_chip_intx_interrupt_disable(struct pm8001_hba_info *pm8001_ha) · 757 unmodified lines
17111713 /**
17121714 * pm8001_chip_interrupt_enable - enable PM8001 chip interrupt
17131715 * @pm8001_ha: our hba card information
1716+ * @vec: interrupt number to enable
17141717 */
17151718 static void
17161719 pm80xx_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec)
@@ -1729,6 +1732,7 @@ pm80xx_chip_interrupt_enable(struct pm8001_hba_info *pm8001_ha, u8 vec) · 12 unmodified lines
17291732 /**
17301733 * pm8001_chip_interrupt_disable- disable PM8001 chip interrupt
17311734 * @pm8001_ha: our hba card information
1735+ * @vec: interrupt number to disable
17321736 */
17331737 static void
17341738 pm80xx_chip_interrupt_disable(struct pm8001_hba_info *pm8001_ha, u8 vec)
@@ -4822,7 +4826,6 @@ static int pm80xx_chip_sata_req(struct pm8001_hba_info *pm8001_ha, · 3087 unmodified lines
48224826 /**
48234827 * pm80xx_chip_phy_start_req - start phy via PHY_START COMMAND
48244828 * @pm8001_ha: our hba card information.
4825− * @num: the inbound queue number
48264829 * @phy_id: the phy id which we wanted to start up.
48274830 */
48284831 static int
@@ -4864,7 +4867,6 @@ pm80xx_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) · 35 unmodified lines
48644867 /**
48654868 * pm8001_chip_phy_stop_req - start phy via PHY_STOP COMMAND
48664869 * @pm8001_ha: our hba card information.
4867− * @num: the inbound queue number
48684870 * @phy_id: the phy id which we wanted to start up.
48694871 */
48704872 static int pm80xx_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha,
@@ -4884,7 +4886,7 @@ static int pm80xx_chip_phy_stop_req(struct pm8001_hba_info *pm8001_ha, · 13 unmodified lines
48844886 return ret;
48854887 }
48864888
4887−/**
4889+/*
48884890 * see comments on pm8001_mpi_reg_resp.
48894891 */
48904892 static int pm80xx_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha,
@@ -4957,9 +4959,8 @@ static int pm80xx_chip_reg_dev_req(struct pm8001_hba_info *pm8001_ha, · 66 unmodified lines
49574959 /**
49584960 * pm80xx_chip_phy_ctl_req - support the local phy operation
49594961 * @pm8001_ha: our hba card information.
4960− * @num: the inbound queue number
4961− * @phy_id: the phy id which we wanted to operate
4962− * @phy_op:
4962+ * @phyId: the phy id which we wanted to operate
4963+ * @phy_op: phy operation to request
49634964 */
49644965 static int pm80xx_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
49654966 u32 phyId, u32 phy_op)
@@ -4998,8 +4999,7 @@ static u32 pm80xx_chip_is_our_interrupt(struct pm8001_hba_info *pm8001_ha) · 32 unmodified lines
49984999 /**
49995000 * pm8001_chip_isr - PM8001 isr handler.
50005001 * @pm8001_ha: our hba card information.
5001− * @irq: irq number.
5002− * @stat: stat.
5002+ * @vec: irq number.
50035003 */
50045004 static irqreturn_t
50055005 pm80xx_chip_isr(struct pm8001_hba_info *pm8001_ha, u8 vec)
@@ -5013,8 +5013,9 @@ pm80xx_chip_isr(struct pm8001_hba_info *pm8001_ha, u8 vec) · 7 unmodified lines
50135013 return IRQ_HANDLED;
50145014 }
50155015
5016−void mpi_set_phy_profile_req(struct pm8001_hba_info *pm8001_ha,
5017− u32 operation, u32 phyid, u32 length, u32 *buf)
5016+static void mpi_set_phy_profile_req(struct pm8001_hba_info *pm8001_ha,
5017+ u32 operation, u32 phyid,
5018+ u32 length, u32 *buf)
50185019 {
50195020 u32 tag , i, j = 0;
50205021 int rc;
drivers/scsi/ppa.c+0−3
@@ -779,7 +779,6 @@ static int ppa_engine(ppa_struct *dev, struct scsi_cmnd *cmd) · 778 unmodified lines
779779 (DID_OK << 16) + (h << 8) + (l & STATUS_MASK);
780780 }
781781 return 0; /* Finished */
782− break;
783782
784783 default:
785784 printk(KERN_ERR "ppa: Invalid scsi phase\n");
@@ -847,10 +846,8 @@ static int ppa_abort(struct scsi_cmnd *cmd) · 61 unmodified lines
847846 case 1: /* Have not connected to interface */
848847 dev->cur_cmd = NULL; /* Forget the problem */
849848 return SUCCESS;
850− break;
851849 default: /* SCSI command sent, can not abort */
852850 return FAILED;
853− break;
854851 }
855852 }
856853
drivers/scsi/qedf/qedf_debugfs.c+8−10
@@ -14,10 +14,9 @@ · 13 unmodified lines
1414
1515 static struct dentry *qedf_dbg_root;
1616
17−/**
17+/*
1818 * qedf_dbg_host_init - setup the debugfs file for the pf
19− * @pf: the pf that is starting up
20− **/
19+ */
2120 void
2221 qedf_dbg_host_init(struct qedf_dbg_ctx *qedf,
2322 const struct qedf_debugfs_ops *dops,
@@ -42,10 +41,9 @@ qedf_dbg_host_init(struct qedf_dbg_ctx *qedf, · 18 unmodified lines
4241 }
4342 }
4443
45−/**
44+/*
4645 * qedf_dbg_host_exit - clear out the pf's debugfs entries
47− * @pf: the pf that is stopping
48− **/
46+ */
4947 void
5048 qedf_dbg_host_exit(struct qedf_dbg_ctx *qedf_dbg)
5149 {
@@ -56,9 +54,9 @@ qedf_dbg_host_exit(struct qedf_dbg_ctx *qedf_dbg) · 4 unmodified lines
5654 qedf_dbg->bdf_dentry = NULL;
5755 }
5856
59−/**
57+/*
6058 * qedf_dbg_init - start up debugfs for the driver
61− **/
59+ */
6260 void
6361 qedf_dbg_init(char *drv_name)
6462 {
@@ -68,9 +66,9 @@ qedf_dbg_init(char *drv_name) · 3 unmodified lines
6866 qedf_dbg_root = debugfs_create_dir(drv_name, NULL);
6967 }
7068
71−/**
69+/*
7270 * qedf_dbg_exit - clean out the driver's debugfs entries
73− **/
71+ */
7472 void
7573 qedf_dbg_exit(void)
7674 {
drivers/scsi/qedf/qedf_io.c+4−26
@@ -22,7 +22,6 @@ static void qedf_cmd_timeout(struct work_struct *work) · 21 unmodified lines
2222 container_of(work, struct qedf_ioreq, timeout_work.work);
2323 struct qedf_ctx *qedf;
2424 struct qedf_rport *fcport;
25− u8 op = 0;
2625
2726 if (io_req == NULL) {
2827 QEDF_INFO(NULL, QEDF_LOG_IO, "io_req is NULL.\n");
@@ -89,7 +88,6 @@ static void qedf_cmd_timeout(struct work_struct *work) · 60 unmodified lines
8988 io_req->event = QEDF_IOREQ_EV_ELS_TMO;
9089 /* Call callback function to complete command */
9190 if (io_req->cb_func && io_req->cb_arg) {
92− op = io_req->cb_arg->op;
9391 io_req->cb_func(io_req->cb_arg);
9492 io_req->cb_arg = NULL;
9593 }
@@ -487,7 +485,7 @@ static int qedf_map_sg(struct qedf_ioreq *io_req) · 391 unmodified lines
487485 int sg_count = 0;
488486 int bd_count = 0;
489487 u32 sg_len;
490− u64 addr, end_addr;
488+ u64 addr;
491489 int i = 0;
492490
493491 sg_count = dma_map_sg(&qedf->pdev->dev, scsi_sglist(sc),
@@ -502,10 +500,9 @@ static int qedf_map_sg(struct qedf_ioreq *io_req) · 8 unmodified lines
502500 scsi_for_each_sg(sc, sg, sg_count, i) {
503501 sg_len = (u32)sg_dma_len(sg);
504502 addr = (u64)sg_dma_address(sg);
505− end_addr = (u64)(addr + sg_len);
506503
507504 /*
508− * Intermediate s/g element so check if start and end address
505+ * Intermediate s/g element so check if start address
509506 * is page aligned. Only required for writes and only if the
510507 * number of scatter/gather elements is 8 or more.
511508 */
@@ -860,7 +857,6 @@ int qedf_post_io_req(struct qedf_rport *fcport, struct qedf_ioreq *io_req) · 348 unmodified lines
860857 struct qedf_ctx *qedf = lport_priv(lport);
861858 struct e4_fcoe_task_context *task_ctx;
862859 u16 xid;
863− enum fcoe_task_type req_type = 0;
864860 struct fcoe_wqe *sqe;
865861 u16 sqe_idx;
866862
@@ -873,11 +869,9 @@ int qedf_post_io_req(struct qedf_rport *fcport, struct qedf_ioreq *io_req) · 6 unmodified lines
873869 io_req->cpu = smp_processor_id();
874870
875871 if (sc_cmd->sc_data_direction == DMA_FROM_DEVICE) {
876− req_type = FCOE_TASK_TYPE_READ_INITIATOR;
877872 io_req->io_req_flags = QEDF_READ;
878873 qedf->input_requests++;
879874 } else if (sc_cmd->sc_data_direction == DMA_TO_DEVICE) {
880− req_type = FCOE_TASK_TYPE_WRITE_INITIATOR;
881875 io_req->io_req_flags = QEDF_WRITE;
882876 qedf->output_requests++;
883877 } else {
@@ -1130,8 +1124,6 @@ static void qedf_unmap_sg_list(struct qedf_ctx *qedf, struct qedf_ioreq *io_req) · 246 unmodified lines
11301124 void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe,
11311125 struct qedf_ioreq *io_req)
11321126 {
1133− u16 xid;
1134− struct e4_fcoe_task_context *task_ctx;
11351127 struct scsi_cmnd *sc_cmd;
11361128 struct fcoe_cqe_rsp_info *fcp_rsp;
11371129 struct qedf_rport *fcport;
@@ -1155,8 +1147,6 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, · 17 unmodified lines
11551147 return;
11561148 }
11571149
1158− xid = io_req->xid;
1159− task_ctx = qedf_get_task_mem(&qedf->tasks, xid);
11601150 sc_cmd = io_req->sc_cmd;
11611151 fcp_rsp = &cqe->cqe_info.rsp_info;
11621152
@@ -1342,7 +1332,6 @@ out: · 179 unmodified lines
13421332 void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req,
13431333 int result)
13441334 {
1345− u16 xid;
13461335 struct scsi_cmnd *sc_cmd;
13471336 int refcount;
13481337
@@ -1364,7 +1353,6 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, · 15 unmodified lines
13641353 */
13651354 clear_bit(QEDF_CMD_OUTSTANDING, &io_req->flags);
13661355
1367− xid = io_req->xid;
13681356 sc_cmd = io_req->sc_cmd;
13691357
13701358 if (!sc_cmd) {
@@ -1863,7 +1851,6 @@ int qedf_initiate_abts(struct qedf_ioreq *io_req, bool return_scsi_cmd_on_abts) · 492 unmodified lines
18631851 struct fc_rport_priv *rdata;
18641852 struct qedf_ctx *qedf;
18651853 u16 xid;
1866− u32 r_a_tov = 0;
18671854 int rc = 0;
18681855 unsigned long flags;
18691856 struct fcoe_wqe *sqe;
@@ -1886,7 +1873,6 @@ int qedf_initiate_abts(struct qedf_ioreq *io_req, bool return_scsi_cmd_on_abts) · 16 unmodified lines
18861873 goto out;
18871874 }
18881875
1889− r_a_tov = rdata->r_a_tov;
18901876 lport = qedf->lport;
18911877
18921878 if (lport->state != LPORT_ST_READY || !(lport->link_up)) {
@@ -1964,14 +1950,12 @@ void qedf_process_abts_compl(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, · 71 unmodified lines
19641950 struct qedf_ioreq *io_req)
19651951 {
19661952 uint32_t r_ctl;
1967− uint16_t xid;
19681953 int rc;
19691954 struct qedf_rport *fcport = io_req->fcport;
19701955
19711956 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_SCSI_TM, "Entered with xid = "
19721957 "0x%x cmd_type = %d\n", io_req->xid, io_req->cmd_type);
19731958
1974− xid = io_req->xid;
19751959 r_ctl = cqe->cqe_info.abts_info.r_ctl;
19761960
19771961 /* This was added at a point when we were scheduling abts_compl &
@@ -2159,8 +2143,6 @@ int qedf_initiate_cleanup(struct qedf_ioreq *io_req, · 181 unmodified lines
21592143 {
21602144 struct qedf_rport *fcport;
21612145 struct qedf_ctx *qedf;
2162− uint16_t xid;
2163− struct e4_fcoe_task_context *task;
21642146 int tmo = 0;
21652147 int rc = SUCCESS;
21662148 unsigned long flags;
@@ -2220,12 +2202,9 @@ int qedf_initiate_cleanup(struct qedf_ioreq *io_req, · 53 unmodified lines
22202202 refcount, fcport, fcport->rdata->ids.port_id);
22212203
22222204 /* Cleanup cmds re-use the same TID as the original I/O */
2223− xid = io_req->xid;
22242205 io_req->cmd_type = QEDF_CLEANUP;
22252206 io_req->return_scsi_cmd_on_abts = return_scsi_cmd_on_abts;
22262207
2227− task = qedf_get_task_mem(&qedf->tasks, xid);
2228−
22292208 init_completion(&io_req->cleanup_done);
22302209
22312210 spin_lock_irqsave(&fcport->rport_lock, flags);
@@ -2531,7 +2510,6 @@ void qedf_process_unsol_compl(struct qedf_ctx *qedf, uint16_t que_idx, · 299 unmodified lines
25312510 struct fcoe_cqe *cqe)
25322511 {
25332512 unsigned long flags;
2534− uint16_t tmp;
25352513 uint16_t pktlen = cqe->cqe_info.unsolic_info.pkt_len;
25362514 u32 payload_len, crc;
25372515 struct fc_frame_header *fh;
@@ -2629,9 +2607,9 @@ increment_prod: · 91 unmodified lines
26292607 qedf->bdq_prod_idx = 0;
26302608
26312609 writew(qedf->bdq_prod_idx, qedf->bdq_primary_prod);
2632− tmp = readw(qedf->bdq_primary_prod);
2610+ readw(qedf->bdq_primary_prod);
26332611 writew(qedf->bdq_prod_idx, qedf->bdq_secondary_prod);
2634− tmp = readw(qedf->bdq_secondary_prod);
2612+ readw(qedf->bdq_secondary_prod);
26352613
26362614 spin_unlock_irqrestore(&qedf->hba_lock, flags);
26372615 }
drivers/scsi/qedf/qedf_main.c+4−6
@@ -1041,9 +1041,8 @@ static int qedf_xmit_l2_frame(struct qedf_rport *fcport, struct fc_frame *fp) · 1040 unmodified lines
10411041 return rc;
10421042 }
10431043
1044−/**
1044+/*
10451045 * qedf_xmit - qedf FCoE frame transmit function
1046− *
10471046 */
10481047 static int qedf_xmit(struct fc_lport *lport, struct fc_frame *fp)
10491048 {
@@ -1437,7 +1436,7 @@ static void qedf_cleanup_fcport(struct qedf_ctx *qedf, · 387 unmodified lines
14371436 kref_put(&rdata->kref, fc_rport_destroy);
14381437 }
14391438
1440−/**
1439+/*
14411440 * This event_callback is called after successful completion of libfc
14421441 * initiated target login. qedf can proceed with initiating the session
14431442 * establishment.
@@ -3222,7 +3221,6 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) · 1778 unmodified lines
32223221 void *task_start, *task_end;
32233222 struct qed_slowpath_params slowpath_params;
32243223 struct qed_probe_params qed_params;
3225− u16 tmp;
32263224
32273225 /*
32283226 * When doing error recovery we didn't reap the lport so don't try
@@ -3416,9 +3414,9 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) · 187 unmodified lines
34163414 "Writing %d to primary and secondary BDQ doorbell registers.\n",
34173415 qedf->bdq_prod_idx);
34183416 writew(qedf->bdq_prod_idx, qedf->bdq_primary_prod);
3419− tmp = readw(qedf->bdq_primary_prod);
3417+ readw(qedf->bdq_primary_prod);
34203418 writew(qedf->bdq_prod_idx, qedf->bdq_secondary_prod);
3421− tmp = readw(qedf->bdq_secondary_prod);
3419+ readw(qedf->bdq_secondary_prod);
34223420
34233421 qed_ops->common->set_power_state(qedf->cdev, PCI_D0);
34243422
drivers/scsi/qedi/qedi_fw.c+2−3
@@ -352,7 +352,6 @@ static void qedi_put_rq_bdq_buf(struct qedi_ctx *qedi, · 351 unmodified lines
352352 struct iscsi_cqe_unsolicited *cqe,
353353 int count)
354354 {
355− u16 tmp;
356355 u16 idx = 0;
357356 struct scsi_bd *pbl;
358357
@@ -381,10 +380,10 @@ static void qedi_put_rq_bdq_buf(struct qedi_ctx *qedi, · 22 unmodified lines
381380 qedi->bdq_prod_idx += count;
382381
383382 writew(qedi->bdq_prod_idx, qedi->bdq_primary_prod);
384− tmp = readw(qedi->bdq_primary_prod);
383+ readw(qedi->bdq_primary_prod);
385384
386385 writew(qedi->bdq_prod_idx, qedi->bdq_secondary_prod);
387− tmp = readw(qedi->bdq_secondary_prod);
386+ readw(qedi->bdq_secondary_prod);
388387 }
389388
390389 static void qedi_unsol_pdu_adjust_bdq(struct qedi_ctx *qedi,
drivers/scsi/qedi/qedi_iscsi.c+1−1
@@ -1546,7 +1546,7 @@ static const struct { · 1545 unmodified lines
15461546 },
15471547 };
15481548
1549−char *qedi_get_iscsi_error(enum iscsi_error_types err_code)
1549+static char *qedi_get_iscsi_error(enum iscsi_error_types err_code)
15501550 {
15511551 int i;
15521552 char *msg = NULL;
drivers/scsi/qedi/qedi_main.c+3−6
@@ -1155,7 +1155,6 @@ static int qedi_queue_cqe(struct qedi_ctx *qedi, union iscsi_cqe *cqe, · 1154 unmodified lines
11551155 {
11561156 struct qedi_work *qedi_work;
11571157 struct qedi_conn *q_conn;
1158− struct iscsi_conn *conn;
11591158 struct qedi_cmd *qedi_cmd;
11601159 u32 iscsi_cid;
11611160 int rc = 0;
@@ -1168,7 +1167,6 @@ static int qedi_queue_cqe(struct qedi_ctx *qedi, union iscsi_cqe *cqe, · 6 unmodified lines
11681167 iscsi_cid);
11691168 return -1;
11701169 }
1171− conn = q_conn->cls_conn->dd_data;
11721170
11731171 switch (cqe->cqe_common.cqe_type) {
11741172 case ISCSI_CQE_TYPE_SOLICITED:
@@ -1962,7 +1960,7 @@ void qedi_reset_host_mtu(struct qedi_ctx *qedi, u16 mtu) · 787 unmodified lines
19621960 qedi_ops->ll2->start(qedi->cdev, &params);
19631961 }
19641962
1965−/**
1963+/*
19661964 * qedi_get_nvram_block: - Scan through the iSCSI NVRAM block (while accounting
19671965 * for gaps) for the matching absolute-pf-id of the QEDI device.
19681966 */
@@ -2429,7 +2427,6 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) · 460 unmodified lines
24292427 struct qed_probe_params qed_params;
24302428 void *task_start, *task_end;
24312429 int rc;
2432− u16 tmp;
24332430
24342431 if (mode != QEDI_MODE_RECOVERY) {
24352432 qedi = qedi_host_alloc(pdev);
@@ -2528,9 +2525,9 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) · 92 unmodified lines
25282525 "Writing %d to primary and secondary BDQ doorbell registers.\n",
25292526 qedi->bdq_prod_idx);
25302527 writew(qedi->bdq_prod_idx, qedi->bdq_primary_prod);
2531− tmp = readw(qedi->bdq_primary_prod);
2528+ readw(qedi->bdq_primary_prod);
25322529 writew(qedi->bdq_prod_idx, qedi->bdq_secondary_prod);
2533− tmp = readw(qedi->bdq_secondary_prod);
2530+ readw(qedi->bdq_secondary_prod);
25342531
25352532 ether_addr_copy(qedi->mac, qedi->dev_info.common.hw_mac);
25362533 QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_DISC, "MAC address is %pM.\n",
drivers/scsi/qla2xxx/qla_bsg.c+1−2
@@ -223,8 +223,7 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct bsg_job *bsg_job) · 222 unmodified lines
223223
224224 /* validate fcp priority data */
225225
226− if (!qla24xx_fcp_prio_cfg_valid(vha,
227− (struct qla_fcp_prio_cfg *) ha->fcp_prio_cfg, 1)) {
226+ if (!qla24xx_fcp_prio_cfg_valid(vha, ha->fcp_prio_cfg, 1)) {
228227 bsg_reply->result = (DID_ERROR << 16);
229228 ret = -EINVAL;
230229 /* If buffer was invalidatic int
drivers/scsi/qla2xxx/qla_dbg.c+36−75
@@ -11,10 +11,8 @@ · 10 unmodified lines
1111 * ----------------------------------------------------------------------
1212 * | Level | Last Value Used | Holes |
1313 * ----------------------------------------------------------------------
14− * | Module Init and Probe | 0x0193 | 0x0146 |
15− * | | | 0x015b-0x0160 |
16− * | | | 0x016e |
17− * | Mailbox commands | 0x1206 | 0x11a2-0x11ff |
14+ * | Module Init and Probe | 0x0199 | |
15+ * | Mailbox commands | 0x1206 | 0x11a5-0x11ff |
1816 * | Device Discovery | 0x2134 | 0x210e-0x2116 |
1917 * | | | 0x211a |
2018 * | | | 0x211c-0x2128 |
@@ -26,11 +24,7 @@ · 5 unmodified lines
2624 * | | | 0x3036,0x3038 |
2725 * | | | 0x303a |
2826 * | DPC Thread | 0x4023 | 0x4002,0x4013 |
29− * | Async Events | 0x5090 | 0x502b-0x502f |
30− * | | | 0x5047 |
31− * | | | 0x5084,0x5075 |
32− * | | | 0x503d,0x5044 |
33− * | | | 0x505f |
27+ * | Async Events | 0x509c | |
3428 * | Timer Routines | 0x6012 | |
3529 * | User Space Interactions | 0x70e3 | 0x7018,0x702e |
3630 * | | | 0x7020,0x7024 |
@@ -1063,7 +1057,7 @@ qla2100_fw_dump(scsi_qla_host_t *vha) · 1026 unmodified lines
10631057 }
10641058
10651059 if (rval == QLA_SUCCESS)
1066− qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]);
1060+ qla2xxx_copy_queues(ha, &fw->queue_dump[0]);
10671061
10681062 qla2xxx_dump_post_process(base_vha, rval);
10691063 }
@@ -2447,6 +2441,23 @@ qla83xx_fw_dump_failed_0: · 1377 unmodified lines
24472441 /* Driver Debug Functions. */
24482442 /****************************************************************************/
24492443
2444+/* Write the debug message prefix into @pbuf. */
2445+static void ql_dbg_prefix(char *pbuf, int pbuf_size,
2446+ const scsi_qla_host_t *vha, uint msg_id)
2447+{
2448+ if (vha) {
2449+ const struct pci_dev *pdev = vha->hw->pdev;
2450+
2451+ /* <module-name> [<dev-name>]-<msg-id>:<host>: */
2452+ snprintf(pbuf, pbuf_size, "%s [%s]-%04x:%ld: ", QL_MSGHDR,
2453+ dev_name(&(pdev->dev)), msg_id, vha->host_no);
2454+ } else {
2455+ /* <module-name> [<dev-name>]-<msg-id>: : */
2456+ snprintf(pbuf, pbuf_size, "%s [%s]-%04x: : ", QL_MSGHDR,
2457+ "0000:00:00.0", msg_id);
2458+ }
2459+}
2460+
24502461 /*
24512462 * This function is for formatting and logging debug information.
24522463 * It is to be used when vha is available. It formats the message
@@ -2465,41 +2476,19 @@ ql_dbg(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...) · 12 unmodified lines
24652476 {
24662477 va_list va;
24672478 struct va_format vaf;
2479+ char pbuf[64];
24682480
24692481 va_start(va, fmt);
24702482
24712483 vaf.fmt = fmt;
24722484 vaf.va = &va;
24732485
2474− if (!ql_mask_match(level)) {
2475− char pbuf[64];
2486+ ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), vha, id);
24762487
2477− if (vha != NULL) {
2478− const struct pci_dev *pdev = vha->hw->pdev;
2479− /* <module-name> <msg-id>:<host> Message */
2480− snprintf(pbuf, sizeof(pbuf), "%s [%s]-%04x:%ld: ",
2481− QL_MSGHDR, dev_name(&(pdev->dev)), id,
2482− vha->host_no);
2483− } else {
2484− snprintf(pbuf, sizeof(pbuf), "%s [%s]-%04x: : ",
2485− QL_MSGHDR, "0000:00:00.0", id);
2486− }
2487− pbuf[sizeof(pbuf) - 1] = 0;
2488+ if (!ql_mask_match(level))
24882489 trace_ql_dbg_log(pbuf, &vaf);
2489− va_end(va);
2490− return;
2491− }
2492−
2493− if (vha != NULL) {
2494− const struct pci_dev *pdev = vha->hw->pdev;
2495− /* <module-name> <pci-name> <msg-id>:<host> Message */
2496− pr_warn("%s [%s]-%04x:%ld: %pV",
2497− QL_MSGHDR, dev_name(&(pdev->dev)), id + ql_dbg_offset,
2498− vha->host_no, &vaf);
2499− } else {
2500− pr_warn("%s [%s]-%04x: : %pV",
2501− QL_MSGHDR, "0000:00:00.0", id + ql_dbg_offset, &vaf);
2502− }
2490+ else
2491+ pr_warn("%s%pV", pbuf, &vaf);
25032492
25042493 va_end(va);
25052494
@@ -2524,6 +2513,7 @@ ql_dbg_pci(uint level, struct pci_dev *pdev, uint id, const char *fmt, ...) · 18 unmodified lines
25242513 {
25252514 va_list va;
25262515 struct va_format vaf;
2516+ char pbuf[128];
25272517
25282518 if (pdev == NULL)
25292519 return;
@@ -2535,9 +2525,8 @@ ql_dbg_pci(uint level, struct pci_dev *pdev, uint id, const char *fmt, ...) · 5 unmodified lines
25352525 vaf.fmt = fmt;
25362526 vaf.va = &va;
25372527
2538− /* <module-name> <dev-name>:<msg-id> Message */
2539− pr_warn("%s [%s]-%04x: : %pV",
2540− QL_MSGHDR, dev_name(&(pdev->dev)), id + ql_dbg_offset, &vaf);
2528+ ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, id + ql_dbg_offset);
2529+ pr_warn("%s%pV", pbuf, &vaf);
25412530
25422531 va_end(va);
25432532 }
@@ -2565,16 +2554,7 @@ ql_log(uint level, scsi_qla_host_t *vha, uint id, const char *fmt, ...) · 21 unmodified lines
25652554 if (level > ql_errlev)
25662555 return;
25672556
2568− if (vha != NULL) {
2569− const struct pci_dev *pdev = vha->hw->pdev;
2570− /* <module-name> <msg-id>:<host> Message */
2571− snprintf(pbuf, sizeof(pbuf), "%s [%s]-%04x:%ld: ",
2572− QL_MSGHDR, dev_name(&(pdev->dev)), id, vha->host_no);
2573− } else {
2574− snprintf(pbuf, sizeof(pbuf), "%s [%s]-%04x: : ",
2575− QL_MSGHDR, "0000:00:00.0", id);
2576− }
2577− pbuf[sizeof(pbuf) - 1] = 0;
2557+ ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), vha, id);
25782558
25792559 va_start(va, fmt);
25802560
@@ -2625,10 +2605,7 @@ ql_log_pci(uint level, struct pci_dev *pdev, uint id, const char *fmt, ...) · 44 unmodified lines
26252605 if (level > ql_errlev)
26262606 return;
26272607
2628− /* <module-name> <dev-name>:<msg-id> Message */
2629− snprintf(pbuf, sizeof(pbuf), "%s [%s]-%04x: : ",
2630− QL_MSGHDR, dev_name(&(pdev->dev)), id);
2631− pbuf[sizeof(pbuf) - 1] = 0;
2608+ ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), NULL, id);
26322609
26332610 va_start(va, fmt);
26342611
@@ -2679,7 +2656,6 @@ ql_dump_regs(uint level, scsi_qla_host_t *vha, uint id) · 44 unmodified lines
26792656 "mbox[%d] %#04x\n", i, rd_reg_word(mbx_reg));
26802657 }
26812658
2682−
26832659 void
26842660 ql_dump_buffer(uint level, scsi_qla_host_t *vha, uint id, const void *buf,
26852661 uint size)
@@ -2724,16 +2700,7 @@ ql_log_qp(uint32_t level, struct qla_qpair *qpair, int32_t id, · 38 unmodified lines
27242700 if (level > ql_errlev)
27252701 return;
27262702
2727− if (qpair != NULL) {
2728− const struct pci_dev *pdev = qpair->pdev;
2729− /* <module-name> <msg-id>:<host> Message */
2730− snprintf(pbuf, sizeof(pbuf), "%s [%s]-%04x: ",
2731− QL_MSGHDR, dev_name(&(pdev->dev)), id);
2732− } else {
2733− snprintf(pbuf, sizeof(pbuf), "%s [%s]-%04x: : ",
2734− QL_MSGHDR, "0000:00:00.0", id);
2735− }
2736− pbuf[sizeof(pbuf) - 1] = 0;
2703+ ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), qpair ? qpair->vha : NULL, id);
27372704
27382705 va_start(va, fmt);
27392706
@@ -2777,6 +2744,7 @@ ql_dbg_qp(uint32_t level, struct qla_qpair *qpair, int32_t id, · 37 unmodified lines
27772744 {
27782745 va_list va;
27792746 struct va_format vaf;
2747+ char pbuf[128];
27802748
27812749 if (!ql_mask_match(level))
27822750 return;
@@ -2786,16 +2754,9 @@ ql_dbg_qp(uint32_t level, struct qla_qpair *qpair, int32_t id, · 3 unmodified lines
27862754 vaf.fmt = fmt;
27872755 vaf.va = &va;
27882756
2789− if (qpair != NULL) {
2790− const struct pci_dev *pdev = qpair->pdev;
2791− /* <module-name> <pci-name> <msg-id>:<host> Message */
2792− pr_warn("%s [%s]-%04x: %pV",
2793− QL_MSGHDR, dev_name(&(pdev->dev)), id + ql_dbg_offset,
2794− &vaf);
2795− } else {
2796− pr_warn("%s [%s]-%04x: : %pV",
2797− QL_MSGHDR, "0000:00:00.0", id + ql_dbg_offset, &vaf);
2798− }
2757+ ql_dbg_prefix(pbuf, ARRAY_SIZE(pbuf), qpair ? qpair->vha : NULL,
2758+ id + ql_dbg_offset);
2759+ pr_warn("%s%pV", pbuf, &vaf);
27992760
28002761 va_end(va);
28012762
drivers/scsi/qla2xxx/qla_dbg.h+1−0
@@ -53,6 +53,7 @@ struct qla2100_fw_dump { · 52 unmodified lines
5353 __be16 fpm_b0_reg[64];
5454 __be16 fpm_b1_reg[64];
5555 __be16 risc_ram[0xf000];
56+ u8 queue_dump[];
5657 };
5758
5859 struct qla24xx_fw_dump {
drivers/scsi/qla2xxx/qla_def.h+62−2
@@ -34,6 +34,8 @@ · 33 unmodified lines
3434 #include <scsi/scsi_transport_fc.h>
3535 #include <scsi/scsi_bsg_fc.h>
3636
37+#include <uapi/scsi/fc/fc_els.h>
38+
3739 /* Big endian Fibre Channel S_ID (source ID) or D_ID (destination ID). */
3840 typedef struct {
3941 uint8_t domain;
@@ -1053,6 +1055,7 @@ static inline bool qla2xxx_is_valid_mbs(unsigned int mbs) · 1013 unmodified lines
10531055 #define MBA_LIP_F8 0x8016 /* Received a LIP F8. */
10541056 #define MBA_LOOP_INIT_ERR 0x8017 /* Loop Initialization Error. */
10551057 #define MBA_FABRIC_AUTH_REQ 0x801b /* Fabric Authentication Required. */
1058+#define MBA_CONGN_NOTI_RECV 0x801e /* Congestion Notification Received */
10561059 #define MBA_SCSI_COMPLETION 0x8020 /* SCSI Command Complete. */
10571060 #define MBA_CTIO_COMPLETION 0x8021 /* CTIO Complete. */
10581061 #define MBA_IP_COMPLETION 0x8022 /* IP Transmit Command Complete. */
@@ -1304,7 +1307,6 @@ static inline bool qla2xxx_is_valid_mbs(unsigned int mbs) · 245 unmodified lines
13041307 #define RNID_TYPE_ASIC_TEMP 0xC
13051308
13061309 #define ELS_CMD_MAP_SIZE 32
1307−#define ELS_COMMAND_RDP 0x18
13081310
13091311 /*
13101312 * Firmware state codes from get firmware state mailbox command
@@ -1509,6 +1511,25 @@ typedef struct { · 198 unmodified lines
15091511 uint8_t reserved_3[26];
15101512 } init_cb_t;
15111513
1514+/* Special Features Control Block */
1515+struct init_sf_cb {
1516+ uint8_t format;
1517+ uint8_t reserved0;
1518+ /*
1519+ * BIT 15-14 = Reserved
1520+ * BIT_13 = SAN Congestion Management (1 - Enabled, 0 - Disabled)
1521+ * BIT_12 = Remote Write Optimization (1 - Enabled, 0 - Disabled)
1522+ * BIT 11-0 = Reserved
1523+ */
1524+ uint16_t flags;
1525+ uint8_t reserved1[32];
1526+ uint16_t discard_OHRB_timeout_value;
1527+ uint16_t remote_write_opt_queue_num;
1528+ uint8_t reserved2[40];
1529+ uint8_t scm_related_parameter[16];
1530+ uint8_t reserved3[32];
1531+};
1532+
15121533 /*
15131534 * Get Link Status mailbox command return buffer.
15141535 */
@@ -2182,6 +2203,8 @@ typedef struct { · 667 unmodified lines
21822203 struct dsd64 rsp_dsd;
21832204 } ms_iocb_entry_t;
21842205
2206+#define SCM_EDC_ACC_RECEIVED BIT_6
2207+#define SCM_RDF_ACC_RECEIVED BIT_7
21852208
21862209 /*
21872210 * ISP queue - Mailbox Command entry structure definition.
@@ -3851,6 +3874,12 @@ struct qla_hw_data { · 1663 unmodified lines
38513874 uint32_t n2n_bigger:1;
38523875 uint32_t secure_adapter:1;
38533876 uint32_t secure_fw:1;
3877+ /* Supported by Adapter */
3878+ uint32_t scm_supported_a:1;
3879+ /* Supported by Firmware */
3880+ uint32_t scm_supported_f:1;
3881+ /* Enabled in Driver */
3882+ uint32_t scm_enabled:1;
38543883 } flags;
38553884
38563885 uint16_t max_exchg;
@@ -4168,6 +4197,13 @@ struct qla_hw_data { · 311 unmodified lines
41684197 int init_cb_size;
41694198 dma_addr_t ex_init_cb_dma;
41704199 struct ex_init_cb_81xx *ex_init_cb;
4200+ dma_addr_t sf_init_cb_dma;
4201+ struct init_sf_cb *sf_init_cb;
4202+
4203+ void *scm_fpin_els_buff;
4204+ uint64_t scm_fpin_els_buff_size;
4205+ bool scm_fpin_valid;
4206+ bool scm_fpin_payload_size;
41714207
41724208 void *async_pd;
41734209 dma_addr_t async_pd_dma;
@@ -4230,6 +4266,12 @@ struct qla_hw_data { · 56 unmodified lines
42304266 #define FW_ATTR_H_NVME BIT_10
42314267 #define FW_ATTR_H_NVME_UPDATED BIT_14
42324268
4269+ /* About firmware SCM support */
4270+#define FW_ATTR_EXT0_SCM_SUPPORTED BIT_12
4271+ /* Brocade fabric attached */
4272+#define FW_ATTR_EXT0_SCM_BROCADE 0x00001000
4273+ /* Cisco fabric attached */
4274+#define FW_ATTR_EXT0_SCM_CISCO 0x00002000
42334275 uint16_t fw_attributes_ext[2];
42344276 uint32_t fw_memory_size;
42354277 uint32_t fw_transfer_size;
@@ -4522,15 +4564,31 @@ struct active_regions { · 286 unmodified lines
45224564 #define QLA_SET_DATA_RATE_NOLR 1
45234565 #define QLA_SET_DATA_RATE_LR 2 /* Set speed and initiate LR */
45244566
4567+#define QLA_DEFAULT_PAYLOAD_SIZE 64
4568+/*
4569+ * This item might be allocated with a size > sizeof(struct purex_item).
4570+ * The "size" variable gives the size of the payload (which
4571+ * is variable) starting at "iocb".
4572+ */
45254573 struct purex_item {
45264574 struct list_head list;
45274575 struct scsi_qla_host *vha;
4528− void (*process_item)(struct scsi_qla_host *vha, void *pkt);
4576+ void (*process_item)(struct scsi_qla_host *vha,
4577+ struct purex_item *pkt);
4578+ atomic_t in_use;
4579+ uint16_t size;
45294580 struct {
45304581 uint8_t iocb[64];
45314582 } iocb;
45324583 };
45334584
4585+#define SCM_FLAG_RDF_REJECT 0x00
4586+#define SCM_FLAG_RDF_COMPLETED 0x01
4587+
4588+#define QLA_CON_PRIMITIVE_RECEIVED 0x1
4589+#define QLA_CONGESTION_ARB_WARNING 0x1
4590+#define QLA_CONGESTION_ARB_ALARM 0X2
4591+
45344592 /*
45354593 * Qlogic scsi host structure
45364594 */
@@ -4725,6 +4783,7 @@ typedef struct scsi_qla_host { · 188 unmodified lines
47254783 struct list_head head;
47264784 spinlock_t lock;
47274785 } purex_list;
4786+ struct purex_item default_item;
47284787
47294788 struct name_list_extended gnl;
47304789 /* Count of active session/fcport */
@@ -4738,6 +4797,7 @@ typedef struct scsi_qla_host { · 7 unmodified lines
47384797 __le16 dport_data[4];
47394798 struct list_head gpnid_list;
47404799 struct fab_scan scan;
4800+ uint8_t scm_fabric_connection_flags;
47414801
47424802 unsigned int irq_offset;
47434803 } scsi_qla_host_t;
drivers/scsi/qla2xxx/qla_fw.h+6−2
@@ -610,7 +610,7 @@ struct sts_entry_24xx { · 609 unmodified lines
610610 __le32 residual_len; /* FW calc residual transfer length. */
611611
612612 union {
613− uint16_t reserved_1;
613+ __le16 reserved_1;
614614 __le16 nvme_rsp_pyld_len;
615615 };
616616
@@ -723,6 +723,8 @@ struct ct_entry_24xx { · 106 unmodified lines
723723 struct dsd64 dsd[2];
724724 };
725725
726+#define PURX_ELS_HEADER_SIZE 0x18
727+
726728 /*
727729 * ISP queue - PUREX IOCB entry structure definition
728730 */
@@ -2020,7 +2022,9 @@ struct nvram_81xx { · 1291 unmodified lines
20202022 * BIT 0 = Extended BB credits for LR
20212023 * BIT 1 = Virtual Fabric Enable
20222024 * BIT 2-5 = Distance Support if BIT 0 is on
2023− * BIT 6-15 = Unused
2025+ * BIT 6 = Prefer FCP
2026+ * BIT 7 = SCM Disabled if BIT is set (1)
2027+ * BIT 8-15 = Unused
20242028 */
20252029 uint16_t enhanced_features;
20262030
drivers/scsi/qla2xxx/qla_gbl.h+3−1
@@ -127,6 +127,7 @@ int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); · 126 unmodified lines
127127 void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport);
128128 int qla2x00_reserve_mgmt_server_loop_id(scsi_qla_host_t *);
129129 void qla_rscn_replay(fc_port_t *fcport);
130+void qla24xx_free_purex_item(struct purex_item *item);
130131 extern bool qla24xx_risc_firmware_invalid(uint32_t *);
131132
132133 /*
@@ -229,7 +230,8 @@ void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *, · 96 unmodified lines
229230 int qla24xx_post_gnl_work(struct scsi_qla_host *, fc_port_t *);
230231 int qla24xx_post_relogin_work(struct scsi_qla_host *vha);
231232 void qla2x00_wait_for_sess_deletion(scsi_qla_host_t *);
232−void qla24xx_process_purex_rdp(struct scsi_qla_host *vha, void *pkt);
233+void qla24xx_process_purex_rdp(struct scsi_qla_host *vha,
234+ struct purex_item *pkt);
233235
234236 /*
235237 * Global Functions in qla_mid.c source file.
drivers/scsi/qla2xxx/qla_init.c+29−19
@@ -3749,7 +3749,7 @@ enable_82xx_npiv: · 3748 unmodified lines
37493749 }
37503750
37513751 /* Enable PUREX PASSTHRU */
3752− if (ql2xrdpenable)
3752+ if (ql2xrdpenable || ha->flags.scm_supported_f)
37533753 qla25xx_set_els_cmds_supported(vha);
37543754 } else
37553755 goto failed;
@@ -3962,7 +3962,7 @@ qla24xx_update_fw_options(scsi_qla_host_t *vha) · 206 unmodified lines
39623962 ha->fw_options[2] &= ~BIT_8;
39633963 }
39643964
3965− if (ql2xrdpenable)
3965+ if (ql2xrdpenable || ha->flags.scm_supported_f)
39663966 ha->fw_options[1] |= ADD_FO1_ENABLE_PUREX_IOCB;
39673967
39683968 /* Enable Async 8130/8131 events -- transceiver insertion/removal */
@@ -6996,36 +6996,41 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) · 3027 unmodified lines
69966996 static int
69976997 qla2x00_restart_isp(scsi_qla_host_t *vha)
69986998 {
6999− int status = 0;
6999+ int status;
70007000 struct qla_hw_data *ha = vha->hw;
70017001
70027002 /* If firmware needs to be loaded */
70037003 if (qla2x00_isp_firmware(vha)) {
70047004 vha->flags.online = 0;
70057005 status = ha->isp_ops->chip_diag(vha);
7006− if (!status)
7007− status = qla2x00_setup_chip(vha);
7006+ if (status)
7007+ return status;
7008+ status = qla2x00_setup_chip(vha);
7009+ if (status)
7010+ return status;
70087011 }
70097012
7010− if (!status && !(status = qla2x00_init_rings(vha))) {
7011− clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
7012− ha->flags.chip_reset_done = 1;
7013+ status = qla2x00_init_rings(vha);
7014+ if (status)
7015+ return status;
70137016
7014− /* Initialize the queues in use */
7015− qla25xx_init_queues(ha);
7017+ clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
7018+ ha->flags.chip_reset_done = 1;
70167019
7017− status = qla2x00_fw_ready(vha);
7018− if (!status) {
7019− /* Issue a marker after FW becomes ready. */
7020− qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL);
7021− set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
7022− }
7020+ /* Initialize the queues in use */
7021+ qla25xx_init_queues(ha);
70237022
7023+ status = qla2x00_fw_ready(vha);
7024+ if (status) {
70247025 /* if no cable then assume it's good */
7025− if ((vha->device_flags & DFLG_NO_CABLE))
7026− status = 0;
7026+ return vha->device_flags & DFLG_NO_CABLE ? 0 : status;
70277027 }
7028− return (status);
7028+
7029+ /* Issue a marker after FW becomes ready. */
7030+ qla2x00_marker(vha, ha->base_qpair, 0, 0, MK_SYNC_ALL);
7031+ set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags);
7032+
7033+ return 0;
70297034 }
70307035
70317036 static int
@@ -8514,6 +8519,11 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) · 1482 unmodified lines
85148519 icb->node_name[0] &= 0xF0;
85158520 }
85168521
8522+ if (IS_QLA28XX(ha) || IS_QLA27XX(ha)) {
8523+ if ((nv->enhanced_features & BIT_7) == 0)
8524+ ha->flags.scm_supported_a = 1;
8525+ }
8526+
85178527 /* Set host adapter parameters. */
85188528 ha->flags.disable_risc_code_load = 0;
85198529 ha->flags.enable_lip_reset = 0;
drivers/scsi/qla2xxx/qla_inline.h+1−1
@@ -11,7 +11,7 @@ · 10 unmodified lines
1111 * Continuation Type 1 IOCBs to allocate.
1212 *
1313 * @vha: HA context
14− * @dsds: number of data segment decriptors needed
14+ * @dsds: number of data segment descriptors needed
1515 *
1616 * Returns the number of IOCB entries needed to store @dsds.
1717 */
drivers/scsi/qla2xxx/qla_iocb.c+5−5
@@ -44,7 +44,7 @@ qla2x00_get_cmd_direction(srb_t *sp) · 43 unmodified lines
4444 * qla2x00_calc_iocbs_32() - Determine number of Command Type 2 and
4545 * Continuation Type 0 IOCBs to allocate.
4646 *
47− * @dsds: number of data segment decriptors needed
47+ * @dsds: number of data segment descriptors needed
4848 *
4949 * Returns the number of IOCB entries needed to store @dsds.
5050 */
@@ -66,7 +66,7 @@ qla2x00_calc_iocbs_32(uint16_t dsds) · 15 unmodified lines
6666 * qla2x00_calc_iocbs_64() - Determine number of Command Type 3 and
6767 * Continuation Type 1 IOCBs to allocate.
6868 *
69− * @dsds: number of data segment decriptors needed
69+ * @dsds: number of data segment descriptors needed
7070 *
7171 * Returns the number of IOCB entries needed to store @dsds.
7272 */
@@ -669,7 +669,7 @@ qla24xx_build_scsi_type_6_iocbs(srb_t *sp, struct cmd_type_6 *cmd_pkt, · 596 unmodified lines
669669 * qla24xx_calc_dsd_lists() - Determine number of DSD list required
670670 * for Command Type 6.
671671 *
672− * @dsds: number of data segment decriptors needed
672+ * @dsds: number of data segment descriptors needed
673673 *
674674 * Returns the number of dsd list needed to store @dsds.
675675 */
@@ -2305,8 +2305,8 @@ __qla2x00_alloc_iocbs(struct qla_qpair *qpair, srb_t *sp) · 1629 unmodified lines
23052305 pkt = req->ring_ptr;
23062306 memset(pkt, 0, REQUEST_ENTRY_SIZE);
23072307 if (IS_QLAFX00(ha)) {
2308− wrt_reg_byte((void __iomem *)&pkt->entry_count, req_cnt);
2309− wrt_reg_word((void __iomem *)&pkt->handle, handle);
2308+ wrt_reg_byte((u8 __force __iomem *)&pkt->entry_count, req_cnt);
2309+ wrt_reg_dword((__le32 __force __iomem *)&pkt->handle, handle);
23102310 } else {
23112311 pkt->entry_count = req_cnt;
23122312 pkt->handle = handle;
drivers/scsi/qla2xxx/qla_isr.c+249−41
@@ -22,6 +22,31 @@ static void qla2x00_status_entry(scsi_qla_host_t *, struct rsp_que *, void *); · 21 unmodified lines
2222 static void qla2x00_status_cont_entry(struct rsp_que *, sts_cont_entry_t *);
2323 static int qla2x00_error_entry(scsi_qla_host_t *, struct rsp_que *,
2424 sts_entry_t *);
25+static void qla27xx_process_purex_fpin(struct scsi_qla_host *vha,
26+ struct purex_item *item);
27+static struct purex_item *qla24xx_alloc_purex_item(scsi_qla_host_t *vha,
28+ uint16_t size);
29+static struct purex_item *qla24xx_copy_std_pkt(struct scsi_qla_host *vha,
30+ void *pkt);
31+static struct purex_item *qla27xx_copy_fpin_pkt(struct scsi_qla_host *vha,
32+ void **pkt, struct rsp_que **rsp);
33+
34+static void
35+qla27xx_process_purex_fpin(struct scsi_qla_host *vha, struct purex_item *item)
36+{
37+ void *pkt = &item->iocb;
38+ uint16_t pkt_size = item->size;
39+
40+ ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x508d,
41+ "%s: Enter\n", __func__);
42+
43+ ql_dbg(ql_dbg_init + ql_dbg_verbose, vha, 0x508e,
44+ "-------- ELS REQ -------\n");
45+ ql_dump_buffer(ql_dbg_init + ql_dbg_verbose, vha, 0x508f,
46+ pkt, pkt_size);
47+
48+ fc_host_fpin_rcv(vha->host, pkt_size, (char *)pkt);
49+}
2550
2651 const char *const port_state_str[] = {
2752 "Unknown",
@@ -31,35 +56,11 @@ const char *const port_state_str[] = { · 3 unmodified lines
3156 "ONLINE"
3257 };
3358
34−static void qla24xx_purex_iocb(scsi_qla_host_t *vha, void *pkt,
35− void (*process_item)(struct scsi_qla_host *vha, void *pkt))
36−{
37− struct purex_list *list = &vha->purex_list;
38− struct purex_item *item;
39− ulong flags;
40−
41− item = kzalloc(sizeof(*item), GFP_KERNEL);
42− if (!item) {
43− ql_log(ql_log_warn, vha, 0x5092,
44− ">> Failed allocate purex list item.\n");
45− return;
46− }
47−
48− item->vha = vha;
49− item->process_item = process_item;
50− memcpy(&item->iocb, pkt, sizeof(item->iocb));
51−
52− spin_lock_irqsave(&list->lock, flags);
53− list_add_tail(&item->list, &list->head);
54− spin_unlock_irqrestore(&list->lock, flags);
55−
56− set_bit(PROCESS_PUREX_IOCB, &vha->dpc_flags);
57−}
58−
5959 static void
60−qla24xx_process_abts(struct scsi_qla_host *vha, void *pkt)
60+qla24xx_process_abts(struct scsi_qla_host *vha, struct purex_item *pkt)
6161 {
62− struct abts_entry_24xx *abts = pkt;
62+ struct abts_entry_24xx *abts =
63+ (struct abts_entry_24xx *)&pkt->iocb;
6364 struct qla_hw_data *ha = vha->hw;
6465 struct els_entry_24xx *rsp_els;
6566 struct abts_entry_24xx *abts_rsp;
@@ -789,6 +790,179 @@ qla27xx_handle_8200_aen(scsi_qla_host_t *vha, uint16_t *mb) · 723 unmodified lines
789790 }
790791 }
791792
793+static struct purex_item *
794+qla24xx_alloc_purex_item(scsi_qla_host_t *vha, uint16_t size)
795+{
796+ struct purex_item *item = NULL;
797+ uint8_t item_hdr_size = sizeof(*item);
798+
799+ if (size > QLA_DEFAULT_PAYLOAD_SIZE) {
800+ item = kzalloc(item_hdr_size +
801+ (size - QLA_DEFAULT_PAYLOAD_SIZE), GFP_ATOMIC);
802+ } else {
803+ if (atomic_inc_return(&vha->default_item.in_use) == 1) {
804+ item = &vha->default_item;
805+ goto initialize_purex_header;
806+ } else {
807+ item = kzalloc(item_hdr_size, GFP_ATOMIC);
808+ }
809+ }
810+ if (!item) {
811+ ql_log(ql_log_warn, vha, 0x5092,
812+ ">> Failed allocate purex list item.\n");
813+
814+ return NULL;
815+ }
816+
817+initialize_purex_header:
818+ item->vha = vha;
819+ item->size = size;
820+ return item;
821+}
822+
823+static void
824+qla24xx_queue_purex_item(scsi_qla_host_t *vha, struct purex_item *pkt,
825+ void (*process_item)(struct scsi_qla_host *vha,
826+ struct purex_item *pkt))
827+{
828+ struct purex_list *list = &vha->purex_list;
829+ ulong flags;
830+
831+ pkt->process_item = process_item;
832+
833+ spin_lock_irqsave(&list->lock, flags);
834+ list_add_tail(&pkt->list, &list->head);
835+ spin_unlock_irqrestore(&list->lock, flags);
836+
837+ set_bit(PROCESS_PUREX_IOCB, &vha->dpc_flags);
838+}
839+
840+/**
841+ * qla24xx_copy_std_pkt() - Copy over purex ELS which is
842+ * contained in a single IOCB.
843+ * purex packet.
844+ * @vha: SCSI driver HA context
845+ * @pkt: ELS packet
846+ */
847+static struct purex_item
848+*qla24xx_copy_std_pkt(struct scsi_qla_host *vha, void *pkt)
849+{
850+ struct purex_item *item;
851+
852+ item = qla24xx_alloc_purex_item(vha,
853+ QLA_DEFAULT_PAYLOAD_SIZE);
854+ if (!item)
855+ return item;
856+
857+ memcpy(&item->iocb, pkt, sizeof(item->iocb));
858+ return item;
859+}
860+
861+/**
862+ * qla27xx_copy_fpin_pkt() - Copy over fpin packets that can
863+ * span over multiple IOCBs.
864+ * @vha: SCSI driver HA context
865+ * @pkt: ELS packet
866+ * @rsp: Response queue
867+ */
868+static struct purex_item *
869+qla27xx_copy_fpin_pkt(struct scsi_qla_host *vha, void **pkt,
870+ struct rsp_que **rsp)
871+{
872+ struct purex_entry_24xx *purex = *pkt;
873+ struct rsp_que *rsp_q = *rsp;
874+ sts_cont_entry_t *new_pkt;
875+ uint16_t no_bytes = 0, total_bytes = 0, pending_bytes = 0;
876+ uint16_t buffer_copy_offset = 0;
877+ uint16_t entry_count, entry_count_remaining;
878+ struct purex_item *item;
879+ void *fpin_pkt = NULL;
880+
881+ total_bytes = (le16_to_cpu(purex->frame_size) & 0x0FFF)
882+ - PURX_ELS_HEADER_SIZE;
883+ pending_bytes = total_bytes;
884+ entry_count = entry_count_remaining = purex->entry_count;
885+ no_bytes = (pending_bytes > sizeof(purex->els_frame_payload)) ?
886+ sizeof(purex->els_frame_payload) : pending_bytes;
887+ ql_log(ql_log_info, vha, 0x509a,
888+ "FPIN ELS, frame_size 0x%x, entry count %d\n",
889+ total_bytes, entry_count);
890+
891+ item = qla24xx_alloc_purex_item(vha, total_bytes);
892+ if (!item)
893+ return item;
894+
895+ fpin_pkt = &item->iocb;
896+
897+ memcpy(fpin_pkt, &purex->els_frame_payload[0], no_bytes);
898+ buffer_copy_offset += no_bytes;
899+ pending_bytes -= no_bytes;
900+ --entry_count_remaining;
901+
902+ ((response_t *)purex)->signature = RESPONSE_PROCESSED;
903+ wmb();
904+
905+ do {
906+ while ((total_bytes > 0) && (entry_count_remaining > 0)) {
907+ if (rsp_q->ring_ptr->signature == RESPONSE_PROCESSED) {
908+ ql_dbg(ql_dbg_async, vha, 0x5084,
909+ "Ran out of IOCBs, partial data 0x%x\n",
910+ buffer_copy_offset);
911+ cpu_relax();
912+ continue;
913+ }
914+
915+ new_pkt = (sts_cont_entry_t *)rsp_q->ring_ptr;
916+ *pkt = new_pkt;
917+
918+ if (new_pkt->entry_type != STATUS_CONT_TYPE) {
919+ ql_log(ql_log_warn, vha, 0x507a,
920+ "Unexpected IOCB type, partial data 0x%x\n",
921+ buffer_copy_offset);
922+ break;
923+ }
924+
925+ rsp_q->ring_index++;
926+ if (rsp_q->ring_index == rsp_q->length) {
927+ rsp_q->ring_index = 0;
928+ rsp_q->ring_ptr = rsp_q->ring;
929+ } else {
930+ rsp_q->ring_ptr++;
931+ }
932+ no_bytes = (pending_bytes > sizeof(new_pkt->data)) ?
933+ sizeof(new_pkt->data) : pending_bytes;
934+ if ((buffer_copy_offset + no_bytes) <= total_bytes) {
935+ memcpy(((uint8_t *)fpin_pkt +
936+ buffer_copy_offset), new_pkt->data,
937+ no_bytes);
938+ buffer_copy_offset += no_bytes;
939+ pending_bytes -= no_bytes;
940+ --entry_count_remaining;
941+ } else {
942+ ql_log(ql_log_warn, vha, 0x5044,
943+ "Attempt to copy more that we got, optimizing..%x\n",
944+ buffer_copy_offset);
945+ memcpy(((uint8_t *)fpin_pkt +
946+ buffer_copy_offset), new_pkt->data,
947+ total_bytes - buffer_copy_offset);
948+ }
949+
950+ ((response_t *)new_pkt)->signature = RESPONSE_PROCESSED;
951+ wmb();
952+ }
953+
954+ if (pending_bytes != 0 || entry_count_remaining != 0) {
955+ ql_log(ql_log_fatal, vha, 0x508b,
956+ "Dropping partial FPIN, underrun bytes = 0x%x, entry cnts 0x%x\n",
957+ total_bytes, entry_count_remaining);
958+ qla24xx_free_purex_item(item);
959+ return NULL;
960+ }
961+ } while (entry_count_remaining > 0);
962+ host_to_fcp_swap((uint8_t *)&item->iocb, total_bytes);
963+ return item;
964+}
965+
792966 /**
793967 * qla2x00_async_event() - Process aynchronous events.
794968 * @vha: SCSI driver HA context
@@ -1302,6 +1476,19 @@ global_port_update: · 507 unmodified lines
13021476 qla2x00_post_aen_work(vha, FCH_EVT_RSCN, rscn_entry);
13031477 }
13041478 break;
1479+ case MBA_CONGN_NOTI_RECV:
1480+ if (!ha->flags.scm_enabled ||
1481+ mb[1] != QLA_CON_PRIMITIVE_RECEIVED)
1482+ break;
1483+
1484+ if (mb[2] == QLA_CONGESTION_ARB_WARNING) {
1485+ ql_dbg(ql_dbg_async, vha, 0x509b,
1486+ "Congestion Warning %04x %04x.\n", mb[1], mb[2]);
1487+ } else if (mb[2] == QLA_CONGESTION_ARB_ALARM) {
1488+ ql_log(ql_log_warn, vha, 0x509b,
1489+ "Congestion Alarm %04x %04x.\n", mb[1], mb[2]);
1490+ }
1491+ break;
13051492 /* case MBA_RIO_RESPONSE: */
13061493 case MBA_ZIO_RESPONSE:
13071494 ql_dbg(ql_dbg_async, vha, 0x5015,
@@ -3229,6 +3416,8 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, · 1921 unmodified lines
32293416 {
32303417 struct sts_entry_24xx *pkt;
32313418 struct qla_hw_data *ha = vha->hw;
3419+ struct purex_entry_24xx *purex_entry;
3420+ struct purex_item *pure_item;
32323421
32333422 if (!ha->flags.fw_started)
32343423 return;
@@ -3280,8 +3469,11 @@ process_err: · 45 unmodified lines
32803469 break;
32813470 case ABTS_RECV_24XX:
32823471 if (qla_ini_mode_enabled(vha)) {
3283− qla24xx_purex_iocb(vha, pkt,
3284− qla24xx_process_abts);
3472+ pure_item = qla24xx_copy_std_pkt(vha, pkt);
3473+ if (!pure_item)
3474+ break;
3475+ qla24xx_queue_purex_item(vha, pure_item,
3476+ qla24xx_process_abts);
32853477 break;
32863478 }
32873479 if (IS_QLA83XX(ha) || IS_QLA27XX(ha) ||
@@ -3329,24 +3521,40 @@ process_err: · 41 unmodified lines
33293521 (struct vp_ctrl_entry_24xx *)pkt);
33303522 break;
33313523 case PUREX_IOCB_TYPE:
3332− {
3333− struct purex_entry_24xx *purex = (void *)pkt;
3334−
3335− if (purex->els_frame_payload[3] != ELS_COMMAND_RDP) {
3336− ql_dbg(ql_dbg_init, vha, 0x5091,
3337− "Discarding ELS Request opcode %#x...\n",
3338− purex->els_frame_payload[3]);
3524+ purex_entry = (void *)pkt;
3525+ switch (purex_entry->els_frame_payload[3]) {
3526+ case ELS_RDP:
3527+ pure_item = qla24xx_copy_std_pkt(vha, pkt);
3528+ if (!pure_item)
3529+ break;
3530+ qla24xx_queue_purex_item(vha, pure_item,
3531+ qla24xx_process_purex_rdp);
3532+ break;
3533+ case ELS_FPIN:
3534+ if (!vha->hw->flags.scm_enabled) {
3535+ ql_log(ql_log_warn, vha, 0x5094,
3536+ "SCM not active for this port\n");
3537+ break;
3538+ }
3539+ pure_item = qla27xx_copy_fpin_pkt(vha,
3540+ (void **)&pkt, &rsp);
3541+ if (!pure_item)
3542+ break;
3543+ qla24xx_queue_purex_item(vha, pure_item,
3544+ qla27xx_process_purex_fpin);
33393545 break;
3546+
3547+ default:
3548+ ql_log(ql_log_warn, vha, 0x509c,
3549+ "Discarding ELS Request opcode 0x%x\n",
3550+ purex_entry->els_frame_payload[3]);
33403551 }
3341− qla24xx_purex_iocb(vha, pkt, qla24xx_process_purex_rdp);
33423552 break;
3343− }
33443553 default:
33453554 /* Type Not Supported. */
33463555 ql_dbg(ql_dbg_async, vha, 0x5042,
3347− "Received unknown response pkt type %x "
3348− "entry status=%x.\n",
3349− pkt->entry_type, pkt->entry_status);
3556+ "Received unknown response pkt type 0x%x entry status=%x.\n",
3557+ pkt->entry_type, pkt->entry_status);
33503558 break;
33513559 }
33523560 ((response_t *)pkt)->signature = RESPONSE_PROCESSED;
drivers/scsi/qla2xxx/qla_mbx.c+57−7
@@ -59,6 +59,7 @@ static struct rom_cmd { · 58 unmodified lines
5959 { MBC_IOCB_COMMAND_A64 },
6060 { MBC_GET_ADAPTER_LOOP_ID },
6161 { MBC_READ_SFP },
62+ { MBC_SET_RNID_PARAMS },
6263 { MBC_GET_RNID_PARAMS },
6364 { MBC_GET_SET_ZIO_THRESHOLD },
6465 };
@@ -1124,6 +1125,16 @@ qla2x00_get_fw_version(scsi_qla_host_t *vha) · 1059 unmodified lines
11241125 (ha->flags.secure_fw) ? "Supported" :
11251126 "Not Supported");
11261127 }
1128+
1129+ if (ha->flags.scm_supported_a &&
1130+ (ha->fw_attributes_ext[0] & FW_ATTR_EXT0_SCM_SUPPORTED)) {
1131+ ha->flags.scm_supported_f = 1;
1132+ memset(ha->sf_init_cb, 0, sizeof(struct init_sf_cb));
1133+ ha->sf_init_cb->flags |= BIT_13;
1134+ }
1135+ ql_log(ql_log_info, vha, 0x11a3, "SCM in FW: %s\n",
1136+ (ha->flags.scm_supported_f) ? "Supported" :
1137+ "Not Supported");
11271138 }
11281139
11291140 failed:
@@ -1633,8 +1644,11 @@ qla2x00_get_adapter_id(scsi_qla_host_t *vha, uint16_t *id, uint8_t *al_pa, · 503 unmodified lines
16331644 mcp->in_mb |= MBX_13|MBX_12|MBX_11|MBX_10;
16341645 if (IS_FWI2_CAPABLE(vha->hw))
16351646 mcp->in_mb |= MBX_19|MBX_18|MBX_17|MBX_16;
1636− if (IS_QLA27XX(vha->hw) || IS_QLA28XX(vha->hw))
1647+ if (IS_QLA27XX(vha->hw) || IS_QLA28XX(vha->hw)) {
16371648 mcp->in_mb |= MBX_15;
1649+ mcp->out_mb |= MBX_7|MBX_21|MBX_22|MBX_23;
1650+ }
1651+
16381652 mcp->tov = MBX_TOV_SECONDS;
16391653 mcp->flags = 0;
16401654 rval = qla2x00_mailbox_command(vha, mcp);
@@ -1687,8 +1701,22 @@ qla2x00_get_adapter_id(scsi_qla_host_t *vha, uint16_t *id, uint8_t *al_pa, · 46 unmodified lines
16871701 }
16881702 }
16891703
1690− if (IS_QLA27XX(vha->hw) || IS_QLA28XX(vha->hw))
1704+ if (IS_QLA27XX(vha->hw) || IS_QLA28XX(vha->hw)) {
16911705 vha->bbcr = mcp->mb[15];
1706+ if (mcp->mb[7] & SCM_EDC_ACC_RECEIVED) {
1707+ ql_log(ql_log_info, vha, 0x11a4,
1708+ "SCM: EDC ELS completed, flags 0x%x\n",
1709+ mcp->mb[21]);
1710+ }
1711+ if (mcp->mb[7] & SCM_RDF_ACC_RECEIVED) {
1712+ vha->hw->flags.scm_enabled = 1;
1713+ vha->scm_fabric_connection_flags |=
1714+ SCM_FLAG_RDF_COMPLETED;
1715+ ql_log(ql_log_info, vha, 0x11a5,
1716+ "SCM: RDF ELS completed, flags 0x%x\n",
1717+ mcp->mb[23]);
1718+ }
1719+ }
16921720 }
16931721
16941722 return rval;
@@ -1801,6 +1829,17 @@ qla2x00_init_firmware(scsi_qla_host_t *vha, uint16_t size) · 106 unmodified lines
18011829 mcp->mb[14] = sizeof(*ha->ex_init_cb);
18021830 mcp->out_mb |= MBX_14|MBX_13|MBX_12|MBX_11|MBX_10;
18031831 }
1832+
1833+ if (ha->flags.scm_supported_f) {
1834+ mcp->mb[1] |= BIT_1;
1835+ mcp->mb[16] = MSW(ha->sf_init_cb_dma);
1836+ mcp->mb[17] = LSW(ha->sf_init_cb_dma);
1837+ mcp->mb[18] = MSW(MSD(ha->sf_init_cb_dma));
1838+ mcp->mb[19] = LSW(MSD(ha->sf_init_cb_dma));
1839+ mcp->mb[15] = sizeof(*ha->sf_init_cb);
1840+ mcp->out_mb |= MBX_19|MBX_18|MBX_17|MBX_16|MBX_15;
1841+ }
1842+
18041843 /* 1 and 2 should normally be captured. */
18051844 mcp->in_mb = MBX_2|MBX_1|MBX_0;
18061845 if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha))
@@ -4866,6 +4905,7 @@ qla24xx_get_port_login_templ(scsi_qla_host_t *vha, dma_addr_t buf_dma, · 3059 unmodified lines
48664905 return rval;
48674906 }
48684907
4908+#define PUREX_CMD_COUNT 2
48694909 int
48704910 qla25xx_set_els_cmds_supported(scsi_qla_host_t *vha)
48714911 {
@@ -4874,12 +4914,12 @@ qla25xx_set_els_cmds_supported(scsi_qla_host_t *vha) · 2 unmodified lines
48744914 mbx_cmd_t *mcp = &mc;
48754915 uint8_t *els_cmd_map;
48764916 dma_addr_t els_cmd_map_dma;
4877− uint cmd_opcode = ELS_COMMAND_RDP;
4878− uint index = cmd_opcode / 8;
4879− uint bit = cmd_opcode % 8;
4917+ uint8_t cmd_opcode[PUREX_CMD_COUNT];
4918+ uint8_t i, index, purex_bit;
48804919 struct qla_hw_data *ha = vha->hw;
48814920
4882− if (!IS_QLA25XX(ha) && !IS_QLA2031(ha) && !IS_QLA27XX(ha))
4921+ if (!IS_QLA25XX(ha) && !IS_QLA2031(ha) &&
4922+ !IS_QLA27XX(ha) && !IS_QLA28XX(ha))
48834923 return QLA_SUCCESS;
48844924
48854925 ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1197,
@@ -4893,7 +4933,17 @@ qla25xx_set_els_cmds_supported(scsi_qla_host_t *vha) · 7 unmodified lines
48934933 return QLA_MEMORY_ALLOC_FAILED;
48944934 }
48954935
4896− els_cmd_map[index] |= 1 << bit;
4936+ memset(els_cmd_map, 0, ELS_CMD_MAP_SIZE);
4937+
4938+ /* List of Purex ELS */
4939+ cmd_opcode[0] = ELS_FPIN;
4940+ cmd_opcode[1] = ELS_RDP;
4941+
4942+ for (i = 0; i < PUREX_CMD_COUNT; i++) {
4943+ index = cmd_opcode[i] / 8;
4944+ purex_bit = cmd_opcode[i] % 8;
4945+ els_cmd_map[index] |= 1 << purex_bit;
4946+ }
48974947
48984948 mcp->mb[0] = MBC_SET_RNID_PARAMS;
48994949 mcp->mb[1] = RNID_TYPE_ELS_CMD << 8;
drivers/scsi/qla2xxx/qla_nx.c+8−12
@@ -966,26 +966,21 @@ qla82xx_read_status_reg(struct qla_hw_data *ha, uint32_t *val) · 965 unmodified lines
966966 static int
967967 qla82xx_flash_wait_write_finish(struct qla_hw_data *ha)
968968 {
969− long timeout = 0;
970− uint32_t done = 1 ;
971969 uint32_t val;
972− int ret = 0;
970+ int i, ret;
973971 scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
974972
975973 qla82xx_wr_32(ha, QLA82XX_ROMUSB_ROM_ABYTE_CNT, 0);
976− while ((done != 0) && (ret == 0)) {
974+ for (i = 0; i < 50000; i++) {
977975 ret = qla82xx_read_status_reg(ha, &val);
978− done = val & 1;
979− timeout++;
976+ if (ret < 0 || (val & 1) == 0)
977+ return ret;
980978 udelay(10);
981979 cond_resched();
982− if (timeout >= 50000) {
983− ql_log(ql_log_warn, vha, 0xb00d,
984− "Timeout reached waiting for write finish.\n");
985− return -1;
986− }
987980 }
988− return ret;
981+ ql_log(ql_log_warn, vha, 0xb00d,
982+ "Timeout reached waiting for write finish.\n");
983+ return -1;
989984 }
990985
991986 static int
@@ -1172,6 +1167,7 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha) · 180 unmodified lines
11721167 * Offset 4: Offset and number of addr/value pairs
11731168 * that present in CRB initialize sequence
11741169 */
1170+ n = 0;
11751171 if (qla82xx_rom_fast_read(ha, 0, &n) != 0 || n != 0xcafecafeUL ||
11761172 qla82xx_rom_fast_read(ha, 4, &n) != 0) {
11771173 ql_log(ql_log_fatal, vha, 0x006e,
drivers/scsi/qla2xxx/qla_os.c+33−4
@@ -4218,6 +4218,16 @@ qla2x00_mem_alloc(struct qla_hw_data *ha, uint16_t req_len, uint16_t rsp_len, · 4217 unmodified lines
42184218 "ex_init_cb=%p.\n", ha->ex_init_cb);
42194219 }
42204220
4221+ /* Get consistent memory allocated for Special Features-CB. */
4222+ if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
4223+ ha->sf_init_cb = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL,
4224+ &ha->sf_init_cb_dma);
4225+ if (!ha->sf_init_cb)
4226+ goto fail_sf_init_cb;
4227+ ql_dbg_pci(ql_dbg_init, ha->pdev, 0x0199,
4228+ "sf_init_cb=%p.\n", ha->sf_init_cb);
4229+ }
4230+
42214231 INIT_LIST_HEAD(&ha->gbl_dsd_list);
42224232
42234233 /* Get consistent memory allocated for Async Port-Database. */
@@ -4271,6 +4281,8 @@ fail_sfp_data: · 47 unmodified lines
42714281 fail_loop_id_map:
42724282 dma_pool_free(ha->s_dma_pool, ha->async_pd, ha->async_pd_dma);
42734283 fail_async_pd:
4284+ dma_pool_free(ha->s_dma_pool, ha->sf_init_cb, ha->sf_init_cb_dma);
4285+fail_sf_init_cb:
42744286 dma_pool_free(ha->s_dma_pool, ha->ex_init_cb, ha->ex_init_cb_dma);
42754287 fail_ex_init_cb:
42764288 kfree(ha->npiv_info);
@@ -4693,6 +4705,10 @@ qla2x00_mem_free(struct qla_hw_data *ha) · 416 unmodified lines
46934705 ha->ms_iocb = NULL;
46944706 ha->ms_iocb_dma = 0;
46954707
4708+ if (ha->sf_init_cb)
4709+ dma_pool_free(ha->s_dma_pool,
4710+ ha->sf_init_cb, ha->sf_init_cb_dma);
4711+
46964712 if (ha->ex_init_cb)
46974713 dma_pool_free(ha->s_dma_pool,
46984714 ha->ex_init_cb, ha->ex_init_cb_dma);
@@ -4780,6 +4796,8 @@ qla2x00_mem_free(struct qla_hw_data *ha) · 81 unmodified lines
47804796 kfree(ha->swl);
47814797 ha->swl = NULL;
47824798 kfree(ha->loop_id_map);
4799+ ha->sf_init_cb = NULL;
4800+ ha->sf_init_cb_dma = 0;
47834801 ha->loop_id_map = NULL;
47844802 }
47854803
@@ -5893,10 +5911,12 @@ qla25xx_rdp_port_speed_currently(struct qla_hw_data *ha) · 1107 unmodified lines
58935911 * vha: SCSI qla host
58945912 * purex: RDP request received by HBA
58955913 */
5896−void qla24xx_process_purex_rdp(struct scsi_qla_host *vha, void *pkt)
5914+void qla24xx_process_purex_rdp(struct scsi_qla_host *vha,
5915+ struct purex_item *item)
58975916 {
58985917 struct qla_hw_data *ha = vha->hw;
5899− struct purex_entry_24xx *purex = pkt;
5918+ struct purex_entry_24xx *purex =
5919+ (struct purex_entry_24xx *)&item->iocb;
59005920 dma_addr_t rsp_els_dma;
59015921 dma_addr_t rsp_payload_dma;
59025922 dma_addr_t stat_dma;
@@ -6306,6 +6326,15 @@ dealloc: · 403 unmodified lines
63066326 rsp_els, rsp_els_dma);
63076327 }
63086328
6329+void
6330+qla24xx_free_purex_item(struct purex_item *item)
6331+{
6332+ if (item == &item->vha->default_item)
6333+ memset(&item->vha->default_item, 0, sizeof(struct purex_item));
6334+ else
6335+ kfree(item);
6336+}
6337+
63096338 void qla24xx_process_purex_list(struct purex_list *list)
63106339 {
63116340 struct list_head head = LIST_HEAD_INIT(head);
@@ -6318,8 +6347,8 @@ void qla24xx_process_purex_list(struct purex_list *list) · 6 unmodified lines
63186347
63196348 list_for_each_entry_safe(item, next, &head, list) {
63206349 list_del(&item->list);
6321− item->process_item(item->vha, &item->iocb);
6322− kfree(item);
6350+ item->process_item(item->vha, item);
6351+ qla24xx_free_purex_item(item);
63236352 }
63246353 }
63256354
drivers/scsi/qla2xxx/qla_target.h+2−2
@@ -258,7 +258,7 @@ struct fcp_hdr { · 257 unmodified lines
258258 __be16 ox_id;
259259 uint16_t rx_id;
260260 __le32 parameter;
261−} __packed;
261+};
262262
263263 struct fcp_hdr_le {
264264 le_id_t d_id;
@@ -273,7 +273,7 @@ struct fcp_hdr_le { · 8 unmodified lines
273273 __le16 rx_id;
274274 __le16 ox_id;
275275 __le32 parameter;
276−} __packed;
276+};
277277
278278 #define F_CTL_EXCH_CONTEXT_RESP BIT_23
279279 #define F_CTL_SEQ_CONTEXT_RESIP BIT_22
drivers/scsi/qla2xxx/tcm_qla2xxx.c+1−0
@@ -1971,6 +1971,7 @@ static int __init tcm_qla2xxx_init(void) · 1970 unmodified lines
19711971 BUILD_BUG_ON(sizeof(struct ctio_crc2_to_fw) != 64);
19721972 BUILD_BUG_ON(sizeof(struct ctio_crc_from_fw) != 64);
19731973 BUILD_BUG_ON(sizeof(struct ctio_to_2xxx) != 64);
1974+ BUILD_BUG_ON(sizeof(struct fcp_hdr) != 24);
19741975 BUILD_BUG_ON(sizeof(struct fcp_hdr_le) != 24);
19751976 BUILD_BUG_ON(sizeof(struct nack_to_isp) != 64);
19761977
drivers/scsi/qla4xxx/ql4_83xx.c+12−22
@@ -1406,16 +1406,16 @@ exit_isp_reset: · 1405 unmodified lines
14061406 static void qla4_83xx_dump_pause_control_regs(struct scsi_qla_host *ha)
14071407 {
14081408 u32 val = 0, val1 = 0;
1409− int i, status = QLA_SUCCESS;
1409+ int i;
14101410
1411− status = qla4_83xx_rd_reg_indirect(ha, QLA83XX_SRE_SHIM_CONTROL, &val);
1411+ qla4_83xx_rd_reg_indirect(ha, QLA83XX_SRE_SHIM_CONTROL, &val);
14121412 DEBUG2(ql4_printk(KERN_INFO, ha, "SRE-Shim Ctrl:0x%x\n", val));
14131413
14141414 /* Port 0 Rx Buffer Pause Threshold Registers. */
14151415 DEBUG2(ql4_printk(KERN_INFO, ha,
14161416 "Port 0 Rx Buffer Pause Threshold Registers[TC7..TC0]:"));
14171417 for (i = 0; i < 8; i++) {
1418− status = qla4_83xx_rd_reg_indirect(ha,
1418+ qla4_83xx_rd_reg_indirect(ha,
14191419 QLA83XX_PORT0_RXB_PAUSE_THRS + (i * 0x4), &val);
14201420 DEBUG2(pr_info("0x%x ", val));
14211421 }
@@ -1426,7 +1426,7 @@ static void qla4_83xx_dump_pause_control_regs(struct scsi_qla_host *ha) · 4 unmodified lines
14261426 DEBUG2(ql4_printk(KERN_INFO, ha,
14271427 "Port 1 Rx Buffer Pause Threshold Registers[TC7..TC0]:"));
14281428 for (i = 0; i < 8; i++) {
1429− status = qla4_83xx_rd_reg_indirect(ha,
1429+ qla4_83xx_rd_reg_indirect(ha,
14301430 QLA83XX_PORT1_RXB_PAUSE_THRS + (i * 0x4), &val);
14311431 DEBUG2(pr_info("0x%x ", val));
14321432 }
@@ -1437,7 +1437,7 @@ static void qla4_83xx_dump_pause_control_regs(struct scsi_qla_host *ha) · 4 unmodified lines
14371437 DEBUG2(ql4_printk(KERN_INFO, ha,
14381438 "Port 0 RxB Traffic Class Max Cell Registers[3..0]:"));
14391439 for (i = 0; i < 4; i++) {
1440− status = qla4_83xx_rd_reg_indirect(ha,
1440+ qla4_83xx_rd_reg_indirect(ha,
14411441 QLA83XX_PORT0_RXB_TC_MAX_CELL + (i * 0x4), &val);
14421442 DEBUG2(pr_info("0x%x ", val));
14431443 }
@@ -1448,7 +1448,7 @@ static void qla4_83xx_dump_pause_control_regs(struct scsi_qla_host *ha) · 4 unmodified lines
14481448 DEBUG2(ql4_printk(KERN_INFO, ha,
14491449 "Port 1 RxB Traffic Class Max Cell Registers[3..0]:"));
14501450 for (i = 0; i < 4; i++) {
1451− status = qla4_83xx_rd_reg_indirect(ha,
1451+ qla4_83xx_rd_reg_indirect(ha,
14521452 QLA83XX_PORT1_RXB_TC_MAX_CELL + (i * 0x4), &val);
14531453 DEBUG2(pr_info("0x%x ", val));
14541454 }
@@ -1459,15 +1459,11 @@ static void qla4_83xx_dump_pause_control_regs(struct scsi_qla_host *ha) · 4 unmodified lines
14591459 DEBUG2(ql4_printk(KERN_INFO, ha,
14601460 "Port 0 RxB Rx Traffic Class Stats [TC7..TC0]"));
14611461 for (i = 7; i >= 0; i--) {
1462− status = qla4_83xx_rd_reg_indirect(ha,
1463− QLA83XX_PORT0_RXB_TC_STATS,
1464− &val);
1462+ qla4_83xx_rd_reg_indirect(ha, QLA83XX_PORT0_RXB_TC_STATS, &val);
14651463 val &= ~(0x7 << 29); /* Reset bits 29 to 31 */
14661464 qla4_83xx_wr_reg_indirect(ha, QLA83XX_PORT0_RXB_TC_STATS,
14671465 (val | (i << 29)));
1468− status = qla4_83xx_rd_reg_indirect(ha,
1469− QLA83XX_PORT0_RXB_TC_STATS,
1470− &val);
1466+ qla4_83xx_rd_reg_indirect(ha, QLA83XX_PORT0_RXB_TC_STATS, &val);
14711467 DEBUG2(pr_info("0x%x ", val));
14721468 }
14731469
@@ -1477,24 +1473,18 @@ static void qla4_83xx_dump_pause_control_regs(struct scsi_qla_host *ha) · 3 unmodified lines
14771473 DEBUG2(ql4_printk(KERN_INFO, ha,
14781474 "Port 1 RxB Rx Traffic Class Stats [TC7..TC0]"));
14791475 for (i = 7; i >= 0; i--) {
1480− status = qla4_83xx_rd_reg_indirect(ha,
1481− QLA83XX_PORT1_RXB_TC_STATS,
1482− &val);
1476+ qla4_83xx_rd_reg_indirect(ha, QLA83XX_PORT1_RXB_TC_STATS, &val);
14831477 val &= ~(0x7 << 29); /* Reset bits 29 to 31 */
14841478 qla4_83xx_wr_reg_indirect(ha, QLA83XX_PORT1_RXB_TC_STATS,
14851479 (val | (i << 29)));
1486− status = qla4_83xx_rd_reg_indirect(ha,
1487− QLA83XX_PORT1_RXB_TC_STATS,
1488− &val);
1480+ qla4_83xx_rd_reg_indirect(ha, QLA83XX_PORT1_RXB_TC_STATS, &val);
14891481 DEBUG2(pr_info("0x%x ", val));
14901482 }
14911483
14921484 DEBUG2(pr_info("\n"));
14931485
1494− status = qla4_83xx_rd_reg_indirect(ha, QLA83XX_PORT2_IFB_PAUSE_THRS,
1495− &val);
1496− status = qla4_83xx_rd_reg_indirect(ha, QLA83XX_PORT3_IFB_PAUSE_THRS,
1497− &val1);
1486+ qla4_83xx_rd_reg_indirect(ha, QLA83XX_PORT2_IFB_PAUSE_THRS, &val);
1487+ qla4_83xx_rd_reg_indirect(ha, QLA83XX_PORT3_IFB_PAUSE_THRS, &val1);
14981488
14991489 DEBUG2(ql4_printk(KERN_INFO, ha,
15001490 "IFB-Pause Thresholds: Port 2:0x%x, Port 3:0x%x\n",
drivers/scsi/qla4xxx/ql4_83xx.h+0−17
@@ -87,23 +87,6 @@ · 86 unmodified lines
8787 #define QLA83XX_FW_API 0x356C
8888 #define QLA83XX_DRV_OP_MODE 0x3570
8989
90−static const uint32_t qla4_83xx_reg_tbl[] = {
91− QLA83XX_PEG_HALT_STATUS1,
92− QLA83XX_PEG_HALT_STATUS2,
93− QLA83XX_PEG_ALIVE_COUNTER,
94− QLA83XX_CRB_DRV_ACTIVE,
95− QLA83XX_CRB_DEV_STATE,
96− QLA83XX_CRB_DRV_STATE,
97− QLA83XX_CRB_DRV_SCRATCH,
98− QLA83XX_CRB_DEV_PART_INFO1,
99− QLA83XX_CRB_IDC_VER_MAJOR,
100− QLA83XX_FW_VER_MAJOR,
101− QLA83XX_FW_VER_MINOR,
102− QLA83XX_FW_VER_SUB,
103− QLA83XX_CMDPEG_STATE,
104− QLA83XX_ASIC_TEMP,
105−};
106−
10790 #define QLA83XX_CRB_WIN_BASE 0x3800
10891 #define QLA83XX_CRB_WIN_FUNC(f) (QLA83XX_CRB_WIN_BASE+((f)*4))
10992 #define QLA83XX_SEM_LOCK_BASE 0x3840
drivers/scsi/qla4xxx/ql4_bsg.c+2−2
@@ -805,7 +805,7 @@ static int qla4xxx_execute_diag_test(struct bsg_job *bsg_job) · 804 unmodified lines
805805
806806 /**
807807 * qla4xxx_process_vendor_specific - handle vendor specific bsg request
808− * @job: iscsi_bsg_job to handle
808+ * @bsg_job: iscsi_bsg_job to handle
809809 **/
810810 int qla4xxx_process_vendor_specific(struct bsg_job *bsg_job)
811811 {
@@ -852,7 +852,7 @@ int qla4xxx_process_vendor_specific(struct bsg_job *bsg_job) · 40 unmodified lines
852852
853853 /**
854854 * qla4xxx_bsg_request - handle bsg request from ISCSI transport
855− * @job: iscsi_bsg_job to handle
855+ * @bsg_job: iscsi_bsg_job to handle
856856 */
857857 int qla4xxx_bsg_request(struct bsg_job *bsg_job)
858858 {
drivers/scsi/qla4xxx/ql4_init.c+8−5
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 static void ql4xxx_set_mac_number(struct scsi_qla_host *ha)
1515 {
1616 uint32_t value;
17− uint8_t func_number;
1817 unsigned long flags;
1918
2019 /* Get the function number */
@@ -22,7 +21,6 @@ static void ql4xxx_set_mac_number(struct scsi_qla_host *ha) · 1 unmodified line
2221 value = readw(&ha->reg->ctrl_status);
2322 spin_unlock_irqrestore(&ha->hardware_lock, flags);
2423
25− func_number = (uint8_t) ((value >> 4) & 0x30);
2624 switch (value & ISP_CONTROL_FN_MASK) {
2725 case ISP_CONTROL_FN0_SCSI:
2826 ha->mac_index = 1;
@@ -667,6 +665,9 @@ void qla4xxx_pci_config(struct scsi_qla_host *ha) · 638 unmodified lines
667665
668666 pci_set_master(ha->pdev);
669667 status = pci_set_mwi(ha->pdev);
668+ if (status)
669+ ql4_printk(KERN_WARNING, ha, "Failed to set MWI\n");
670+
670671 /*
671672 * We want to respect framework's setting of PCI configuration space
672673 * command register and also want to make sure that all bits of
@@ -945,6 +946,7 @@ void qla4xxx_free_ddb_index(struct scsi_qla_host *ha) · 272 unmodified lines
945946 /**
946947 * qla4xxx_initialize_adapter - initiailizes hba
947948 * @ha: Pointer to host adapter structure.
949+ * @is_reset: Is this init path or reset path
948950 *
949951 * This routine parforms all of the steps necessary to initialize the adapter.
950952 *
@@ -1156,9 +1158,10 @@ int qla4xxx_flash_ddb_change(struct scsi_qla_host *ha, uint32_t fw_ddb_index, · 205 unmodified lines
11561158
11571159 /**
11581160 * qla4xxx_process_ddb_changed - process ddb state change
1159− * @ha - Pointer to host adapter structure.
1160− * @fw_ddb_index - Firmware's device database index
1161− * @state - Device state
1161+ * @ha: Pointer to host adapter structure.
1162+ * @fw_ddb_index: Firmware's device database index
1163+ * @state: Device state
1164+ * @conn_err: Unused
11621165 *
11631166 * This routine processes a Decive Database Changed AEN Event.
11641167 **/
drivers/scsi/qla4xxx/ql4_iocb.c+1−1
@@ -78,7 +78,7 @@ static int qla4xxx_get_req_pkt(struct scsi_qla_host *ha, · 77 unmodified lines
7878 * @ha: Pointer to host adapter structure.
7979 * @ddb_entry: Pointer to device database entry
8080 * @lun: SCSI LUN
81− * @marker_type: marker identifier
81+ * @mrkr_mod: marker identifier
8282 *
8383 * This routine issues a marker IOCB.
8484 **/
drivers/scsi/qla4xxx/ql4_isr.c+4−2
@@ -582,7 +582,7 @@ exit_prq_error: · 581 unmodified lines
582582 /**
583583 * qla4_83xx_loopback_in_progress: Is loopback in progress?
584584 * @ha: Pointer to host adapter structure.
585− * @ret: 1 = loopback in progress, 0 = loopback not in progress
585+ * returns: 1 = loopback in progress, 0 = loopback not in progress
586586 **/
587587 static int qla4_83xx_loopback_in_progress(struct scsi_qla_host *ha)
588588 {
@@ -651,7 +651,7 @@ static void qla4xxx_default_router_changed(struct scsi_qla_host *ha, · 62 unmodified lines
651651 /**
652652 * qla4xxx_isr_decode_mailbox - decodes mailbox status
653653 * @ha: Pointer to host adapter structure.
654− * @mailbox_status: Mailbox status.
654+ * @mbox_status: Mailbox status.
655655 *
656656 * This routine decodes the mailbox status during the ISR.
657657 * Hardware_lock locked upon entry. runs in interrupt context.
@@ -1044,6 +1044,7 @@ void qla4_83xx_interrupt_service_routine(struct scsi_qla_host *ha, · 386 unmodified lines
10441044 /**
10451045 * qla4_82xx_interrupt_service_routine - isr
10461046 * @ha: pointer to host adapter structure.
1047+ * @intr_status: Local interrupt status/type.
10471048 *
10481049 * This is the main interrupt service routine.
10491050 * hardware_lock locked upon entry. runs in interrupt context.
@@ -1069,6 +1070,7 @@ void qla4_82xx_interrupt_service_routine(struct scsi_qla_host *ha, · 19 unmodified lines
10691070 /**
10701071 * qla4xxx_interrupt_service_routine - isr
10711072 * @ha: pointer to host adapter structure.
1073+ * @intr_status: Local interrupt status/type.
10721074 *
10731075 * This is the main interrupt service routine.
10741076 * hardware_lock locked upon entry. runs in interrupt context.
drivers/scsi/qla4xxx/ql4_mbx.c+3−4
@@ -47,7 +47,7 @@ void qla4xxx_process_mbox_intr(struct scsi_qla_host *ha, int out_count) · 46 unmodified lines
4747 /**
4848 * qla4xxx_is_intr_poll_mode – Are we allowed to poll for interrupts?
4949 * @ha: Pointer to host adapter structure.
50− * @ret: 1=polling mode, 0=non-polling mode
50+ * returns: 1=polling mode, 0=non-polling mode
5151 **/
5252 static int qla4xxx_is_intr_poll_mode(struct scsi_qla_host *ha)
5353 {
@@ -810,7 +810,7 @@ int qla4xxx_get_firmware_status(struct scsi_qla_host * ha) · 756 unmodified lines
810810 return QLA_SUCCESS;
811811 }
812812
813−/**
813+/*
814814 * qla4xxx_get_fwddb_entry - retrieves firmware ddb entry
815815 * @ha: Pointer to host adapter structure.
816816 * @fw_ddb_index: Firmware's device database index
@@ -1259,8 +1259,7 @@ int qla4xxx_reset_lun(struct scsi_qla_host * ha, struct ddb_entry * ddb_entry, · 442 unmodified lines
12591259 /**
12601260 * qla4xxx_reset_target - issues target Reset
12611261 * @ha: Pointer to host adapter structure.
1262− * @db_entry: Pointer to device database entry
1263− * @un_entry: Pointer to lun entry structure
1262+ * @ddb_entry: Pointer to device database entry
12641263 *
12651264 * This routine performs a TARGET RESET on the specified target.
12661265 * The caller must ensure that the ddb_entry pointers
drivers/scsi/qla4xxx/ql4_nx.c+8−10
@@ -974,10 +974,10 @@ qla4_82xx_rom_fast_read(struct scsi_qla_host *ha, int addr, int *valp) · 973 unmodified lines
974974 return ret;
975975 }
976976
977−/**
977+/*
978978 * This routine does CRB initialize sequence
979979 * to put the ISP into operational state
980− **/
980+ */
981981 static int
982982 qla4_82xx_pinit_from_rom(struct scsi_qla_host *ha, int verbose)
983983 {
@@ -2645,7 +2645,7 @@ static uint32_t qla4_84xx_minidump_process_rddfe(struct scsi_qla_host *ha, · 1661 unmodified lines
26452645 uint32_t addr1, addr2, value, data, temp, wrval;
26462646 uint8_t stride, stride2;
26472647 uint16_t count;
2648− uint32_t poll, mask, data_size, modify_mask;
2648+ uint32_t poll, mask, modify_mask;
26492649 uint32_t wait_count = 0;
26502650 uint32_t *data_ptr = *d_ptr;
26512651 struct qla8044_minidump_entry_rddfe *rddfe;
@@ -2661,7 +2661,6 @@ static uint32_t qla4_84xx_minidump_process_rddfe(struct scsi_qla_host *ha, · 9 unmodified lines
26612661 poll = le32_to_cpu(rddfe->poll);
26622662 mask = le32_to_cpu(rddfe->mask);
26632663 modify_mask = le32_to_cpu(rddfe->modify_mask);
2664− data_size = le32_to_cpu(rddfe->data_size);
26652664
26662665 addr2 = addr1 + stride;
26672666
@@ -2742,7 +2741,7 @@ static uint32_t qla4_84xx_minidump_process_rdmdio(struct scsi_qla_host *ha, · 74 unmodified lines
27422741 uint8_t stride1, stride2;
27432742 uint32_t addr3, addr4, addr5, addr6, addr7;
27442743 uint16_t count, loop_cnt;
2745− uint32_t poll, mask;
2744+ uint32_t mask;
27462745 uint32_t *data_ptr = *d_ptr;
27472746 struct qla8044_minidump_entry_rdmdio *rdmdio;
27482747
@@ -2754,7 +2753,6 @@ static uint32_t qla4_84xx_minidump_process_rdmdio(struct scsi_qla_host *ha, · 5 unmodified lines
27542753 stride2 = le32_to_cpu(rdmdio->stride_2);
27552754 count = le32_to_cpu(rdmdio->count);
27562755
2757− poll = le32_to_cpu(rdmdio->poll);
27582756 mask = le32_to_cpu(rdmdio->mask);
27592757 value2 = le32_to_cpu(rdmdio->value_2);
27602758
@@ -2813,7 +2811,7 @@ static uint32_t qla4_84xx_minidump_process_pollwr(struct scsi_qla_host *ha, · 52 unmodified lines
28132811 struct qla8xxx_minidump_entry_hdr *entry_hdr,
28142812 uint32_t **d_ptr)
28152813 {
2816− uint32_t addr1, addr2, value1, value2, poll, mask, r_value;
2814+ uint32_t addr1, addr2, value1, value2, poll, r_value;
28172815 struct qla8044_minidump_entry_pollwr *pollwr_hdr;
28182816 uint32_t wait_count = 0;
28192817 uint32_t rval = QLA_SUCCESS;
@@ -2825,7 +2823,6 @@ static uint32_t qla4_84xx_minidump_process_pollwr(struct scsi_qla_host *ha, · 5 unmodified lines
28252823 value2 = le32_to_cpu(pollwr_hdr->value_2);
28262824
28272825 poll = le32_to_cpu(pollwr_hdr->poll);
2828− mask = le32_to_cpu(pollwr_hdr->mask);
28292826
28302827 while (wait_count < poll) {
28312828 ha->isp_ops->rd_reg_indirect(ha, addr1, &r_value);
@@ -3220,6 +3217,7 @@ md_failed: · 388 unmodified lines
32203217 /**
32213218 * qla4_8xxx_uevent_emit - Send uevent when the firmware dump is ready.
32223219 * @ha: pointer to adapter structure
3220+ * @code: uevent code to act upon
32233221 **/
32243222 static void qla4_8xxx_uevent_emit(struct scsi_qla_host *ha, u32 code)
32253223 {
@@ -3688,9 +3686,9 @@ done_read: · 462 unmodified lines
36883686 return dwptr;
36893687 }
36903688
3691−/**
3689+/*
36923690 * Address and length are byte address
3693− **/
3691+ */
36943692 static uint8_t *
36953693 qla4_82xx_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
36963694 uint32_t offset, uint32_t length)
drivers/scsi/qla4xxx/ql4_nx.h+0−17
@@ -599,23 +599,6 @@ enum qla_regs { · 598 unmodified lines
599599 QLA8XXX_CRB_TEMP_STATE,
600600 };
601601
602−static const uint32_t qla4_82xx_reg_tbl[] = {
603− QLA82XX_PEG_HALT_STATUS1,
604− QLA82XX_PEG_HALT_STATUS2,
605− QLA82XX_PEG_ALIVE_COUNTER,
606− QLA82XX_CRB_DRV_ACTIVE,
607− QLA82XX_CRB_DEV_STATE,
608− QLA82XX_CRB_DRV_STATE,
609− QLA82XX_CRB_DRV_SCRATCH,
610− QLA82XX_CRB_DEV_PART_INFO,
611− QLA82XX_CRB_DRV_IDC_VERSION,
612− QLA82XX_FW_VERSION_MAJOR,
613− QLA82XX_FW_VERSION_MINOR,
614− QLA82XX_FW_VERSION_SUB,
615− CRB_CMDPEG_STATE,
616− CRB_TEMP_STATE,
617−};
618−
619602 /* Every driver should use these Device State */
620603 #define QLA8XXX_DEV_COLD 1
621604 #define QLA8XXX_DEV_INITIALIZING 2
drivers/scsi/qla4xxx/ql4_os.c+42−16
@@ -188,6 +188,40 @@ static int qla4xxx_sysfs_ddb_logout_sid(struct iscsi_cls_session *cls_sess); · 187 unmodified lines
188188 static struct qla4_8xxx_legacy_intr_set legacy_intr[] =
189189 QLA82XX_LEGACY_INTR_CONFIG;
190190
191+static const uint32_t qla4_82xx_reg_tbl[] = {
192+ QLA82XX_PEG_HALT_STATUS1,
193+ QLA82XX_PEG_HALT_STATUS2,
194+ QLA82XX_PEG_ALIVE_COUNTER,
195+ QLA82XX_CRB_DRV_ACTIVE,
196+ QLA82XX_CRB_DEV_STATE,
197+ QLA82XX_CRB_DRV_STATE,
198+ QLA82XX_CRB_DRV_SCRATCH,
199+ QLA82XX_CRB_DEV_PART_INFO,
200+ QLA82XX_CRB_DRV_IDC_VERSION,
201+ QLA82XX_FW_VERSION_MAJOR,
202+ QLA82XX_FW_VERSION_MINOR,
203+ QLA82XX_FW_VERSION_SUB,
204+ CRB_CMDPEG_STATE,
205+ CRB_TEMP_STATE,
206+};
207+
208+static const uint32_t qla4_83xx_reg_tbl[] = {
209+ QLA83XX_PEG_HALT_STATUS1,
210+ QLA83XX_PEG_HALT_STATUS2,
211+ QLA83XX_PEG_ALIVE_COUNTER,
212+ QLA83XX_CRB_DRV_ACTIVE,
213+ QLA83XX_CRB_DEV_STATE,
214+ QLA83XX_CRB_DRV_STATE,
215+ QLA83XX_CRB_DRV_SCRATCH,
216+ QLA83XX_CRB_DEV_PART_INFO1,
217+ QLA83XX_CRB_IDC_VER_MAJOR,
218+ QLA83XX_FW_VER_MAJOR,
219+ QLA83XX_FW_VER_MINOR,
220+ QLA83XX_FW_VER_SUB,
221+ QLA83XX_CMDPEG_STATE,
222+ QLA83XX_ASIC_TEMP,
223+};
224+
191225 static struct scsi_host_template qla4xxx_driver_template = {
192226 .module = THIS_MODULE,
193227 .name = DRIVER_NAME,
@@ -1845,12 +1879,10 @@ exit_get_stats: · 1651 unmodified lines
18451879 static enum blk_eh_timer_return qla4xxx_eh_cmd_timed_out(struct scsi_cmnd *sc)
18461880 {
18471881 struct iscsi_cls_session *session;
1848− struct iscsi_session *sess;
18491882 unsigned long flags;
18501883 enum blk_eh_timer_return ret = BLK_EH_DONE;
18511884
18521885 session = starget_to_session(scsi_target(sc->device));
1853− sess = session->dd_data;
18541886
18551887 spin_lock_irqsave(&session->lock, flags);
18561888 if (session->state == ISCSI_SESSION_FAILED)
@@ -3059,7 +3091,6 @@ qla4xxx_session_create(struct iscsi_endpoint *ep, · 1202 unmodified lines
30593091 struct ddb_entry *ddb_entry;
30603092 uint16_t ddb_index;
30613093 struct iscsi_session *sess;
3062− struct sockaddr *dst_addr;
30633094 int ret;
30643095
30653096 if (!ep) {
@@ -3068,7 +3099,6 @@ qla4xxx_session_create(struct iscsi_endpoint *ep, · 2 unmodified lines
30683099 }
30693100
30703101 qla_ep = ep->dd_data;
3071− dst_addr = (struct sockaddr *)&qla_ep->dst_addr;
30723102 ha = to_qla_host(qla_ep->host);
30733103 DEBUG2(ql4_printk(KERN_INFO, ha, "%s: host: %ld\n", __func__,
30743104 ha->host_no));
@@ -4515,7 +4545,7 @@ static void qla4xxx_check_relogin_flash_ddb(struct iscsi_cls_session *cls_sess) · 1440 unmodified lines
45154545
45164546 /**
45174547 * qla4xxx_timer - checks every second for work to do.
4518− * @ha: Pointer to host adapter structure.
4548+ * @t: Context to obtain pointer to host adapter structure.
45194549 **/
45204550 static void qla4xxx_timer(struct timer_list *t)
45214551 {
@@ -5269,7 +5299,7 @@ static void qla4xxx_do_work(struct scsi_qla_host *ha) · 747 unmodified lines
52695299
52705300 /**
52715301 * qla4xxx_do_dpc - dpc routine
5272− * @data: in our case pointer to adapter structure
5302+ * @work: Context to obtain pointer to host adapter structure.
52735303 *
52745304 * This routine is a task that is schedule by the interrupt handler
52755305 * to perform the background processing for interrupts. We put it
@@ -5492,7 +5522,7 @@ static void qla4xxx_free_adapter(struct scsi_qla_host *ha) · 216 unmodified lines
54925522 int qla4_8xxx_iospace_config(struct scsi_qla_host *ha)
54935523 {
54945524 int status = 0;
5495− unsigned long mem_base, mem_len, db_base, db_len;
5525+ unsigned long mem_base, mem_len;
54965526 struct pci_dev *pdev = ha->pdev;
54975527
54985528 status = pci_request_regions(pdev, DRIVER_NAME);
@@ -5536,9 +5566,6 @@ int qla4_8xxx_iospace_config(struct scsi_qla_host *ha) · 37 unmodified lines
55365566 ((uint8_t *)ha->nx_pcibase);
55375567 }
55385568
5539− db_base = pci_resource_start(pdev, 4); /* doorbell is on bar 4 */
5540− db_len = pci_resource_len(pdev, 4);
5541−
55425569 return 0;
55435570 iospace_error_exit:
55445571 return -ENOMEM;
@@ -6249,14 +6276,12 @@ kset_free: · 704 unmodified lines
62496276 static void qla4xxx_get_param_ddb(struct ddb_entry *ddb_entry,
62506277 struct ql4_tuple_ddb *tddb)
62516278 {
6252− struct scsi_qla_host *ha;
62536279 struct iscsi_cls_session *cls_sess;
62546280 struct iscsi_cls_conn *cls_conn;
62556281 struct iscsi_session *sess;
62566282 struct iscsi_conn *conn;
62576283
62586284 DEBUG2(printk(KERN_INFO "Func: %s\n", __func__));
6259− ha = ddb_entry->ha;
62606285 cls_sess = ddb_entry->sess;
62616286 sess = cls_sess->dd_data;
62626287 cls_conn = ddb_entry->conn;
@@ -8591,7 +8616,7 @@ exit_login_resp: · 2328 unmodified lines
85918616 /**
85928617 * qla4xxx_probe_adapter - callback function to probe HBA
85938618 * @pdev: pointer to pci_dev structure
8594− * @pci_device_id: pointer to pci_device entry
8619+ * @ent: pointer to pci_device entry
85958620 *
85968621 * This routine will probe for Qlogic 4xxx iSCSI host adapters.
85978622 * It returns zero if successful. It also initializes all data necessary for
@@ -8977,7 +9002,7 @@ static void qla4xxx_destroy_fw_ddb_session(struct scsi_qla_host *ha) · 379 unmodified lines
89779002 }
89789003 /**
89799004 * qla4xxx_remove_adapter - callback function to remove adapter.
8980− * @pci_dev: PCI device pointer
9005+ * @pdev: PCI device pointer
89819006 **/
89829007 static void qla4xxx_remove_adapter(struct pci_dev *pdev)
89839008 {
@@ -9144,8 +9169,8 @@ static int qla4xxx_wait_for_hba_online(struct scsi_qla_host *ha) · 160 unmodified lines
91449169 /**
91459170 * qla4xxx_eh_wait_for_commands - wait for active cmds to finish.
91469171 * @ha: pointer to HBA
9147− * @t: target id
9148− * @l: lun id
9172+ * @stgt: pointer to SCSI target
9173+ * @sdev: pointer to SCSI device
91499174 *
91509175 * This function waits for all outstanding commands to a lun to complete. It
91519176 * returns 0 if all pending commands are returned and 1 otherwise.
@@ -9615,6 +9640,7 @@ qla4xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) · 463 unmodified lines
96159640 * qla4xxx_pci_mmio_enabled() gets called if
96169641 * qla4xxx_pci_error_detected() returns PCI_ERS_RESULT_CAN_RECOVER
96179642 * and read/write to the device still works.
9643+ * @pdev: PCI device pointer
96189644 **/
96199645 static pci_ers_result_t
96209646 qla4xxx_pci_mmio_enabled(struct pci_dev *pdev)
drivers/scsi/scsi.c+0−3
@@ -754,9 +754,6 @@ static int __init init_scsi(void) · 753 unmodified lines
754754 {
755755 int error;
756756
757− error = scsi_init_queue();
758− if (error)
759− return error;
760757 error = scsi_init_procfs();
761758 if (error)
762759 goto cleanup_queue;
drivers/scsi/scsi_debug.c+303−197
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 *
1010 * Copyright (C) 2001 - 2020 Douglas Gilbert
1111 *
12− * For documentation see http://sg.danny.cz/sg/sdebug26.html
12+ * For documentation see http://sg.danny.cz/sg/scsi_debug.html
1313 */
1414
1515
@@ -60,8 +60,8 @@ · 44 unmodified lines
6060 #include "scsi_logging.h"
6161
6262 /* make sure inq_product_rev string corresponds to this version */
63−#define SDEBUG_VERSION "0189" /* format to fit INQUIRY revision field */
64−static const char *sdebug_version_date = "20200421";
63+#define SDEBUG_VERSION "0190" /* format to fit INQUIRY revision field */
64+static const char *sdebug_version_date = "20200710";
6565
6666 #define MY_NAME "scsi_debug"
6767
@@ -151,6 +151,7 @@ static const char *sdebug_version_date = "20200421"; · 83 unmodified lines
151151 #define DEF_STRICT 0
152152 #define DEF_STATISTICS false
153153 #define DEF_SUBMIT_QUEUES 1
154+#define DEF_TUR_MS_TO_READY 0
154155 #define DEF_UUID_CTL 0
155156 #define JDELAY_OVERRIDDEN -9999
156157
@@ -187,21 +188,8 @@ static const char *sdebug_version_date = "20200421"; · 30 unmodified lines
187188 SDEBUG_OPT_SHORT_TRANSFER | \
188189 SDEBUG_OPT_HOST_BUSY | \
189190 SDEBUG_OPT_CMD_ABORT)
190−/* When "every_nth" > 0 then modulo "every_nth" commands:
191− * - a missing response is simulated if SDEBUG_OPT_TIMEOUT is set
192− * - a RECOVERED_ERROR is simulated on successful read and write
193− * commands if SDEBUG_OPT_RECOVERED_ERR is set.
194− * - a TRANSPORT_ERROR is simulated on successful read and write
195− * commands if SDEBUG_OPT_TRANSPORT_ERR is set.
196− * - similarly for DIF_ERR, DIX_ERR, SHORT_TRANSFER, HOST_BUSY and
197− * CMD_ABORT
198− *
199− * When "every_nth" < 0 then after "- every_nth" commands the selected
200− * error will be injected. The error will be injected on every subsequent
201− * command until some other action occurs; for example, the user writing
202− * a new value (other than -1 or 1) to every_nth:
203− * echo 0 > /sys/bus/pseudo/drivers/scsi_debug/every_nth
204− */
191+#define SDEBUG_OPT_RECOV_DIF_DIX (SDEBUG_OPT_RECOVERED_ERR | \
192+ SDEBUG_OPT_DIF_ERR | SDEBUG_OPT_DIX_ERR)
205193
206194 /* As indicated in SAM-5 and SPC-4 Unit Attentions (UAs) are returned in
207195 * priority order. In the subset implemented here lower numbers have higher
@@ -301,7 +289,7 @@ struct sdebug_dev_info { · 93 unmodified lines
301289 struct sdebug_host_info *sdbg_host;
302290 unsigned long uas_bm[1];
303291 atomic_t num_in_q;
304− atomic_t stopped;
292+ atomic_t stopped; /* 1: by SSU, 2: device start */
305293 bool used;
306294
307295 /* For ZBC devices */
@@ -314,6 +302,7 @@ struct sdebug_dev_info { · 6 unmodified lines
314302 unsigned int nr_exp_open;
315303 unsigned int nr_closed;
316304 unsigned int max_open;
305+ ktime_t create_ts; /* time since bootup that this device was created */
317306 struct sdeb_zone_state *zstate;
318307 };
319308
@@ -344,6 +333,7 @@ struct sdebug_defer { · 24 unmodified lines
344333 struct execute_work ew;
345334 int sqa_idx; /* index of sdebug_queue array */
346335 int qc_idx; /* index of sdebug_queued_cmd array within sqa_idx */
336+ int hc_idx; /* hostwide tag index */
347337 int issuing_cpu;
348338 bool init_hrt;
349339 bool init_wq;
@@ -357,13 +347,6 @@ struct sdebug_queued_cmd { · 7 unmodified lines
357347 */
358348 struct sdebug_defer *sd_dp;
359349 struct scsi_cmnd *a_cmnd;
360− unsigned int inj_recovered:1;
361− unsigned int inj_transport:1;
362− unsigned int inj_dif:1;
363− unsigned int inj_dix:1;
364− unsigned int inj_short:1;
365− unsigned int inj_host_busy:1;
366− unsigned int inj_cmd_abort:1;
367350 };
368351
369352 struct sdebug_queue {
@@ -377,6 +360,7 @@ static atomic_t sdebug_cmnd_count; /* number of incoming commands */ · 7 unmodified lines
377360 static atomic_t sdebug_completions; /* count of deferred completions */
378361 static atomic_t sdebug_miss_cpus; /* submission + completion cpus differ */
379362 static atomic_t sdebug_a_tsf; /* 'almost task set full' counter */
363+static atomic_t sdeb_inject_pending;
380364
381365 struct opcode_info_t {
382366 u8 num_attached; /* 0 if this is it (i.e. a leaf); use 0xff */
@@ -759,6 +743,7 @@ static int sdebug_dsense = DEF_D_SENSE; · 376 unmodified lines
759743 static int sdebug_every_nth = DEF_EVERY_NTH;
760744 static int sdebug_fake_rw = DEF_FAKE_RW;
761745 static unsigned int sdebug_guard = DEF_GUARD;
746+static int sdebug_host_max_queue; /* per host */
762747 static int sdebug_lowest_aligned = DEF_LOWEST_ALIGNED;
763748 static int sdebug_max_luns = DEF_MAX_LUNS;
764749 static int sdebug_max_queue = SDEBUG_CANQUEUE; /* per submit queue */
@@ -777,6 +762,7 @@ static int sdebug_opt_xferlen_exp = DEF_OPT_XFERLEN_EXP; · 12 unmodified lines
777762 static int sdebug_ptype = DEF_PTYPE; /* SCSI peripheral device type */
778763 static int sdebug_scsi_level = DEF_SCSI_LEVEL;
779764 static int sdebug_sector_size = DEF_SECTOR_SIZE;
765+static int sdeb_tur_ms_to_ready = DEF_TUR_MS_TO_READY;
780766 static int sdebug_virtual_gb = DEF_VIRTUAL_GB;
781767 static int sdebug_vpd_use_hostno = DEF_VPD_USE_HOSTNO;
782768 static unsigned int sdebug_lbpu = DEF_LBPU;
@@ -1729,75 +1715,68 @@ static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) · 946 unmodified lines
17291715 return ret;
17301716 }
17311717
1718+/* See resp_iec_m_pg() for how this data is manipulated */
17321719 static unsigned char iec_m_pg[] = {0x1c, 0xa, 0x08, 0, 0, 0, 0, 0,
17331720 0, 0, 0x0, 0x0};
17341721
17351722 static int resp_requests(struct scsi_cmnd *scp,
17361723 struct sdebug_dev_info *devip)
17371724 {
1738− unsigned char *sbuff;
17391725 unsigned char *cmd = scp->cmnd;
1740− unsigned char arr[SCSI_SENSE_BUFFERSIZE];
1741− bool dsense;
1726+ unsigned char arr[SCSI_SENSE_BUFFERSIZE]; /* assume >= 18 bytes */
1727+ bool dsense = !!(cmd[1] & 1);
1728+ int alloc_len = cmd[4];
17421729 int len = 18;
1730+ int stopped_state = atomic_read(&devip->stopped);
17431731
17441732 memset(arr, 0, sizeof(arr));
1745− dsense = !!(cmd[1] & 1);
1746− sbuff = scp->sense_buffer;
1747− if ((iec_m_pg[2] & 0x4) && (6 == (iec_m_pg[3] & 0xf))) {
1733+ if (stopped_state > 0) { /* some "pollable" data [spc6r02: 5.12.2] */
1734+ if (dsense) {
1735+ arr[0] = 0x72;
1736+ arr[1] = NOT_READY;
1737+ arr[2] = LOGICAL_UNIT_NOT_READY;
1738+ arr[3] = (stopped_state == 2) ? 0x1 : 0x2;
1739+ len = 8;
1740+ } else {
1741+ arr[0] = 0x70;
1742+ arr[2] = NOT_READY; /* NO_SENSE in sense_key */
1743+ arr[7] = 0xa; /* 18 byte sense buffer */
1744+ arr[12] = LOGICAL_UNIT_NOT_READY;
1745+ arr[13] = (stopped_state == 2) ? 0x1 : 0x2;
1746+ }
1747+ } else if ((iec_m_pg[2] & 0x4) && (6 == (iec_m_pg[3] & 0xf))) {
1748+ /* Information exceptions control mode page: TEST=1, MRIE=6 */
17481749 if (dsense) {
17491750 arr[0] = 0x72;
17501751 arr[1] = 0x0; /* NO_SENSE in sense_key */
17511752 arr[2] = THRESHOLD_EXCEEDED;
1752− arr[3] = 0xff; /* TEST set and MRIE==6 */
1753+ arr[3] = 0xff; /* Failure prediction(false) */
17531754 len = 8;
17541755 } else {
17551756 arr[0] = 0x70;
17561757 arr[2] = 0x0; /* NO_SENSE in sense_key */
17571758 arr[7] = 0xa; /* 18 byte sense buffer */
17581759 arr[12] = THRESHOLD_EXCEEDED;
1759− arr[13] = 0xff; /* TEST set and MRIE==6 */
1760+ arr[13] = 0xff; /* Failure prediction(false) */
17601761 }
1761− } else {
1762− memcpy(arr, sbuff, SCSI_SENSE_BUFFERSIZE);
1763− if (arr[0] >= 0x70 && dsense == sdebug_dsense)
1764− ; /* have sense and formats match */
1765− else if (arr[0] <= 0x70) {
1766− if (dsense) {
1767− memset(arr, 0, 8);
1768− arr[0] = 0x72;
1769− len = 8;
1770− } else {
1771− memset(arr, 0, 18);
1772− arr[0] = 0x70;
1773− arr[7] = 0xa;
1774− }
1775− } else if (dsense) {
1776− memset(arr, 0, 8);
1777− arr[0] = 0x72;
1778− arr[1] = sbuff[2]; /* sense key */
1779− arr[2] = sbuff[12]; /* asc */
1780− arr[3] = sbuff[13]; /* ascq */
1762+ } else { /* nothing to report */
1763+ if (dsense) {
17811764 len = 8;
1765+ memset(arr, 0, len);
1766+ arr[0] = 0x72;
17821767 } else {
1783− memset(arr, 0, 18);
1768+ memset(arr, 0, len);
17841769 arr[0] = 0x70;
1785− arr[2] = sbuff[1];
17861770 arr[7] = 0xa;
1787− arr[12] = sbuff[1];
1788− arr[13] = sbuff[3];
17891771 }
1790−
17911772 }
1792− mk_sense_buffer(scp, 0, NO_ADDITIONAL_SENSE, 0);
1793− return fill_from_dev_buffer(scp, arr, len);
1773+ return fill_from_dev_buffer(scp, arr, min_t(int, len, alloc_len));
17941774 }
17951775
1796−static int resp_start_stop(struct scsi_cmnd *scp,
1797− struct sdebug_dev_info *devip)
1776+static int resp_start_stop(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
17981777 {
17991778 unsigned char *cmd = scp->cmnd;
1800− int power_cond, stop;
1779+ int power_cond, want_stop, stopped_state;
18011780 bool changing;
18021781
18031782 power_cond = (cmd[4] & 0xf0) >> 4;
@@ -1805,10 +1784,33 @@ static int resp_start_stop(struct scsi_cmnd *scp, · 1 unmodified line
18051784 mk_sense_invalid_fld(scp, SDEB_IN_CDB, 4, 7);
18061785 return check_condition_result;
18071786 }
1808− stop = !(cmd[4] & 1);
1809− changing = atomic_read(&devip->stopped) == !stop;
1810− atomic_xchg(&devip->stopped, stop);
1811− if (!changing || cmd[1] & 0x1) /* state unchanged or IMMED set */
1787+ want_stop = !(cmd[4] & 1);
1788+ stopped_state = atomic_read(&devip->stopped);
1789+ if (stopped_state == 2) {
1790+ ktime_t now_ts = ktime_get_boottime();
1791+
1792+ if (ktime_to_ns(now_ts) > ktime_to_ns(devip->create_ts)) {
1793+ u64 diff_ns = ktime_to_ns(ktime_sub(now_ts, devip->create_ts));
1794+
1795+ if (diff_ns >= ((u64)sdeb_tur_ms_to_ready * 1000000)) {
1796+ /* tur_ms_to_ready timer extinguished */
1797+ atomic_set(&devip->stopped, 0);
1798+ stopped_state = 0;
1799+ }
1800+ }
1801+ if (stopped_state == 2) {
1802+ if (want_stop) {
1803+ stopped_state = 1; /* dummy up success */
1804+ } else { /* Disallow tur_ms_to_ready delay to be overridden */
1805+ mk_sense_invalid_fld(scp, SDEB_IN_CDB, 4, 0 /* START bit */);
1806+ return check_condition_result;
1807+ }
1808+ }
1809+ }
1810+ changing = (stopped_state != want_stop);
1811+ if (changing)
1812+ atomic_xchg(&devip->stopped, want_stop);
1813+ if (!changing || (cmd[1] & 0x1)) /* state unchanged or IMMED bit set in cdb */
18121814 return SDEG_RES_IMMED_MASK;
18131815 else
18141816 return 0;
@@ -3109,7 +3111,6 @@ static int resp_read_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) · 1294 unmodified lines
31093111 struct sdeb_store_info *sip = devip2sip(devip, true);
31103112 rwlock_t *macc_lckp = sip ? &sip->macc_lck : &sdeb_fake_rw_lck;
31113113 u8 *cmd = scp->cmnd;
3112− struct sdebug_queued_cmd *sqcp;
31133114
31143115 switch (cmd[0]) {
31153116 case READ_16:
@@ -3162,15 +3163,11 @@ static int resp_read_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) · 46 unmodified lines
31623163 sdev_printk(KERN_ERR, scp->device, "Unprotected RD "
31633164 "to DIF device\n");
31643165 }
3165− if (unlikely(sdebug_any_injecting_opt)) {
3166− sqcp = (struct sdebug_queued_cmd *)scp->host_scribble;
3167−
3168− if (sqcp) {
3169− if (sqcp->inj_short)
3170− num /= 2;
3171− }
3172− } else
3173− sqcp = NULL;
3166+ if (unlikely((sdebug_opts & SDEBUG_OPT_SHORT_TRANSFER) &&
3167+ atomic_read(&sdeb_inject_pending))) {
3168+ num /= 2;
3169+ atomic_set(&sdeb_inject_pending, 0);
3170+ }
31743171
31753172 ret = check_device_access_params(scp, lba, num, false);
31763173 if (ret)
@@ -3211,21 +3208,20 @@ static int resp_read_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) · 34 unmodified lines
32113208
32123209 scsi_set_resid(scp, scsi_bufflen(scp) - ret);
32133210
3214− if (unlikely(sqcp)) {
3215− if (sqcp->inj_recovered) {
3216− mk_sense_buffer(scp, RECOVERED_ERROR,
3217− THRESHOLD_EXCEEDED, 0);
3211+ if (unlikely((sdebug_opts & SDEBUG_OPT_RECOV_DIF_DIX) &&
3212+ atomic_read(&sdeb_inject_pending))) {
3213+ if (sdebug_opts & SDEBUG_OPT_RECOVERED_ERR) {
3214+ mk_sense_buffer(scp, RECOVERED_ERROR, THRESHOLD_EXCEEDED, 0);
3215+ atomic_set(&sdeb_inject_pending, 0);
32183216 return check_condition_result;
3219− } else if (sqcp->inj_transport) {
3220− mk_sense_buffer(scp, ABORTED_COMMAND,
3221− TRANSPORT_PROBLEM, ACK_NAK_TO);
3222− return check_condition_result;
3223− } else if (sqcp->inj_dif) {
3217+ } else if (sdebug_opts & SDEBUG_OPT_DIF_ERR) {
32243218 /* Logical block guard check failed */
32253219 mk_sense_buffer(scp, ABORTED_COMMAND, 0x10, 1);
3220+ atomic_set(&sdeb_inject_pending, 0);
32263221 return illegal_condition_result;
3227− } else if (sqcp->inj_dix) {
3222+ } else if (SDEBUG_OPT_DIX_ERR & sdebug_opts) {
32283223 mk_sense_buffer(scp, ILLEGAL_REQUEST, 0x10, 1);
3224+ atomic_set(&sdeb_inject_pending, 0);
32293225 return illegal_condition_result;
32303226 }
32313227 }
@@ -3504,23 +3500,21 @@ static int resp_write_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) · 272 unmodified lines
35043500 "%s: write: cdb indicated=%u, IO sent=%d bytes\n",
35053501 my_name, num * sdebug_sector_size, ret);
35063502
3507− if (unlikely(sdebug_any_injecting_opt)) {
3508− struct sdebug_queued_cmd *sqcp =
3509− (struct sdebug_queued_cmd *)scp->host_scribble;
3510−
3511− if (sqcp) {
3512− if (sqcp->inj_recovered) {
3513− mk_sense_buffer(scp, RECOVERED_ERROR,
3514− THRESHOLD_EXCEEDED, 0);
3515− return check_condition_result;
3516− } else if (sqcp->inj_dif) {
3517− /* Logical block guard check failed */
3518− mk_sense_buffer(scp, ABORTED_COMMAND, 0x10, 1);
3519− return illegal_condition_result;
3520− } else if (sqcp->inj_dix) {
3521− mk_sense_buffer(scp, ILLEGAL_REQUEST, 0x10, 1);
3522− return illegal_condition_result;
3523− }
3503+ if (unlikely((sdebug_opts & SDEBUG_OPT_RECOV_DIF_DIX) &&
3504+ atomic_read(&sdeb_inject_pending))) {
3505+ if (sdebug_opts & SDEBUG_OPT_RECOVERED_ERR) {
3506+ mk_sense_buffer(scp, RECOVERED_ERROR, THRESHOLD_EXCEEDED, 0);
3507+ atomic_set(&sdeb_inject_pending, 0);
3508+ return check_condition_result;
3509+ } else if (sdebug_opts & SDEBUG_OPT_DIF_ERR) {
3510+ /* Logical block guard check failed */
3511+ mk_sense_buffer(scp, ABORTED_COMMAND, 0x10, 1);
3512+ atomic_set(&sdeb_inject_pending, 0);
3513+ return illegal_condition_result;
3514+ } else if (sdebug_opts & SDEBUG_OPT_DIX_ERR) {
3515+ mk_sense_buffer(scp, ILLEGAL_REQUEST, 0x10, 1);
3516+ atomic_set(&sdeb_inject_pending, 0);
3517+ return illegal_condition_result;
35243518 }
35253519 }
35263520 return 0;
@@ -3662,28 +3656,24 @@ static int resp_write_scat(struct scsi_cmnd *scp, · 135 unmodified lines
36623656 "%s: write: cdb indicated=%u, IO sent=%d bytes\n",
36633657 my_name, num_by, ret);
36643658
3665− if (unlikely(sdebug_any_injecting_opt)) {
3666− struct sdebug_queued_cmd *sqcp =
3667− (struct sdebug_queued_cmd *)scp->host_scribble;
3668−
3669− if (sqcp) {
3670− if (sqcp->inj_recovered) {
3671− mk_sense_buffer(scp, RECOVERED_ERROR,
3672− THRESHOLD_EXCEEDED, 0);
3673− ret = illegal_condition_result;
3674− goto err_out_unlock;
3675− } else if (sqcp->inj_dif) {
3676− /* Logical block guard check failed */
3677− mk_sense_buffer(scp, ABORTED_COMMAND,
3678− 0x10, 1);
3679− ret = illegal_condition_result;
3680− goto err_out_unlock;
3681− } else if (sqcp->inj_dix) {
3682− mk_sense_buffer(scp, ILLEGAL_REQUEST,
3683− 0x10, 1);
3684− ret = illegal_condition_result;
3685− goto err_out_unlock;
3686− }
3659+ if (unlikely((sdebug_opts & SDEBUG_OPT_RECOV_DIF_DIX) &&
3660+ atomic_read(&sdeb_inject_pending))) {
3661+ if (sdebug_opts & SDEBUG_OPT_RECOVERED_ERR) {
3662+ mk_sense_buffer(scp, RECOVERED_ERROR, THRESHOLD_EXCEEDED, 0);
3663+ atomic_set(&sdeb_inject_pending, 0);
3664+ ret = check_condition_result;
3665+ goto err_out_unlock;
3666+ } else if (sdebug_opts & SDEBUG_OPT_DIF_ERR) {
3667+ /* Logical block guard check failed */
3668+ mk_sense_buffer(scp, ABORTED_COMMAND, 0x10, 1);
3669+ atomic_set(&sdeb_inject_pending, 0);
3670+ ret = illegal_condition_result;
3671+ goto err_out_unlock;
3672+ } else if (sdebug_opts & SDEBUG_OPT_DIX_ERR) {
3673+ mk_sense_buffer(scp, ILLEGAL_REQUEST, 0x10, 1);
3674+ atomic_set(&sdeb_inject_pending, 0);
3675+ ret = illegal_condition_result;
3676+ goto err_out_unlock;
36873677 }
36883678 }
36893679 sg_off += num_by;
@@ -4049,7 +4039,7 @@ static int resp_sync_cache(struct scsi_cmnd *scp, · 359 unmodified lines
40494039 mk_sense_buffer(scp, ILLEGAL_REQUEST, LBA_OUT_OF_RANGE, 0);
40504040 return check_condition_result;
40514041 }
4052− if (!write_since_sync || cmd[1] & 0x2)
4042+ if (!write_since_sync || (cmd[1] & 0x2))
40534043 res = SDEG_RES_IMMED_MASK;
40544044 else /* delay if write_since_sync and IMMED clear */
40554045 write_since_sync = false;
@@ -4707,15 +4697,28 @@ fini: · 651 unmodified lines
47074697
47084698 static struct sdebug_queue *get_queue(struct scsi_cmnd *cmnd)
47094699 {
4710− u32 tag = blk_mq_unique_tag(cmnd->request);
4711− u16 hwq = blk_mq_unique_tag_to_hwq(tag);
4700+ u16 hwq;
47124701
4713− pr_debug("tag=%#x, hwq=%d\n", tag, hwq);
4714− if (WARN_ON_ONCE(hwq >= submit_queues))
4715− hwq = 0;
4702+ if (sdebug_host_max_queue) {
4703+ /* Provide a simple method to choose the hwq */
4704+ hwq = smp_processor_id() % submit_queues;
4705+ } else {
4706+ u32 tag = blk_mq_unique_tag(cmnd->request);
4707+
4708+ hwq = blk_mq_unique_tag_to_hwq(tag);
4709+
4710+ pr_debug("tag=%#x, hwq=%d\n", tag, hwq);
4711+ if (WARN_ON_ONCE(hwq >= submit_queues))
4712+ hwq = 0;
4713+ }
47164714 return sdebug_q_arr + hwq;
47174715 }
47184716
4717+static u32 get_tag(struct scsi_cmnd *cmnd)
4718+{
4719+ return blk_mq_unique_tag(cmnd->request);
4720+}
4721+
47194722 /* Queued (deferred) command completions converge here. */
47204723 static void sdebug_q_cmd_complete(struct sdebug_defer *sd_dp)
47214724 {
@@ -4747,8 +4750,8 @@ static void sdebug_q_cmd_complete(struct sdebug_defer *sd_dp) · 25 unmodified lines
47474750 scp = sqcp->a_cmnd;
47484751 if (unlikely(scp == NULL)) {
47494752 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
4750− pr_err("scp is NULL, sqa_idx=%d, qc_idx=%d\n",
4751− sd_dp->sqa_idx, qc_idx);
4753+ pr_err("scp is NULL, sqa_idx=%d, qc_idx=%d, hc_idx=%d\n",
4754+ sd_dp->sqa_idx, qc_idx, sd_dp->hc_idx);
47524755 return;
47534756 }
47544757 devip = (struct sdebug_dev_info *)scp->device->hostdata;
@@ -4925,6 +4928,8 @@ static struct sdebug_dev_info *sdebug_device_create( · 170 unmodified lines
49254928 devip->zmodel = BLK_ZONED_NONE;
49264929 }
49274930 devip->sdbg_host = sdbg_host;
4931+ devip->create_ts = ktime_get_boottime();
4932+ atomic_set(&devip->stopped, (sdeb_tur_ms_to_ready > 0 ? 2 : 0));
49284933 list_add_tail(&devip->dev_list, &sdbg_host->dev_info_list);
49294934 }
49304935 return devip;
@@ -5333,24 +5338,11 @@ static void clear_queue_stats(void) · 402 unmodified lines
53335338 atomic_set(&sdebug_a_tsf, 0);
53345339 }
53355340
5336−static void setup_inject(struct sdebug_queue *sqp,
5337− struct sdebug_queued_cmd *sqcp)
5341+static bool inject_on_this_cmd(void)
53385342 {
5339− if ((atomic_read(&sdebug_cmnd_count) % abs(sdebug_every_nth)) > 0) {
5340− if (sdebug_every_nth > 0)
5341− sqcp->inj_recovered = sqcp->inj_transport
5342− = sqcp->inj_dif
5343− = sqcp->inj_dix = sqcp->inj_short
5344− = sqcp->inj_host_busy = sqcp->inj_cmd_abort = 0;
5345− return;
5346− }
5347− sqcp->inj_recovered = !!(SDEBUG_OPT_RECOVERED_ERR & sdebug_opts);
5348− sqcp->inj_transport = !!(SDEBUG_OPT_TRANSPORT_ERR & sdebug_opts);
5349− sqcp->inj_dif = !!(SDEBUG_OPT_DIF_ERR & sdebug_opts);
5350− sqcp->inj_dix = !!(SDEBUG_OPT_DIX_ERR & sdebug_opts);
5351− sqcp->inj_short = !!(SDEBUG_OPT_SHORT_TRANSFER & sdebug_opts);
5352− sqcp->inj_host_busy = !!(SDEBUG_OPT_HOST_BUSY & sdebug_opts);
5353− sqcp->inj_cmd_abort = !!(SDEBUG_OPT_CMD_ABORT & sdebug_opts);
5343+ if (sdebug_every_nth == 0)
5344+ return false;
5345+ return (atomic_read(&sdebug_cmnd_count) % abs(sdebug_every_nth)) == 0;
53545346 }
53555347
53565348 #define INCLUSIVE_TIMING_MAX_NS 1000000 /* 1 millisecond */
@@ -5367,7 +5359,8 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, · 10 unmodified lines
53675359 int delta_jiff, int ndelay)
53685360 {
53695361 bool new_sd_dp;
5370− int k, num_in_q, qdepth, inject;
5362+ bool inject = false;
5363+ int k, num_in_q, qdepth;
53715364 unsigned long iflags;
53725365 u64 ns_from_boot = 0;
53735366 struct sdebug_queue *sqp;
@@ -5393,7 +5386,6 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, · 19 unmodified lines
53935386 }
53945387 num_in_q = atomic_read(&devip->num_in_q);
53955388 qdepth = cmnd->device->queue_depth;
5396− inject = 0;
53975389 if (unlikely((qdepth > 0) && (num_in_q >= qdepth))) {
53985390 if (scsi_result) {
53995391 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
@@ -5407,7 +5399,7 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, · 7 unmodified lines
54075399 (atomic_inc_return(&sdebug_a_tsf) >=
54085400 abs(sdebug_every_nth))) {
54095401 atomic_set(&sdebug_a_tsf, 0);
5410− inject = 1;
5402+ inject = true;
54115403 scsi_result = device_qfull_result;
54125404 }
54135405 }
@@ -5430,35 +5422,47 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, · 16 unmodified lines
54305422 else
54315423 return SCSI_MLQUEUE_HOST_BUSY;
54325424 }
5433− __set_bit(k, sqp->in_use_bm);
5425+ set_bit(k, sqp->in_use_bm);
54345426 atomic_inc(&devip->num_in_q);
54355427 sqcp = &sqp->qc_arr[k];
54365428 sqcp->a_cmnd = cmnd;
54375429 cmnd->host_scribble = (unsigned char *)sqcp;
54385430 sd_dp = sqcp->sd_dp;
54395431 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
5440− if (unlikely(sdebug_every_nth && sdebug_any_injecting_opt))
5441− setup_inject(sqp, sqcp);
5442− if (sd_dp == NULL) {
5432+ if (!sd_dp) {
54435433 sd_dp = kzalloc(sizeof(*sd_dp), GFP_ATOMIC);
5444− if (sd_dp == NULL)
5434+ if (!sd_dp) {
5435+ atomic_dec(&devip->num_in_q);
5436+ clear_bit(k, sqp->in_use_bm);
54455437 return SCSI_MLQUEUE_HOST_BUSY;
5438+ }
54465439 new_sd_dp = true;
54475440 } else {
54485441 new_sd_dp = false;
54495442 }
54505443
5444+ /* Set the hostwide tag */
5445+ if (sdebug_host_max_queue)
5446+ sd_dp->hc_idx = get_tag(cmnd);
5447+
54515448 if (ndelay > 0 && ndelay < INCLUSIVE_TIMING_MAX_NS)
54525449 ns_from_boot = ktime_get_boottime_ns();
54535450
54545451 /* one of the resp_*() response functions is called here */
5455− cmnd->result = pfp != NULL ? pfp(cmnd, devip) : 0;
5452+ cmnd->result = pfp ? pfp(cmnd, devip) : 0;
54565453 if (cmnd->result & SDEG_RES_IMMED_MASK) {
54575454 cmnd->result &= ~SDEG_RES_IMMED_MASK;
54585455 delta_jiff = ndelay = 0;
54595456 }
54605457 if (cmnd->result == 0 && scsi_result != 0)
54615458 cmnd->result = scsi_result;
5459+ if (cmnd->result == 0 && unlikely(sdebug_opts & SDEBUG_OPT_TRANSPORT_ERR)) {
5460+ if (atomic_read(&sdeb_inject_pending)) {
5461+ mk_sense_buffer(cmnd, ABORTED_COMMAND, TRANSPORT_PROBLEM, ACK_NAK_TO);
5462+ atomic_set(&sdeb_inject_pending, 0);
5463+ cmnd->result = check_condition_result;
5464+ }
5465+ }
54625466
54635467 if (unlikely(sdebug_verbose && cmnd->result))
54645468 sdev_printk(KERN_INFO, sdp, "%s: non-zero result=0x%x\n",
@@ -5524,21 +5528,20 @@ static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, · 59 unmodified lines
55245528 if (sdebug_statistics)
55255529 sd_dp->issuing_cpu = raw_smp_processor_id();
55265530 sd_dp->defer_t = SDEB_DEFER_WQ;
5527− if (unlikely(sqcp->inj_cmd_abort))
5531+ if (unlikely((sdebug_opts & SDEBUG_OPT_CMD_ABORT) &&
5532+ atomic_read(&sdeb_inject_pending)))
55285533 sd_dp->aborted = true;
55295534 schedule_work(&sd_dp->ew.work);
5530− if (unlikely(sqcp->inj_cmd_abort)) {
5531− sdev_printk(KERN_INFO, sdp, "abort request tag %d\n",
5532− cmnd->request->tag);
5535+ if (unlikely((sdebug_opts & SDEBUG_OPT_CMD_ABORT) &&
5536+ atomic_read(&sdeb_inject_pending))) {
5537+ sdev_printk(KERN_INFO, sdp, "abort request tag %d\n", cmnd->request->tag);
55335538 blk_abort_request(cmnd->request);
5539+ atomic_set(&sdeb_inject_pending, 0);
55345540 }
55355541 }
5536− if (unlikely((SDEBUG_OPT_Q_NOISE & sdebug_opts) &&
5537− (scsi_result == device_qfull_result)))
5538− sdev_printk(KERN_INFO, sdp,
5539− "%s: num_in_q=%d +1, %s%s\n", __func__,
5540− num_in_q, (inject ? "<inject> " : ""),
5541− "status: TASK SET FULL");
5542+ if (unlikely((SDEBUG_OPT_Q_NOISE & sdebug_opts) && scsi_result == device_qfull_result))
5543+ sdev_printk(KERN_INFO, sdp, "%s: num_in_q=%d +1, %s%s\n", __func__,
5544+ num_in_q, (inject ? "<inject> " : ""), "status: TASK SET FULL");
55425545 return 0;
55435546
55445547 respond_in_thread: /* call back to mid-layer using invocation thread */
@@ -5569,6 +5572,7 @@ module_param_named(every_nth, sdebug_every_nth, int, S_IRUGO | S_IWUSR); · 24 unmodified lines
55695572 module_param_named(fake_rw, sdebug_fake_rw, int, S_IRUGO | S_IWUSR);
55705573 module_param_named(guard, sdebug_guard, uint, S_IRUGO);
55715574 module_param_named(host_lock, sdebug_host_lock, bool, S_IRUGO | S_IWUSR);
5575+module_param_named(host_max_queue, sdebug_host_max_queue, int, S_IRUGO);
55725576 module_param_string(inq_product, sdebug_inq_product_id,
55735577 sizeof(sdebug_inq_product_id), S_IRUGO | S_IWUSR);
55745578 module_param_string(inq_rev, sdebug_inq_product_rev,
@@ -5605,6 +5609,7 @@ module_param_named(sector_size, sdebug_sector_size, int, S_IRUGO); · 30 unmodified lines
56055609 module_param_named(statistics, sdebug_statistics, bool, S_IRUGO | S_IWUSR);
56065610 module_param_named(strict, sdebug_strict, bool, S_IRUGO | S_IWUSR);
56075611 module_param_named(submit_queues, submit_queues, int, S_IRUGO);
5612+module_param_named(tur_ms_to_ready, sdeb_tur_ms_to_ready, int, S_IRUGO);
56085613 module_param_named(unmap_alignment, sdebug_unmap_alignment, int, S_IRUGO);
56095614 module_param_named(unmap_granularity, sdebug_unmap_granularity, int, S_IRUGO);
56105615 module_param_named(unmap_max_blocks, sdebug_unmap_max_blocks, int, S_IRUGO);
@@ -5639,6 +5644,8 @@ MODULE_PARM_DESC(every_nth, "timeout every nth command(def=0)"); · 28 unmodified lines
56395644 MODULE_PARM_DESC(fake_rw, "fake reads/writes instead of copying (def=0)");
56405645 MODULE_PARM_DESC(guard, "protection checksum: 0=crc, 1=ip (def=0)");
56415646 MODULE_PARM_DESC(host_lock, "host_lock is ignored (def=0)");
5647+MODULE_PARM_DESC(host_max_queue,
5648+ "host max # of queued cmds (0 to max(def) [max_queue fixed equal for !0])");
56425649 MODULE_PARM_DESC(inq_product, "SCSI INQUIRY product string (def=\"scsi_debug\")");
56435650 MODULE_PARM_DESC(inq_rev, "SCSI INQUIRY revision string (def=\""
56445651 SDEBUG_VERSION "\")");
@@ -5671,6 +5678,7 @@ MODULE_PARM_DESC(sector_size, "logical block size in bytes (def=512)"); · 26 unmodified lines
56715678 MODULE_PARM_DESC(statistics, "collect statistics on commands, queues (def=0)");
56725679 MODULE_PARM_DESC(strict, "stricter checks: reserved field in cdb (def=0)");
56735680 MODULE_PARM_DESC(submit_queues, "support for block multi-queue (def=1)");
5681+MODULE_PARM_DESC(tur_ms_to_ready, "TEST UNIT READY millisecs before initial good status (def=0)");
56745682 MODULE_PARM_DESC(unmap_alignment, "lowest aligned thin provisioning lba (def=0)");
56755683 MODULE_PARM_DESC(unmap_granularity, "thin provisioning granularity in blocks (def=1)");
56765684 MODULE_PARM_DESC(unmap_max_blocks, "max # of blocks can be unmapped in one cmd (def=0xffffffff)");
@@ -6072,17 +6080,27 @@ static ssize_t every_nth_store(struct device_driver *ddp, const char *buf, · 395 unmodified lines
60726080 size_t count)
60736081 {
60746082 int nth;
6083+ char work[20];
60756084
6076− if ((count > 0) && (1 == sscanf(buf, "%d", &nth))) {
6077− sdebug_every_nth = nth;
6078− if (nth && !sdebug_statistics) {
6079− pr_info("every_nth needs statistics=1, set it\n");
6080− sdebug_statistics = true;
6085+ if (sscanf(buf, "%10s", work) == 1) {
6086+ if (strncasecmp(work, "0x", 2) == 0) {
6087+ if (kstrtoint(work + 2, 16, &nth) == 0)
6088+ goto every_nth_done;
6089+ } else {
6090+ if (kstrtoint(work, 10, &nth) == 0)
6091+ goto every_nth_done;
60816092 }
6082− tweak_cmnd_count();
6083− return count;
60846093 }
60856094 return -EINVAL;
6095+
6096+every_nth_done:
6097+ sdebug_every_nth = nth;
6098+ if (nth && !sdebug_statistics) {
6099+ pr_info("every_nth needs statistics=1, set it\n");
6100+ sdebug_statistics = true;
6101+ }
6102+ tweak_cmnd_count();
6103+ return count;
60866104 }
60876105 static DRIVER_ATTR_RW(every_nth);
60886106
@@ -6138,7 +6156,8 @@ static ssize_t max_queue_store(struct device_driver *ddp, const char *buf, · 49 unmodified lines
61386156 struct sdebug_queue *sqp;
61396157
61406158 if ((count > 0) && (1 == sscanf(buf, "%d", &n)) && (n > 0) &&
6141− (n <= SDEBUG_CANQUEUE)) {
6159+ (n <= SDEBUG_CANQUEUE) &&
6160+ (sdebug_host_max_queue == 0)) {
61426161 block_unblock_all_queues(true);
61436162 k = 0;
61446163 for (j = 0, sqp = sdebug_q_arr; j < submit_queues;
@@ -6161,6 +6180,17 @@ static ssize_t max_queue_store(struct device_driver *ddp, const char *buf, · 16 unmodified lines
61616180 }
61626181 static DRIVER_ATTR_RW(max_queue);
61636182
6183+static ssize_t host_max_queue_show(struct device_driver *ddp, char *buf)
6184+{
6185+ return scnprintf(buf, PAGE_SIZE, "%d\n", sdebug_host_max_queue);
6186+}
6187+
6188+/*
6189+ * Since this is used for .can_queue, and we get the hc_idx tag from the bitmap
6190+ * in range [0, sdebug_host_max_queue), we can't change it.
6191+ */
6192+static DRIVER_ATTR_RO(host_max_queue);
6193+
61646194 static ssize_t no_uld_show(struct device_driver *ddp, char *buf)
61656195 {
61666196 return scnprintf(buf, PAGE_SIZE, "%d\n", sdebug_no_uld);
@@ -6487,6 +6517,12 @@ static ssize_t zbc_show(struct device_driver *ddp, char *buf) · 320 unmodified lines
64876517 }
64886518 static DRIVER_ATTR_RO(zbc);
64896519
6520+static ssize_t tur_ms_to_ready_show(struct device_driver *ddp, char *buf)
6521+{
6522+ return scnprintf(buf, PAGE_SIZE, "%d\n", sdeb_tur_ms_to_ready);
6523+}
6524+static DRIVER_ATTR_RO(tur_ms_to_ready);
6525+
64906526 /* Note: The following array creates attribute files in the
64916527 /sys/bus/pseudo/drivers/scsi_debug directory. The advantage of these
64926528 files (over those found in the /sys/module/scsi_debug/parameters
@@ -6500,6 +6536,7 @@ static struct attribute *sdebug_drv_attrs[] = { · 7 unmodified lines
65006536 &driver_attr_ptype.attr,
65016537 &driver_attr_dsense.attr,
65026538 &driver_attr_fake_rw.attr,
6539+ &driver_attr_host_max_queue.attr,
65036540 &driver_attr_no_lun_0.attr,
65046541 &driver_attr_num_tgts.attr,
65056542 &driver_attr_dev_size_mb.attr,
@@ -6528,6 +6565,7 @@ static struct attribute *sdebug_drv_attrs[] = { · 22 unmodified lines
65286565 &driver_attr_strict.attr,
65296566 &driver_attr_uuid_ctl.attr,
65306567 &driver_attr_cdb_len.attr,
6568+ &driver_attr_tur_ms_to_ready.attr,
65316569 &driver_attr_zbc.attr,
65326570 NULL,
65336571 };
@@ -6610,6 +6648,26 @@ static int __init scsi_debug_init(void) · 76 unmodified lines
66106648 pr_err("submit_queues must be 1 or more\n");
66116649 return -EINVAL;
66126650 }
6651+
6652+ if ((sdebug_max_queue > SDEBUG_CANQUEUE) || (sdebug_max_queue < 1)) {
6653+ pr_err("max_queue must be in range [1, %d]\n", SDEBUG_CANQUEUE);
6654+ return -EINVAL;
6655+ }
6656+
6657+ if ((sdebug_host_max_queue > SDEBUG_CANQUEUE) ||
6658+ (sdebug_host_max_queue < 0)) {
6659+ pr_err("host_max_queue must be in range [0 %d]\n",
6660+ SDEBUG_CANQUEUE);
6661+ return -EINVAL;
6662+ }
6663+
6664+ if (sdebug_host_max_queue &&
6665+ (sdebug_max_queue != sdebug_host_max_queue)) {
6666+ sdebug_max_queue = sdebug_host_max_queue;
6667+ pr_warn("fixing max submit queue depth to host max queue depth, %d\n",
6668+ sdebug_max_queue);
6669+ }
6670+
66136671 sdebug_q_arr = kcalloc(submit_queues, sizeof(struct sdebug_queue),
66146672 GFP_KERNEL);
66156673 if (sdebug_q_arr == NULL)
@@ -7044,10 +7102,47 @@ static bool fake_timeout(struct scsi_cmnd *scp) · 428 unmodified lines
70447102 return false;
70457103 }
70467104
7047−static bool fake_host_busy(struct scsi_cmnd *scp)
7105+/* Response to TUR or media access command when device stopped */
7106+static int resp_not_ready(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
70487107 {
7049− return (sdebug_opts & SDEBUG_OPT_HOST_BUSY) &&
7050− (atomic_read(&sdebug_cmnd_count) % abs(sdebug_every_nth)) == 0;
7108+ int stopped_state;
7109+ u64 diff_ns = 0;
7110+ ktime_t now_ts = ktime_get_boottime();
7111+ struct scsi_device *sdp = scp->device;
7112+
7113+ stopped_state = atomic_read(&devip->stopped);
7114+ if (stopped_state == 2) {
7115+ if (ktime_to_ns(now_ts) > ktime_to_ns(devip->create_ts)) {
7116+ diff_ns = ktime_to_ns(ktime_sub(now_ts, devip->create_ts));
7117+ if (diff_ns >= ((u64)sdeb_tur_ms_to_ready * 1000000)) {
7118+ /* tur_ms_to_ready timer extinguished */
7119+ atomic_set(&devip->stopped, 0);
7120+ return 0;
7121+ }
7122+ }
7123+ mk_sense_buffer(scp, NOT_READY, LOGICAL_UNIT_NOT_READY, 0x1);
7124+ if (sdebug_verbose)
7125+ sdev_printk(KERN_INFO, sdp,
7126+ "%s: Not ready: in process of becoming ready\n", my_name);
7127+ if (scp->cmnd[0] == TEST_UNIT_READY) {
7128+ u64 tur_nanosecs_to_ready = (u64)sdeb_tur_ms_to_ready * 1000000;
7129+
7130+ if (diff_ns <= tur_nanosecs_to_ready)
7131+ diff_ns = tur_nanosecs_to_ready - diff_ns;
7132+ else
7133+ diff_ns = tur_nanosecs_to_ready;
7134+ /* As per 20-061r2 approved for spc6 by T10 on 20200716 */
7135+ do_div(diff_ns, 1000000); /* diff_ns becomes milliseconds */
7136+ scsi_set_sense_information(scp->sense_buffer, SCSI_SENSE_BUFFERSIZE,
7137+ diff_ns);
7138+ return check_condition_result;
7139+ }
7140+ }
7141+ mk_sense_buffer(scp, NOT_READY, LOGICAL_UNIT_NOT_READY, 0x2);
7142+ if (sdebug_verbose)
7143+ sdev_printk(KERN_INFO, sdp, "%s: Not ready: initializing command required\n",
7144+ my_name);
7145+ return check_condition_result;
70517146 }
70527147
70537148 static int scsi_debug_queuecommand(struct Scsi_Host *shost,
@@ -7058,7 +7153,6 @@ static int scsi_debug_queuecommand(struct Scsi_Host *shost, · 4 unmodified lines
70587153 const struct opcode_info_t *oip;
70597154 const struct opcode_info_t *r_oip;
70607155 struct sdebug_dev_info *devip;
7061−
70627156 u8 *cmd = scp->cmnd;
70637157 int (*r_pfp)(struct scsi_cmnd *, struct sdebug_dev_info *);
70647158 int (*pfp)(struct scsi_cmnd *, struct sdebug_dev_info *) = NULL;
@@ -7068,10 +7162,15 @@ static int scsi_debug_queuecommand(struct Scsi_Host *shost, · 3 unmodified lines
70687162 u16 sa;
70697163 u8 opcode = cmd[0];
70707164 bool has_wlun_rl;
7165+ bool inject_now;
70717166
70727167 scsi_set_resid(scp, 0);
7073− if (sdebug_statistics)
7168+ if (sdebug_statistics) {
70747169 atomic_inc(&sdebug_cmnd_count);
7170+ inject_now = inject_on_this_cmd();
7171+ } else {
7172+ inject_now = false;
7173+ }
70757174 if (unlikely(sdebug_verbose &&
70767175 !(SDEBUG_OPT_NO_CDB_NOISE & sdebug_opts))) {
70777176 char b[120];
@@ -7089,7 +7188,7 @@ static int scsi_debug_queuecommand(struct Scsi_Host *shost, · 11 unmodified lines
70897188 sdev_printk(KERN_INFO, sdp, "%s: tag=%#x, cmd %s\n", my_name,
70907189 blk_mq_unique_tag(scp->request), b);
70917190 }
7092− if (fake_host_busy(scp))
7191+ if (unlikely(inject_now && (sdebug_opts & SDEBUG_OPT_HOST_BUSY)))
70937192 return SCSI_MLQUEUE_HOST_BUSY;
70947193 has_wlun_rl = (sdp->lun == SCSI_W_LUN_REPORT_LUNS);
70957194 if (unlikely((sdp->lun >= sdebug_max_luns) && !has_wlun_rl))
@@ -7103,6 +7202,9 @@ static int scsi_debug_queuecommand(struct Scsi_Host *shost, · 7 unmodified lines
71037202 if (NULL == devip)
71047203 goto err_out;
71057204 }
7205+ if (unlikely(inject_now && !atomic_read(&sdeb_inject_pending)))
7206+ atomic_set(&sdeb_inject_pending, 1);
7207+
71067208 na = oip->num_attached;
71077209 r_pfp = oip->pfp;
71087210 if (na) { /* multiple commands with this opcode */
@@ -7167,14 +7269,11 @@ static int scsi_debug_queuecommand(struct Scsi_Host *shost, · 58 unmodified lines
71677269 if (errsts)
71687270 goto check_cond;
71697271 }
7170− if (unlikely((F_M_ACCESS & flags) && atomic_read(&devip->stopped))) {
7171− mk_sense_buffer(scp, NOT_READY, LOGICAL_UNIT_NOT_READY, 0x2);
7172− if (sdebug_verbose)
7173− sdev_printk(KERN_INFO, sdp, "%s reports: Not ready: "
7174− "%s\n", my_name, "initializing command "
7175− "required");
7176− errsts = check_condition_result;
7177− goto fini;
7272+ if (unlikely(((F_M_ACCESS & flags) || scp->cmnd[0] == TEST_UNIT_READY) &&
7273+ atomic_read(&devip->stopped))) {
7274+ errsts = resp_not_ready(scp, devip);
7275+ if (errsts)
7276+ goto fini;
71787277 }
71797278 if (sdebug_fake_rw && (F_FAKE_RW & flags))
71807279 goto fini;
@@ -7248,7 +7347,10 @@ static int sdebug_driver_probe(struct device *dev) · 67 unmodified lines
72487347
72497348 sdbg_host = to_sdebug_host(dev);
72507349
7251− sdebug_driver_template.can_queue = sdebug_max_queue;
7350+ if (sdebug_host_max_queue)
7351+ sdebug_driver_template.can_queue = sdebug_host_max_queue;
7352+ else
7353+ sdebug_driver_template.can_queue = sdebug_max_queue;
72527354 if (!sdebug_clustering)
72537355 sdebug_driver_template.dma_boundary = PAGE_SIZE - 1;
72547356
@@ -7263,9 +7365,13 @@ static int sdebug_driver_probe(struct device *dev) · 8 unmodified lines
72637365 my_name, submit_queues, nr_cpu_ids);
72647366 submit_queues = nr_cpu_ids;
72657367 }
7266− /* Decide whether to tell scsi subsystem that we want mq */
7267− /* Following should give the same answer for each host */
7268− hpnt->nr_hw_queues = submit_queues;
7368+ /*
7369+ * Decide whether to tell scsi subsystem that we want mq. The
7370+ * following should give the same answer for each host. If the host
7371+ * has a limit of hostwide max commands, then do not set.
7372+ */
7373+ if (!sdebug_host_max_queue)
7374+ hpnt->nr_hw_queues = submit_queues;
72697375
72707376 sdbg_host->shost = hpnt;
72717377 *((struct sdebug_host_info **)hpnt->hostdata) = sdbg_host;
drivers/scsi/scsi_lib.c+24−38
@@ -52,7 +52,6 @@ · 51 unmodified lines
5252 #define SCSI_INLINE_SG_CNT 2
5353 #endif
5454
55−static struct kmem_cache *scsi_sdb_cache;
5655 static struct kmem_cache *scsi_sense_cache;
5756 static struct kmem_cache *scsi_sense_isadma_cache;
5857 static DEFINE_MUTEX(scsi_sense_cache_mutex);
@@ -390,7 +389,7 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev) · 331 unmodified lines
390389 spin_unlock_irqrestore(shost->host_lock, flags);
391390 scsi_kick_queue(sdev->request_queue);
392391 spin_lock_irqsave(shost->host_lock, flags);
393−
392+
394393 scsi_device_put(sdev);
395394 }
396395 out:
@@ -1461,18 +1460,18 @@ static void scsi_softirq_done(struct request *rq) · 1064 unmodified lines
14611460 scsi_log_completion(cmd, disposition);
14621461
14631462 switch (disposition) {
1464− case SUCCESS:
1465− scsi_finish_command(cmd);
1466− break;
1467− case NEEDS_RETRY:
1468− scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY);
1469− break;
1470− case ADD_TO_MLQUEUE:
1471− scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
1472− break;
1473− default:
1474− scsi_eh_scmd_add(cmd);
1475− break;
1463+ case SUCCESS:
1464+ scsi_finish_command(cmd);
1465+ break;
1466+ case NEEDS_RETRY:
1467+ scsi_queue_insert(cmd, SCSI_MLQUEUE_EH_RETRY);
1468+ break;
1469+ case ADD_TO_MLQUEUE:
1470+ scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
1471+ break;
1472+ default:
1473+ scsi_eh_scmd_add(cmd);
1474+ break;
14761475 }
14771476 }
14781477
@@ -1953,24 +1952,10 @@ void scsi_unblock_requests(struct Scsi_Host *shost) · 474 unmodified lines
19531952 }
19541953 EXPORT_SYMBOL(scsi_unblock_requests);
19551954
1956−int __init scsi_init_queue(void)
1957−{
1958− scsi_sdb_cache = kmem_cache_create("scsi_data_buffer",
1959− sizeof(struct scsi_data_buffer),
1960− 0, 0, NULL);
1961− if (!scsi_sdb_cache) {
1962− printk(KERN_ERR "SCSI: can't init scsi sdb cache\n");
1963− return -ENOMEM;
1964− }
1965−
1966− return 0;
1967−}
1968−
19691955 void scsi_exit_queue(void)
19701956 {
19711957 kmem_cache_destroy(scsi_sense_cache);
19721958 kmem_cache_destroy(scsi_sense_isadma_cache);
1973− kmem_cache_destroy(scsi_sdb_cache);
19741959 }
19751960
19761961 /**
@@ -2037,7 +2022,6 @@ scsi_mode_select(struct scsi_device *sdev, int pf, int sp, int modepage, · 60 unmodified lines
20372022 real_buffer[1] = data->medium_type;
20382023 real_buffer[2] = data->device_specific;
20392024 real_buffer[3] = data->block_descriptor_length;
2040−
20412025
20422026 cmd[0] = MODE_SELECT;
20432027 cmd[4] = len;
@@ -2123,7 +2107,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, · 79 unmodified lines
21232107 if (scsi_sense_valid(sshdr)) {
21242108 if ((sshdr->sense_key == ILLEGAL_REQUEST) &&
21252109 (sshdr->asc == 0x20) && (sshdr->ascq == 0)) {
2126− /*
2110+ /*
21272111 * Invalid command operation code
21282112 */
21292113 sdev->use_10_for_ms = 0;
@@ -2132,7 +2116,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, · 2 unmodified lines
21322116 }
21332117 }
21342118
2135− if(scsi_status_is_good(result)) {
2119+ if (scsi_status_is_good(result)) {
21362120 if (unlikely(buffer[0] == 0x86 && buffer[1] == 0x0b &&
21372121 (modepage == 6 || modepage == 8))) {
21382122 /* Initio breakage? */
@@ -2142,7 +2126,7 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage, · 3 unmodified lines
21422126 data->device_specific = 0;
21432127 data->longlba = 0;
21442128 data->block_descriptor_length = 0;
2145− } else if(use_10_for_ms) {
2129+ } else if (use_10_for_ms) {
21462130 data->length = buffer[0]*256 + buffer[1] + 2;
21472131 data->medium_type = buffer[2];
21482132 data->device_specific = buffer[3];
@@ -2225,7 +2209,7 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) · 76 unmodified lines
22252209 goto illegal;
22262210 }
22272211 break;
2228−
2212+
22292213 case SDEV_RUNNING:
22302214 switch (oldstate) {
22312215 case SDEV_CREATED:
@@ -2510,7 +2494,7 @@ EXPORT_SYMBOL_GPL(sdev_evt_send_simple); · 278 unmodified lines
25102494 * (which must be a legal transition). When the device is in this
25112495 * state, only special requests will be accepted, all others will
25122496 * be deferred. Since special requests may also be requeued requests,
2513− * a successful return doesn't guarantee the device will be
2497+ * a successful return doesn't guarantee the device will be
25142498 * totally quiescent.
25152499 *
25162500 * Must be called with user context, may sleep.
@@ -2636,10 +2620,10 @@ int scsi_internal_device_block_nowait(struct scsi_device *sdev) · 119 unmodified lines
26362620 return err;
26372621 }
26382622
2639− /*
2623+ /*
26402624 * The device has transitioned to SDEV_BLOCK. Stop the
26412625 * block layer from calling the midlayer with this device's
2642− * request queue.
2626+ * request queue.
26432627 */
26442628 blk_mq_quiesce_queue_nowait(q);
26452629 return 0;
@@ -2674,7 +2658,7 @@ static int scsi_internal_device_block(struct scsi_device *sdev) · 28 unmodified lines
26742658
26752659 return err;
26762660 }
2677−
2661+
26782662 void scsi_start_queue(struct scsi_device *sdev)
26792663 {
26802664 struct request_queue *q = sdev->request_queue;
@@ -2833,8 +2817,10 @@ scsi_host_block(struct Scsi_Host *shost) · 152 unmodified lines
28332817 mutex_lock(&sdev->state_mutex);
28342818 ret = scsi_internal_device_block_nowait(sdev);
28352819 mutex_unlock(&sdev->state_mutex);
2836− if (ret)
2820+ if (ret) {
2821+ scsi_device_put(sdev);
28372822 break;
2823+ }
28382824 }
28392825
28402826 /*
drivers/scsi/scsi_logging.c+2−6
@@ -205,13 +205,9 @@ void scsi_print_command(struct scsi_cmnd *cmd) · 204 unmodified lines
205205 /* Print opcode in one line and use separate lines for CDB */
206206 off += scnprintf(logbuf + off, logbuf_len - off, "\n");
207207 dev_printk(KERN_INFO, &cmd->device->sdev_gendev, "%s", logbuf);
208− scsi_log_release_buffer(logbuf);
209208 for (k = 0; k < cmd->cmd_len; k += 16) {
210209 size_t linelen = min(cmd->cmd_len - k, 16);
211210
212− logbuf = scsi_log_reserve_buffer(&logbuf_len);
213− if (!logbuf)
214− break;
215211 off = sdev_format_header(logbuf, logbuf_len,
216212 scmd_name(cmd),
217213 cmd->request->tag);
@@ -224,9 +220,8 @@ void scsi_print_command(struct scsi_cmnd *cmd) · 6 unmodified lines
224220 }
225221 dev_printk(KERN_INFO, &cmd->device->sdev_gendev, "%s",
226222 logbuf);
227− scsi_log_release_buffer(logbuf);
228223 }
229− return;
224+ goto out;
230225 }
231226 if (!WARN_ON(off > logbuf_len - 49)) {
232227 off += scnprintf(logbuf + off, logbuf_len - off, " ");
@@ -236,6 +231,7 @@ void scsi_print_command(struct scsi_cmnd *cmd) · 3 unmodified lines
236231 }
237232 out_printk:
238233 dev_printk(KERN_INFO, &cmd->device->sdev_gendev, "%s", logbuf);
234+out:
239235 scsi_log_release_buffer(logbuf);
240236 }
241237 EXPORT_SYMBOL(scsi_print_command);
drivers/scsi/scsi_pm.c+2−8
@@ -80,10 +80,6 @@ static int scsi_dev_type_resume(struct device *dev, · 79 unmodified lines
8080 dev_dbg(dev, "scsi resume: %d\n", err);
8181
8282 if (err == 0) {
83− bool was_runtime_suspended;
84−
85− was_runtime_suspended = pm_runtime_suspended(dev);
86−
8783 pm_runtime_disable(dev);
8884 err = pm_runtime_set_active(dev);
8985 pm_runtime_enable(dev);
@@ -97,10 +93,8 @@ static int scsi_dev_type_resume(struct device *dev, · 7 unmodified lines
9793 */
9894 if (!err && scsi_is_sdev_device(dev)) {
9995 struct scsi_device *sdev = to_scsi_device(dev);
100− if (was_runtime_suspended)
101− blk_post_runtime_resume(sdev->request_queue, 0);
102− else
103− blk_set_runtime_active(sdev->request_queue);
96+
97+ blk_set_runtime_active(sdev->request_queue);
10498 }
10599 }
106100
drivers/scsi/scsi_priv.h+0−1
@@ -93,7 +93,6 @@ extern struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev); · 92 unmodified lines
9393 extern void scsi_start_queue(struct scsi_device *sdev);
9494 extern int scsi_mq_setup_tags(struct Scsi_Host *shost);
9595 extern void scsi_mq_destroy_tags(struct Scsi_Host *shost);
96−extern int scsi_init_queue(void);
9796 extern void scsi_exit_queue(void);
9897 extern void scsi_evt_thread(struct work_struct *work);
9998 struct request_queue;
drivers/scsi/scsi_transport_iscsi.c+16−15
@@ -1623,7 +1623,6 @@ static DEFINE_MUTEX(rx_queue_mutex); · 1622 unmodified lines
16231623 static DEFINE_MUTEX(conn_mutex);
16241624
16251625 static LIST_HEAD(sesslist);
1626−static LIST_HEAD(sessdestroylist);
16271626 static DEFINE_SPINLOCK(sesslock);
16281627 static LIST_HEAD(connlist);
16291628 static LIST_HEAD(connlist_err);
@@ -1978,10 +1977,11 @@ void iscsi_unblock_session(struct iscsi_cls_session *session) · 348 unmodified lines
19781977 {
19791978 queue_work(iscsi_eh_timer_workq, &session->unblock_work);
19801979 /*
1981− * make sure all the events have completed before tell the driver
1982− * it is safe
1980+ * Blocking the session can be done from any context so we only
1981+ * queue the block work. Make sure the unblock work has completed
1982+ * because it flushes/cancels the other works and updates the state.
19831983 */
1984− flush_workqueue(iscsi_eh_timer_workq);
1984+ flush_work(&session->unblock_work);
19851985 }
19861986 EXPORT_SYMBOL_GPL(iscsi_unblock_session);
19871987
@@ -2036,11 +2036,11 @@ static void __iscsi_unbind_session(struct work_struct *work) · 48 unmodified lines
20362036 spin_unlock_irqrestore(&session->lock, flags);
20372037 mutex_unlock(&ihost->mutex);
20382038
2039+ scsi_remove_target(&session->dev);
2040+
20392041 if (session->ida_used)
20402042 ida_simple_remove(&iscsi_sess_ida, target_id);
20412043
2042− scsi_remove_target(&session->dev);
2043−
20442044 unbind_session_exit:
20452045 iscsi_session_event(session, ISCSI_KEVENT_UNBIND_SESSION);
20462046 ISCSI_DBG_TRANS_SESSION(session, "Completed target removal\n");
@@ -2202,14 +2202,13 @@ void iscsi_remove_session(struct iscsi_cls_session *session) · 155 unmodified lines
22022202 ISCSI_DBG_TRANS_SESSION(session, "Removing session\n");
22032203
22042204 spin_lock_irqsave(&sesslock, flags);
2205− list_del(&session->sess_list);
2205+ if (!list_empty(&session->sess_list))
2206+ list_del(&session->sess_list);
22062207 spin_unlock_irqrestore(&sesslock, flags);
22072208
2208− /* make sure there are no blocks/unblocks queued */
2209− flush_workqueue(iscsi_eh_timer_workq);
2210− /* make sure the timedout callout is not running */
2211− if (!cancel_delayed_work(&session->recovery_work))
2212− flush_workqueue(iscsi_eh_timer_workq);
2209+ flush_work(&session->block_work);
2210+ flush_work(&session->unblock_work);
2211+ cancel_delayed_work_sync(&session->recovery_work);
22132212 /*
22142213 * If we are blocked let commands flow again. The lld or iscsi
22152214 * layer should set up the queuecommand to fail commands.
@@ -3291,7 +3290,7 @@ static int iscsi_set_flashnode_param(struct iscsi_transport *transport, · 1075 unmodified lines
32913290 pr_err("%s could not find host no %u\n",
32923291 __func__, ev->u.set_flashnode.host_no);
32933292 err = -ENODEV;
3294− goto put_host;
3293+ goto exit_set_fnode;
32953294 }
32963295
32973296 idx = ev->u.set_flashnode.flashnode_idx;
@@ -3679,7 +3678,7 @@ iscsi_if_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, uint32_t *group) · 381 unmodified lines
36793678
36803679 /* Prevent this session from being found again */
36813680 spin_lock_irqsave(&sesslock, flags);
3682− list_move(&session->sess_list, &sessdestroylist);
3681+ list_del_init(&session->sess_list);
36833682 spin_unlock_irqrestore(&sesslock, flags);
36843683
36853684 queue_work(iscsi_destroy_workq, &session->destroy_work);
@@ -4766,7 +4765,9 @@ static __init int iscsi_transport_init(void) · 1080 unmodified lines
47664765 goto release_nls;
47674766 }
47684767
4769− iscsi_destroy_workq = create_singlethread_workqueue("iscsi_destroy");
4768+ iscsi_destroy_workq = alloc_workqueue("%s",
4769+ WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND,
4770+ 1, "iscsi_destroy");
47704771 if (!iscsi_destroy_workq) {
47714772 err = -ENOMEM;
47724773 goto destroy_wq;
drivers/scsi/scsi_transport_sas.c+1−1
@@ -563,7 +563,7 @@ show_sas_phy_enable(struct device *dev, struct device_attribute *attr, · 562 unmodified lines
563563 {
564564 struct sas_phy *phy = transport_class_to_phy(dev);
565565
566− return snprintf(buf, 20, "%d", phy->enabled);
566+ return snprintf(buf, 20, "%d\n", phy->enabled);
567567 }
568568
569569 static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, show_sas_phy_enable,
drivers/scsi/scsi_transport_srp.c+5−7
@@ -395,6 +395,10 @@ static void srp_reconnect_work(struct work_struct *work) · 394 unmodified lines
395395 }
396396 }
397397
398+/*
399+ * scsi_target_block() must have been called before this function is
400+ * called to guarantee that no .queuecommand() calls are in progress.
401+ */
398402 static void __rport_fail_io_fast(struct srp_rport *rport)
399403 {
400404 struct Scsi_Host *shost = rport_to_shost(rport);
@@ -404,11 +408,7 @@ static void __rport_fail_io_fast(struct srp_rport *rport) · 3 unmodified lines
404408
405409 if (srp_rport_set_state(rport, SRP_RPORT_FAIL_FAST))
406410 return;
407− /*
408− * Call scsi_target_block() to wait for ongoing shost->queuecommand()
409− * calls before invoking i->f->terminate_rport_io().
410− */
411− scsi_target_block(rport->dev.parent);
411+
412412 scsi_target_unblock(rport->dev.parent, SDEV_TRANSPORT_OFFLINE);
413413
414414 /* Involve the LLD if possible to terminate all I/O on the rport. */
@@ -570,8 +570,6 @@ int srp_reconnect_rport(struct srp_rport *rport) · 155 unmodified lines
570570 * failure timers if these had not yet been started.
571571 */
572572 __rport_fail_io_fast(rport);
573− scsi_target_unblock(&shost->shost_gendev,
574− SDEV_TRANSPORT_OFFLINE);
575573 __srp_start_tl_fail_timers(rport);

2 more lines aren’t shown here.

drivers/scsi/sd.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/scsi/sd.h+0−6

This diff is large: its 18 lines aren’t shown here.

drivers/scsi/sd_zbc.c+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/scsi/storvsc_drv.c+12−1

This diff is large: its 48 lines aren’t shown here.

drivers/scsi/sym53c8xx_2/sym_glue.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/scsi/sym53c8xx_2/sym_hipd.c+8−0

This diff is large: its 50 lines aren’t shown here.

drivers/scsi/ufs/Kconfig+22−0

This diff is large: its 33 lines aren’t shown here.

drivers/scsi/ufs/Makefile+5−1

This diff is large: its 16 lines aren’t shown here.

drivers/scsi/ufs/ufs-exynos.c+1297−0

This diff is large: its 1298 lines aren’t shown here.

drivers/scsi/ufs/ufs-exynos.h+287−0

This diff is large: its 288 lines aren’t shown here.

drivers/scsi/ufs/ufs-mediatek.c+112−28

This diff is large: its 270 lines aren’t shown here.

drivers/scsi/ufs/ufs-mediatek.h+3−1

This diff is large: its 25 lines aren’t shown here.

drivers/scsi/ufs/ufs-qcom-ice.c+245−0

This diff is large: its 246 lines aren’t shown here.

drivers/scsi/ufs/ufs-qcom.c+16−5

This diff is large: its 84 lines aren’t shown here.

drivers/scsi/ufs/ufs-qcom.h+27−0

This diff is large: its 39 lines aren’t shown here.

drivers/scsi/ufs/ufs.h+2−36

This diff is large: its 63 lines aren’t shown here.

drivers/scsi/ufs/ufs_bsg.c+2−3

This diff is large: its 16 lines aren’t shown here.

drivers/scsi/ufs/ufs_quirks.h+9−1

This diff is large: its 24 lines aren’t shown here.

drivers/scsi/ufs/ufshcd-crypto.c+245−0

This diff is large: its 246 lines aren’t shown here.

drivers/scsi/ufs/ufshcd-crypto.h+77−0

This diff is large: its 78 lines aren’t shown here.

drivers/scsi/ufs/ufshcd-pci.c+1−24

This diff is large: its 36 lines aren’t shown here.

drivers/scsi/ufs/ufshcd-pltfrm.c+1−26

This diff is large: its 38 lines aren’t shown here.

drivers/scsi/ufs/ufshcd.c+290−251

This diff is large: its 1063 lines aren’t shown here.

drivers/scsi/ufs/ufshcd.h+61−44

This diff is large: its 222 lines aren’t shown here.

drivers/scsi/ufs/ufshci.h+66−28

This diff is large: its 150 lines aren’t shown here.

drivers/scsi/ufs/unipro.h+33−0

This diff is large: its 54 lines aren’t shown here.

drivers/scsi/virtio_scsi.c+13−9

This diff is large: its 43 lines aren’t shown here.

drivers/target/iscsi/cxgbit/cxgbit.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/target/iscsi/cxgbit/cxgbit_cm.c+24−10

This diff is large: its 69 lines aren’t shown here.

drivers/target/iscsi/cxgbit/cxgbit_target.c+4−20

This diff is large: its 44 lines aren’t shown here.

drivers/target/iscsi/iscsi_target_nego.c+31−5

This diff is large: its 70 lines aren’t shown here.

drivers/target/target_core_fabric_lib.c+50−55

This diff is large: its 166 lines aren’t shown here.

drivers/target/target_core_internal.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/target/target_core_pr.c+34−27

This diff is large: its 128 lines aren’t shown here.

drivers/target/target_core_tmr.c+28−8

This diff is large: its 77 lines aren’t shown here.

drivers/target/target_core_transport.c+7−1

This diff is large: its 29 lines aren’t shown here.

drivers/target/target_core_user.c+325−72

This diff is large: its 665 lines aren’t shown here.

drivers/target/target_core_xcopy.c+9−2

This diff is large: its 30 lines aren’t shown here.

include/linux/qcom_scm.h+19−0

This diff is large: its 40 lines aren’t shown here.

include/scsi/fc/fc_ms.h+2−2

This diff is large: its 11 lines aren’t shown here.

include/scsi/scsi_tcq.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/scsi/scsi_transport_iscsi.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/target/iscsi/iscsi_target_core.h+5−4

This diff is large: its 16 lines aren’t shown here.

include/target/target_core_backend.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/target/target_core_base.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/trace/events/ufs.h+31−0

This diff is large: its 38 lines aren’t shown here.

include/uapi/linux/target_core_user.h+25−0

This diff is large: its 46 lines aren’t shown here.

include/uapi/scsi/fc/fc_els.h+2−0

This diff is large: its 16 lines aren’t shown here.