| .. | .. |
|---|
| 51 | 51 | #include <linux/workqueue.h> |
|---|
| 52 | 52 | #include <linux/delay.h> |
|---|
| 53 | 53 | #include <linux/pci.h> |
|---|
| 54 | | -#include <linux/pci-aspm.h> |
|---|
| 55 | 54 | #include <linux/interrupt.h> |
|---|
| 56 | 55 | #include <linux/aer.h> |
|---|
| 57 | 56 | #include <linux/raid_class.h> |
|---|
| .. | .. |
|---|
| 113 | 112 | |
|---|
| 114 | 113 | |
|---|
| 115 | 114 | static ushort max_sectors = 0xFFFF; |
|---|
| 116 | | -module_param(max_sectors, ushort, 0); |
|---|
| 115 | +module_param(max_sectors, ushort, 0444); |
|---|
| 117 | 116 | MODULE_PARM_DESC(max_sectors, "max sectors, range 64 to 32767 default=32767"); |
|---|
| 118 | 117 | |
|---|
| 119 | 118 | |
|---|
| 120 | 119 | static int missing_delay[2] = {-1, -1}; |
|---|
| 121 | | -module_param_array(missing_delay, int, NULL, 0); |
|---|
| 120 | +module_param_array(missing_delay, int, NULL, 0444); |
|---|
| 122 | 121 | MODULE_PARM_DESC(missing_delay, " device missing delay , io missing delay"); |
|---|
| 123 | 122 | |
|---|
| 124 | 123 | /* scsi-mid layer global parmeter is max_report_luns, which is 511 */ |
|---|
| 125 | 124 | #define MPT3SAS_MAX_LUN (16895) |
|---|
| 126 | 125 | static u64 max_lun = MPT3SAS_MAX_LUN; |
|---|
| 127 | | -module_param(max_lun, ullong, 0); |
|---|
| 126 | +module_param(max_lun, ullong, 0444); |
|---|
| 128 | 127 | MODULE_PARM_DESC(max_lun, " max lun, default=16895 "); |
|---|
| 129 | 128 | |
|---|
| 130 | 129 | static ushort hbas_to_enumerate; |
|---|
| 131 | | -module_param(hbas_to_enumerate, ushort, 0); |
|---|
| 130 | +module_param(hbas_to_enumerate, ushort, 0444); |
|---|
| 132 | 131 | MODULE_PARM_DESC(hbas_to_enumerate, |
|---|
| 133 | 132 | " 0 - enumerates both SAS 2.0 & SAS 3.0 generation HBAs\n \ |
|---|
| 134 | 133 | 1 - enumerates only SAS 2.0 generation HBAs\n \ |
|---|
| .. | .. |
|---|
| 142 | 141 | * Either bit can be set, or both |
|---|
| 143 | 142 | */ |
|---|
| 144 | 143 | static int diag_buffer_enable = -1; |
|---|
| 145 | | -module_param(diag_buffer_enable, int, 0); |
|---|
| 144 | +module_param(diag_buffer_enable, int, 0444); |
|---|
| 146 | 145 | MODULE_PARM_DESC(diag_buffer_enable, |
|---|
| 147 | 146 | " post diag buffers (TRACE=1/SNAPSHOT=2/EXTENDED=4/default=0)"); |
|---|
| 148 | 147 | static int disable_discovery = -1; |
|---|
| 149 | | -module_param(disable_discovery, int, 0); |
|---|
| 148 | +module_param(disable_discovery, int, 0444); |
|---|
| 150 | 149 | MODULE_PARM_DESC(disable_discovery, " disable discovery "); |
|---|
| 151 | 150 | |
|---|
| 152 | 151 | |
|---|
| 153 | 152 | /* permit overriding the host protection capabilities mask (EEDP/T10 PI) */ |
|---|
| 154 | 153 | static int prot_mask = -1; |
|---|
| 155 | | -module_param(prot_mask, int, 0); |
|---|
| 154 | +module_param(prot_mask, int, 0444); |
|---|
| 156 | 155 | MODULE_PARM_DESC(prot_mask, " host protection capabilities mask, def=7 "); |
|---|
| 157 | 156 | |
|---|
| 157 | +static bool enable_sdev_max_qd; |
|---|
| 158 | +module_param(enable_sdev_max_qd, bool, 0444); |
|---|
| 159 | +MODULE_PARM_DESC(enable_sdev_max_qd, |
|---|
| 160 | + "Enable sdev max qd as can_queue, def=disabled(0)"); |
|---|
| 158 | 161 | |
|---|
| 159 | 162 | /* raid transport support */ |
|---|
| 160 | 163 | static struct raid_template *mpt3sas_raid_template; |
|---|
| .. | .. |
|---|
| 204 | 207 | u8 ignore; |
|---|
| 205 | 208 | u16 event; |
|---|
| 206 | 209 | struct kref refcount; |
|---|
| 207 | | - char event_data[0] __aligned(4); |
|---|
| 210 | + char event_data[] __aligned(4); |
|---|
| 208 | 211 | }; |
|---|
| 209 | 212 | |
|---|
| 210 | 213 | static void fw_event_work_free(struct kref *r) |
|---|
| .. | .. |
|---|
| 418 | 421 | |
|---|
| 419 | 422 | if ((mpt3sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0, |
|---|
| 420 | 423 | MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) { |
|---|
| 421 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 422 | | - __FILE__, __LINE__, __func__); |
|---|
| 424 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 425 | + __FILE__, __LINE__, __func__); |
|---|
| 423 | 426 | return -ENXIO; |
|---|
| 424 | 427 | } |
|---|
| 425 | 428 | |
|---|
| .. | .. |
|---|
| 442 | 445 | return -ENXIO; |
|---|
| 443 | 446 | |
|---|
| 444 | 447 | /* else error case */ |
|---|
| 445 | | - pr_err(MPT3SAS_FMT |
|---|
| 446 | | - "handle(0x%04x), ioc_status(0x%04x), failure at %s:%d/%s()!\n", |
|---|
| 447 | | - ioc->name, handle, ioc_status, |
|---|
| 448 | | - __FILE__, __LINE__, __func__); |
|---|
| 448 | + ioc_err(ioc, "handle(0x%04x), ioc_status(0x%04x), failure at %s:%d/%s()!\n", |
|---|
| 449 | + handle, ioc_status, __FILE__, __LINE__, __func__); |
|---|
| 449 | 450 | return -EIO; |
|---|
| 450 | 451 | } |
|---|
| 451 | 452 | |
|---|
| .. | .. |
|---|
| 508 | 509 | (ioc->bios_pg2.ReqBootDeviceForm & |
|---|
| 509 | 510 | MPI2_BIOSPAGE2_FORM_MASK), |
|---|
| 510 | 511 | &ioc->bios_pg2.RequestedBootDevice)) { |
|---|
| 511 | | - dinitprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 512 | | - "%s: req_boot_device(0x%016llx)\n", |
|---|
| 513 | | - ioc->name, __func__, |
|---|
| 514 | | - (unsigned long long)sas_address)); |
|---|
| 512 | + dinitprintk(ioc, |
|---|
| 513 | + ioc_info(ioc, "%s: req_boot_device(0x%016llx)\n", |
|---|
| 514 | + __func__, (u64)sas_address)); |
|---|
| 515 | 515 | ioc->req_boot_device.device = device; |
|---|
| 516 | 516 | ioc->req_boot_device.channel = channel; |
|---|
| 517 | 517 | } |
|---|
| .. | .. |
|---|
| 523 | 523 | (ioc->bios_pg2.ReqAltBootDeviceForm & |
|---|
| 524 | 524 | MPI2_BIOSPAGE2_FORM_MASK), |
|---|
| 525 | 525 | &ioc->bios_pg2.RequestedAltBootDevice)) { |
|---|
| 526 | | - dinitprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 527 | | - "%s: req_alt_boot_device(0x%016llx)\n", |
|---|
| 528 | | - ioc->name, __func__, |
|---|
| 529 | | - (unsigned long long)sas_address)); |
|---|
| 526 | + dinitprintk(ioc, |
|---|
| 527 | + ioc_info(ioc, "%s: req_alt_boot_device(0x%016llx)\n", |
|---|
| 528 | + __func__, (u64)sas_address)); |
|---|
| 530 | 529 | ioc->req_alt_boot_device.device = device; |
|---|
| 531 | 530 | ioc->req_alt_boot_device.channel = channel; |
|---|
| 532 | 531 | } |
|---|
| .. | .. |
|---|
| 538 | 537 | (ioc->bios_pg2.CurrentBootDeviceForm & |
|---|
| 539 | 538 | MPI2_BIOSPAGE2_FORM_MASK), |
|---|
| 540 | 539 | &ioc->bios_pg2.CurrentBootDevice)) { |
|---|
| 541 | | - dinitprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 542 | | - "%s: current_boot_device(0x%016llx)\n", |
|---|
| 543 | | - ioc->name, __func__, |
|---|
| 544 | | - (unsigned long long)sas_address)); |
|---|
| 540 | + dinitprintk(ioc, |
|---|
| 541 | + ioc_info(ioc, "%s: current_boot_device(0x%016llx)\n", |
|---|
| 542 | + __func__, (u64)sas_address)); |
|---|
| 545 | 543 | ioc->current_boot_device.device = device; |
|---|
| 546 | 544 | ioc->current_boot_device.channel = channel; |
|---|
| 547 | 545 | } |
|---|
| .. | .. |
|---|
| 752 | 750 | sas_device->chassis_slot); |
|---|
| 753 | 751 | } else { |
|---|
| 754 | 752 | if (sas_device->enclosure_handle != 0) |
|---|
| 755 | | - pr_info(MPT3SAS_FMT |
|---|
| 756 | | - "enclosure logical id(0x%016llx), slot(%d) \n", |
|---|
| 757 | | - ioc->name, (unsigned long long) |
|---|
| 758 | | - sas_device->enclosure_logical_id, |
|---|
| 759 | | - sas_device->slot); |
|---|
| 753 | + ioc_info(ioc, "enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 754 | + (u64)sas_device->enclosure_logical_id, |
|---|
| 755 | + sas_device->slot); |
|---|
| 760 | 756 | if (sas_device->connector_name[0] != '\0') |
|---|
| 761 | | - pr_info(MPT3SAS_FMT |
|---|
| 762 | | - "enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 763 | | - ioc->name, sas_device->enclosure_level, |
|---|
| 764 | | - sas_device->connector_name); |
|---|
| 757 | + ioc_info(ioc, "enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 758 | + sas_device->enclosure_level, |
|---|
| 759 | + sas_device->connector_name); |
|---|
| 765 | 760 | if (sas_device->is_chassis_slot_valid) |
|---|
| 766 | | - pr_info(MPT3SAS_FMT "chassis slot(0x%04x)\n", |
|---|
| 767 | | - ioc->name, sas_device->chassis_slot); |
|---|
| 761 | + ioc_info(ioc, "chassis slot(0x%04x)\n", |
|---|
| 762 | + sas_device->chassis_slot); |
|---|
| 768 | 763 | } |
|---|
| 769 | 764 | } |
|---|
| 770 | 765 | |
|---|
| .. | .. |
|---|
| 784 | 779 | |
|---|
| 785 | 780 | if (!sas_device) |
|---|
| 786 | 781 | return; |
|---|
| 787 | | - pr_info(MPT3SAS_FMT |
|---|
| 788 | | - "removing handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 789 | | - ioc->name, sas_device->handle, |
|---|
| 790 | | - (unsigned long long) sas_device->sas_address); |
|---|
| 782 | + ioc_info(ioc, "removing handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 783 | + sas_device->handle, (u64)sas_device->sas_address); |
|---|
| 791 | 784 | |
|---|
| 792 | 785 | _scsih_display_enclosure_chassis_info(ioc, sas_device, NULL, NULL); |
|---|
| 793 | 786 | |
|---|
| .. | .. |
|---|
| 872 | 865 | { |
|---|
| 873 | 866 | unsigned long flags; |
|---|
| 874 | 867 | |
|---|
| 875 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 876 | | - "%s: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 877 | | - ioc->name, __func__, sas_device->handle, |
|---|
| 878 | | - (unsigned long long)sas_device->sas_address)); |
|---|
| 868 | + dewtprintk(ioc, |
|---|
| 869 | + ioc_info(ioc, "%s: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 870 | + __func__, sas_device->handle, |
|---|
| 871 | + (u64)sas_device->sas_address)); |
|---|
| 879 | 872 | |
|---|
| 880 | 873 | dewtprintk(ioc, _scsih_display_enclosure_chassis_info(ioc, sas_device, |
|---|
| 881 | 874 | NULL, NULL)); |
|---|
| .. | .. |
|---|
| 923 | 916 | { |
|---|
| 924 | 917 | unsigned long flags; |
|---|
| 925 | 918 | |
|---|
| 926 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 927 | | - "%s: handle(0x%04x), sas_addr(0x%016llx)\n", ioc->name, |
|---|
| 928 | | - __func__, sas_device->handle, |
|---|
| 929 | | - (unsigned long long)sas_device->sas_address)); |
|---|
| 919 | + dewtprintk(ioc, |
|---|
| 920 | + ioc_info(ioc, "%s: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 921 | + __func__, sas_device->handle, |
|---|
| 922 | + (u64)sas_device->sas_address)); |
|---|
| 930 | 923 | |
|---|
| 931 | 924 | dewtprintk(ioc, _scsih_display_enclosure_chassis_info(ioc, sas_device, |
|---|
| 932 | 925 | NULL, NULL)); |
|---|
| .. | .. |
|---|
| 1057 | 1050 | } |
|---|
| 1058 | 1051 | |
|---|
| 1059 | 1052 | /** |
|---|
| 1053 | + * _scsih_set_nvme_max_shutdown_latency - Update max_shutdown_latency. |
|---|
| 1054 | + * @ioc: per adapter object |
|---|
| 1055 | + * Context: This function will acquire ioc->pcie_device_lock |
|---|
| 1056 | + * |
|---|
| 1057 | + * Update ioc->max_shutdown_latency to that NVMe drives RTD3 Entry Latency |
|---|
| 1058 | + * which has reported maximum among all available NVMe drives. |
|---|
| 1059 | + * Minimum max_shutdown_latency will be six seconds. |
|---|
| 1060 | + */ |
|---|
| 1061 | +static void |
|---|
| 1062 | +_scsih_set_nvme_max_shutdown_latency(struct MPT3SAS_ADAPTER *ioc) |
|---|
| 1063 | +{ |
|---|
| 1064 | + struct _pcie_device *pcie_device; |
|---|
| 1065 | + unsigned long flags; |
|---|
| 1066 | + u16 shutdown_latency = IO_UNIT_CONTROL_SHUTDOWN_TIMEOUT; |
|---|
| 1067 | + |
|---|
| 1068 | + spin_lock_irqsave(&ioc->pcie_device_lock, flags); |
|---|
| 1069 | + list_for_each_entry(pcie_device, &ioc->pcie_device_list, list) { |
|---|
| 1070 | + if (pcie_device->shutdown_latency) { |
|---|
| 1071 | + if (shutdown_latency < pcie_device->shutdown_latency) |
|---|
| 1072 | + shutdown_latency = |
|---|
| 1073 | + pcie_device->shutdown_latency; |
|---|
| 1074 | + } |
|---|
| 1075 | + } |
|---|
| 1076 | + ioc->max_shutdown_latency = shutdown_latency; |
|---|
| 1077 | + spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); |
|---|
| 1078 | +} |
|---|
| 1079 | + |
|---|
| 1080 | +/** |
|---|
| 1060 | 1081 | * _scsih_pcie_device_remove - remove pcie_device from list. |
|---|
| 1061 | 1082 | * @ioc: per adapter object |
|---|
| 1062 | 1083 | * @pcie_device: the pcie_device object |
|---|
| .. | .. |
|---|
| 1070 | 1091 | { |
|---|
| 1071 | 1092 | unsigned long flags; |
|---|
| 1072 | 1093 | int was_on_pcie_device_list = 0; |
|---|
| 1094 | + u8 update_latency = 0; |
|---|
| 1073 | 1095 | |
|---|
| 1074 | 1096 | if (!pcie_device) |
|---|
| 1075 | 1097 | return; |
|---|
| 1076 | | - pr_info(MPT3SAS_FMT |
|---|
| 1077 | | - "removing handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 1078 | | - ioc->name, pcie_device->handle, |
|---|
| 1079 | | - (unsigned long long) pcie_device->wwid); |
|---|
| 1098 | + ioc_info(ioc, "removing handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 1099 | + pcie_device->handle, (u64)pcie_device->wwid); |
|---|
| 1080 | 1100 | if (pcie_device->enclosure_handle != 0) |
|---|
| 1081 | | - pr_info(MPT3SAS_FMT |
|---|
| 1082 | | - "removing enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 1083 | | - ioc->name, |
|---|
| 1084 | | - (unsigned long long)pcie_device->enclosure_logical_id, |
|---|
| 1085 | | - pcie_device->slot); |
|---|
| 1101 | + ioc_info(ioc, "removing enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 1102 | + (u64)pcie_device->enclosure_logical_id, |
|---|
| 1103 | + pcie_device->slot); |
|---|
| 1086 | 1104 | if (pcie_device->connector_name[0] != '\0') |
|---|
| 1087 | | - pr_info(MPT3SAS_FMT |
|---|
| 1088 | | - "removing enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 1089 | | - ioc->name, pcie_device->enclosure_level, |
|---|
| 1090 | | - pcie_device->connector_name); |
|---|
| 1105 | + ioc_info(ioc, "removing enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 1106 | + pcie_device->enclosure_level, |
|---|
| 1107 | + pcie_device->connector_name); |
|---|
| 1091 | 1108 | |
|---|
| 1092 | 1109 | spin_lock_irqsave(&ioc->pcie_device_lock, flags); |
|---|
| 1093 | 1110 | if (!list_empty(&pcie_device->list)) { |
|---|
| 1094 | 1111 | list_del_init(&pcie_device->list); |
|---|
| 1095 | 1112 | was_on_pcie_device_list = 1; |
|---|
| 1096 | 1113 | } |
|---|
| 1114 | + if (pcie_device->shutdown_latency == ioc->max_shutdown_latency) |
|---|
| 1115 | + update_latency = 1; |
|---|
| 1097 | 1116 | spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); |
|---|
| 1098 | 1117 | if (was_on_pcie_device_list) { |
|---|
| 1099 | 1118 | kfree(pcie_device->serial_number); |
|---|
| 1100 | 1119 | pcie_device_put(pcie_device); |
|---|
| 1101 | 1120 | } |
|---|
| 1121 | + |
|---|
| 1122 | + /* |
|---|
| 1123 | + * This device's RTD3 Entry Latency matches IOC's |
|---|
| 1124 | + * max_shutdown_latency. Recalculate IOC's max_shutdown_latency |
|---|
| 1125 | + * from the available drives as current drive is getting removed. |
|---|
| 1126 | + */ |
|---|
| 1127 | + if (update_latency) |
|---|
| 1128 | + _scsih_set_nvme_max_shutdown_latency(ioc); |
|---|
| 1102 | 1129 | } |
|---|
| 1103 | 1130 | |
|---|
| 1104 | 1131 | |
|---|
| .. | .. |
|---|
| 1113 | 1140 | struct _pcie_device *pcie_device; |
|---|
| 1114 | 1141 | unsigned long flags; |
|---|
| 1115 | 1142 | int was_on_pcie_device_list = 0; |
|---|
| 1143 | + u8 update_latency = 0; |
|---|
| 1116 | 1144 | |
|---|
| 1117 | 1145 | if (ioc->shost_recovery) |
|---|
| 1118 | 1146 | return; |
|---|
| .. | .. |
|---|
| 1125 | 1153 | was_on_pcie_device_list = 1; |
|---|
| 1126 | 1154 | pcie_device_put(pcie_device); |
|---|
| 1127 | 1155 | } |
|---|
| 1156 | + if (pcie_device->shutdown_latency == ioc->max_shutdown_latency) |
|---|
| 1157 | + update_latency = 1; |
|---|
| 1128 | 1158 | } |
|---|
| 1129 | 1159 | spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); |
|---|
| 1130 | 1160 | if (was_on_pcie_device_list) { |
|---|
| 1131 | 1161 | _scsih_pcie_device_remove_from_sml(ioc, pcie_device); |
|---|
| 1132 | 1162 | pcie_device_put(pcie_device); |
|---|
| 1133 | 1163 | } |
|---|
| 1164 | + |
|---|
| 1165 | + /* |
|---|
| 1166 | + * This device's RTD3 Entry Latency matches IOC's |
|---|
| 1167 | + * max_shutdown_latency. Recalculate IOC's max_shutdown_latency |
|---|
| 1168 | + * from the available drives as current drive is getting removed. |
|---|
| 1169 | + */ |
|---|
| 1170 | + if (update_latency) |
|---|
| 1171 | + _scsih_set_nvme_max_shutdown_latency(ioc); |
|---|
| 1134 | 1172 | } |
|---|
| 1135 | 1173 | |
|---|
| 1136 | 1174 | /** |
|---|
| .. | .. |
|---|
| 1146 | 1184 | { |
|---|
| 1147 | 1185 | unsigned long flags; |
|---|
| 1148 | 1186 | |
|---|
| 1149 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 1150 | | - "%s: handle (0x%04x), wwid(0x%016llx)\n", ioc->name, __func__, |
|---|
| 1151 | | - pcie_device->handle, (unsigned long long)pcie_device->wwid)); |
|---|
| 1187 | + dewtprintk(ioc, |
|---|
| 1188 | + ioc_info(ioc, "%s: handle (0x%04x), wwid(0x%016llx)\n", |
|---|
| 1189 | + __func__, |
|---|
| 1190 | + pcie_device->handle, (u64)pcie_device->wwid)); |
|---|
| 1152 | 1191 | if (pcie_device->enclosure_handle != 0) |
|---|
| 1153 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 1154 | | - "%s: enclosure logical id(0x%016llx), slot( %d)\n", |
|---|
| 1155 | | - ioc->name, __func__, |
|---|
| 1156 | | - (unsigned long long)pcie_device->enclosure_logical_id, |
|---|
| 1157 | | - pcie_device->slot)); |
|---|
| 1192 | + dewtprintk(ioc, |
|---|
| 1193 | + ioc_info(ioc, "%s: enclosure logical id(0x%016llx), slot( %d)\n", |
|---|
| 1194 | + __func__, |
|---|
| 1195 | + (u64)pcie_device->enclosure_logical_id, |
|---|
| 1196 | + pcie_device->slot)); |
|---|
| 1158 | 1197 | if (pcie_device->connector_name[0] != '\0') |
|---|
| 1159 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 1160 | | - "%s: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 1161 | | - ioc->name, __func__, pcie_device->enclosure_level, |
|---|
| 1162 | | - pcie_device->connector_name)); |
|---|
| 1198 | + dewtprintk(ioc, |
|---|
| 1199 | + ioc_info(ioc, "%s: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 1200 | + __func__, pcie_device->enclosure_level, |
|---|
| 1201 | + pcie_device->connector_name)); |
|---|
| 1163 | 1202 | |
|---|
| 1164 | 1203 | spin_lock_irqsave(&ioc->pcie_device_lock, flags); |
|---|
| 1165 | 1204 | pcie_device_get(pcie_device); |
|---|
| 1166 | 1205 | list_add_tail(&pcie_device->list, &ioc->pcie_device_list); |
|---|
| 1167 | 1206 | spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); |
|---|
| 1168 | 1207 | |
|---|
| 1208 | + if (pcie_device->access_status == |
|---|
| 1209 | + MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED) { |
|---|
| 1210 | + clear_bit(pcie_device->handle, ioc->pend_os_device_add); |
|---|
| 1211 | + return; |
|---|
| 1212 | + } |
|---|
| 1169 | 1213 | if (scsi_add_device(ioc->shost, PCIE_CHANNEL, pcie_device->id, 0)) { |
|---|
| 1170 | 1214 | _scsih_pcie_device_remove(ioc, pcie_device); |
|---|
| 1171 | 1215 | } else if (!pcie_device->starget) { |
|---|
| .. | .. |
|---|
| 1191 | 1235 | { |
|---|
| 1192 | 1236 | unsigned long flags; |
|---|
| 1193 | 1237 | |
|---|
| 1194 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 1195 | | - "%s: handle (0x%04x), wwid(0x%016llx)\n", ioc->name, __func__, |
|---|
| 1196 | | - pcie_device->handle, (unsigned long long)pcie_device->wwid)); |
|---|
| 1238 | + dewtprintk(ioc, |
|---|
| 1239 | + ioc_info(ioc, "%s: handle (0x%04x), wwid(0x%016llx)\n", |
|---|
| 1240 | + __func__, |
|---|
| 1241 | + pcie_device->handle, (u64)pcie_device->wwid)); |
|---|
| 1197 | 1242 | if (pcie_device->enclosure_handle != 0) |
|---|
| 1198 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 1199 | | - "%s: enclosure logical id(0x%016llx), slot( %d)\n", |
|---|
| 1200 | | - ioc->name, __func__, |
|---|
| 1201 | | - (unsigned long long)pcie_device->enclosure_logical_id, |
|---|
| 1202 | | - pcie_device->slot)); |
|---|
| 1243 | + dewtprintk(ioc, |
|---|
| 1244 | + ioc_info(ioc, "%s: enclosure logical id(0x%016llx), slot( %d)\n", |
|---|
| 1245 | + __func__, |
|---|
| 1246 | + (u64)pcie_device->enclosure_logical_id, |
|---|
| 1247 | + pcie_device->slot)); |
|---|
| 1203 | 1248 | if (pcie_device->connector_name[0] != '\0') |
|---|
| 1204 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 1205 | | - "%s: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 1206 | | - ioc->name, __func__, pcie_device->enclosure_level, |
|---|
| 1207 | | - pcie_device->connector_name)); |
|---|
| 1249 | + dewtprintk(ioc, |
|---|
| 1250 | + ioc_info(ioc, "%s: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 1251 | + __func__, pcie_device->enclosure_level, |
|---|
| 1252 | + pcie_device->connector_name)); |
|---|
| 1208 | 1253 | |
|---|
| 1209 | 1254 | spin_lock_irqsave(&ioc->pcie_device_lock, flags); |
|---|
| 1210 | 1255 | pcie_device_get(pcie_device); |
|---|
| 1211 | 1256 | list_add_tail(&pcie_device->list, &ioc->pcie_device_init_list); |
|---|
| 1212 | | - _scsih_determine_boot_device(ioc, pcie_device, PCIE_CHANNEL); |
|---|
| 1257 | + if (pcie_device->access_status != |
|---|
| 1258 | + MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED) |
|---|
| 1259 | + _scsih_determine_boot_device(ioc, pcie_device, PCIE_CHANNEL); |
|---|
| 1213 | 1260 | spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); |
|---|
| 1214 | 1261 | } |
|---|
| 1215 | 1262 | /** |
|---|
| .. | .. |
|---|
| 1304 | 1351 | { |
|---|
| 1305 | 1352 | unsigned long flags; |
|---|
| 1306 | 1353 | |
|---|
| 1307 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 1308 | | - "%s: handle(0x%04x), wwid(0x%016llx)\n", ioc->name, __func__, |
|---|
| 1309 | | - raid_device->handle, (unsigned long long)raid_device->wwid)); |
|---|
| 1354 | + dewtprintk(ioc, |
|---|
| 1355 | + ioc_info(ioc, "%s: handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 1356 | + __func__, |
|---|
| 1357 | + raid_device->handle, (u64)raid_device->wwid)); |
|---|
| 1310 | 1358 | |
|---|
| 1311 | 1359 | spin_lock_irqsave(&ioc->raid_device_lock, flags); |
|---|
| 1312 | 1360 | list_add_tail(&raid_device->list, &ioc->raid_device_list); |
|---|
| .. | .. |
|---|
| 1445 | 1493 | } |
|---|
| 1446 | 1494 | |
|---|
| 1447 | 1495 | /** |
|---|
| 1448 | | - * _scsih_is_nvme_device - determines if device is an nvme device |
|---|
| 1496 | + * _scsih_is_nvme_pciescsi_device - determines if |
|---|
| 1497 | + * device is an pcie nvme/scsi device |
|---|
| 1449 | 1498 | * @device_info: bitfield providing information about the device. |
|---|
| 1450 | 1499 | * Context: none |
|---|
| 1451 | 1500 | * |
|---|
| 1452 | | - * Return: 1 if nvme device. |
|---|
| 1501 | + * Returns 1 if device is pcie device type nvme/scsi. |
|---|
| 1453 | 1502 | */ |
|---|
| 1454 | 1503 | static int |
|---|
| 1455 | | -_scsih_is_nvme_device(u32 device_info) |
|---|
| 1504 | +_scsih_is_nvme_pciescsi_device(u32 device_info) |
|---|
| 1456 | 1505 | { |
|---|
| 1457 | | - if ((device_info & MPI26_PCIE_DEVINFO_MASK_DEVICE_TYPE) |
|---|
| 1458 | | - == MPI26_PCIE_DEVINFO_NVME) |
|---|
| 1506 | + if (((device_info & MPI26_PCIE_DEVINFO_MASK_DEVICE_TYPE) |
|---|
| 1507 | + == MPI26_PCIE_DEVINFO_NVME) || |
|---|
| 1508 | + ((device_info & MPI26_PCIE_DEVINFO_MASK_DEVICE_TYPE) |
|---|
| 1509 | + == MPI26_PCIE_DEVINFO_SCSI)) |
|---|
| 1459 | 1510 | return 1; |
|---|
| 1460 | 1511 | else |
|---|
| 1461 | 1512 | return 0; |
|---|
| 1513 | +} |
|---|
| 1514 | + |
|---|
| 1515 | +/** |
|---|
| 1516 | + * _scsih_scsi_lookup_find_by_target - search for matching channel:id |
|---|
| 1517 | + * @ioc: per adapter object |
|---|
| 1518 | + * @id: target id |
|---|
| 1519 | + * @channel: channel |
|---|
| 1520 | + * Context: This function will acquire ioc->scsi_lookup_lock. |
|---|
| 1521 | + * |
|---|
| 1522 | + * This will search for a matching channel:id in the scsi_lookup array, |
|---|
| 1523 | + * returning 1 if found. |
|---|
| 1524 | + */ |
|---|
| 1525 | +static u8 |
|---|
| 1526 | +_scsih_scsi_lookup_find_by_target(struct MPT3SAS_ADAPTER *ioc, int id, |
|---|
| 1527 | + int channel) |
|---|
| 1528 | +{ |
|---|
| 1529 | + int smid; |
|---|
| 1530 | + struct scsi_cmnd *scmd; |
|---|
| 1531 | + |
|---|
| 1532 | + for (smid = 1; |
|---|
| 1533 | + smid <= ioc->shost->can_queue; smid++) { |
|---|
| 1534 | + scmd = mpt3sas_scsih_scsi_lookup_get(ioc, smid); |
|---|
| 1535 | + if (!scmd) |
|---|
| 1536 | + continue; |
|---|
| 1537 | + if (scmd->device->id == id && |
|---|
| 1538 | + scmd->device->channel == channel) |
|---|
| 1539 | + return 1; |
|---|
| 1540 | + } |
|---|
| 1541 | + return 0; |
|---|
| 1542 | +} |
|---|
| 1543 | + |
|---|
| 1544 | +/** |
|---|
| 1545 | + * _scsih_scsi_lookup_find_by_lun - search for matching channel:id:lun |
|---|
| 1546 | + * @ioc: per adapter object |
|---|
| 1547 | + * @id: target id |
|---|
| 1548 | + * @lun: lun number |
|---|
| 1549 | + * @channel: channel |
|---|
| 1550 | + * Context: This function will acquire ioc->scsi_lookup_lock. |
|---|
| 1551 | + * |
|---|
| 1552 | + * This will search for a matching channel:id:lun in the scsi_lookup array, |
|---|
| 1553 | + * returning 1 if found. |
|---|
| 1554 | + */ |
|---|
| 1555 | +static u8 |
|---|
| 1556 | +_scsih_scsi_lookup_find_by_lun(struct MPT3SAS_ADAPTER *ioc, int id, |
|---|
| 1557 | + unsigned int lun, int channel) |
|---|
| 1558 | +{ |
|---|
| 1559 | + int smid; |
|---|
| 1560 | + struct scsi_cmnd *scmd; |
|---|
| 1561 | + |
|---|
| 1562 | + for (smid = 1; smid <= ioc->shost->can_queue; smid++) { |
|---|
| 1563 | + |
|---|
| 1564 | + scmd = mpt3sas_scsih_scsi_lookup_get(ioc, smid); |
|---|
| 1565 | + if (!scmd) |
|---|
| 1566 | + continue; |
|---|
| 1567 | + if (scmd->device->id == id && |
|---|
| 1568 | + scmd->device->channel == channel && |
|---|
| 1569 | + scmd->device->lun == lun) |
|---|
| 1570 | + return 1; |
|---|
| 1571 | + } |
|---|
| 1572 | + return 0; |
|---|
| 1462 | 1573 | } |
|---|
| 1463 | 1574 | |
|---|
| 1464 | 1575 | /** |
|---|
| .. | .. |
|---|
| 1521 | 1632 | |
|---|
| 1522 | 1633 | max_depth = shost->can_queue; |
|---|
| 1523 | 1634 | |
|---|
| 1524 | | - /* limit max device queue for SATA to 32 */ |
|---|
| 1635 | + /* |
|---|
| 1636 | + * limit max device queue for SATA to 32 if enable_sdev_max_qd |
|---|
| 1637 | + * is disabled. |
|---|
| 1638 | + */ |
|---|
| 1639 | + if (ioc->enable_sdev_max_qd) |
|---|
| 1640 | + goto not_sata; |
|---|
| 1641 | + |
|---|
| 1525 | 1642 | sas_device_priv_data = sdev->hostdata; |
|---|
| 1526 | 1643 | if (!sas_device_priv_data) |
|---|
| 1527 | 1644 | goto not_sata; |
|---|
| .. | .. |
|---|
| 1547 | 1664 | max_depth = 1; |
|---|
| 1548 | 1665 | if (qdepth > max_depth) |
|---|
| 1549 | 1666 | qdepth = max_depth; |
|---|
| 1550 | | - return scsi_change_queue_depth(sdev, qdepth); |
|---|
| 1667 | + scsi_change_queue_depth(sdev, qdepth); |
|---|
| 1668 | + sdev_printk(KERN_INFO, sdev, |
|---|
| 1669 | + "qdepth(%d), tagged(%d), scsi_level(%d), cmd_que(%d)\n", |
|---|
| 1670 | + sdev->queue_depth, sdev->tagged_supported, |
|---|
| 1671 | + sdev->scsi_level, ((sdev->inquiry[7] & 2) >> 1)); |
|---|
| 1672 | + return sdev->queue_depth; |
|---|
| 1673 | +} |
|---|
| 1674 | + |
|---|
| 1675 | +/** |
|---|
| 1676 | + * mpt3sas_scsih_change_queue_depth - setting device queue depth |
|---|
| 1677 | + * @sdev: scsi device struct |
|---|
| 1678 | + * @qdepth: requested queue depth |
|---|
| 1679 | + * |
|---|
| 1680 | + * Returns nothing. |
|---|
| 1681 | + */ |
|---|
| 1682 | +void |
|---|
| 1683 | +mpt3sas_scsih_change_queue_depth(struct scsi_device *sdev, int qdepth) |
|---|
| 1684 | +{ |
|---|
| 1685 | + struct Scsi_Host *shost = sdev->host; |
|---|
| 1686 | + struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
|---|
| 1687 | + |
|---|
| 1688 | + if (ioc->enable_sdev_max_qd) |
|---|
| 1689 | + qdepth = shost->can_queue; |
|---|
| 1690 | + |
|---|
| 1691 | + scsih_change_queue_depth(sdev, qdepth); |
|---|
| 1551 | 1692 | } |
|---|
| 1552 | 1693 | |
|---|
| 1553 | 1694 | /** |
|---|
| .. | .. |
|---|
| 1869 | 2010 | |
|---|
| 1870 | 2011 | if ((mpt3sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0, |
|---|
| 1871 | 2012 | MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) { |
|---|
| 1872 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 1873 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 2013 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2014 | + __FILE__, __LINE__, __func__); |
|---|
| 1874 | 2015 | return; |
|---|
| 1875 | 2016 | } |
|---|
| 1876 | 2017 | |
|---|
| 1877 | 2018 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 1878 | 2019 | MPI2_IOCSTATUS_MASK; |
|---|
| 1879 | 2020 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 1880 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 1881 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 2021 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2022 | + __FILE__, __LINE__, __func__); |
|---|
| 1882 | 2023 | return; |
|---|
| 1883 | 2024 | } |
|---|
| 1884 | 2025 | |
|---|
| .. | .. |
|---|
| 1964 | 2105 | if (mpt3sas_config_get_raid_volume_pg0(ioc, &mpi_reply, &vol_pg0, |
|---|
| 1965 | 2106 | MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, handle, |
|---|
| 1966 | 2107 | sizeof(Mpi2RaidVolPage0_t))) { |
|---|
| 1967 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 1968 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 2108 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2109 | + __FILE__, __LINE__, __func__); |
|---|
| 1969 | 2110 | percent_complete = 0; |
|---|
| 1970 | 2111 | goto out; |
|---|
| 1971 | 2112 | } |
|---|
| .. | .. |
|---|
| 2018 | 2159 | if (mpt3sas_config_get_raid_volume_pg0(ioc, &mpi_reply, &vol_pg0, |
|---|
| 2019 | 2160 | MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, handle, |
|---|
| 2020 | 2161 | sizeof(Mpi2RaidVolPage0_t))) { |
|---|
| 2021 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 2022 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 2162 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2163 | + __FILE__, __LINE__, __func__); |
|---|
| 2023 | 2164 | goto out; |
|---|
| 2024 | 2165 | } |
|---|
| 2025 | 2166 | |
|---|
| .. | .. |
|---|
| 2115 | 2256 | |
|---|
| 2116 | 2257 | if ((mpt3sas_config_get_number_pds(ioc, raid_device->handle, |
|---|
| 2117 | 2258 | &num_pds)) || !num_pds) { |
|---|
| 2118 | | - dfailprintk(ioc, pr_warn(MPT3SAS_FMT |
|---|
| 2119 | | - "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__, |
|---|
| 2120 | | - __func__)); |
|---|
| 2259 | + dfailprintk(ioc, |
|---|
| 2260 | + ioc_warn(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2261 | + __FILE__, __LINE__, __func__)); |
|---|
| 2121 | 2262 | return 1; |
|---|
| 2122 | 2263 | } |
|---|
| 2123 | 2264 | |
|---|
| .. | .. |
|---|
| 2126 | 2267 | sizeof(Mpi2RaidVol0PhysDisk_t)); |
|---|
| 2127 | 2268 | vol_pg0 = kzalloc(sz, GFP_KERNEL); |
|---|
| 2128 | 2269 | if (!vol_pg0) { |
|---|
| 2129 | | - dfailprintk(ioc, pr_warn(MPT3SAS_FMT |
|---|
| 2130 | | - "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__, |
|---|
| 2131 | | - __func__)); |
|---|
| 2270 | + dfailprintk(ioc, |
|---|
| 2271 | + ioc_warn(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2272 | + __FILE__, __LINE__, __func__)); |
|---|
| 2132 | 2273 | return 1; |
|---|
| 2133 | 2274 | } |
|---|
| 2134 | 2275 | |
|---|
| 2135 | 2276 | if ((mpt3sas_config_get_raid_volume_pg0(ioc, &mpi_reply, vol_pg0, |
|---|
| 2136 | 2277 | MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle, sz))) { |
|---|
| 2137 | | - dfailprintk(ioc, pr_warn(MPT3SAS_FMT |
|---|
| 2138 | | - "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__, |
|---|
| 2139 | | - __func__)); |
|---|
| 2278 | + dfailprintk(ioc, |
|---|
| 2279 | + ioc_warn(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2280 | + __FILE__, __LINE__, __func__)); |
|---|
| 2140 | 2281 | kfree(vol_pg0); |
|---|
| 2141 | 2282 | return 1; |
|---|
| 2142 | 2283 | } |
|---|
| .. | .. |
|---|
| 2227 | 2368 | raid_device = mpt3sas_raid_device_find_by_handle(ioc, handle); |
|---|
| 2228 | 2369 | spin_unlock_irqrestore(&ioc->raid_device_lock, flags); |
|---|
| 2229 | 2370 | if (!raid_device) { |
|---|
| 2230 | | - dfailprintk(ioc, pr_warn(MPT3SAS_FMT |
|---|
| 2231 | | - "failure at %s:%d/%s()!\n", ioc->name, __FILE__, |
|---|
| 2232 | | - __LINE__, __func__)); |
|---|
| 2371 | + dfailprintk(ioc, |
|---|
| 2372 | + ioc_warn(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2373 | + __FILE__, __LINE__, __func__)); |
|---|
| 2233 | 2374 | return 1; |
|---|
| 2234 | 2375 | } |
|---|
| 2235 | 2376 | |
|---|
| 2236 | 2377 | if (_scsih_get_volume_capabilities(ioc, raid_device)) { |
|---|
| 2237 | | - dfailprintk(ioc, pr_warn(MPT3SAS_FMT |
|---|
| 2238 | | - "failure at %s:%d/%s()!\n", ioc->name, __FILE__, |
|---|
| 2239 | | - __LINE__, __func__)); |
|---|
| 2378 | + dfailprintk(ioc, |
|---|
| 2379 | + ioc_warn(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2380 | + __FILE__, __LINE__, __func__)); |
|---|
| 2240 | 2381 | return 1; |
|---|
| 2241 | 2382 | } |
|---|
| 2242 | 2383 | |
|---|
| .. | .. |
|---|
| 2308 | 2449 | MPT3SAS_RAID_MAX_SECTORS); |
|---|
| 2309 | 2450 | } |
|---|
| 2310 | 2451 | |
|---|
| 2311 | | - scsih_change_queue_depth(sdev, qdepth); |
|---|
| 2452 | + mpt3sas_scsih_change_queue_depth(sdev, qdepth); |
|---|
| 2312 | 2453 | |
|---|
| 2313 | 2454 | /* raid transport support */ |
|---|
| 2314 | 2455 | if (!ioc->is_warpdrive) |
|---|
| .. | .. |
|---|
| 2320 | 2461 | if (sas_target_priv_data->flags & MPT_TARGET_FLAGS_RAID_COMPONENT) { |
|---|
| 2321 | 2462 | if (mpt3sas_config_get_volume_handle(ioc, handle, |
|---|
| 2322 | 2463 | &volume_handle)) { |
|---|
| 2323 | | - dfailprintk(ioc, pr_warn(MPT3SAS_FMT |
|---|
| 2324 | | - "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 2325 | | - __FILE__, __LINE__, __func__)); |
|---|
| 2464 | + dfailprintk(ioc, |
|---|
| 2465 | + ioc_warn(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2466 | + __FILE__, __LINE__, __func__)); |
|---|
| 2326 | 2467 | return 1; |
|---|
| 2327 | 2468 | } |
|---|
| 2328 | 2469 | if (volume_handle && mpt3sas_config_get_volume_wwid(ioc, |
|---|
| 2329 | 2470 | volume_handle, &volume_wwid)) { |
|---|
| 2330 | | - dfailprintk(ioc, pr_warn(MPT3SAS_FMT |
|---|
| 2331 | | - "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 2332 | | - __FILE__, __LINE__, __func__)); |
|---|
| 2471 | + dfailprintk(ioc, |
|---|
| 2472 | + ioc_warn(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2473 | + __FILE__, __LINE__, __func__)); |
|---|
| 2333 | 2474 | return 1; |
|---|
| 2334 | 2475 | } |
|---|
| 2335 | 2476 | } |
|---|
| .. | .. |
|---|
| 2341 | 2482 | sas_device_priv_data->sas_target->sas_address); |
|---|
| 2342 | 2483 | if (!pcie_device) { |
|---|
| 2343 | 2484 | spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); |
|---|
| 2344 | | - dfailprintk(ioc, pr_warn(MPT3SAS_FMT |
|---|
| 2345 | | - "failure at %s:%d/%s()!\n", ioc->name, __FILE__, |
|---|
| 2346 | | - __LINE__, __func__)); |
|---|
| 2485 | + dfailprintk(ioc, |
|---|
| 2486 | + ioc_warn(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2487 | + __FILE__, __LINE__, __func__)); |
|---|
| 2347 | 2488 | return 1; |
|---|
| 2348 | 2489 | } |
|---|
| 2349 | 2490 | |
|---|
| .. | .. |
|---|
| 2372 | 2513 | |
|---|
| 2373 | 2514 | pcie_device_put(pcie_device); |
|---|
| 2374 | 2515 | spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); |
|---|
| 2375 | | - scsih_change_queue_depth(sdev, qdepth); |
|---|
| 2516 | + mpt3sas_scsih_change_queue_depth(sdev, qdepth); |
|---|
| 2376 | 2517 | /* Enable QUEUE_FLAG_NOMERGES flag, so that IOs won't be |
|---|
| 2377 | 2518 | ** merged and can eliminate holes created during merging |
|---|
| 2378 | 2519 | ** operation. |
|---|
| .. | .. |
|---|
| 2389 | 2530 | sas_device_priv_data->sas_target->sas_address); |
|---|
| 2390 | 2531 | if (!sas_device) { |
|---|
| 2391 | 2532 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); |
|---|
| 2392 | | - dfailprintk(ioc, pr_warn(MPT3SAS_FMT |
|---|
| 2393 | | - "failure at %s:%d/%s()!\n", ioc->name, __FILE__, __LINE__, |
|---|
| 2394 | | - __func__)); |
|---|
| 2533 | + dfailprintk(ioc, |
|---|
| 2534 | + ioc_warn(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 2535 | + __FILE__, __LINE__, __func__)); |
|---|
| 2395 | 2536 | return 1; |
|---|
| 2396 | 2537 | } |
|---|
| 2397 | 2538 | |
|---|
| .. | .. |
|---|
| 2432 | 2573 | _scsih_display_sata_capabilities(ioc, handle, sdev); |
|---|
| 2433 | 2574 | |
|---|
| 2434 | 2575 | |
|---|
| 2435 | | - scsih_change_queue_depth(sdev, qdepth); |
|---|
| 2576 | + mpt3sas_scsih_change_queue_depth(sdev, qdepth); |
|---|
| 2436 | 2577 | |
|---|
| 2437 | 2578 | if (ssp_target) { |
|---|
| 2438 | 2579 | sas_read_port_mode_page(sdev); |
|---|
| .. | .. |
|---|
| 2527 | 2668 | desc = "unknown"; |
|---|
| 2528 | 2669 | break; |
|---|
| 2529 | 2670 | } |
|---|
| 2530 | | - pr_warn(MPT3SAS_FMT "response_code(0x%01x): %s\n", |
|---|
| 2531 | | - ioc->name, response_code, desc); |
|---|
| 2671 | + ioc_warn(ioc, "response_code(0x%01x): %s\n", response_code, desc); |
|---|
| 2532 | 2672 | } |
|---|
| 2533 | 2673 | |
|---|
| 2534 | 2674 | /** |
|---|
| .. | .. |
|---|
| 2621 | 2761 | } |
|---|
| 2622 | 2762 | |
|---|
| 2623 | 2763 | /** |
|---|
| 2764 | + * scsih_tm_cmd_map_status - map the target reset & LUN reset TM status |
|---|
| 2765 | + * @ioc - per adapter object |
|---|
| 2766 | + * @channel - the channel assigned by the OS |
|---|
| 2767 | + * @id: the id assigned by the OS |
|---|
| 2768 | + * @lun: lun number |
|---|
| 2769 | + * @type: MPI2_SCSITASKMGMT_TASKTYPE__XXX (defined in mpi2_init.h) |
|---|
| 2770 | + * @smid_task: smid assigned to the task |
|---|
| 2771 | + * |
|---|
| 2772 | + * Look whether TM has aborted the timed out SCSI command, if |
|---|
| 2773 | + * TM has aborted the IO then return SUCCESS else return FAILED. |
|---|
| 2774 | + */ |
|---|
| 2775 | +static int |
|---|
| 2776 | +scsih_tm_cmd_map_status(struct MPT3SAS_ADAPTER *ioc, uint channel, |
|---|
| 2777 | + uint id, uint lun, u8 type, u16 smid_task) |
|---|
| 2778 | +{ |
|---|
| 2779 | + |
|---|
| 2780 | + if (smid_task <= ioc->shost->can_queue) { |
|---|
| 2781 | + switch (type) { |
|---|
| 2782 | + case MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET: |
|---|
| 2783 | + if (!(_scsih_scsi_lookup_find_by_target(ioc, |
|---|
| 2784 | + id, channel))) |
|---|
| 2785 | + return SUCCESS; |
|---|
| 2786 | + break; |
|---|
| 2787 | + case MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET: |
|---|
| 2788 | + case MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET: |
|---|
| 2789 | + if (!(_scsih_scsi_lookup_find_by_lun(ioc, id, |
|---|
| 2790 | + lun, channel))) |
|---|
| 2791 | + return SUCCESS; |
|---|
| 2792 | + break; |
|---|
| 2793 | + default: |
|---|
| 2794 | + return SUCCESS; |
|---|
| 2795 | + } |
|---|
| 2796 | + } else if (smid_task == ioc->scsih_cmds.smid) { |
|---|
| 2797 | + if ((ioc->scsih_cmds.status & MPT3_CMD_COMPLETE) || |
|---|
| 2798 | + (ioc->scsih_cmds.status & MPT3_CMD_NOT_USED)) |
|---|
| 2799 | + return SUCCESS; |
|---|
| 2800 | + } else if (smid_task == ioc->ctl_cmds.smid) { |
|---|
| 2801 | + if ((ioc->ctl_cmds.status & MPT3_CMD_COMPLETE) || |
|---|
| 2802 | + (ioc->ctl_cmds.status & MPT3_CMD_NOT_USED)) |
|---|
| 2803 | + return SUCCESS; |
|---|
| 2804 | + } |
|---|
| 2805 | + |
|---|
| 2806 | + return FAILED; |
|---|
| 2807 | +} |
|---|
| 2808 | + |
|---|
| 2809 | +/** |
|---|
| 2810 | + * scsih_tm_post_processing - post processing of target & LUN reset |
|---|
| 2811 | + * @ioc - per adapter object |
|---|
| 2812 | + * @handle: device handle |
|---|
| 2813 | + * @channel - the channel assigned by the OS |
|---|
| 2814 | + * @id: the id assigned by the OS |
|---|
| 2815 | + * @lun: lun number |
|---|
| 2816 | + * @type: MPI2_SCSITASKMGMT_TASKTYPE__XXX (defined in mpi2_init.h) |
|---|
| 2817 | + * @smid_task: smid assigned to the task |
|---|
| 2818 | + * |
|---|
| 2819 | + * Post processing of target & LUN reset. Due to interrupt latency |
|---|
| 2820 | + * issue it possible that interrupt for aborted IO might not be |
|---|
| 2821 | + * received yet. So before returning failure status, poll the |
|---|
| 2822 | + * reply descriptor pools for the reply of timed out SCSI command. |
|---|
| 2823 | + * Return FAILED status if reply for timed out is not received |
|---|
| 2824 | + * otherwise return SUCCESS. |
|---|
| 2825 | + */ |
|---|
| 2826 | +static int |
|---|
| 2827 | +scsih_tm_post_processing(struct MPT3SAS_ADAPTER *ioc, u16 handle, |
|---|
| 2828 | + uint channel, uint id, uint lun, u8 type, u16 smid_task) |
|---|
| 2829 | +{ |
|---|
| 2830 | + int rc; |
|---|
| 2831 | + |
|---|
| 2832 | + rc = scsih_tm_cmd_map_status(ioc, channel, id, lun, type, smid_task); |
|---|
| 2833 | + if (rc == SUCCESS) |
|---|
| 2834 | + return rc; |
|---|
| 2835 | + |
|---|
| 2836 | + ioc_info(ioc, |
|---|
| 2837 | + "Poll ReplyDescriptor queues for completion of" |
|---|
| 2838 | + " smid(%d), task_type(0x%02x), handle(0x%04x)\n", |
|---|
| 2839 | + smid_task, type, handle); |
|---|
| 2840 | + |
|---|
| 2841 | + /* |
|---|
| 2842 | + * Due to interrupt latency issues, driver may receive interrupt for |
|---|
| 2843 | + * TM first and then for aborted SCSI IO command. So, poll all the |
|---|
| 2844 | + * ReplyDescriptor pools before returning the FAILED status to SML. |
|---|
| 2845 | + */ |
|---|
| 2846 | + mpt3sas_base_mask_interrupts(ioc); |
|---|
| 2847 | + mpt3sas_base_sync_reply_irqs(ioc, 1); |
|---|
| 2848 | + mpt3sas_base_unmask_interrupts(ioc); |
|---|
| 2849 | + |
|---|
| 2850 | + return scsih_tm_cmd_map_status(ioc, channel, id, lun, type, smid_task); |
|---|
| 2851 | +} |
|---|
| 2852 | + |
|---|
| 2853 | +/** |
|---|
| 2624 | 2854 | * mpt3sas_scsih_issue_tm - main routine for sending tm requests |
|---|
| 2625 | 2855 | * @ioc: per adapter struct |
|---|
| 2626 | 2856 | * @handle: device handle |
|---|
| 2857 | + * @channel: the channel assigned by the OS |
|---|
| 2858 | + * @id: the id assigned by the OS |
|---|
| 2627 | 2859 | * @lun: lun number |
|---|
| 2628 | 2860 | * @type: MPI2_SCSITASKMGMT_TASKTYPE__XXX (defined in mpi2_init.h) |
|---|
| 2629 | 2861 | * @smid_task: smid assigned to the task |
|---|
| .. | .. |
|---|
| 2640 | 2872 | * Return: SUCCESS or FAILED. |
|---|
| 2641 | 2873 | */ |
|---|
| 2642 | 2874 | int |
|---|
| 2643 | | -mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, u64 lun, |
|---|
| 2644 | | - u8 type, u16 smid_task, u16 msix_task, u8 timeout, u8 tr_method) |
|---|
| 2875 | +mpt3sas_scsih_issue_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, uint channel, |
|---|
| 2876 | + uint id, u64 lun, u8 type, u16 smid_task, u16 msix_task, |
|---|
| 2877 | + u8 timeout, u8 tr_method) |
|---|
| 2645 | 2878 | { |
|---|
| 2646 | 2879 | Mpi2SCSITaskManagementRequest_t *mpi_request; |
|---|
| 2647 | 2880 | Mpi2SCSITaskManagementReply_t *mpi_reply; |
|---|
| 2881 | + Mpi25SCSIIORequest_t *request; |
|---|
| 2648 | 2882 | u16 smid = 0; |
|---|
| 2649 | 2883 | u32 ioc_state; |
|---|
| 2650 | 2884 | int rc; |
|---|
| 2885 | + u8 issue_reset = 0; |
|---|
| 2651 | 2886 | |
|---|
| 2652 | 2887 | lockdep_assert_held(&ioc->tm_cmds.mutex); |
|---|
| 2653 | 2888 | |
|---|
| 2654 | 2889 | if (ioc->tm_cmds.status != MPT3_CMD_NOT_USED) { |
|---|
| 2655 | | - pr_info(MPT3SAS_FMT "%s: tm_cmd busy!!!\n", |
|---|
| 2656 | | - __func__, ioc->name); |
|---|
| 2890 | + ioc_info(ioc, "%s: tm_cmd busy!!!\n", __func__); |
|---|
| 2657 | 2891 | return FAILED; |
|---|
| 2658 | 2892 | } |
|---|
| 2659 | 2893 | |
|---|
| 2660 | 2894 | if (ioc->shost_recovery || ioc->remove_host || |
|---|
| 2661 | 2895 | ioc->pci_error_recovery) { |
|---|
| 2662 | | - pr_info(MPT3SAS_FMT "%s: host reset in progress!\n", |
|---|
| 2663 | | - __func__, ioc->name); |
|---|
| 2896 | + ioc_info(ioc, "%s: host reset in progress!\n", __func__); |
|---|
| 2664 | 2897 | return FAILED; |
|---|
| 2665 | 2898 | } |
|---|
| 2666 | 2899 | |
|---|
| 2667 | 2900 | ioc_state = mpt3sas_base_get_iocstate(ioc, 0); |
|---|
| 2668 | 2901 | if (ioc_state & MPI2_DOORBELL_USED) { |
|---|
| 2669 | | - dhsprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 2670 | | - "unexpected doorbell active!\n", ioc->name)); |
|---|
| 2902 | + dhsprintk(ioc, ioc_info(ioc, "unexpected doorbell active!\n")); |
|---|
| 2671 | 2903 | rc = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
|---|
| 2672 | 2904 | return (!rc) ? SUCCESS : FAILED; |
|---|
| 2673 | 2905 | } |
|---|
| 2674 | 2906 | |
|---|
| 2675 | 2907 | if ((ioc_state & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) { |
|---|
| 2676 | | - mpt3sas_base_fault_info(ioc, ioc_state & |
|---|
| 2908 | + mpt3sas_print_fault_code(ioc, ioc_state & |
|---|
| 2909 | + MPI2_DOORBELL_DATA_MASK); |
|---|
| 2910 | + rc = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
|---|
| 2911 | + return (!rc) ? SUCCESS : FAILED; |
|---|
| 2912 | + } else if ((ioc_state & MPI2_IOC_STATE_MASK) == |
|---|
| 2913 | + MPI2_IOC_STATE_COREDUMP) { |
|---|
| 2914 | + mpt3sas_print_coredump_info(ioc, ioc_state & |
|---|
| 2677 | 2915 | MPI2_DOORBELL_DATA_MASK); |
|---|
| 2678 | 2916 | rc = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
|---|
| 2679 | 2917 | return (!rc) ? SUCCESS : FAILED; |
|---|
| .. | .. |
|---|
| 2681 | 2919 | |
|---|
| 2682 | 2920 | smid = mpt3sas_base_get_smid_hpr(ioc, ioc->tm_cb_idx); |
|---|
| 2683 | 2921 | if (!smid) { |
|---|
| 2684 | | - pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n", |
|---|
| 2685 | | - ioc->name, __func__); |
|---|
| 2922 | + ioc_err(ioc, "%s: failed obtaining a smid\n", __func__); |
|---|
| 2686 | 2923 | return FAILED; |
|---|
| 2687 | 2924 | } |
|---|
| 2688 | 2925 | |
|---|
| 2689 | | - dtmprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 2690 | | - "sending tm: handle(0x%04x), task_type(0x%02x), smid(%d), timeout(%d), tr_method(0x%x)\n", |
|---|
| 2691 | | - ioc->name, handle, type, smid_task, timeout, tr_method)); |
|---|
| 2926 | + dtmprintk(ioc, |
|---|
| 2927 | + ioc_info(ioc, "sending tm: handle(0x%04x), task_type(0x%02x), smid(%d), timeout(%d), tr_method(0x%x)\n", |
|---|
| 2928 | + handle, type, smid_task, timeout, tr_method)); |
|---|
| 2692 | 2929 | ioc->tm_cmds.status = MPT3_CMD_PENDING; |
|---|
| 2693 | 2930 | mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); |
|---|
| 2694 | 2931 | ioc->tm_cmds.smid = smid; |
|---|
| .. | .. |
|---|
| 2697 | 2934 | mpi_request->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; |
|---|
| 2698 | 2935 | mpi_request->DevHandle = cpu_to_le16(handle); |
|---|
| 2699 | 2936 | mpi_request->TaskType = type; |
|---|
| 2700 | | - mpi_request->MsgFlags = tr_method; |
|---|
| 2937 | + if (type == MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK || |
|---|
| 2938 | + type == MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK) |
|---|
| 2939 | + mpi_request->MsgFlags = tr_method; |
|---|
| 2701 | 2940 | mpi_request->TaskMID = cpu_to_le16(smid_task); |
|---|
| 2702 | 2941 | int_to_scsilun(lun, (struct scsi_lun *)mpi_request->LUN); |
|---|
| 2703 | 2942 | mpt3sas_scsih_set_tm_flag(ioc, handle); |
|---|
| 2704 | 2943 | init_completion(&ioc->tm_cmds.done); |
|---|
| 2705 | | - mpt3sas_base_put_smid_hi_priority(ioc, smid, msix_task); |
|---|
| 2944 | + ioc->put_smid_hi_priority(ioc, smid, msix_task); |
|---|
| 2706 | 2945 | wait_for_completion_timeout(&ioc->tm_cmds.done, timeout*HZ); |
|---|
| 2707 | 2946 | if (!(ioc->tm_cmds.status & MPT3_CMD_COMPLETE)) { |
|---|
| 2708 | | - if (mpt3sas_base_check_cmd_timeout(ioc, |
|---|
| 2709 | | - ioc->tm_cmds.status, mpi_request, |
|---|
| 2710 | | - sizeof(Mpi2SCSITaskManagementRequest_t)/4)) { |
|---|
| 2947 | + mpt3sas_check_cmd_timeout(ioc, |
|---|
| 2948 | + ioc->tm_cmds.status, mpi_request, |
|---|
| 2949 | + sizeof(Mpi2SCSITaskManagementRequest_t)/4, issue_reset); |
|---|
| 2950 | + if (issue_reset) { |
|---|
| 2711 | 2951 | rc = mpt3sas_base_hard_reset_handler(ioc, |
|---|
| 2712 | 2952 | FORCE_BIG_HAMMER); |
|---|
| 2713 | 2953 | rc = (!rc) ? SUCCESS : FAILED; |
|---|
| .. | .. |
|---|
| 2716 | 2956 | } |
|---|
| 2717 | 2957 | |
|---|
| 2718 | 2958 | /* sync IRQs in case those were busy during flush. */ |
|---|
| 2719 | | - mpt3sas_base_sync_reply_irqs(ioc); |
|---|
| 2959 | + mpt3sas_base_sync_reply_irqs(ioc, 0); |
|---|
| 2720 | 2960 | |
|---|
| 2721 | 2961 | if (ioc->tm_cmds.status & MPT3_CMD_REPLY_VALID) { |
|---|
| 2722 | 2962 | mpt3sas_trigger_master(ioc, MASTER_TRIGGER_TASK_MANAGMENT); |
|---|
| 2723 | 2963 | mpi_reply = ioc->tm_cmds.reply; |
|---|
| 2724 | | - dtmprintk(ioc, pr_info(MPT3SAS_FMT "complete tm: " \ |
|---|
| 2725 | | - "ioc_status(0x%04x), loginfo(0x%08x), term_count(0x%08x)\n", |
|---|
| 2726 | | - ioc->name, le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 2727 | | - le32_to_cpu(mpi_reply->IOCLogInfo), |
|---|
| 2728 | | - le32_to_cpu(mpi_reply->TerminationCount))); |
|---|
| 2964 | + dtmprintk(ioc, |
|---|
| 2965 | + ioc_info(ioc, "complete tm: ioc_status(0x%04x), loginfo(0x%08x), term_count(0x%08x)\n", |
|---|
| 2966 | + le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 2967 | + le32_to_cpu(mpi_reply->IOCLogInfo), |
|---|
| 2968 | + le32_to_cpu(mpi_reply->TerminationCount))); |
|---|
| 2729 | 2969 | if (ioc->logging_level & MPT_DEBUG_TM) { |
|---|
| 2730 | 2970 | _scsih_response_code(ioc, mpi_reply->ResponseCode); |
|---|
| 2731 | 2971 | if (mpi_reply->IOCStatus) |
|---|
| .. | .. |
|---|
| 2733 | 2973 | sizeof(Mpi2SCSITaskManagementRequest_t)/4); |
|---|
| 2734 | 2974 | } |
|---|
| 2735 | 2975 | } |
|---|
| 2736 | | - rc = SUCCESS; |
|---|
| 2976 | + |
|---|
| 2977 | + switch (type) { |
|---|
| 2978 | + case MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK: |
|---|
| 2979 | + rc = SUCCESS; |
|---|
| 2980 | + /* |
|---|
| 2981 | + * If DevHandle filed in smid_task's entry of request pool |
|---|
| 2982 | + * doesn't match with device handle on which this task abort |
|---|
| 2983 | + * TM is received then it means that TM has successfully |
|---|
| 2984 | + * aborted the timed out command. Since smid_task's entry in |
|---|
| 2985 | + * request pool will be memset to zero once the timed out |
|---|
| 2986 | + * command is returned to the SML. If the command is not |
|---|
| 2987 | + * aborted then smid_task’s entry won’t be cleared and it |
|---|
| 2988 | + * will have same DevHandle value on which this task abort TM |
|---|
| 2989 | + * is received and driver will return the TM status as FAILED. |
|---|
| 2990 | + */ |
|---|
| 2991 | + request = mpt3sas_base_get_msg_frame(ioc, smid_task); |
|---|
| 2992 | + if (le16_to_cpu(request->DevHandle) != handle) |
|---|
| 2993 | + break; |
|---|
| 2994 | + |
|---|
| 2995 | + ioc_info(ioc, "Task abort tm failed: handle(0x%04x)," |
|---|
| 2996 | + "timeout(%d) tr_method(0x%x) smid(%d) msix_index(%d)\n", |
|---|
| 2997 | + handle, timeout, tr_method, smid_task, msix_task); |
|---|
| 2998 | + rc = FAILED; |
|---|
| 2999 | + break; |
|---|
| 3000 | + |
|---|
| 3001 | + case MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET: |
|---|
| 3002 | + case MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET: |
|---|
| 3003 | + case MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET: |
|---|
| 3004 | + rc = scsih_tm_post_processing(ioc, handle, channel, id, lun, |
|---|
| 3005 | + type, smid_task); |
|---|
| 3006 | + break; |
|---|
| 3007 | + case MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK: |
|---|
| 3008 | + rc = SUCCESS; |
|---|
| 3009 | + break; |
|---|
| 3010 | + default: |
|---|
| 3011 | + rc = FAILED; |
|---|
| 3012 | + break; |
|---|
| 3013 | + } |
|---|
| 2737 | 3014 | |
|---|
| 2738 | 3015 | out: |
|---|
| 2739 | 3016 | mpt3sas_scsih_clear_tm_flag(ioc, handle); |
|---|
| .. | .. |
|---|
| 2742 | 3019 | } |
|---|
| 2743 | 3020 | |
|---|
| 2744 | 3021 | int mpt3sas_scsih_issue_locked_tm(struct MPT3SAS_ADAPTER *ioc, u16 handle, |
|---|
| 2745 | | - u64 lun, u8 type, u16 smid_task, u16 msix_task, |
|---|
| 2746 | | - u8 timeout, u8 tr_method) |
|---|
| 3022 | + uint channel, uint id, u64 lun, u8 type, u16 smid_task, |
|---|
| 3023 | + u16 msix_task, u8 timeout, u8 tr_method) |
|---|
| 2747 | 3024 | { |
|---|
| 2748 | 3025 | int ret; |
|---|
| 2749 | 3026 | |
|---|
| 2750 | 3027 | mutex_lock(&ioc->tm_cmds.mutex); |
|---|
| 2751 | | - ret = mpt3sas_scsih_issue_tm(ioc, handle, lun, type, smid_task, |
|---|
| 2752 | | - msix_task, timeout, tr_method); |
|---|
| 3028 | + ret = mpt3sas_scsih_issue_tm(ioc, handle, channel, id, lun, type, |
|---|
| 3029 | + smid_task, msix_task, timeout, tr_method); |
|---|
| 2753 | 3030 | mutex_unlock(&ioc->tm_cmds.mutex); |
|---|
| 2754 | 3031 | |
|---|
| 2755 | 3032 | return ret; |
|---|
| .. | .. |
|---|
| 2854 | 3131 | |
|---|
| 2855 | 3132 | u8 timeout = 30; |
|---|
| 2856 | 3133 | struct _pcie_device *pcie_device = NULL; |
|---|
| 2857 | | - sdev_printk(KERN_INFO, scmd->device, |
|---|
| 2858 | | - "attempting task abort! scmd(%p)\n", scmd); |
|---|
| 3134 | + sdev_printk(KERN_INFO, scmd->device, "attempting task abort!" |
|---|
| 3135 | + "scmd(0x%p), outstanding for %u ms & timeout %u ms\n", |
|---|
| 3136 | + scmd, jiffies_to_msecs(jiffies - scmd->jiffies_at_alloc), |
|---|
| 3137 | + (scmd->request->timeout / HZ) * 1000); |
|---|
| 2859 | 3138 | _scsih_tm_display_info(ioc, scmd); |
|---|
| 2860 | 3139 | |
|---|
| 2861 | 3140 | sas_device_priv_data = scmd->device->hostdata; |
|---|
| 2862 | 3141 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target || |
|---|
| 2863 | 3142 | ioc->remove_host) { |
|---|
| 2864 | 3143 | sdev_printk(KERN_INFO, scmd->device, |
|---|
| 2865 | | - "device been deleted! scmd(%p)\n", scmd); |
|---|
| 3144 | + "device been deleted! scmd(0x%p)\n", scmd); |
|---|
| 2866 | 3145 | scmd->result = DID_NO_CONNECT << 16; |
|---|
| 2867 | 3146 | scmd->scsi_done(scmd); |
|---|
| 2868 | 3147 | r = SUCCESS; |
|---|
| .. | .. |
|---|
| 2871 | 3150 | |
|---|
| 2872 | 3151 | /* check for completed command */ |
|---|
| 2873 | 3152 | if (st == NULL || st->cb_idx == 0xFF) { |
|---|
| 3153 | + sdev_printk(KERN_INFO, scmd->device, "No reference found at " |
|---|
| 3154 | + "driver, assuming scmd(0x%p) might have completed\n", scmd); |
|---|
| 2874 | 3155 | scmd->result = DID_RESET << 16; |
|---|
| 2875 | 3156 | r = SUCCESS; |
|---|
| 2876 | 3157 | goto out; |
|---|
| .. | .. |
|---|
| 2889 | 3170 | |
|---|
| 2890 | 3171 | handle = sas_device_priv_data->sas_target->handle; |
|---|
| 2891 | 3172 | pcie_device = mpt3sas_get_pdev_by_handle(ioc, handle); |
|---|
| 2892 | | - if (pcie_device && (!ioc->tm_custom_handling)) |
|---|
| 3173 | + if (pcie_device && (!ioc->tm_custom_handling) && |
|---|
| 3174 | + (!(mpt3sas_scsih_is_pcie_scsi_device(pcie_device->device_info)))) |
|---|
| 2893 | 3175 | timeout = ioc->nvme_abort_timeout; |
|---|
| 2894 | | - r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->lun, |
|---|
| 3176 | + r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->channel, |
|---|
| 3177 | + scmd->device->id, scmd->device->lun, |
|---|
| 2895 | 3178 | MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK, |
|---|
| 2896 | 3179 | st->smid, st->msix_io, timeout, 0); |
|---|
| 2897 | 3180 | /* Command must be cleared after abort */ |
|---|
| 2898 | 3181 | if (r == SUCCESS && st->cb_idx != 0xFF) |
|---|
| 2899 | 3182 | r = FAILED; |
|---|
| 2900 | 3183 | out: |
|---|
| 2901 | | - sdev_printk(KERN_INFO, scmd->device, "task abort: %s scmd(%p)\n", |
|---|
| 3184 | + sdev_printk(KERN_INFO, scmd->device, "task abort: %s scmd(0x%p)\n", |
|---|
| 2902 | 3185 | ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); |
|---|
| 2903 | 3186 | if (pcie_device) |
|---|
| 2904 | 3187 | pcie_device_put(pcie_device); |
|---|
| .. | .. |
|---|
| 2927 | 3210 | struct MPT3SAS_TARGET *target_priv_data = starget->hostdata; |
|---|
| 2928 | 3211 | |
|---|
| 2929 | 3212 | sdev_printk(KERN_INFO, scmd->device, |
|---|
| 2930 | | - "attempting device reset! scmd(%p)\n", scmd); |
|---|
| 3213 | + "attempting device reset! scmd(0x%p)\n", scmd); |
|---|
| 2931 | 3214 | _scsih_tm_display_info(ioc, scmd); |
|---|
| 2932 | 3215 | |
|---|
| 2933 | 3216 | sas_device_priv_data = scmd->device->hostdata; |
|---|
| 2934 | 3217 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target || |
|---|
| 2935 | 3218 | ioc->remove_host) { |
|---|
| 2936 | 3219 | sdev_printk(KERN_INFO, scmd->device, |
|---|
| 2937 | | - "device been deleted! scmd(%p)\n", scmd); |
|---|
| 3220 | + "device been deleted! scmd(0x%p)\n", scmd); |
|---|
| 2938 | 3221 | scmd->result = DID_NO_CONNECT << 16; |
|---|
| 2939 | 3222 | scmd->scsi_done(scmd); |
|---|
| 2940 | 3223 | r = SUCCESS; |
|---|
| .. | .. |
|---|
| 2960 | 3243 | |
|---|
| 2961 | 3244 | pcie_device = mpt3sas_get_pdev_by_handle(ioc, handle); |
|---|
| 2962 | 3245 | |
|---|
| 2963 | | - if (pcie_device && (!ioc->tm_custom_handling)) { |
|---|
| 3246 | + if (pcie_device && (!ioc->tm_custom_handling) && |
|---|
| 3247 | + (!(mpt3sas_scsih_is_pcie_scsi_device(pcie_device->device_info)))) { |
|---|
| 2964 | 3248 | tr_timeout = pcie_device->reset_timeout; |
|---|
| 2965 | 3249 | tr_method = MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE; |
|---|
| 2966 | 3250 | } else |
|---|
| 2967 | 3251 | tr_method = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; |
|---|
| 2968 | | - r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->lun, |
|---|
| 3252 | + |
|---|
| 3253 | + r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->channel, |
|---|
| 3254 | + scmd->device->id, scmd->device->lun, |
|---|
| 2969 | 3255 | MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET, 0, 0, |
|---|
| 2970 | 3256 | tr_timeout, tr_method); |
|---|
| 2971 | 3257 | /* Check for busy commands after reset */ |
|---|
| 2972 | 3258 | if (r == SUCCESS && atomic_read(&scmd->device->device_busy)) |
|---|
| 2973 | 3259 | r = FAILED; |
|---|
| 2974 | 3260 | out: |
|---|
| 2975 | | - sdev_printk(KERN_INFO, scmd->device, "device reset: %s scmd(%p)\n", |
|---|
| 3261 | + sdev_printk(KERN_INFO, scmd->device, "device reset: %s scmd(0x%p)\n", |
|---|
| 2976 | 3262 | ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); |
|---|
| 2977 | 3263 | |
|---|
| 2978 | 3264 | if (sas_device) |
|---|
| .. | .. |
|---|
| 3003 | 3289 | struct scsi_target *starget = scmd->device->sdev_target; |
|---|
| 3004 | 3290 | struct MPT3SAS_TARGET *target_priv_data = starget->hostdata; |
|---|
| 3005 | 3291 | |
|---|
| 3006 | | - starget_printk(KERN_INFO, starget, "attempting target reset! scmd(%p)\n", |
|---|
| 3007 | | - scmd); |
|---|
| 3292 | + starget_printk(KERN_INFO, starget, |
|---|
| 3293 | + "attempting target reset! scmd(0x%p)\n", scmd); |
|---|
| 3008 | 3294 | _scsih_tm_display_info(ioc, scmd); |
|---|
| 3009 | 3295 | |
|---|
| 3010 | 3296 | sas_device_priv_data = scmd->device->hostdata; |
|---|
| 3011 | 3297 | if (!sas_device_priv_data || !sas_device_priv_data->sas_target || |
|---|
| 3012 | 3298 | ioc->remove_host) { |
|---|
| 3013 | | - starget_printk(KERN_INFO, starget, "target been deleted! scmd(%p)\n", |
|---|
| 3014 | | - scmd); |
|---|
| 3299 | + starget_printk(KERN_INFO, starget, |
|---|
| 3300 | + "target been deleted! scmd(0x%p)\n", scmd); |
|---|
| 3015 | 3301 | scmd->result = DID_NO_CONNECT << 16; |
|---|
| 3016 | 3302 | scmd->scsi_done(scmd); |
|---|
| 3017 | 3303 | r = SUCCESS; |
|---|
| .. | .. |
|---|
| 3037 | 3323 | |
|---|
| 3038 | 3324 | pcie_device = mpt3sas_get_pdev_by_handle(ioc, handle); |
|---|
| 3039 | 3325 | |
|---|
| 3040 | | - if (pcie_device && (!ioc->tm_custom_handling)) { |
|---|
| 3326 | + if (pcie_device && (!ioc->tm_custom_handling) && |
|---|
| 3327 | + (!(mpt3sas_scsih_is_pcie_scsi_device(pcie_device->device_info)))) { |
|---|
| 3041 | 3328 | tr_timeout = pcie_device->reset_timeout; |
|---|
| 3042 | 3329 | tr_method = MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE; |
|---|
| 3043 | 3330 | } else |
|---|
| 3044 | 3331 | tr_method = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; |
|---|
| 3045 | | - r = mpt3sas_scsih_issue_locked_tm(ioc, handle, 0, |
|---|
| 3332 | + r = mpt3sas_scsih_issue_locked_tm(ioc, handle, scmd->device->channel, |
|---|
| 3333 | + scmd->device->id, 0, |
|---|
| 3046 | 3334 | MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 0, 0, |
|---|
| 3047 | 3335 | tr_timeout, tr_method); |
|---|
| 3048 | 3336 | /* Check for busy commands after reset */ |
|---|
| 3049 | 3337 | if (r == SUCCESS && atomic_read(&starget->target_busy)) |
|---|
| 3050 | 3338 | r = FAILED; |
|---|
| 3051 | 3339 | out: |
|---|
| 3052 | | - starget_printk(KERN_INFO, starget, "target reset: %s scmd(%p)\n", |
|---|
| 3340 | + starget_printk(KERN_INFO, starget, "target reset: %s scmd(0x%p)\n", |
|---|
| 3053 | 3341 | ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); |
|---|
| 3054 | 3342 | |
|---|
| 3055 | 3343 | if (sas_device) |
|---|
| .. | .. |
|---|
| 3072 | 3360 | struct MPT3SAS_ADAPTER *ioc = shost_priv(scmd->device->host); |
|---|
| 3073 | 3361 | int r, retval; |
|---|
| 3074 | 3362 | |
|---|
| 3075 | | - pr_info(MPT3SAS_FMT "attempting host reset! scmd(%p)\n", |
|---|
| 3076 | | - ioc->name, scmd); |
|---|
| 3363 | + ioc_info(ioc, "attempting host reset! scmd(0x%p)\n", scmd); |
|---|
| 3077 | 3364 | scsi_print_command(scmd); |
|---|
| 3078 | 3365 | |
|---|
| 3079 | 3366 | if (ioc->is_driver_loading || ioc->remove_host) { |
|---|
| 3080 | | - pr_info(MPT3SAS_FMT "Blocking the host reset\n", |
|---|
| 3081 | | - ioc->name); |
|---|
| 3367 | + ioc_info(ioc, "Blocking the host reset\n"); |
|---|
| 3082 | 3368 | r = FAILED; |
|---|
| 3083 | 3369 | goto out; |
|---|
| 3084 | 3370 | } |
|---|
| .. | .. |
|---|
| 3086 | 3372 | retval = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
|---|
| 3087 | 3373 | r = (retval < 0) ? FAILED : SUCCESS; |
|---|
| 3088 | 3374 | out: |
|---|
| 3089 | | - pr_info(MPT3SAS_FMT "host reset: %s scmd(%p)\n", |
|---|
| 3090 | | - ioc->name, ((r == SUCCESS) ? "SUCCESS" : "FAILED"), scmd); |
|---|
| 3375 | + ioc_info(ioc, "host reset: %s scmd(0x%p)\n", |
|---|
| 3376 | + r == SUCCESS ? "SUCCESS" : "FAILED", scmd); |
|---|
| 3091 | 3377 | |
|---|
| 3092 | 3378 | return r; |
|---|
| 3093 | 3379 | } |
|---|
| .. | .. |
|---|
| 3215 | 3501 | fw_event = list_first_entry(&ioc->fw_event_list, |
|---|
| 3216 | 3502 | struct fw_event_work, list); |
|---|
| 3217 | 3503 | list_del_init(&fw_event->list); |
|---|
| 3504 | + fw_event_work_put(fw_event); |
|---|
| 3218 | 3505 | } |
|---|
| 3219 | 3506 | spin_unlock_irqrestore(&ioc->fw_event_lock, flags); |
|---|
| 3220 | 3507 | |
|---|
| .. | .. |
|---|
| 3233 | 3520 | { |
|---|
| 3234 | 3521 | struct fw_event_work *fw_event; |
|---|
| 3235 | 3522 | |
|---|
| 3236 | | - if (list_empty(&ioc->fw_event_list) || |
|---|
| 3523 | + if ((list_empty(&ioc->fw_event_list) && !ioc->current_event) || |
|---|
| 3237 | 3524 | !ioc->firmware_event_thread || in_interrupt()) |
|---|
| 3238 | 3525 | return; |
|---|
| 3239 | 3526 | |
|---|
| 3240 | | - while ((fw_event = dequeue_next_fw_event(ioc))) { |
|---|
| 3527 | + ioc->fw_events_cleanup = 1; |
|---|
| 3528 | + while ((fw_event = dequeue_next_fw_event(ioc)) || |
|---|
| 3529 | + (fw_event = ioc->current_event)) { |
|---|
| 3530 | + |
|---|
| 3531 | + /* |
|---|
| 3532 | + * Don't call cancel_work_sync() for current_event |
|---|
| 3533 | + * other than MPT3SAS_REMOVE_UNRESPONDING_DEVICES; |
|---|
| 3534 | + * otherwise we may observe deadlock if current |
|---|
| 3535 | + * hard reset issued as part of processing the current_event. |
|---|
| 3536 | + * |
|---|
| 3537 | + * Orginal logic of cleaning the current_event is added |
|---|
| 3538 | + * for handling the back to back host reset issued by the user. |
|---|
| 3539 | + * i.e. during back to back host reset, driver use to process |
|---|
| 3540 | + * the two instances of MPT3SAS_REMOVE_UNRESPONDING_DEVICES |
|---|
| 3541 | + * event back to back and this made the drives to unregister |
|---|
| 3542 | + * the devices from SML. |
|---|
| 3543 | + */ |
|---|
| 3544 | + |
|---|
| 3545 | + if (fw_event == ioc->current_event && |
|---|
| 3546 | + ioc->current_event->event != |
|---|
| 3547 | + MPT3SAS_REMOVE_UNRESPONDING_DEVICES) { |
|---|
| 3548 | + ioc->current_event = NULL; |
|---|
| 3549 | + continue; |
|---|
| 3550 | + } |
|---|
| 3551 | + |
|---|
| 3241 | 3552 | /* |
|---|
| 3242 | 3553 | * Wait on the fw_event to complete. If this returns 1, then |
|---|
| 3243 | 3554 | * the event was never executed, and we need a put for the |
|---|
| .. | .. |
|---|
| 3249 | 3560 | if (cancel_work_sync(&fw_event->work)) |
|---|
| 3250 | 3561 | fw_event_work_put(fw_event); |
|---|
| 3251 | 3562 | |
|---|
| 3252 | | - fw_event_work_put(fw_event); |
|---|
| 3253 | 3563 | } |
|---|
| 3564 | + ioc->fw_events_cleanup = 0; |
|---|
| 3254 | 3565 | } |
|---|
| 3255 | 3566 | |
|---|
| 3256 | 3567 | /** |
|---|
| .. | .. |
|---|
| 3579 | 3890 | u8 tr_method = 0; |
|---|
| 3580 | 3891 | |
|---|
| 3581 | 3892 | if (ioc->pci_error_recovery) { |
|---|
| 3582 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3583 | | - "%s: host in pci error recovery: handle(0x%04x)\n", |
|---|
| 3584 | | - __func__, ioc->name, |
|---|
| 3585 | | - handle)); |
|---|
| 3893 | + dewtprintk(ioc, |
|---|
| 3894 | + ioc_info(ioc, "%s: host in pci error recovery: handle(0x%04x)\n", |
|---|
| 3895 | + __func__, handle)); |
|---|
| 3586 | 3896 | return; |
|---|
| 3587 | 3897 | } |
|---|
| 3588 | 3898 | ioc_state = mpt3sas_base_get_iocstate(ioc, 1); |
|---|
| 3589 | 3899 | if (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { |
|---|
| 3590 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3591 | | - "%s: host is not operational: handle(0x%04x)\n", |
|---|
| 3592 | | - __func__, ioc->name, |
|---|
| 3593 | | - handle)); |
|---|
| 3900 | + dewtprintk(ioc, |
|---|
| 3901 | + ioc_info(ioc, "%s: host is not operational: handle(0x%04x)\n", |
|---|
| 3902 | + __func__, handle)); |
|---|
| 3594 | 3903 | return; |
|---|
| 3595 | 3904 | } |
|---|
| 3596 | 3905 | |
|---|
| .. | .. |
|---|
| 3619 | 3928 | sas_address = pcie_device->wwid; |
|---|
| 3620 | 3929 | } |
|---|
| 3621 | 3930 | spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); |
|---|
| 3622 | | - if (pcie_device && (!ioc->tm_custom_handling)) |
|---|
| 3931 | + if (pcie_device && (!ioc->tm_custom_handling) && |
|---|
| 3932 | + (!(mpt3sas_scsih_is_pcie_scsi_device( |
|---|
| 3933 | + pcie_device->device_info)))) |
|---|
| 3623 | 3934 | tr_method = |
|---|
| 3624 | 3935 | MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE; |
|---|
| 3625 | 3936 | else |
|---|
| 3626 | 3937 | tr_method = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; |
|---|
| 3627 | 3938 | } |
|---|
| 3628 | 3939 | if (sas_target_priv_data) { |
|---|
| 3629 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3630 | | - "setting delete flag: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 3631 | | - ioc->name, handle, |
|---|
| 3632 | | - (unsigned long long)sas_address)); |
|---|
| 3940 | + dewtprintk(ioc, |
|---|
| 3941 | + ioc_info(ioc, "setting delete flag: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 3942 | + handle, (u64)sas_address)); |
|---|
| 3633 | 3943 | if (sas_device) { |
|---|
| 3634 | 3944 | if (sas_device->enclosure_handle != 0) |
|---|
| 3635 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3636 | | - "setting delete flag:enclosure logical " |
|---|
| 3637 | | - "id(0x%016llx), slot(%d)\n", ioc->name, |
|---|
| 3638 | | - (unsigned long long) |
|---|
| 3639 | | - sas_device->enclosure_logical_id, |
|---|
| 3640 | | - sas_device->slot)); |
|---|
| 3945 | + dewtprintk(ioc, |
|---|
| 3946 | + ioc_info(ioc, "setting delete flag:enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 3947 | + (u64)sas_device->enclosure_logical_id, |
|---|
| 3948 | + sas_device->slot)); |
|---|
| 3641 | 3949 | if (sas_device->connector_name[0] != '\0') |
|---|
| 3642 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3643 | | - "setting delete flag: enclosure " |
|---|
| 3644 | | - "level(0x%04x), connector name( %s)\n", |
|---|
| 3645 | | - ioc->name, sas_device->enclosure_level, |
|---|
| 3646 | | - sas_device->connector_name)); |
|---|
| 3950 | + dewtprintk(ioc, |
|---|
| 3951 | + ioc_info(ioc, "setting delete flag: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 3952 | + sas_device->enclosure_level, |
|---|
| 3953 | + sas_device->connector_name)); |
|---|
| 3647 | 3954 | } else if (pcie_device) { |
|---|
| 3648 | 3955 | if (pcie_device->enclosure_handle != 0) |
|---|
| 3649 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3650 | | - "setting delete flag: logical " |
|---|
| 3651 | | - "id(0x%016llx), slot(%d)\n", ioc->name, |
|---|
| 3652 | | - (unsigned long long) |
|---|
| 3653 | | - pcie_device->enclosure_logical_id, |
|---|
| 3654 | | - pcie_device->slot)); |
|---|
| 3956 | + dewtprintk(ioc, |
|---|
| 3957 | + ioc_info(ioc, "setting delete flag: logical id(0x%016llx), slot(%d)\n", |
|---|
| 3958 | + (u64)pcie_device->enclosure_logical_id, |
|---|
| 3959 | + pcie_device->slot)); |
|---|
| 3655 | 3960 | if (pcie_device->connector_name[0] != '\0') |
|---|
| 3656 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3657 | | - "setting delete flag:, enclosure " |
|---|
| 3658 | | - "level(0x%04x), " |
|---|
| 3659 | | - "connector name( %s)\n", ioc->name, |
|---|
| 3660 | | - pcie_device->enclosure_level, |
|---|
| 3661 | | - pcie_device->connector_name)); |
|---|
| 3961 | + dewtprintk(ioc, |
|---|
| 3962 | + ioc_info(ioc, "setting delete flag:, enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 3963 | + pcie_device->enclosure_level, |
|---|
| 3964 | + pcie_device->connector_name)); |
|---|
| 3662 | 3965 | } |
|---|
| 3663 | 3966 | _scsih_ublock_io_device(ioc, sas_address); |
|---|
| 3664 | 3967 | sas_target_priv_data->handle = MPT3SAS_INVALID_DEVICE_HANDLE; |
|---|
| .. | .. |
|---|
| 3672 | 3975 | INIT_LIST_HEAD(&delayed_tr->list); |
|---|
| 3673 | 3976 | delayed_tr->handle = handle; |
|---|
| 3674 | 3977 | list_add_tail(&delayed_tr->list, &ioc->delayed_tr_list); |
|---|
| 3675 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3676 | | - "DELAYED:tr:handle(0x%04x), (open)\n", |
|---|
| 3677 | | - ioc->name, handle)); |
|---|
| 3978 | + dewtprintk(ioc, |
|---|
| 3979 | + ioc_info(ioc, "DELAYED:tr:handle(0x%04x), (open)\n", |
|---|
| 3980 | + handle)); |
|---|
| 3678 | 3981 | goto out; |
|---|
| 3679 | 3982 | } |
|---|
| 3680 | 3983 | |
|---|
| 3681 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3682 | | - "tr_send:handle(0x%04x), (open), smid(%d), cb(%d)\n", |
|---|
| 3683 | | - ioc->name, handle, smid, |
|---|
| 3684 | | - ioc->tm_tr_cb_idx)); |
|---|
| 3984 | + dewtprintk(ioc, |
|---|
| 3985 | + ioc_info(ioc, "tr_send:handle(0x%04x), (open), smid(%d), cb(%d)\n", |
|---|
| 3986 | + handle, smid, ioc->tm_tr_cb_idx)); |
|---|
| 3685 | 3987 | mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); |
|---|
| 3686 | 3988 | memset(mpi_request, 0, sizeof(Mpi2SCSITaskManagementRequest_t)); |
|---|
| 3687 | 3989 | mpi_request->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; |
|---|
| .. | .. |
|---|
| 3689 | 3991 | mpi_request->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; |
|---|
| 3690 | 3992 | mpi_request->MsgFlags = tr_method; |
|---|
| 3691 | 3993 | set_bit(handle, ioc->device_remove_in_progress); |
|---|
| 3692 | | - mpt3sas_base_put_smid_hi_priority(ioc, smid, 0); |
|---|
| 3994 | + ioc->put_smid_hi_priority(ioc, smid, 0); |
|---|
| 3693 | 3995 | mpt3sas_trigger_master(ioc, MASTER_TRIGGER_DEVICE_REMOVAL); |
|---|
| 3694 | 3996 | |
|---|
| 3695 | 3997 | out: |
|---|
| .. | .. |
|---|
| 3729 | 4031 | struct _sc_list *delayed_sc; |
|---|
| 3730 | 4032 | |
|---|
| 3731 | 4033 | if (ioc->pci_error_recovery) { |
|---|
| 3732 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3733 | | - "%s: host in pci error recovery\n", __func__, |
|---|
| 3734 | | - ioc->name)); |
|---|
| 4034 | + dewtprintk(ioc, |
|---|
| 4035 | + ioc_info(ioc, "%s: host in pci error recovery\n", |
|---|
| 4036 | + __func__)); |
|---|
| 3735 | 4037 | return 1; |
|---|
| 3736 | 4038 | } |
|---|
| 3737 | 4039 | ioc_state = mpt3sas_base_get_iocstate(ioc, 1); |
|---|
| 3738 | 4040 | if (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { |
|---|
| 3739 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3740 | | - "%s: host is not operational\n", __func__, ioc->name)); |
|---|
| 4041 | + dewtprintk(ioc, |
|---|
| 4042 | + ioc_info(ioc, "%s: host is not operational\n", |
|---|
| 4043 | + __func__)); |
|---|
| 3741 | 4044 | return 1; |
|---|
| 3742 | 4045 | } |
|---|
| 3743 | 4046 | if (unlikely(!mpi_reply)) { |
|---|
| 3744 | | - pr_err(MPT3SAS_FMT "mpi_reply not valid at %s:%d/%s()!\n", |
|---|
| 3745 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 4047 | + ioc_err(ioc, "mpi_reply not valid at %s:%d/%s()!\n", |
|---|
| 4048 | + __FILE__, __LINE__, __func__); |
|---|
| 3746 | 4049 | return 1; |
|---|
| 3747 | 4050 | } |
|---|
| 3748 | 4051 | mpi_request_tm = mpt3sas_base_get_msg_frame(ioc, smid); |
|---|
| 3749 | 4052 | handle = le16_to_cpu(mpi_request_tm->DevHandle); |
|---|
| 3750 | 4053 | if (handle != le16_to_cpu(mpi_reply->DevHandle)) { |
|---|
| 3751 | | - dewtprintk(ioc, pr_err(MPT3SAS_FMT |
|---|
| 3752 | | - "spurious interrupt: handle(0x%04x:0x%04x), smid(%d)!!!\n", |
|---|
| 3753 | | - ioc->name, handle, |
|---|
| 3754 | | - le16_to_cpu(mpi_reply->DevHandle), smid)); |
|---|
| 4054 | + dewtprintk(ioc, |
|---|
| 4055 | + ioc_err(ioc, "spurious interrupt: handle(0x%04x:0x%04x), smid(%d)!!!\n", |
|---|
| 4056 | + handle, |
|---|
| 4057 | + le16_to_cpu(mpi_reply->DevHandle), smid)); |
|---|
| 3755 | 4058 | return 0; |
|---|
| 3756 | 4059 | } |
|---|
| 3757 | 4060 | |
|---|
| 3758 | 4061 | mpt3sas_trigger_master(ioc, MASTER_TRIGGER_TASK_MANAGMENT); |
|---|
| 3759 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3760 | | - "tr_complete:handle(0x%04x), (open) smid(%d), ioc_status(0x%04x), " |
|---|
| 3761 | | - "loginfo(0x%08x), completed(%d)\n", ioc->name, |
|---|
| 3762 | | - handle, smid, le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 3763 | | - le32_to_cpu(mpi_reply->IOCLogInfo), |
|---|
| 3764 | | - le32_to_cpu(mpi_reply->TerminationCount))); |
|---|
| 4062 | + dewtprintk(ioc, |
|---|
| 4063 | + ioc_info(ioc, "tr_complete:handle(0x%04x), (open) smid(%d), ioc_status(0x%04x), loginfo(0x%08x), completed(%d)\n", |
|---|
| 4064 | + handle, smid, le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 4065 | + le32_to_cpu(mpi_reply->IOCLogInfo), |
|---|
| 4066 | + le32_to_cpu(mpi_reply->TerminationCount))); |
|---|
| 3765 | 4067 | |
|---|
| 3766 | 4068 | smid_sas_ctrl = mpt3sas_base_get_smid(ioc, ioc->tm_sas_control_cb_idx); |
|---|
| 3767 | 4069 | if (!smid_sas_ctrl) { |
|---|
| .. | .. |
|---|
| 3771 | 4073 | INIT_LIST_HEAD(&delayed_sc->list); |
|---|
| 3772 | 4074 | delayed_sc->handle = le16_to_cpu(mpi_request_tm->DevHandle); |
|---|
| 3773 | 4075 | list_add_tail(&delayed_sc->list, &ioc->delayed_sc_list); |
|---|
| 3774 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3775 | | - "DELAYED:sc:handle(0x%04x), (open)\n", |
|---|
| 3776 | | - ioc->name, handle)); |
|---|
| 4076 | + dewtprintk(ioc, |
|---|
| 4077 | + ioc_info(ioc, "DELAYED:sc:handle(0x%04x), (open)\n", |
|---|
| 4078 | + handle)); |
|---|
| 3777 | 4079 | return _scsih_check_for_pending_tm(ioc, smid); |
|---|
| 3778 | 4080 | } |
|---|
| 3779 | 4081 | |
|---|
| 3780 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3781 | | - "sc_send:handle(0x%04x), (open), smid(%d), cb(%d)\n", |
|---|
| 3782 | | - ioc->name, handle, smid_sas_ctrl, |
|---|
| 3783 | | - ioc->tm_sas_control_cb_idx)); |
|---|
| 4082 | + dewtprintk(ioc, |
|---|
| 4083 | + ioc_info(ioc, "sc_send:handle(0x%04x), (open), smid(%d), cb(%d)\n", |
|---|
| 4084 | + handle, smid_sas_ctrl, ioc->tm_sas_control_cb_idx)); |
|---|
| 3784 | 4085 | mpi_request = mpt3sas_base_get_msg_frame(ioc, smid_sas_ctrl); |
|---|
| 3785 | 4086 | memset(mpi_request, 0, sizeof(Mpi2SasIoUnitControlRequest_t)); |
|---|
| 3786 | 4087 | mpi_request->Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL; |
|---|
| 3787 | 4088 | mpi_request->Operation = MPI2_SAS_OP_REMOVE_DEVICE; |
|---|
| 3788 | 4089 | mpi_request->DevHandle = mpi_request_tm->DevHandle; |
|---|
| 3789 | | - mpt3sas_base_put_smid_default(ioc, smid_sas_ctrl); |
|---|
| 4090 | + ioc->put_smid_default(ioc, smid_sas_ctrl); |
|---|
| 3790 | 4091 | |
|---|
| 3791 | 4092 | return _scsih_check_for_pending_tm(ioc, smid); |
|---|
| 3792 | 4093 | } |
|---|
| .. | .. |
|---|
| 3849 | 4150 | mpt3sas_base_get_reply_virt_addr(ioc, reply); |
|---|
| 3850 | 4151 | |
|---|
| 3851 | 4152 | if (likely(mpi_reply)) { |
|---|
| 3852 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3853 | | - "sc_complete:handle(0x%04x), (open) " |
|---|
| 3854 | | - "smid(%d), ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 3855 | | - ioc->name, le16_to_cpu(mpi_reply->DevHandle), smid, |
|---|
| 3856 | | - le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 3857 | | - le32_to_cpu(mpi_reply->IOCLogInfo))); |
|---|
| 4153 | + dewtprintk(ioc, |
|---|
| 4154 | + ioc_info(ioc, "sc_complete:handle(0x%04x), (open) smid(%d), ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 4155 | + le16_to_cpu(mpi_reply->DevHandle), smid, |
|---|
| 4156 | + le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 4157 | + le32_to_cpu(mpi_reply->IOCLogInfo))); |
|---|
| 3858 | 4158 | if (le16_to_cpu(mpi_reply->IOCStatus) == |
|---|
| 3859 | 4159 | MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 3860 | 4160 | clear_bit(le16_to_cpu(mpi_reply->DevHandle), |
|---|
| 3861 | 4161 | ioc->device_remove_in_progress); |
|---|
| 3862 | 4162 | } |
|---|
| 3863 | 4163 | } else { |
|---|
| 3864 | | - pr_err(MPT3SAS_FMT "mpi_reply not valid at %s:%d/%s()!\n", |
|---|
| 3865 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 4164 | + ioc_err(ioc, "mpi_reply not valid at %s:%d/%s()!\n", |
|---|
| 4165 | + __FILE__, __LINE__, __func__); |
|---|
| 3866 | 4166 | } |
|---|
| 3867 | 4167 | return mpt3sas_check_for_pending_internal_cmds(ioc, smid); |
|---|
| 3868 | 4168 | } |
|---|
| .. | .. |
|---|
| 3885 | 4185 | struct _tr_list *delayed_tr; |
|---|
| 3886 | 4186 | |
|---|
| 3887 | 4187 | if (ioc->pci_error_recovery) { |
|---|
| 3888 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3889 | | - "%s: host reset in progress!\n", |
|---|
| 3890 | | - __func__, ioc->name)); |
|---|
| 4188 | + dewtprintk(ioc, |
|---|
| 4189 | + ioc_info(ioc, "%s: host reset in progress!\n", |
|---|
| 4190 | + __func__)); |
|---|
| 3891 | 4191 | return; |
|---|
| 3892 | 4192 | } |
|---|
| 3893 | 4193 | |
|---|
| .. | .. |
|---|
| 3899 | 4199 | INIT_LIST_HEAD(&delayed_tr->list); |
|---|
| 3900 | 4200 | delayed_tr->handle = handle; |
|---|
| 3901 | 4201 | list_add_tail(&delayed_tr->list, &ioc->delayed_tr_volume_list); |
|---|
| 3902 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3903 | | - "DELAYED:tr:handle(0x%04x), (open)\n", |
|---|
| 3904 | | - ioc->name, handle)); |
|---|
| 4202 | + dewtprintk(ioc, |
|---|
| 4203 | + ioc_info(ioc, "DELAYED:tr:handle(0x%04x), (open)\n", |
|---|
| 4204 | + handle)); |
|---|
| 3905 | 4205 | return; |
|---|
| 3906 | 4206 | } |
|---|
| 3907 | 4207 | |
|---|
| 3908 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3909 | | - "tr_send:handle(0x%04x), (open), smid(%d), cb(%d)\n", |
|---|
| 3910 | | - ioc->name, handle, smid, |
|---|
| 3911 | | - ioc->tm_tr_volume_cb_idx)); |
|---|
| 4208 | + dewtprintk(ioc, |
|---|
| 4209 | + ioc_info(ioc, "tr_send:handle(0x%04x), (open), smid(%d), cb(%d)\n", |
|---|
| 4210 | + handle, smid, ioc->tm_tr_volume_cb_idx)); |
|---|
| 3912 | 4211 | mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); |
|---|
| 3913 | 4212 | memset(mpi_request, 0, sizeof(Mpi2SCSITaskManagementRequest_t)); |
|---|
| 3914 | 4213 | mpi_request->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; |
|---|
| 3915 | 4214 | mpi_request->DevHandle = cpu_to_le16(handle); |
|---|
| 3916 | 4215 | mpi_request->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; |
|---|
| 3917 | | - mpt3sas_base_put_smid_hi_priority(ioc, smid, 0); |
|---|
| 4216 | + ioc->put_smid_hi_priority(ioc, smid, 0); |
|---|
| 3918 | 4217 | } |
|---|
| 3919 | 4218 | |
|---|
| 3920 | 4219 | /** |
|---|
| .. | .. |
|---|
| 3938 | 4237 | mpt3sas_base_get_reply_virt_addr(ioc, reply); |
|---|
| 3939 | 4238 | |
|---|
| 3940 | 4239 | if (ioc->shost_recovery || ioc->pci_error_recovery) { |
|---|
| 3941 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3942 | | - "%s: host reset in progress!\n", |
|---|
| 3943 | | - __func__, ioc->name)); |
|---|
| 4240 | + dewtprintk(ioc, |
|---|
| 4241 | + ioc_info(ioc, "%s: host reset in progress!\n", |
|---|
| 4242 | + __func__)); |
|---|
| 3944 | 4243 | return 1; |
|---|
| 3945 | 4244 | } |
|---|
| 3946 | 4245 | if (unlikely(!mpi_reply)) { |
|---|
| 3947 | | - pr_err(MPT3SAS_FMT "mpi_reply not valid at %s:%d/%s()!\n", |
|---|
| 3948 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 4246 | + ioc_err(ioc, "mpi_reply not valid at %s:%d/%s()!\n", |
|---|
| 4247 | + __FILE__, __LINE__, __func__); |
|---|
| 3949 | 4248 | return 1; |
|---|
| 3950 | 4249 | } |
|---|
| 3951 | 4250 | |
|---|
| 3952 | 4251 | mpi_request_tm = mpt3sas_base_get_msg_frame(ioc, smid); |
|---|
| 3953 | 4252 | handle = le16_to_cpu(mpi_request_tm->DevHandle); |
|---|
| 3954 | 4253 | if (handle != le16_to_cpu(mpi_reply->DevHandle)) { |
|---|
| 3955 | | - dewtprintk(ioc, pr_err(MPT3SAS_FMT |
|---|
| 3956 | | - "spurious interrupt: handle(0x%04x:0x%04x), smid(%d)!!!\n", |
|---|
| 3957 | | - ioc->name, handle, |
|---|
| 3958 | | - le16_to_cpu(mpi_reply->DevHandle), smid)); |
|---|
| 4254 | + dewtprintk(ioc, |
|---|
| 4255 | + ioc_err(ioc, "spurious interrupt: handle(0x%04x:0x%04x), smid(%d)!!!\n", |
|---|
| 4256 | + handle, le16_to_cpu(mpi_reply->DevHandle), |
|---|
| 4257 | + smid)); |
|---|
| 3959 | 4258 | return 0; |
|---|
| 3960 | 4259 | } |
|---|
| 3961 | 4260 | |
|---|
| 3962 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3963 | | - "tr_complete:handle(0x%04x), (open) smid(%d), ioc_status(0x%04x), " |
|---|
| 3964 | | - "loginfo(0x%08x), completed(%d)\n", ioc->name, |
|---|
| 3965 | | - handle, smid, le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 3966 | | - le32_to_cpu(mpi_reply->IOCLogInfo), |
|---|
| 3967 | | - le32_to_cpu(mpi_reply->TerminationCount))); |
|---|
| 4261 | + dewtprintk(ioc, |
|---|
| 4262 | + ioc_info(ioc, "tr_complete:handle(0x%04x), (open) smid(%d), ioc_status(0x%04x), loginfo(0x%08x), completed(%d)\n", |
|---|
| 4263 | + handle, smid, le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 4264 | + le32_to_cpu(mpi_reply->IOCLogInfo), |
|---|
| 4265 | + le32_to_cpu(mpi_reply->TerminationCount))); |
|---|
| 3968 | 4266 | |
|---|
| 3969 | 4267 | return _scsih_check_for_pending_tm(ioc, smid); |
|---|
| 3970 | 4268 | } |
|---|
| .. | .. |
|---|
| 3994 | 4292 | ioc->internal_lookup[i].cb_idx = ioc->base_cb_idx; |
|---|
| 3995 | 4293 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); |
|---|
| 3996 | 4294 | |
|---|
| 3997 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 3998 | | - "EVENT ACK: event(0x%04x), smid(%d), cb(%d)\n", |
|---|
| 3999 | | - ioc->name, le16_to_cpu(event), smid, |
|---|
| 4000 | | - ioc->base_cb_idx)); |
|---|
| 4295 | + dewtprintk(ioc, |
|---|
| 4296 | + ioc_info(ioc, "EVENT ACK: event(0x%04x), smid(%d), cb(%d)\n", |
|---|
| 4297 | + le16_to_cpu(event), smid, ioc->base_cb_idx)); |
|---|
| 4001 | 4298 | ack_request = mpt3sas_base_get_msg_frame(ioc, smid); |
|---|
| 4002 | 4299 | memset(ack_request, 0, sizeof(Mpi2EventAckRequest_t)); |
|---|
| 4003 | 4300 | ack_request->Function = MPI2_FUNCTION_EVENT_ACK; |
|---|
| .. | .. |
|---|
| 4005 | 4302 | ack_request->EventContext = event_context; |
|---|
| 4006 | 4303 | ack_request->VF_ID = 0; /* TODO */ |
|---|
| 4007 | 4304 | ack_request->VP_ID = 0; |
|---|
| 4008 | | - mpt3sas_base_put_smid_default(ioc, smid); |
|---|
| 4305 | + ioc->put_smid_default(ioc, smid); |
|---|
| 4009 | 4306 | } |
|---|
| 4010 | 4307 | |
|---|
| 4011 | 4308 | /** |
|---|
| .. | .. |
|---|
| 4027 | 4324 | unsigned long flags; |
|---|
| 4028 | 4325 | |
|---|
| 4029 | 4326 | if (ioc->remove_host) { |
|---|
| 4030 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 4031 | | - "%s: host has been removed\n", |
|---|
| 4032 | | - __func__, ioc->name)); |
|---|
| 4327 | + dewtprintk(ioc, |
|---|
| 4328 | + ioc_info(ioc, "%s: host has been removed\n", |
|---|
| 4329 | + __func__)); |
|---|
| 4033 | 4330 | return; |
|---|
| 4034 | 4331 | } else if (ioc->pci_error_recovery) { |
|---|
| 4035 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 4036 | | - "%s: host in pci error recovery\n", |
|---|
| 4037 | | - __func__, ioc->name)); |
|---|
| 4332 | + dewtprintk(ioc, |
|---|
| 4333 | + ioc_info(ioc, "%s: host in pci error recovery\n", |
|---|
| 4334 | + __func__)); |
|---|
| 4038 | 4335 | return; |
|---|
| 4039 | 4336 | } |
|---|
| 4040 | 4337 | ioc_state = mpt3sas_base_get_iocstate(ioc, 1); |
|---|
| 4041 | 4338 | if (ioc_state != MPI2_IOC_STATE_OPERATIONAL) { |
|---|
| 4042 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 4043 | | - "%s: host is not operational\n", |
|---|
| 4044 | | - __func__, ioc->name)); |
|---|
| 4339 | + dewtprintk(ioc, |
|---|
| 4340 | + ioc_info(ioc, "%s: host is not operational\n", |
|---|
| 4341 | + __func__)); |
|---|
| 4045 | 4342 | return; |
|---|
| 4046 | 4343 | } |
|---|
| 4047 | 4344 | |
|---|
| .. | .. |
|---|
| 4053 | 4350 | ioc->internal_lookup[i].cb_idx = ioc->tm_sas_control_cb_idx; |
|---|
| 4054 | 4351 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); |
|---|
| 4055 | 4352 | |
|---|
| 4056 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 4057 | | - "sc_send:handle(0x%04x), (open), smid(%d), cb(%d)\n", |
|---|
| 4058 | | - ioc->name, handle, smid, |
|---|
| 4059 | | - ioc->tm_sas_control_cb_idx)); |
|---|
| 4353 | + dewtprintk(ioc, |
|---|
| 4354 | + ioc_info(ioc, "sc_send:handle(0x%04x), (open), smid(%d), cb(%d)\n", |
|---|
| 4355 | + handle, smid, ioc->tm_sas_control_cb_idx)); |
|---|
| 4060 | 4356 | mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); |
|---|
| 4061 | 4357 | memset(mpi_request, 0, sizeof(Mpi2SasIoUnitControlRequest_t)); |
|---|
| 4062 | 4358 | mpi_request->Function = MPI2_FUNCTION_SAS_IO_UNIT_CONTROL; |
|---|
| 4063 | 4359 | mpi_request->Operation = MPI2_SAS_OP_REMOVE_DEVICE; |
|---|
| 4064 | 4360 | mpi_request->DevHandle = cpu_to_le16(handle); |
|---|
| 4065 | | - mpt3sas_base_put_smid_default(ioc, smid); |
|---|
| 4361 | + ioc->put_smid_default(ioc, smid); |
|---|
| 4066 | 4362 | } |
|---|
| 4067 | 4363 | |
|---|
| 4068 | 4364 | /** |
|---|
| .. | .. |
|---|
| 4217 | 4513 | MPI2_EVENT_SAS_TOPO_ES_RESPONDING) { |
|---|
| 4218 | 4514 | if (le16_to_cpu(local_event_data->ExpanderDevHandle) == |
|---|
| 4219 | 4515 | expander_handle) { |
|---|
| 4220 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 4221 | | - "setting ignoring flag\n", ioc->name)); |
|---|
| 4516 | + dewtprintk(ioc, |
|---|
| 4517 | + ioc_info(ioc, "setting ignoring flag\n")); |
|---|
| 4222 | 4518 | fw_event->ignore = 1; |
|---|
| 4223 | 4519 | } |
|---|
| 4224 | 4520 | } |
|---|
| .. | .. |
|---|
| 4289 | 4585 | MPI2_EVENT_SAS_TOPO_ES_RESPONDING) { |
|---|
| 4290 | 4586 | if (le16_to_cpu(local_event_data->SwitchDevHandle) == |
|---|
| 4291 | 4587 | switch_handle) { |
|---|
| 4292 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 4293 | | - "setting ignoring flag for switch event\n", |
|---|
| 4294 | | - ioc->name)); |
|---|
| 4588 | + dewtprintk(ioc, |
|---|
| 4589 | + ioc_info(ioc, "setting ignoring flag for switch event\n")); |
|---|
| 4295 | 4590 | fw_event->ignore = 1; |
|---|
| 4296 | 4591 | } |
|---|
| 4297 | 4592 | } |
|---|
| .. | .. |
|---|
| 4320 | 4615 | sas_target_priv_data = |
|---|
| 4321 | 4616 | raid_device->starget->hostdata; |
|---|
| 4322 | 4617 | sas_target_priv_data->deleted = 1; |
|---|
| 4323 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 4324 | | - "setting delete flag: handle(0x%04x), " |
|---|
| 4325 | | - "wwid(0x%016llx)\n", ioc->name, handle, |
|---|
| 4326 | | - (unsigned long long) raid_device->wwid)); |
|---|
| 4618 | + dewtprintk(ioc, |
|---|
| 4619 | + ioc_info(ioc, "setting delete flag: handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 4620 | + handle, (u64)raid_device->wwid)); |
|---|
| 4327 | 4621 | } |
|---|
| 4328 | 4622 | spin_unlock_irqrestore(&ioc->raid_device_lock, flags); |
|---|
| 4329 | 4623 | } |
|---|
| .. | .. |
|---|
| 4425 | 4719 | INIT_LIST_HEAD(&delayed_tr->list); |
|---|
| 4426 | 4720 | delayed_tr->handle = handle; |
|---|
| 4427 | 4721 | list_add_tail(&delayed_tr->list, &ioc->delayed_tr_list); |
|---|
| 4428 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 4429 | | - "DELAYED:tr:handle(0x%04x), (open)\n", ioc->name, |
|---|
| 4430 | | - handle)); |
|---|
| 4722 | + dewtprintk(ioc, |
|---|
| 4723 | + ioc_info(ioc, "DELAYED:tr:handle(0x%04x), (open)\n", |
|---|
| 4724 | + handle)); |
|---|
| 4431 | 4725 | } else |
|---|
| 4432 | 4726 | _scsih_tm_tr_send(ioc, handle); |
|---|
| 4433 | 4727 | } |
|---|
| .. | .. |
|---|
| 4469 | 4763 | _scsih_temp_threshold_events(struct MPT3SAS_ADAPTER *ioc, |
|---|
| 4470 | 4764 | Mpi2EventDataTemperature_t *event_data) |
|---|
| 4471 | 4765 | { |
|---|
| 4766 | + u32 doorbell; |
|---|
| 4472 | 4767 | if (ioc->temp_sensors_count >= event_data->SensorNum) { |
|---|
| 4473 | | - pr_err(MPT3SAS_FMT "Temperature Threshold flags %s%s%s%s" |
|---|
| 4474 | | - " exceeded for Sensor: %d !!!\n", ioc->name, |
|---|
| 4475 | | - ((le16_to_cpu(event_data->Status) & 0x1) == 1) ? "0 " : " ", |
|---|
| 4476 | | - ((le16_to_cpu(event_data->Status) & 0x2) == 2) ? "1 " : " ", |
|---|
| 4477 | | - ((le16_to_cpu(event_data->Status) & 0x4) == 4) ? "2 " : " ", |
|---|
| 4478 | | - ((le16_to_cpu(event_data->Status) & 0x8) == 8) ? "3 " : " ", |
|---|
| 4479 | | - event_data->SensorNum); |
|---|
| 4480 | | - pr_err(MPT3SAS_FMT "Current Temp In Celsius: %d\n", |
|---|
| 4481 | | - ioc->name, event_data->CurrentTemperature); |
|---|
| 4768 | + ioc_err(ioc, "Temperature Threshold flags %s%s%s%s exceeded for Sensor: %d !!!\n", |
|---|
| 4769 | + le16_to_cpu(event_data->Status) & 0x1 ? "0 " : " ", |
|---|
| 4770 | + le16_to_cpu(event_data->Status) & 0x2 ? "1 " : " ", |
|---|
| 4771 | + le16_to_cpu(event_data->Status) & 0x4 ? "2 " : " ", |
|---|
| 4772 | + le16_to_cpu(event_data->Status) & 0x8 ? "3 " : " ", |
|---|
| 4773 | + event_data->SensorNum); |
|---|
| 4774 | + ioc_err(ioc, "Current Temp In Celsius: %d\n", |
|---|
| 4775 | + event_data->CurrentTemperature); |
|---|
| 4776 | + if (ioc->hba_mpi_version_belonged != MPI2_VERSION) { |
|---|
| 4777 | + doorbell = mpt3sas_base_get_iocstate(ioc, 0); |
|---|
| 4778 | + if ((doorbell & MPI2_IOC_STATE_MASK) == |
|---|
| 4779 | + MPI2_IOC_STATE_FAULT) { |
|---|
| 4780 | + mpt3sas_print_fault_code(ioc, |
|---|
| 4781 | + doorbell & MPI2_DOORBELL_DATA_MASK); |
|---|
| 4782 | + } else if ((doorbell & MPI2_IOC_STATE_MASK) == |
|---|
| 4783 | + MPI2_IOC_STATE_COREDUMP) { |
|---|
| 4784 | + mpt3sas_print_coredump_info(ioc, |
|---|
| 4785 | + doorbell & MPI2_DOORBELL_DATA_MASK); |
|---|
| 4786 | + } |
|---|
| 4787 | + } |
|---|
| 4482 | 4788 | } |
|---|
| 4483 | 4789 | } |
|---|
| 4484 | 4790 | |
|---|
| .. | .. |
|---|
| 4526 | 4832 | scmd->result = DID_RESET << 16; |
|---|
| 4527 | 4833 | scmd->scsi_done(scmd); |
|---|
| 4528 | 4834 | } |
|---|
| 4529 | | - dtmprintk(ioc, pr_info(MPT3SAS_FMT "completing %d cmds\n", |
|---|
| 4530 | | - ioc->name, count)); |
|---|
| 4835 | + dtmprintk(ioc, ioc_info(ioc, "completing %d cmds\n", count)); |
|---|
| 4531 | 4836 | } |
|---|
| 4532 | 4837 | |
|---|
| 4533 | 4838 | /** |
|---|
| .. | .. |
|---|
| 4694 | 4999 | * since we're lockless at this point |
|---|
| 4695 | 5000 | */ |
|---|
| 4696 | 5001 | do { |
|---|
| 4697 | | - if (test_bit(0, &sas_device_priv_data->ata_command_pending)) { |
|---|
| 4698 | | - scmd->result = SAM_STAT_BUSY; |
|---|
| 4699 | | - scmd->scsi_done(scmd); |
|---|
| 4700 | | - return 0; |
|---|
| 4701 | | - } |
|---|
| 5002 | + if (test_bit(0, &sas_device_priv_data->ata_command_pending)) |
|---|
| 5003 | + return SCSI_MLQUEUE_DEVICE_BUSY; |
|---|
| 4702 | 5004 | } while (_scsih_set_satl_pending(scmd, true)); |
|---|
| 4703 | 5005 | |
|---|
| 4704 | 5006 | if (scmd->sc_data_direction == DMA_FROM_DEVICE) |
|---|
| .. | .. |
|---|
| 4726 | 5028 | |
|---|
| 4727 | 5029 | smid = mpt3sas_base_get_smid_scsiio(ioc, ioc->scsi_io_cb_idx, scmd); |
|---|
| 4728 | 5030 | if (!smid) { |
|---|
| 4729 | | - pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n", |
|---|
| 4730 | | - ioc->name, __func__); |
|---|
| 5031 | + ioc_err(ioc, "%s: failed obtaining a smid\n", __func__); |
|---|
| 4731 | 5032 | _scsih_set_satl_pending(scmd, false); |
|---|
| 4732 | 5033 | goto out; |
|---|
| 4733 | 5034 | } |
|---|
| .. | .. |
|---|
| 4775 | 5076 | if (sas_target_priv_data->flags & MPT_TARGET_FASTPATH_IO) { |
|---|
| 4776 | 5077 | mpi_request->IoFlags = cpu_to_le16(scmd->cmd_len | |
|---|
| 4777 | 5078 | MPI25_SCSIIO_IOFLAGS_FAST_PATH); |
|---|
| 4778 | | - mpt3sas_base_put_smid_fast_path(ioc, smid, handle); |
|---|
| 5079 | + ioc->put_smid_fast_path(ioc, smid, handle); |
|---|
| 4779 | 5080 | } else |
|---|
| 4780 | 5081 | ioc->put_smid_scsi_io(ioc, smid, |
|---|
| 4781 | 5082 | le16_to_cpu(mpi_request->DevHandle)); |
|---|
| 4782 | 5083 | } else |
|---|
| 4783 | | - mpt3sas_base_put_smid_default(ioc, smid); |
|---|
| 5084 | + ioc->put_smid_default(ioc, smid); |
|---|
| 4784 | 5085 | return 0; |
|---|
| 4785 | 5086 | |
|---|
| 4786 | 5087 | out: |
|---|
| .. | .. |
|---|
| 4965 | 5266 | scsi_print_command(scmd); |
|---|
| 4966 | 5267 | |
|---|
| 4967 | 5268 | if (priv_target->flags & MPT_TARGET_FLAGS_VOLUME) { |
|---|
| 4968 | | - pr_warn(MPT3SAS_FMT "\t%s wwid(0x%016llx)\n", ioc->name, |
|---|
| 4969 | | - device_str, (unsigned long long)priv_target->sas_address); |
|---|
| 5269 | + ioc_warn(ioc, "\t%s wwid(0x%016llx)\n", |
|---|
| 5270 | + device_str, (u64)priv_target->sas_address); |
|---|
| 4970 | 5271 | } else if (priv_target->flags & MPT_TARGET_FLAGS_PCIE_DEVICE) { |
|---|
| 4971 | 5272 | pcie_device = mpt3sas_get_pdev_from_target(ioc, priv_target); |
|---|
| 4972 | 5273 | if (pcie_device) { |
|---|
| 4973 | | - pr_info(MPT3SAS_FMT "\twwid(0x%016llx), port(%d)\n", |
|---|
| 4974 | | - ioc->name, |
|---|
| 4975 | | - (unsigned long long)pcie_device->wwid, |
|---|
| 4976 | | - pcie_device->port_num); |
|---|
| 5274 | + ioc_info(ioc, "\twwid(0x%016llx), port(%d)\n", |
|---|
| 5275 | + (u64)pcie_device->wwid, pcie_device->port_num); |
|---|
| 4977 | 5276 | if (pcie_device->enclosure_handle != 0) |
|---|
| 4978 | | - pr_info(MPT3SAS_FMT |
|---|
| 4979 | | - "\tenclosure logical id(0x%016llx), " |
|---|
| 4980 | | - "slot(%d)\n", ioc->name, |
|---|
| 4981 | | - (unsigned long long) |
|---|
| 4982 | | - pcie_device->enclosure_logical_id, |
|---|
| 4983 | | - pcie_device->slot); |
|---|
| 5277 | + ioc_info(ioc, "\tenclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 5278 | + (u64)pcie_device->enclosure_logical_id, |
|---|
| 5279 | + pcie_device->slot); |
|---|
| 4984 | 5280 | if (pcie_device->connector_name[0]) |
|---|
| 4985 | | - pr_info(MPT3SAS_FMT |
|---|
| 4986 | | - "\tenclosure level(0x%04x)," |
|---|
| 4987 | | - "connector name( %s)\n", |
|---|
| 4988 | | - ioc->name, pcie_device->enclosure_level, |
|---|
| 4989 | | - pcie_device->connector_name); |
|---|
| 5281 | + ioc_info(ioc, "\tenclosure level(0x%04x), connector name( %s)\n", |
|---|
| 5282 | + pcie_device->enclosure_level, |
|---|
| 5283 | + pcie_device->connector_name); |
|---|
| 4990 | 5284 | pcie_device_put(pcie_device); |
|---|
| 4991 | 5285 | } |
|---|
| 4992 | 5286 | } else { |
|---|
| 4993 | 5287 | sas_device = mpt3sas_get_sdev_from_target(ioc, priv_target); |
|---|
| 4994 | 5288 | if (sas_device) { |
|---|
| 4995 | | - pr_warn(MPT3SAS_FMT |
|---|
| 4996 | | - "\tsas_address(0x%016llx), phy(%d)\n", |
|---|
| 4997 | | - ioc->name, (unsigned long long) |
|---|
| 4998 | | - sas_device->sas_address, sas_device->phy); |
|---|
| 5289 | + ioc_warn(ioc, "\tsas_address(0x%016llx), phy(%d)\n", |
|---|
| 5290 | + (u64)sas_device->sas_address, sas_device->phy); |
|---|
| 4999 | 5291 | |
|---|
| 5000 | 5292 | _scsih_display_enclosure_chassis_info(ioc, sas_device, |
|---|
| 5001 | 5293 | NULL, NULL); |
|---|
| .. | .. |
|---|
| 5004 | 5296 | } |
|---|
| 5005 | 5297 | } |
|---|
| 5006 | 5298 | |
|---|
| 5007 | | - pr_warn(MPT3SAS_FMT |
|---|
| 5008 | | - "\thandle(0x%04x), ioc_status(%s)(0x%04x), smid(%d)\n", |
|---|
| 5009 | | - ioc->name, le16_to_cpu(mpi_reply->DevHandle), |
|---|
| 5010 | | - desc_ioc_state, ioc_status, smid); |
|---|
| 5011 | | - pr_warn(MPT3SAS_FMT |
|---|
| 5012 | | - "\trequest_len(%d), underflow(%d), resid(%d)\n", |
|---|
| 5013 | | - ioc->name, scsi_bufflen(scmd), scmd->underflow, |
|---|
| 5014 | | - scsi_get_resid(scmd)); |
|---|
| 5015 | | - pr_warn(MPT3SAS_FMT |
|---|
| 5016 | | - "\ttag(%d), transfer_count(%d), sc->result(0x%08x)\n", |
|---|
| 5017 | | - ioc->name, le16_to_cpu(mpi_reply->TaskTag), |
|---|
| 5018 | | - le32_to_cpu(mpi_reply->TransferCount), scmd->result); |
|---|
| 5019 | | - pr_warn(MPT3SAS_FMT |
|---|
| 5020 | | - "\tscsi_status(%s)(0x%02x), scsi_state(%s)(0x%02x)\n", |
|---|
| 5021 | | - ioc->name, desc_scsi_status, |
|---|
| 5022 | | - scsi_status, desc_scsi_state, scsi_state); |
|---|
| 5299 | + ioc_warn(ioc, "\thandle(0x%04x), ioc_status(%s)(0x%04x), smid(%d)\n", |
|---|
| 5300 | + le16_to_cpu(mpi_reply->DevHandle), |
|---|
| 5301 | + desc_ioc_state, ioc_status, smid); |
|---|
| 5302 | + ioc_warn(ioc, "\trequest_len(%d), underflow(%d), resid(%d)\n", |
|---|
| 5303 | + scsi_bufflen(scmd), scmd->underflow, scsi_get_resid(scmd)); |
|---|
| 5304 | + ioc_warn(ioc, "\ttag(%d), transfer_count(%d), sc->result(0x%08x)\n", |
|---|
| 5305 | + le16_to_cpu(mpi_reply->TaskTag), |
|---|
| 5306 | + le32_to_cpu(mpi_reply->TransferCount), scmd->result); |
|---|
| 5307 | + ioc_warn(ioc, "\tscsi_status(%s)(0x%02x), scsi_state(%s)(0x%02x)\n", |
|---|
| 5308 | + desc_scsi_status, scsi_status, desc_scsi_state, scsi_state); |
|---|
| 5023 | 5309 | |
|---|
| 5024 | 5310 | if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) { |
|---|
| 5025 | 5311 | struct sense_info data; |
|---|
| 5026 | 5312 | _scsih_normalize_sense(scmd->sense_buffer, &data); |
|---|
| 5027 | | - pr_warn(MPT3SAS_FMT |
|---|
| 5028 | | - "\t[sense_key,asc,ascq]: [0x%02x,0x%02x,0x%02x], count(%d)\n", |
|---|
| 5029 | | - ioc->name, data.skey, |
|---|
| 5030 | | - data.asc, data.ascq, le32_to_cpu(mpi_reply->SenseCount)); |
|---|
| 5313 | + ioc_warn(ioc, "\t[sense_key,asc,ascq]: [0x%02x,0x%02x,0x%02x], count(%d)\n", |
|---|
| 5314 | + data.skey, data.asc, data.ascq, |
|---|
| 5315 | + le32_to_cpu(mpi_reply->SenseCount)); |
|---|
| 5031 | 5316 | } |
|---|
| 5032 | 5317 | if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) { |
|---|
| 5033 | 5318 | response_info = le32_to_cpu(mpi_reply->ResponseInfo); |
|---|
| .. | .. |
|---|
| 5062 | 5347 | mpi_request.Flags = MPI2_SEP_REQ_FLAGS_DEVHANDLE_ADDRESS; |
|---|
| 5063 | 5348 | if ((mpt3sas_base_scsi_enclosure_processor(ioc, &mpi_reply, |
|---|
| 5064 | 5349 | &mpi_request)) != 0) { |
|---|
| 5065 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 5066 | | - __FILE__, __LINE__, __func__); |
|---|
| 5350 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5351 | + __FILE__, __LINE__, __func__); |
|---|
| 5067 | 5352 | goto out; |
|---|
| 5068 | 5353 | } |
|---|
| 5069 | 5354 | sas_device->pfa_led_on = 1; |
|---|
| 5070 | 5355 | |
|---|
| 5071 | 5356 | if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) { |
|---|
| 5072 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 5073 | | - "enclosure_processor: ioc_status (0x%04x), loginfo(0x%08x)\n", |
|---|
| 5074 | | - ioc->name, le16_to_cpu(mpi_reply.IOCStatus), |
|---|
| 5075 | | - le32_to_cpu(mpi_reply.IOCLogInfo))); |
|---|
| 5357 | + dewtprintk(ioc, |
|---|
| 5358 | + ioc_info(ioc, "enclosure_processor: ioc_status (0x%04x), loginfo(0x%08x)\n", |
|---|
| 5359 | + le16_to_cpu(mpi_reply.IOCStatus), |
|---|
| 5360 | + le32_to_cpu(mpi_reply.IOCLogInfo))); |
|---|
| 5076 | 5361 | goto out; |
|---|
| 5077 | 5362 | } |
|---|
| 5078 | 5363 | out: |
|---|
| .. | .. |
|---|
| 5102 | 5387 | mpi_request.Flags = MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS; |
|---|
| 5103 | 5388 | if ((mpt3sas_base_scsi_enclosure_processor(ioc, &mpi_reply, |
|---|
| 5104 | 5389 | &mpi_request)) != 0) { |
|---|
| 5105 | | - printk(MPT3SAS_FMT "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 5106 | | - __FILE__, __LINE__, __func__); |
|---|
| 5390 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5391 | + __FILE__, __LINE__, __func__); |
|---|
| 5107 | 5392 | return; |
|---|
| 5108 | 5393 | } |
|---|
| 5109 | 5394 | |
|---|
| 5110 | 5395 | if (mpi_reply.IOCStatus || mpi_reply.IOCLogInfo) { |
|---|
| 5111 | | - dewtprintk(ioc, printk(MPT3SAS_FMT |
|---|
| 5112 | | - "enclosure_processor: ioc_status (0x%04x), loginfo(0x%08x)\n", |
|---|
| 5113 | | - ioc->name, le16_to_cpu(mpi_reply.IOCStatus), |
|---|
| 5114 | | - le32_to_cpu(mpi_reply.IOCLogInfo))); |
|---|
| 5396 | + dewtprintk(ioc, |
|---|
| 5397 | + ioc_info(ioc, "enclosure_processor: ioc_status (0x%04x), loginfo(0x%08x)\n", |
|---|
| 5398 | + le16_to_cpu(mpi_reply.IOCStatus), |
|---|
| 5399 | + le32_to_cpu(mpi_reply.IOCLogInfo))); |
|---|
| 5115 | 5400 | return; |
|---|
| 5116 | 5401 | } |
|---|
| 5117 | 5402 | } |
|---|
| .. | .. |
|---|
| 5177 | 5462 | /* insert into event log */ |
|---|
| 5178 | 5463 | sz = offsetof(Mpi2EventNotificationReply_t, EventData) + |
|---|
| 5179 | 5464 | sizeof(Mpi2EventDataSasDeviceStatusChange_t); |
|---|
| 5180 | | - event_reply = kzalloc(sz, GFP_KERNEL); |
|---|
| 5465 | + event_reply = kzalloc(sz, GFP_ATOMIC); |
|---|
| 5181 | 5466 | if (!event_reply) { |
|---|
| 5182 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5183 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5467 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5468 | + __FILE__, __LINE__, __func__); |
|---|
| 5184 | 5469 | goto out; |
|---|
| 5185 | 5470 | } |
|---|
| 5186 | 5471 | |
|---|
| .. | .. |
|---|
| 5267 | 5552 | ((ioc_status & MPI2_IOCSTATUS_MASK) |
|---|
| 5268 | 5553 | != MPI2_IOCSTATUS_SCSI_TASK_TERMINATED)) { |
|---|
| 5269 | 5554 | st->direct_io = 0; |
|---|
| 5555 | + st->scmd = scmd; |
|---|
| 5270 | 5556 | memcpy(mpi_request->CDB.CDB32, scmd->cmnd, scmd->cmd_len); |
|---|
| 5271 | 5557 | mpi_request->DevHandle = |
|---|
| 5272 | 5558 | cpu_to_le16(sas_device_priv_data->sas_target->handle); |
|---|
| .. | .. |
|---|
| 5405 | 5691 | |
|---|
| 5406 | 5692 | case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: |
|---|
| 5407 | 5693 | scsi_set_resid(scmd, 0); |
|---|
| 5408 | | - /* fall through */ |
|---|
| 5694 | + fallthrough; |
|---|
| 5409 | 5695 | case MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR: |
|---|
| 5410 | 5696 | case MPI2_IOCSTATUS_SUCCESS: |
|---|
| 5411 | 5697 | scmd->result = (DID_OK << 16) | scsi_status; |
|---|
| .. | .. |
|---|
| 5470 | 5756 | u16 attached_handle; |
|---|
| 5471 | 5757 | u8 link_rate; |
|---|
| 5472 | 5758 | |
|---|
| 5473 | | - dtmprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 5474 | | - "updating handles for sas_host(0x%016llx)\n", |
|---|
| 5475 | | - ioc->name, (unsigned long long)ioc->sas_hba.sas_address)); |
|---|
| 5759 | + dtmprintk(ioc, |
|---|
| 5760 | + ioc_info(ioc, "updating handles for sas_host(0x%016llx)\n", |
|---|
| 5761 | + (u64)ioc->sas_hba.sas_address)); |
|---|
| 5476 | 5762 | |
|---|
| 5477 | 5763 | sz = offsetof(Mpi2SasIOUnitPage0_t, PhyData) + (ioc->sas_hba.num_phys |
|---|
| 5478 | 5764 | * sizeof(Mpi2SasIOUnit0PhyData_t)); |
|---|
| 5479 | 5765 | sas_iounit_pg0 = kzalloc(sz, GFP_KERNEL); |
|---|
| 5480 | 5766 | if (!sas_iounit_pg0) { |
|---|
| 5481 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5482 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5767 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5768 | + __FILE__, __LINE__, __func__); |
|---|
| 5483 | 5769 | return; |
|---|
| 5484 | 5770 | } |
|---|
| 5485 | 5771 | |
|---|
| .. | .. |
|---|
| 5529 | 5815 | |
|---|
| 5530 | 5816 | mpt3sas_config_get_number_hba_phys(ioc, &num_phys); |
|---|
| 5531 | 5817 | if (!num_phys) { |
|---|
| 5532 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5533 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5818 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5819 | + __FILE__, __LINE__, __func__); |
|---|
| 5534 | 5820 | return; |
|---|
| 5535 | 5821 | } |
|---|
| 5536 | 5822 | ioc->sas_hba.phy = kcalloc(num_phys, |
|---|
| 5537 | 5823 | sizeof(struct _sas_phy), GFP_KERNEL); |
|---|
| 5538 | 5824 | if (!ioc->sas_hba.phy) { |
|---|
| 5539 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5540 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5825 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5826 | + __FILE__, __LINE__, __func__); |
|---|
| 5541 | 5827 | goto out; |
|---|
| 5542 | 5828 | } |
|---|
| 5543 | 5829 | ioc->sas_hba.num_phys = num_phys; |
|---|
| .. | .. |
|---|
| 5547 | 5833 | sizeof(Mpi2SasIOUnit0PhyData_t)); |
|---|
| 5548 | 5834 | sas_iounit_pg0 = kzalloc(sz, GFP_KERNEL); |
|---|
| 5549 | 5835 | if (!sas_iounit_pg0) { |
|---|
| 5550 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5551 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5836 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5837 | + __FILE__, __LINE__, __func__); |
|---|
| 5552 | 5838 | return; |
|---|
| 5553 | 5839 | } |
|---|
| 5554 | 5840 | if ((mpt3sas_config_get_sas_iounit_pg0(ioc, &mpi_reply, |
|---|
| 5555 | 5841 | sas_iounit_pg0, sz))) { |
|---|
| 5556 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5557 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5842 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5843 | + __FILE__, __LINE__, __func__); |
|---|
| 5558 | 5844 | goto out; |
|---|
| 5559 | 5845 | } |
|---|
| 5560 | 5846 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 5561 | 5847 | MPI2_IOCSTATUS_MASK; |
|---|
| 5562 | 5848 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 5563 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5564 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5849 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5850 | + __FILE__, __LINE__, __func__); |
|---|
| 5565 | 5851 | goto out; |
|---|
| 5566 | 5852 | } |
|---|
| 5567 | 5853 | |
|---|
| .. | .. |
|---|
| 5570 | 5856 | sizeof(Mpi2SasIOUnit1PhyData_t)); |
|---|
| 5571 | 5857 | sas_iounit_pg1 = kzalloc(sz, GFP_KERNEL); |
|---|
| 5572 | 5858 | if (!sas_iounit_pg1) { |
|---|
| 5573 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5574 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5859 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5860 | + __FILE__, __LINE__, __func__); |
|---|
| 5575 | 5861 | goto out; |
|---|
| 5576 | 5862 | } |
|---|
| 5577 | 5863 | if ((mpt3sas_config_get_sas_iounit_pg1(ioc, &mpi_reply, |
|---|
| 5578 | 5864 | sas_iounit_pg1, sz))) { |
|---|
| 5579 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5580 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5865 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5866 | + __FILE__, __LINE__, __func__); |
|---|
| 5581 | 5867 | goto out; |
|---|
| 5582 | 5868 | } |
|---|
| 5583 | 5869 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 5584 | 5870 | MPI2_IOCSTATUS_MASK; |
|---|
| 5585 | 5871 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 5586 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5587 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5872 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5873 | + __FILE__, __LINE__, __func__); |
|---|
| 5588 | 5874 | goto out; |
|---|
| 5589 | 5875 | } |
|---|
| 5590 | 5876 | |
|---|
| .. | .. |
|---|
| 5603 | 5889 | for (i = 0; i < ioc->sas_hba.num_phys ; i++) { |
|---|
| 5604 | 5890 | if ((mpt3sas_config_get_phy_pg0(ioc, &mpi_reply, &phy_pg0, |
|---|
| 5605 | 5891 | i))) { |
|---|
| 5606 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5607 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5892 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5893 | + __FILE__, __LINE__, __func__); |
|---|
| 5608 | 5894 | goto out; |
|---|
| 5609 | 5895 | } |
|---|
| 5610 | 5896 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 5611 | 5897 | MPI2_IOCSTATUS_MASK; |
|---|
| 5612 | 5898 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 5613 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5614 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5899 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5900 | + __FILE__, __LINE__, __func__); |
|---|
| 5615 | 5901 | goto out; |
|---|
| 5616 | 5902 | } |
|---|
| 5617 | 5903 | |
|---|
| .. | .. |
|---|
| 5625 | 5911 | } |
|---|
| 5626 | 5912 | if ((mpt3sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0, |
|---|
| 5627 | 5913 | MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, ioc->sas_hba.handle))) { |
|---|
| 5628 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5629 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5914 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5915 | + __FILE__, __LINE__, __func__); |
|---|
| 5630 | 5916 | goto out; |
|---|
| 5631 | 5917 | } |
|---|
| 5632 | 5918 | ioc->sas_hba.enclosure_handle = |
|---|
| 5633 | 5919 | le16_to_cpu(sas_device_pg0.EnclosureHandle); |
|---|
| 5634 | 5920 | ioc->sas_hba.sas_address = le64_to_cpu(sas_device_pg0.SASAddress); |
|---|
| 5635 | | - pr_info(MPT3SAS_FMT |
|---|
| 5636 | | - "host_add: handle(0x%04x), sas_addr(0x%016llx), phys(%d)\n", |
|---|
| 5637 | | - ioc->name, ioc->sas_hba.handle, |
|---|
| 5638 | | - (unsigned long long) ioc->sas_hba.sas_address, |
|---|
| 5639 | | - ioc->sas_hba.num_phys) ; |
|---|
| 5921 | + ioc_info(ioc, "host_add: handle(0x%04x), sas_addr(0x%016llx), phys(%d)\n", |
|---|
| 5922 | + ioc->sas_hba.handle, |
|---|
| 5923 | + (u64)ioc->sas_hba.sas_address, |
|---|
| 5924 | + ioc->sas_hba.num_phys); |
|---|
| 5640 | 5925 | |
|---|
| 5641 | 5926 | if (ioc->sas_hba.enclosure_handle) { |
|---|
| 5642 | 5927 | if (!(mpt3sas_config_get_enclosure_pg0(ioc, &mpi_reply, |
|---|
| .. | .. |
|---|
| 5685 | 5970 | |
|---|
| 5686 | 5971 | if ((mpt3sas_config_get_expander_pg0(ioc, &mpi_reply, &expander_pg0, |
|---|
| 5687 | 5972 | MPI2_SAS_EXPAND_PGAD_FORM_HNDL, handle))) { |
|---|
| 5688 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5689 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5973 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5974 | + __FILE__, __LINE__, __func__); |
|---|
| 5690 | 5975 | return -1; |
|---|
| 5691 | 5976 | } |
|---|
| 5692 | 5977 | |
|---|
| 5693 | 5978 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 5694 | 5979 | MPI2_IOCSTATUS_MASK; |
|---|
| 5695 | 5980 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 5696 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5697 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5981 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5982 | + __FILE__, __LINE__, __func__); |
|---|
| 5698 | 5983 | return -1; |
|---|
| 5699 | 5984 | } |
|---|
| 5700 | 5985 | |
|---|
| .. | .. |
|---|
| 5702 | 5987 | parent_handle = le16_to_cpu(expander_pg0.ParentDevHandle); |
|---|
| 5703 | 5988 | if (_scsih_get_sas_address(ioc, parent_handle, &sas_address_parent) |
|---|
| 5704 | 5989 | != 0) { |
|---|
| 5705 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5706 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 5990 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 5991 | + __FILE__, __LINE__, __func__); |
|---|
| 5707 | 5992 | return -1; |
|---|
| 5708 | 5993 | } |
|---|
| 5709 | 5994 | if (sas_address_parent != ioc->sas_hba.sas_address) { |
|---|
| .. | .. |
|---|
| 5730 | 6015 | sas_expander = kzalloc(sizeof(struct _sas_node), |
|---|
| 5731 | 6016 | GFP_KERNEL); |
|---|
| 5732 | 6017 | if (!sas_expander) { |
|---|
| 5733 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5734 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6018 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 6019 | + __FILE__, __LINE__, __func__); |
|---|
| 5735 | 6020 | return -1; |
|---|
| 5736 | 6021 | } |
|---|
| 5737 | 6022 | |
|---|
| .. | .. |
|---|
| 5740 | 6025 | sas_expander->sas_address_parent = sas_address_parent; |
|---|
| 5741 | 6026 | sas_expander->sas_address = sas_address; |
|---|
| 5742 | 6027 | |
|---|
| 5743 | | - pr_info(MPT3SAS_FMT "expander_add: handle(0x%04x)," \ |
|---|
| 5744 | | - " parent(0x%04x), sas_addr(0x%016llx), phys(%d)\n", ioc->name, |
|---|
| 5745 | | - handle, parent_handle, (unsigned long long) |
|---|
| 5746 | | - sas_expander->sas_address, sas_expander->num_phys); |
|---|
| 6028 | + ioc_info(ioc, "expander_add: handle(0x%04x), parent(0x%04x), sas_addr(0x%016llx), phys(%d)\n", |
|---|
| 6029 | + handle, parent_handle, |
|---|
| 6030 | + (u64)sas_expander->sas_address, sas_expander->num_phys); |
|---|
| 5747 | 6031 | |
|---|
| 5748 | 6032 | if (!sas_expander->num_phys) { |
|---|
| 5749 | 6033 | rc = -1; |
|---|
| .. | .. |
|---|
| 5752 | 6036 | sas_expander->phy = kcalloc(sas_expander->num_phys, |
|---|
| 5753 | 6037 | sizeof(struct _sas_phy), GFP_KERNEL); |
|---|
| 5754 | 6038 | if (!sas_expander->phy) { |
|---|
| 5755 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5756 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6039 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 6040 | + __FILE__, __LINE__, __func__); |
|---|
| 5757 | 6041 | rc = -1; |
|---|
| 5758 | 6042 | goto out_fail; |
|---|
| 5759 | 6043 | } |
|---|
| .. | .. |
|---|
| 5762 | 6046 | mpt3sas_port = mpt3sas_transport_port_add(ioc, handle, |
|---|
| 5763 | 6047 | sas_address_parent); |
|---|
| 5764 | 6048 | if (!mpt3sas_port) { |
|---|
| 5765 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5766 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6049 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 6050 | + __FILE__, __LINE__, __func__); |
|---|
| 5767 | 6051 | rc = -1; |
|---|
| 5768 | 6052 | goto out_fail; |
|---|
| 5769 | 6053 | } |
|---|
| .. | .. |
|---|
| 5772 | 6056 | for (i = 0 ; i < sas_expander->num_phys ; i++) { |
|---|
| 5773 | 6057 | if ((mpt3sas_config_get_expander_pg1(ioc, &mpi_reply, |
|---|
| 5774 | 6058 | &expander_pg1, i, handle))) { |
|---|
| 5775 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5776 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6059 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 6060 | + __FILE__, __LINE__, __func__); |
|---|
| 5777 | 6061 | rc = -1; |
|---|
| 5778 | 6062 | goto out_fail; |
|---|
| 5779 | 6063 | } |
|---|
| .. | .. |
|---|
| 5783 | 6067 | if ((mpt3sas_transport_add_expander_phy(ioc, |
|---|
| 5784 | 6068 | &sas_expander->phy[i], expander_pg1, |
|---|
| 5785 | 6069 | sas_expander->parent_dev))) { |
|---|
| 5786 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 5787 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6070 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 6071 | + __FILE__, __LINE__, __func__); |
|---|
| 5788 | 6072 | rc = -1; |
|---|
| 5789 | 6073 | goto out_fail; |
|---|
| 5790 | 6074 | } |
|---|
| .. | .. |
|---|
| 5931 | 6215 | if (!rc) |
|---|
| 5932 | 6216 | return 0; |
|---|
| 5933 | 6217 | |
|---|
| 5934 | | - pr_err(MPT3SAS_FMT |
|---|
| 5935 | | - "discovery errors(%s): sas_address(0x%016llx), handle(0x%04x)\n", |
|---|
| 5936 | | - ioc->name, desc, (unsigned long long)sas_address, handle); |
|---|
| 6218 | + ioc_err(ioc, "discovery errors(%s): sas_address(0x%016llx), handle(0x%04x)\n", |
|---|
| 6219 | + desc, (u64)sas_address, handle); |
|---|
| 5937 | 6220 | return rc; |
|---|
| 5938 | 6221 | } |
|---|
| 5939 | 6222 | |
|---|
| .. | .. |
|---|
| 6027 | 6310 | /* check if device is present */ |
|---|
| 6028 | 6311 | if (!(le16_to_cpu(sas_device_pg0.Flags) & |
|---|
| 6029 | 6312 | MPI2_SAS_DEVICE0_FLAGS_DEVICE_PRESENT)) { |
|---|
| 6030 | | - pr_err(MPT3SAS_FMT |
|---|
| 6031 | | - "device is not present handle(0x%04x), flags!!!\n", |
|---|
| 6032 | | - ioc->name, handle); |
|---|
| 6313 | + ioc_err(ioc, "device is not present handle(0x%04x), flags!!!\n", |
|---|
| 6314 | + handle); |
|---|
| 6033 | 6315 | goto out_unlock; |
|---|
| 6034 | 6316 | } |
|---|
| 6035 | 6317 | |
|---|
| .. | .. |
|---|
| 6076 | 6358 | |
|---|
| 6077 | 6359 | if ((mpt3sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0, |
|---|
| 6078 | 6360 | MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) { |
|---|
| 6079 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 6080 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6361 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 6362 | + __FILE__, __LINE__, __func__); |
|---|
| 6081 | 6363 | return -1; |
|---|
| 6082 | 6364 | } |
|---|
| 6083 | 6365 | |
|---|
| 6084 | 6366 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 6085 | 6367 | MPI2_IOCSTATUS_MASK; |
|---|
| 6086 | 6368 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 6087 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 6088 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6369 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 6370 | + __FILE__, __LINE__, __func__); |
|---|
| 6089 | 6371 | return -1; |
|---|
| 6090 | 6372 | } |
|---|
| 6091 | 6373 | |
|---|
| .. | .. |
|---|
| 6099 | 6381 | /* check if device is present */ |
|---|
| 6100 | 6382 | if (!(le16_to_cpu(sas_device_pg0.Flags) & |
|---|
| 6101 | 6383 | MPI2_SAS_DEVICE0_FLAGS_DEVICE_PRESENT)) { |
|---|
| 6102 | | - pr_err(MPT3SAS_FMT "device is not present handle(0x04%x)!!!\n", |
|---|
| 6103 | | - ioc->name, handle); |
|---|
| 6384 | + ioc_err(ioc, "device is not present handle(0x04%x)!!!\n", |
|---|
| 6385 | + handle); |
|---|
| 6104 | 6386 | return -1; |
|---|
| 6105 | 6387 | } |
|---|
| 6106 | 6388 | |
|---|
| .. | .. |
|---|
| 6122 | 6404 | mpt3sas_scsih_enclosure_find_by_handle(ioc, |
|---|
| 6123 | 6405 | le16_to_cpu(sas_device_pg0.EnclosureHandle)); |
|---|
| 6124 | 6406 | if (enclosure_dev == NULL) |
|---|
| 6125 | | - pr_info(MPT3SAS_FMT "Enclosure handle(0x%04x)" |
|---|
| 6126 | | - "doesn't match with enclosure device!\n", |
|---|
| 6127 | | - ioc->name, sas_device_pg0.EnclosureHandle); |
|---|
| 6407 | + ioc_info(ioc, "Enclosure handle(0x%04x) doesn't match with enclosure device!\n", |
|---|
| 6408 | + sas_device_pg0.EnclosureHandle); |
|---|
| 6128 | 6409 | } |
|---|
| 6129 | 6410 | |
|---|
| 6130 | 6411 | sas_device = kzalloc(sizeof(struct _sas_device), |
|---|
| 6131 | 6412 | GFP_KERNEL); |
|---|
| 6132 | 6413 | if (!sas_device) { |
|---|
| 6133 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 6134 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6414 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 6415 | + __FILE__, __LINE__, __func__); |
|---|
| 6135 | 6416 | return 0; |
|---|
| 6136 | 6417 | } |
|---|
| 6137 | 6418 | |
|---|
| .. | .. |
|---|
| 6140 | 6421 | if (_scsih_get_sas_address(ioc, |
|---|
| 6141 | 6422 | le16_to_cpu(sas_device_pg0.ParentDevHandle), |
|---|
| 6142 | 6423 | &sas_device->sas_address_parent) != 0) |
|---|
| 6143 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 6144 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6424 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 6425 | + __FILE__, __LINE__, __func__); |
|---|
| 6145 | 6426 | sas_device->enclosure_handle = |
|---|
| 6146 | 6427 | le16_to_cpu(sas_device_pg0.EnclosureHandle); |
|---|
| 6147 | 6428 | if (sas_device->enclosure_handle != 0) |
|---|
| .. | .. |
|---|
| 6206 | 6487 | sas_device->pfa_led_on = 0; |
|---|
| 6207 | 6488 | } |
|---|
| 6208 | 6489 | |
|---|
| 6209 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6210 | | - "%s: enter: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 6211 | | - ioc->name, __func__, |
|---|
| 6212 | | - sas_device->handle, (unsigned long long) |
|---|
| 6213 | | - sas_device->sas_address)); |
|---|
| 6490 | + dewtprintk(ioc, |
|---|
| 6491 | + ioc_info(ioc, "%s: enter: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 6492 | + __func__, |
|---|
| 6493 | + sas_device->handle, (u64)sas_device->sas_address)); |
|---|
| 6214 | 6494 | |
|---|
| 6215 | 6495 | dewtprintk(ioc, _scsih_display_enclosure_chassis_info(ioc, sas_device, |
|---|
| 6216 | 6496 | NULL, NULL)); |
|---|
| .. | .. |
|---|
| 6228 | 6508 | sas_device->sas_address, |
|---|
| 6229 | 6509 | sas_device->sas_address_parent); |
|---|
| 6230 | 6510 | |
|---|
| 6231 | | - pr_info(MPT3SAS_FMT |
|---|
| 6232 | | - "removing handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 6233 | | - ioc->name, sas_device->handle, |
|---|
| 6234 | | - (unsigned long long) sas_device->sas_address); |
|---|
| 6511 | + ioc_info(ioc, "removing handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 6512 | + sas_device->handle, (u64)sas_device->sas_address); |
|---|
| 6235 | 6513 | |
|---|
| 6236 | 6514 | _scsih_display_enclosure_chassis_info(ioc, sas_device, NULL, NULL); |
|---|
| 6237 | 6515 | |
|---|
| 6238 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6239 | | - "%s: exit: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 6240 | | - ioc->name, __func__, |
|---|
| 6241 | | - sas_device->handle, (unsigned long long) |
|---|
| 6242 | | - sas_device->sas_address)); |
|---|
| 6516 | + dewtprintk(ioc, |
|---|
| 6517 | + ioc_info(ioc, "%s: exit: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 6518 | + __func__, |
|---|
| 6519 | + sas_device->handle, (u64)sas_device->sas_address)); |
|---|
| 6243 | 6520 | dewtprintk(ioc, _scsih_display_enclosure_chassis_info(ioc, sas_device, |
|---|
| 6244 | 6521 | NULL, NULL)); |
|---|
| 6245 | 6522 | } |
|---|
| .. | .. |
|---|
| 6279 | 6556 | status_str = "unknown status"; |
|---|
| 6280 | 6557 | break; |
|---|
| 6281 | 6558 | } |
|---|
| 6282 | | - pr_info(MPT3SAS_FMT "sas topology change: (%s)\n", |
|---|
| 6283 | | - ioc->name, status_str); |
|---|
| 6559 | + ioc_info(ioc, "sas topology change: (%s)\n", status_str); |
|---|
| 6284 | 6560 | pr_info("\thandle(0x%04x), enclosure_handle(0x%04x) " \ |
|---|
| 6285 | 6561 | "start_phy(%02d), count(%d)\n", |
|---|
| 6286 | 6562 | le16_to_cpu(event_data->ExpanderDevHandle), |
|---|
| .. | .. |
|---|
| 6357 | 6633 | _scsih_sas_host_refresh(ioc); |
|---|
| 6358 | 6634 | |
|---|
| 6359 | 6635 | if (fw_event->ignore) { |
|---|
| 6360 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6361 | | - "ignoring expander event\n", ioc->name)); |
|---|
| 6636 | + dewtprintk(ioc, ioc_info(ioc, "ignoring expander event\n")); |
|---|
| 6362 | 6637 | return 0; |
|---|
| 6363 | 6638 | } |
|---|
| 6364 | 6639 | |
|---|
| .. | .. |
|---|
| 6387 | 6662 | /* handle siblings events */ |
|---|
| 6388 | 6663 | for (i = 0; i < event_data->NumEntries; i++) { |
|---|
| 6389 | 6664 | if (fw_event->ignore) { |
|---|
| 6390 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6391 | | - "ignoring expander event\n", ioc->name)); |
|---|
| 6665 | + dewtprintk(ioc, |
|---|
| 6666 | + ioc_info(ioc, "ignoring expander event\n")); |
|---|
| 6392 | 6667 | return 0; |
|---|
| 6393 | 6668 | } |
|---|
| 6394 | 6669 | if (ioc->remove_host || ioc->pci_error_recovery) |
|---|
| .. | .. |
|---|
| 6428 | 6703 | if (!test_bit(handle, ioc->pend_os_device_add)) |
|---|
| 6429 | 6704 | break; |
|---|
| 6430 | 6705 | |
|---|
| 6431 | | - /* fall through */ |
|---|
| 6706 | + fallthrough; |
|---|
| 6432 | 6707 | |
|---|
| 6433 | 6708 | case MPI2_EVENT_SAS_TOPO_RC_TARG_ADDED: |
|---|
| 6434 | 6709 | |
|---|
| .. | .. |
|---|
| 6512 | 6787 | reason_str = "unknown reason"; |
|---|
| 6513 | 6788 | break; |
|---|
| 6514 | 6789 | } |
|---|
| 6515 | | - pr_info(MPT3SAS_FMT "device status change: (%s)\n" |
|---|
| 6516 | | - "\thandle(0x%04x), sas address(0x%016llx), tag(%d)", |
|---|
| 6517 | | - ioc->name, reason_str, le16_to_cpu(event_data->DevHandle), |
|---|
| 6518 | | - (unsigned long long)le64_to_cpu(event_data->SASAddress), |
|---|
| 6519 | | - le16_to_cpu(event_data->TaskTag)); |
|---|
| 6790 | + ioc_info(ioc, "device status change: (%s)\thandle(0x%04x), sas address(0x%016llx), tag(%d)", |
|---|
| 6791 | + reason_str, le16_to_cpu(event_data->DevHandle), |
|---|
| 6792 | + (u64)le64_to_cpu(event_data->SASAddress), |
|---|
| 6793 | + le16_to_cpu(event_data->TaskTag)); |
|---|
| 6520 | 6794 | if (event_data->ReasonCode == MPI2_EVENT_SAS_DEV_STAT_RC_SMART_DATA) |
|---|
| 6521 | | - pr_info(MPT3SAS_FMT ", ASC(0x%x), ASCQ(0x%x)\n", ioc->name, |
|---|
| 6522 | | - event_data->ASC, event_data->ASCQ); |
|---|
| 6523 | | - pr_info("\n"); |
|---|
| 6795 | + pr_cont(", ASC(0x%x), ASCQ(0x%x)\n", |
|---|
| 6796 | + event_data->ASC, event_data->ASCQ); |
|---|
| 6797 | + pr_cont("\n"); |
|---|
| 6524 | 6798 | } |
|---|
| 6525 | 6799 | |
|---|
| 6526 | 6800 | /** |
|---|
| 6527 | 6801 | * _scsih_sas_device_status_change_event - handle device status change |
|---|
| 6528 | 6802 | * @ioc: per adapter object |
|---|
| 6529 | | - * @fw_event: The fw_event_work object |
|---|
| 6803 | + * @event_data: The fw event |
|---|
| 6530 | 6804 | * Context: user. |
|---|
| 6531 | 6805 | */ |
|---|
| 6532 | 6806 | static void |
|---|
| 6533 | 6807 | _scsih_sas_device_status_change_event(struct MPT3SAS_ADAPTER *ioc, |
|---|
| 6534 | | - struct fw_event_work *fw_event) |
|---|
| 6808 | + Mpi2EventDataSasDeviceStatusChange_t *event_data) |
|---|
| 6535 | 6809 | { |
|---|
| 6536 | 6810 | struct MPT3SAS_TARGET *target_priv_data; |
|---|
| 6537 | 6811 | struct _sas_device *sas_device; |
|---|
| 6538 | 6812 | u64 sas_address; |
|---|
| 6539 | 6813 | unsigned long flags; |
|---|
| 6540 | | - Mpi2EventDataSasDeviceStatusChange_t *event_data = |
|---|
| 6541 | | - (Mpi2EventDataSasDeviceStatusChange_t *) |
|---|
| 6542 | | - fw_event->event_data; |
|---|
| 6543 | | - |
|---|
| 6544 | | - if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) |
|---|
| 6545 | | - _scsih_sas_device_status_change_event_debug(ioc, |
|---|
| 6546 | | - event_data); |
|---|
| 6547 | 6814 | |
|---|
| 6548 | 6815 | /* In MPI Revision K (0xC), the internal device reset complete was |
|---|
| 6549 | 6816 | * implemented, so avoid setting tm_busy flag for older firmware. |
|---|
| .. | .. |
|---|
| 6574 | 6841 | target_priv_data->tm_busy = 1; |
|---|
| 6575 | 6842 | else |
|---|
| 6576 | 6843 | target_priv_data->tm_busy = 0; |
|---|
| 6844 | + |
|---|
| 6845 | + if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) |
|---|
| 6846 | + ioc_info(ioc, |
|---|
| 6847 | + "%s tm_busy flag for handle(0x%04x)\n", |
|---|
| 6848 | + (target_priv_data->tm_busy == 1) ? "Enable" : "Disable", |
|---|
| 6849 | + target_priv_data->handle); |
|---|
| 6577 | 6850 | |
|---|
| 6578 | 6851 | out: |
|---|
| 6579 | 6852 | if (sas_device) |
|---|
| .. | .. |
|---|
| 6609 | 6882 | break; |
|---|
| 6610 | 6883 | case MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED: |
|---|
| 6611 | 6884 | desc = "PCIe device blocked"; |
|---|
| 6885 | + ioc_info(ioc, |
|---|
| 6886 | + "Device with Access Status (%s): wwid(0x%016llx), " |
|---|
| 6887 | + "handle(0x%04x)\n ll only be added to the internal list", |
|---|
| 6888 | + desc, (u64)wwid, handle); |
|---|
| 6889 | + rc = 0; |
|---|
| 6612 | 6890 | break; |
|---|
| 6613 | 6891 | case MPI26_PCIEDEV0_ASTATUS_MEMORY_SPACE_ACCESS_FAILED: |
|---|
| 6614 | 6892 | desc = "PCIe device mem space access failed"; |
|---|
| .. | .. |
|---|
| 6653 | 6931 | desc = "nvme failure status"; |
|---|
| 6654 | 6932 | break; |
|---|
| 6655 | 6933 | default: |
|---|
| 6656 | | - pr_err(MPT3SAS_FMT |
|---|
| 6657 | | - " NVMe discovery error(0x%02x): wwid(0x%016llx)," |
|---|
| 6658 | | - "handle(0x%04x)\n", ioc->name, access_status, |
|---|
| 6659 | | - (unsigned long long)wwid, handle); |
|---|
| 6934 | + ioc_err(ioc, "NVMe discovery error(0x%02x): wwid(0x%016llx), handle(0x%04x)\n", |
|---|
| 6935 | + access_status, (u64)wwid, handle); |
|---|
| 6660 | 6936 | return rc; |
|---|
| 6661 | 6937 | } |
|---|
| 6662 | 6938 | |
|---|
| 6663 | 6939 | if (!rc) |
|---|
| 6664 | 6940 | return rc; |
|---|
| 6665 | 6941 | |
|---|
| 6666 | | - pr_info(MPT3SAS_FMT |
|---|
| 6667 | | - "NVMe discovery error(%s): wwid(0x%016llx), handle(0x%04x)\n", |
|---|
| 6668 | | - ioc->name, desc, |
|---|
| 6669 | | - (unsigned long long)wwid, handle); |
|---|
| 6942 | + ioc_info(ioc, "NVMe discovery error(%s): wwid(0x%016llx), handle(0x%04x)\n", |
|---|
| 6943 | + desc, (u64)wwid, handle); |
|---|
| 6670 | 6944 | return rc; |
|---|
| 6671 | 6945 | } |
|---|
| 6672 | 6946 | |
|---|
| .. | .. |
|---|
| 6682 | 6956 | { |
|---|
| 6683 | 6957 | struct MPT3SAS_TARGET *sas_target_priv_data; |
|---|
| 6684 | 6958 | |
|---|
| 6685 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6686 | | - "%s: enter: handle(0x%04x), wwid(0x%016llx)\n", ioc->name, __func__, |
|---|
| 6687 | | - pcie_device->handle, (unsigned long long) |
|---|
| 6688 | | - pcie_device->wwid)); |
|---|
| 6959 | + dewtprintk(ioc, |
|---|
| 6960 | + ioc_info(ioc, "%s: enter: handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 6961 | + __func__, |
|---|
| 6962 | + pcie_device->handle, (u64)pcie_device->wwid)); |
|---|
| 6689 | 6963 | if (pcie_device->enclosure_handle != 0) |
|---|
| 6690 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6691 | | - "%s: enter: enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 6692 | | - ioc->name, __func__, |
|---|
| 6693 | | - (unsigned long long)pcie_device->enclosure_logical_id, |
|---|
| 6694 | | - pcie_device->slot)); |
|---|
| 6964 | + dewtprintk(ioc, |
|---|
| 6965 | + ioc_info(ioc, "%s: enter: enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 6966 | + __func__, |
|---|
| 6967 | + (u64)pcie_device->enclosure_logical_id, |
|---|
| 6968 | + pcie_device->slot)); |
|---|
| 6695 | 6969 | if (pcie_device->connector_name[0] != '\0') |
|---|
| 6696 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6697 | | - "%s: enter: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 6698 | | - ioc->name, __func__, |
|---|
| 6699 | | - pcie_device->enclosure_level, |
|---|
| 6700 | | - pcie_device->connector_name)); |
|---|
| 6970 | + dewtprintk(ioc, |
|---|
| 6971 | + ioc_info(ioc, "%s: enter: enclosure level(0x%04x), connector name(%s)\n", |
|---|
| 6972 | + __func__, |
|---|
| 6973 | + pcie_device->enclosure_level, |
|---|
| 6974 | + pcie_device->connector_name)); |
|---|
| 6701 | 6975 | |
|---|
| 6702 | 6976 | if (pcie_device->starget && pcie_device->starget->hostdata) { |
|---|
| 6703 | 6977 | sas_target_priv_data = pcie_device->starget->hostdata; |
|---|
| .. | .. |
|---|
| 6706 | 6980 | sas_target_priv_data->handle = MPT3SAS_INVALID_DEVICE_HANDLE; |
|---|
| 6707 | 6981 | } |
|---|
| 6708 | 6982 | |
|---|
| 6709 | | - pr_info(MPT3SAS_FMT |
|---|
| 6710 | | - "removing handle(0x%04x), wwid (0x%016llx)\n", |
|---|
| 6711 | | - ioc->name, pcie_device->handle, |
|---|
| 6712 | | - (unsigned long long) pcie_device->wwid); |
|---|
| 6983 | + ioc_info(ioc, "removing handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 6984 | + pcie_device->handle, (u64)pcie_device->wwid); |
|---|
| 6713 | 6985 | if (pcie_device->enclosure_handle != 0) |
|---|
| 6714 | | - pr_info(MPT3SAS_FMT |
|---|
| 6715 | | - "removing : enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 6716 | | - ioc->name, |
|---|
| 6717 | | - (unsigned long long)pcie_device->enclosure_logical_id, |
|---|
| 6718 | | - pcie_device->slot); |
|---|
| 6986 | + ioc_info(ioc, "removing : enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 6987 | + (u64)pcie_device->enclosure_logical_id, |
|---|
| 6988 | + pcie_device->slot); |
|---|
| 6719 | 6989 | if (pcie_device->connector_name[0] != '\0') |
|---|
| 6720 | | - pr_info(MPT3SAS_FMT |
|---|
| 6721 | | - "removing: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 6722 | | - ioc->name, pcie_device->enclosure_level, |
|---|
| 6723 | | - pcie_device->connector_name); |
|---|
| 6990 | + ioc_info(ioc, "removing: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 6991 | + pcie_device->enclosure_level, |
|---|
| 6992 | + pcie_device->connector_name); |
|---|
| 6724 | 6993 | |
|---|
| 6725 | | - if (pcie_device->starget) |
|---|
| 6994 | + if (pcie_device->starget && (pcie_device->access_status != |
|---|
| 6995 | + MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED)) |
|---|
| 6726 | 6996 | scsi_remove_target(&pcie_device->starget->dev); |
|---|
| 6727 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6728 | | - "%s: exit: handle(0x%04x), wwid(0x%016llx)\n", ioc->name, __func__, |
|---|
| 6729 | | - pcie_device->handle, (unsigned long long) |
|---|
| 6730 | | - pcie_device->wwid)); |
|---|
| 6997 | + dewtprintk(ioc, |
|---|
| 6998 | + ioc_info(ioc, "%s: exit: handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 6999 | + __func__, |
|---|
| 7000 | + pcie_device->handle, (u64)pcie_device->wwid)); |
|---|
| 6731 | 7001 | if (pcie_device->enclosure_handle != 0) |
|---|
| 6732 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6733 | | - "%s: exit: enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 6734 | | - ioc->name, __func__, |
|---|
| 6735 | | - (unsigned long long)pcie_device->enclosure_logical_id, |
|---|
| 6736 | | - pcie_device->slot)); |
|---|
| 7002 | + dewtprintk(ioc, |
|---|
| 7003 | + ioc_info(ioc, "%s: exit: enclosure logical id(0x%016llx), slot(%d)\n", |
|---|
| 7004 | + __func__, |
|---|
| 7005 | + (u64)pcie_device->enclosure_logical_id, |
|---|
| 7006 | + pcie_device->slot)); |
|---|
| 6737 | 7007 | if (pcie_device->connector_name[0] != '\0') |
|---|
| 6738 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 6739 | | - "%s: exit: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 6740 | | - ioc->name, __func__, pcie_device->enclosure_level, |
|---|
| 6741 | | - pcie_device->connector_name)); |
|---|
| 7008 | + dewtprintk(ioc, |
|---|
| 7009 | + ioc_info(ioc, "%s: exit: enclosure level(0x%04x), connector name( %s)\n", |
|---|
| 7010 | + __func__, |
|---|
| 7011 | + pcie_device->enclosure_level, |
|---|
| 7012 | + pcie_device->connector_name)); |
|---|
| 6742 | 7013 | |
|---|
| 6743 | 7014 | kfree(pcie_device->serial_number); |
|---|
| 6744 | 7015 | } |
|---|
| .. | .. |
|---|
| 6772 | 7043 | |
|---|
| 6773 | 7044 | /* check if this is end device */ |
|---|
| 6774 | 7045 | device_info = le32_to_cpu(pcie_device_pg0.DeviceInfo); |
|---|
| 6775 | | - if (!(_scsih_is_nvme_device(device_info))) |
|---|
| 7046 | + if (!(_scsih_is_nvme_pciescsi_device(device_info))) |
|---|
| 6776 | 7047 | return; |
|---|
| 6777 | 7048 | |
|---|
| 6778 | 7049 | wwid = le64_to_cpu(pcie_device_pg0.WWID); |
|---|
| .. | .. |
|---|
| 6787 | 7058 | if (unlikely(pcie_device->handle != handle)) { |
|---|
| 6788 | 7059 | starget = pcie_device->starget; |
|---|
| 6789 | 7060 | sas_target_priv_data = starget->hostdata; |
|---|
| 7061 | + pcie_device->access_status = pcie_device_pg0.AccessStatus; |
|---|
| 6790 | 7062 | starget_printk(KERN_INFO, starget, |
|---|
| 6791 | 7063 | "handle changed from(0x%04x) to (0x%04x)!!!\n", |
|---|
| 6792 | 7064 | pcie_device->handle, handle); |
|---|
| .. | .. |
|---|
| 6808 | 7080 | /* check if device is present */ |
|---|
| 6809 | 7081 | if (!(le32_to_cpu(pcie_device_pg0.Flags) & |
|---|
| 6810 | 7082 | MPI26_PCIEDEV0_FLAGS_DEVICE_PRESENT)) { |
|---|
| 6811 | | - pr_info(MPT3SAS_FMT |
|---|
| 6812 | | - "device is not present handle(0x%04x), flags!!!\n", |
|---|
| 6813 | | - ioc->name, handle); |
|---|
| 7083 | + ioc_info(ioc, "device is not present handle(0x%04x), flags!!!\n", |
|---|
| 7084 | + handle); |
|---|
| 6814 | 7085 | spin_unlock_irqrestore(&ioc->pcie_device_lock, flags); |
|---|
| 6815 | 7086 | pcie_device_put(pcie_device); |
|---|
| 6816 | 7087 | return; |
|---|
| .. | .. |
|---|
| 6854 | 7125 | |
|---|
| 6855 | 7126 | if ((mpt3sas_config_get_pcie_device_pg0(ioc, &mpi_reply, |
|---|
| 6856 | 7127 | &pcie_device_pg0, MPI26_PCIE_DEVICE_PGAD_FORM_HANDLE, handle))) { |
|---|
| 6857 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 6858 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 7128 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 7129 | + __FILE__, __LINE__, __func__); |
|---|
| 6859 | 7130 | return 0; |
|---|
| 6860 | 7131 | } |
|---|
| 6861 | 7132 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 6862 | 7133 | MPI2_IOCSTATUS_MASK; |
|---|
| 6863 | 7134 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 6864 | | - pr_err(MPT3SAS_FMT |
|---|
| 6865 | | - "failure at %s:%d/%s()!\n", |
|---|
| 6866 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 7135 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 7136 | + __FILE__, __LINE__, __func__); |
|---|
| 6867 | 7137 | return 0; |
|---|
| 6868 | 7138 | } |
|---|
| 6869 | 7139 | |
|---|
| .. | .. |
|---|
| 6873 | 7143 | /* check if device is present */ |
|---|
| 6874 | 7144 | if (!(le32_to_cpu(pcie_device_pg0.Flags) & |
|---|
| 6875 | 7145 | MPI26_PCIEDEV0_FLAGS_DEVICE_PRESENT)) { |
|---|
| 6876 | | - pr_err(MPT3SAS_FMT |
|---|
| 6877 | | - "device is not present handle(0x04%x)!!!\n", |
|---|
| 6878 | | - ioc->name, handle); |
|---|
| 7146 | + ioc_err(ioc, "device is not present handle(0x04%x)!!!\n", |
|---|
| 7147 | + handle); |
|---|
| 6879 | 7148 | return 0; |
|---|
| 6880 | 7149 | } |
|---|
| 6881 | 7150 | |
|---|
| .. | .. |
|---|
| 6884 | 7153 | pcie_device_pg0.AccessStatus)) |
|---|
| 6885 | 7154 | return 0; |
|---|
| 6886 | 7155 | |
|---|
| 6887 | | - if (!(_scsih_is_nvme_device(le32_to_cpu(pcie_device_pg0.DeviceInfo)))) |
|---|
| 7156 | + if (!(_scsih_is_nvme_pciescsi_device(le32_to_cpu |
|---|
| 7157 | + (pcie_device_pg0.DeviceInfo)))) |
|---|
| 6888 | 7158 | return 0; |
|---|
| 6889 | 7159 | |
|---|
| 6890 | 7160 | pcie_device = mpt3sas_get_pdev_by_wwid(ioc, wwid); |
|---|
| .. | .. |
|---|
| 6894 | 7164 | return 0; |
|---|
| 6895 | 7165 | } |
|---|
| 6896 | 7166 | |
|---|
| 7167 | + /* PCIe Device Page 2 contains read-only information about a |
|---|
| 7168 | + * specific NVMe device; therefore, this page is only |
|---|
| 7169 | + * valid for NVMe devices and skip for pcie devices of type scsi. |
|---|
| 7170 | + */ |
|---|
| 7171 | + if (!(mpt3sas_scsih_is_pcie_scsi_device( |
|---|
| 7172 | + le32_to_cpu(pcie_device_pg0.DeviceInfo)))) { |
|---|
| 7173 | + if (mpt3sas_config_get_pcie_device_pg2(ioc, &mpi_reply, |
|---|
| 7174 | + &pcie_device_pg2, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, |
|---|
| 7175 | + handle)) { |
|---|
| 7176 | + ioc_err(ioc, |
|---|
| 7177 | + "failure at %s:%d/%s()!\n", __FILE__, |
|---|
| 7178 | + __LINE__, __func__); |
|---|
| 7179 | + return 0; |
|---|
| 7180 | + } |
|---|
| 7181 | + |
|---|
| 7182 | + ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 7183 | + MPI2_IOCSTATUS_MASK; |
|---|
| 7184 | + if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 7185 | + ioc_err(ioc, |
|---|
| 7186 | + "failure at %s:%d/%s()!\n", __FILE__, |
|---|
| 7187 | + __LINE__, __func__); |
|---|
| 7188 | + return 0; |
|---|
| 7189 | + } |
|---|
| 7190 | + } |
|---|
| 7191 | + |
|---|
| 6897 | 7192 | pcie_device = kzalloc(sizeof(struct _pcie_device), GFP_KERNEL); |
|---|
| 6898 | 7193 | if (!pcie_device) { |
|---|
| 6899 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 6900 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 7194 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 7195 | + __FILE__, __LINE__, __func__); |
|---|
| 6901 | 7196 | return 0; |
|---|
| 6902 | 7197 | } |
|---|
| 6903 | 7198 | |
|---|
| .. | .. |
|---|
| 6905 | 7200 | pcie_device->id = ioc->pcie_target_id++; |
|---|
| 6906 | 7201 | pcie_device->channel = PCIE_CHANNEL; |
|---|
| 6907 | 7202 | pcie_device->handle = handle; |
|---|
| 7203 | + pcie_device->access_status = pcie_device_pg0.AccessStatus; |
|---|
| 6908 | 7204 | pcie_device->device_info = le32_to_cpu(pcie_device_pg0.DeviceInfo); |
|---|
| 6909 | 7205 | pcie_device->wwid = wwid; |
|---|
| 6910 | 7206 | pcie_device->port_num = pcie_device_pg0.PortNum; |
|---|
| .. | .. |
|---|
| 6936 | 7232 | le64_to_cpu(enclosure_dev->pg0.EnclosureLogicalID); |
|---|
| 6937 | 7233 | } |
|---|
| 6938 | 7234 | /* TODO -- Add device name once FW supports it */ |
|---|
| 6939 | | - if (mpt3sas_config_get_pcie_device_pg2(ioc, &mpi_reply, |
|---|
| 6940 | | - &pcie_device_pg2, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle)) { |
|---|
| 6941 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 6942 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6943 | | - kfree(pcie_device); |
|---|
| 6944 | | - return 0; |
|---|
| 6945 | | - } |
|---|
| 6946 | | - |
|---|
| 6947 | | - ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & MPI2_IOCSTATUS_MASK; |
|---|
| 6948 | | - if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 6949 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 6950 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 6951 | | - kfree(pcie_device); |
|---|
| 6952 | | - return 0; |
|---|
| 6953 | | - } |
|---|
| 6954 | | - pcie_device->nvme_mdts = |
|---|
| 6955 | | - le32_to_cpu(pcie_device_pg2.MaximumDataTransferSize); |
|---|
| 6956 | | - if (pcie_device_pg2.ControllerResetTO) |
|---|
| 6957 | | - pcie_device->reset_timeout = |
|---|
| 6958 | | - pcie_device_pg2.ControllerResetTO; |
|---|
| 6959 | | - else |
|---|
| 7235 | + if (!(mpt3sas_scsih_is_pcie_scsi_device( |
|---|
| 7236 | + le32_to_cpu(pcie_device_pg0.DeviceInfo)))) { |
|---|
| 7237 | + pcie_device->nvme_mdts = |
|---|
| 7238 | + le32_to_cpu(pcie_device_pg2.MaximumDataTransferSize); |
|---|
| 7239 | + pcie_device->shutdown_latency = |
|---|
| 7240 | + le16_to_cpu(pcie_device_pg2.ShutdownLatency); |
|---|
| 7241 | + /* |
|---|
| 7242 | + * Set IOC's max_shutdown_latency to drive's RTD3 Entry Latency |
|---|
| 7243 | + * if drive's RTD3 Entry Latency is greater then IOC's |
|---|
| 7244 | + * max_shutdown_latency. |
|---|
| 7245 | + */ |
|---|
| 7246 | + if (pcie_device->shutdown_latency > ioc->max_shutdown_latency) |
|---|
| 7247 | + ioc->max_shutdown_latency = |
|---|
| 7248 | + pcie_device->shutdown_latency; |
|---|
| 7249 | + if (pcie_device_pg2.ControllerResetTO) |
|---|
| 7250 | + pcie_device->reset_timeout = |
|---|
| 7251 | + pcie_device_pg2.ControllerResetTO; |
|---|
| 7252 | + else |
|---|
| 7253 | + pcie_device->reset_timeout = 30; |
|---|
| 7254 | + } else |
|---|
| 6960 | 7255 | pcie_device->reset_timeout = 30; |
|---|
| 6961 | 7256 | |
|---|
| 6962 | 7257 | if (ioc->wait_for_discovery_to_complete) |
|---|
| .. | .. |
|---|
| 7004 | 7299 | status_str = "unknown status"; |
|---|
| 7005 | 7300 | break; |
|---|
| 7006 | 7301 | } |
|---|
| 7007 | | - pr_info(MPT3SAS_FMT "pcie topology change: (%s)\n", |
|---|
| 7008 | | - ioc->name, status_str); |
|---|
| 7302 | + ioc_info(ioc, "pcie topology change: (%s)\n", status_str); |
|---|
| 7009 | 7303 | pr_info("\tswitch_handle(0x%04x), enclosure_handle(0x%04x)" |
|---|
| 7010 | 7304 | "start_port(%02d), count(%d)\n", |
|---|
| 7011 | 7305 | le16_to_cpu(event_data->SwitchDevHandle), |
|---|
| .. | .. |
|---|
| 7078 | 7372 | return; |
|---|
| 7079 | 7373 | |
|---|
| 7080 | 7374 | if (fw_event->ignore) { |
|---|
| 7081 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT "ignoring switch event\n", |
|---|
| 7082 | | - ioc->name)); |
|---|
| 7375 | + dewtprintk(ioc, ioc_info(ioc, "ignoring switch event\n")); |
|---|
| 7083 | 7376 | return; |
|---|
| 7084 | 7377 | } |
|---|
| 7085 | 7378 | |
|---|
| 7086 | 7379 | /* handle siblings events */ |
|---|
| 7087 | 7380 | for (i = 0; i < event_data->NumEntries; i++) { |
|---|
| 7088 | 7381 | if (fw_event->ignore) { |
|---|
| 7089 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 7090 | | - "ignoring switch event\n", ioc->name)); |
|---|
| 7382 | + dewtprintk(ioc, |
|---|
| 7383 | + ioc_info(ioc, "ignoring switch event\n")); |
|---|
| 7091 | 7384 | return; |
|---|
| 7092 | 7385 | } |
|---|
| 7093 | 7386 | if (ioc->remove_host || ioc->pci_error_recovery) |
|---|
| .. | .. |
|---|
| 7132 | 7425 | if (!test_bit(handle, ioc->pend_os_device_add)) |
|---|
| 7133 | 7426 | break; |
|---|
| 7134 | 7427 | |
|---|
| 7135 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 7136 | | - "handle(0x%04x) device not found: convert " |
|---|
| 7137 | | - "event to a device add\n", ioc->name, handle)); |
|---|
| 7428 | + dewtprintk(ioc, |
|---|
| 7429 | + ioc_info(ioc, "handle(0x%04x) device not found: convert event to a device add\n", |
|---|
| 7430 | + handle)); |
|---|
| 7138 | 7431 | event_data->PortEntry[i].PortStatus &= 0xF0; |
|---|
| 7139 | 7432 | event_data->PortEntry[i].PortStatus |= |
|---|
| 7140 | 7433 | MPI26_EVENT_PCIE_TOPO_PS_DEV_ADDED; |
|---|
| 7141 | | - /* fall through */ |
|---|
| 7434 | + fallthrough; |
|---|
| 7142 | 7435 | case MPI26_EVENT_PCIE_TOPO_PS_DEV_ADDED: |
|---|
| 7143 | 7436 | if (ioc->shost_recovery) |
|---|
| 7144 | 7437 | break; |
|---|
| .. | .. |
|---|
| 7217 | 7510 | break; |
|---|
| 7218 | 7511 | } |
|---|
| 7219 | 7512 | |
|---|
| 7220 | | - pr_info(MPT3SAS_FMT "PCIE device status change: (%s)\n" |
|---|
| 7221 | | - "\thandle(0x%04x), WWID(0x%016llx), tag(%d)", |
|---|
| 7222 | | - ioc->name, reason_str, le16_to_cpu(event_data->DevHandle), |
|---|
| 7223 | | - (unsigned long long)le64_to_cpu(event_data->WWID), |
|---|
| 7224 | | - le16_to_cpu(event_data->TaskTag)); |
|---|
| 7513 | + ioc_info(ioc, "PCIE device status change: (%s)\n" |
|---|
| 7514 | + "\thandle(0x%04x), WWID(0x%016llx), tag(%d)", |
|---|
| 7515 | + reason_str, le16_to_cpu(event_data->DevHandle), |
|---|
| 7516 | + (u64)le64_to_cpu(event_data->WWID), |
|---|
| 7517 | + le16_to_cpu(event_data->TaskTag)); |
|---|
| 7225 | 7518 | if (event_data->ReasonCode == MPI26_EVENT_PCIDEV_STAT_RC_SMART_DATA) |
|---|
| 7226 | | - pr_info(MPT3SAS_FMT ", ASC(0x%x), ASCQ(0x%x)\n", ioc->name, |
|---|
| 7519 | + pr_cont(", ASC(0x%x), ASCQ(0x%x)\n", |
|---|
| 7227 | 7520 | event_data->ASC, event_data->ASCQ); |
|---|
| 7228 | | - pr_info("\n"); |
|---|
| 7521 | + pr_cont("\n"); |
|---|
| 7229 | 7522 | } |
|---|
| 7230 | 7523 | |
|---|
| 7231 | 7524 | /** |
|---|
| .. | .. |
|---|
| 7303 | 7596 | break; |
|---|
| 7304 | 7597 | } |
|---|
| 7305 | 7598 | |
|---|
| 7306 | | - pr_info(MPT3SAS_FMT "enclosure status change: (%s)\n" |
|---|
| 7307 | | - "\thandle(0x%04x), enclosure logical id(0x%016llx)" |
|---|
| 7308 | | - " number slots(%d)\n", ioc->name, reason_str, |
|---|
| 7309 | | - le16_to_cpu(event_data->EnclosureHandle), |
|---|
| 7310 | | - (unsigned long long)le64_to_cpu(event_data->EnclosureLogicalID), |
|---|
| 7311 | | - le16_to_cpu(event_data->StartSlot)); |
|---|
| 7599 | + ioc_info(ioc, "enclosure status change: (%s)\n" |
|---|
| 7600 | + "\thandle(0x%04x), enclosure logical id(0x%016llx) number slots(%d)\n", |
|---|
| 7601 | + reason_str, |
|---|
| 7602 | + le16_to_cpu(event_data->EnclosureHandle), |
|---|
| 7603 | + (u64)le64_to_cpu(event_data->EnclosureLogicalID), |
|---|
| 7604 | + le16_to_cpu(event_data->StartSlot)); |
|---|
| 7312 | 7605 | } |
|---|
| 7313 | 7606 | |
|---|
| 7314 | 7607 | /** |
|---|
| .. | .. |
|---|
| 7346 | 7639 | kzalloc(sizeof(struct _enclosure_node), |
|---|
| 7347 | 7640 | GFP_KERNEL); |
|---|
| 7348 | 7641 | if (!enclosure_dev) { |
|---|
| 7349 | | - pr_info(MPT3SAS_FMT |
|---|
| 7350 | | - "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 7351 | | - __FILE__, __LINE__, __func__); |
|---|
| 7642 | + ioc_info(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 7643 | + __FILE__, __LINE__, __func__); |
|---|
| 7352 | 7644 | return; |
|---|
| 7353 | 7645 | } |
|---|
| 7354 | 7646 | rc = mpt3sas_config_get_enclosure_pg0(ioc, &mpi_reply, |
|---|
| .. | .. |
|---|
| 7406 | 7698 | u8 task_abort_retries; |
|---|
| 7407 | 7699 | |
|---|
| 7408 | 7700 | mutex_lock(&ioc->tm_cmds.mutex); |
|---|
| 7409 | | - pr_info(MPT3SAS_FMT |
|---|
| 7410 | | - "%s: enter: phy number(%d), width(%d)\n", |
|---|
| 7411 | | - ioc->name, __func__, event_data->PhyNum, |
|---|
| 7412 | | - event_data->PortWidth); |
|---|
| 7701 | + ioc_info(ioc, "%s: enter: phy number(%d), width(%d)\n", |
|---|
| 7702 | + __func__, event_data->PhyNum, event_data->PortWidth); |
|---|
| 7413 | 7703 | |
|---|
| 7414 | 7704 | _scsih_block_io_all_device(ioc); |
|---|
| 7415 | 7705 | |
|---|
| .. | .. |
|---|
| 7419 | 7709 | |
|---|
| 7420 | 7710 | /* sanity checks for retrying this loop */ |
|---|
| 7421 | 7711 | if (max_retries++ == 5) { |
|---|
| 7422 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT "%s: giving up\n", |
|---|
| 7423 | | - ioc->name, __func__)); |
|---|
| 7712 | + dewtprintk(ioc, ioc_info(ioc, "%s: giving up\n", __func__)); |
|---|
| 7424 | 7713 | goto out; |
|---|
| 7425 | 7714 | } else if (max_retries > 1) |
|---|
| 7426 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT "%s: %d retry\n", |
|---|
| 7427 | | - ioc->name, __func__, max_retries - 1)); |
|---|
| 7715 | + dewtprintk(ioc, |
|---|
| 7716 | + ioc_info(ioc, "%s: %d retry\n", |
|---|
| 7717 | + __func__, max_retries - 1)); |
|---|
| 7428 | 7718 | |
|---|
| 7429 | 7719 | termination_count = 0; |
|---|
| 7430 | 7720 | query_count = 0; |
|---|
| .. | .. |
|---|
| 7460 | 7750 | goto out; |
|---|
| 7461 | 7751 | |
|---|
| 7462 | 7752 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); |
|---|
| 7463 | | - r = mpt3sas_scsih_issue_tm(ioc, handle, lun, |
|---|
| 7753 | + r = mpt3sas_scsih_issue_tm(ioc, handle, 0, 0, lun, |
|---|
| 7464 | 7754 | MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK, st->smid, |
|---|
| 7465 | 7755 | st->msix_io, 30, 0); |
|---|
| 7466 | 7756 | if (r == FAILED) { |
|---|
| .. | .. |
|---|
| 7491 | 7781 | task_abort_retries = 0; |
|---|
| 7492 | 7782 | tm_retry: |
|---|
| 7493 | 7783 | if (task_abort_retries++ == 60) { |
|---|
| 7494 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 7495 | | - "%s: ABORT_TASK: giving up\n", ioc->name, |
|---|
| 7496 | | - __func__)); |
|---|
| 7784 | + dewtprintk(ioc, |
|---|
| 7785 | + ioc_info(ioc, "%s: ABORT_TASK: giving up\n", |
|---|
| 7786 | + __func__)); |
|---|
| 7497 | 7787 | spin_lock_irqsave(&ioc->scsi_lookup_lock, flags); |
|---|
| 7498 | 7788 | goto broadcast_aen_retry; |
|---|
| 7499 | 7789 | } |
|---|
| .. | .. |
|---|
| 7501 | 7791 | if (ioc->shost_recovery) |
|---|
| 7502 | 7792 | goto out_no_lock; |
|---|
| 7503 | 7793 | |
|---|
| 7504 | | - r = mpt3sas_scsih_issue_tm(ioc, handle, sdev->lun, |
|---|
| 7505 | | - MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK, st->smid, |
|---|
| 7506 | | - st->msix_io, 30, 0); |
|---|
| 7794 | + r = mpt3sas_scsih_issue_tm(ioc, handle, sdev->channel, sdev->id, |
|---|
| 7795 | + sdev->lun, MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK, |
|---|
| 7796 | + st->smid, st->msix_io, 30, 0); |
|---|
| 7507 | 7797 | if (r == FAILED || st->cb_idx != 0xFF) { |
|---|
| 7508 | 7798 | sdev_printk(KERN_WARNING, sdev, |
|---|
| 7509 | 7799 | "mpt3sas_scsih_issue_tm: ABORT_TASK: FAILED : " |
|---|
| .. | .. |
|---|
| 7522 | 7812 | } |
|---|
| 7523 | 7813 | |
|---|
| 7524 | 7814 | if (ioc->broadcast_aen_pending) { |
|---|
| 7525 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 7526 | | - "%s: loop back due to pending AEN\n", |
|---|
| 7527 | | - ioc->name, __func__)); |
|---|
| 7815 | + dewtprintk(ioc, |
|---|
| 7816 | + ioc_info(ioc, |
|---|
| 7817 | + "%s: loop back due to pending AEN\n", |
|---|
| 7818 | + __func__)); |
|---|
| 7528 | 7819 | ioc->broadcast_aen_pending = 0; |
|---|
| 7529 | 7820 | goto broadcast_aen_retry; |
|---|
| 7530 | 7821 | } |
|---|
| .. | .. |
|---|
| 7533 | 7824 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); |
|---|
| 7534 | 7825 | out_no_lock: |
|---|
| 7535 | 7826 | |
|---|
| 7536 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 7537 | | - "%s - exit, query_count = %d termination_count = %d\n", |
|---|
| 7538 | | - ioc->name, __func__, query_count, termination_count)); |
|---|
| 7827 | + dewtprintk(ioc, |
|---|
| 7828 | + ioc_info(ioc, "%s - exit, query_count = %d termination_count = %d\n", |
|---|
| 7829 | + __func__, query_count, termination_count)); |
|---|
| 7539 | 7830 | |
|---|
| 7540 | 7831 | ioc->broadcast_aen_busy = 0; |
|---|
| 7541 | 7832 | if (!ioc->shost_recovery) |
|---|
| .. | .. |
|---|
| 7557 | 7848 | (Mpi2EventDataSasDiscovery_t *) fw_event->event_data; |
|---|
| 7558 | 7849 | |
|---|
| 7559 | 7850 | if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) { |
|---|
| 7560 | | - pr_info(MPT3SAS_FMT "discovery event: (%s)", ioc->name, |
|---|
| 7561 | | - (event_data->ReasonCode == MPI2_EVENT_SAS_DISC_RC_STARTED) ? |
|---|
| 7562 | | - "start" : "stop"); |
|---|
| 7851 | + ioc_info(ioc, "discovery event: (%s)", |
|---|
| 7852 | + event_data->ReasonCode == MPI2_EVENT_SAS_DISC_RC_STARTED ? |
|---|
| 7853 | + "start" : "stop"); |
|---|
| 7563 | 7854 | if (event_data->DiscoveryStatus) |
|---|
| 7564 | | - pr_info("discovery_status(0x%08x)", |
|---|
| 7565 | | - le32_to_cpu(event_data->DiscoveryStatus)); |
|---|
| 7566 | | - pr_info("\n"); |
|---|
| 7855 | + pr_cont("discovery_status(0x%08x)", |
|---|
| 7856 | + le32_to_cpu(event_data->DiscoveryStatus)); |
|---|
| 7857 | + pr_cont("\n"); |
|---|
| 7567 | 7858 | } |
|---|
| 7568 | 7859 | |
|---|
| 7569 | 7860 | if (event_data->ReasonCode == MPI2_EVENT_SAS_DISC_RC_STARTED && |
|---|
| .. | .. |
|---|
| 7593 | 7884 | |
|---|
| 7594 | 7885 | switch (event_data->ReasonCode) { |
|---|
| 7595 | 7886 | case MPI25_EVENT_SAS_DISC_ERR_SMP_FAILED: |
|---|
| 7596 | | - pr_warn(MPT3SAS_FMT "SMP command sent to the expander" |
|---|
| 7597 | | - "(handle:0x%04x, sas_address:0x%016llx," |
|---|
| 7598 | | - "physical_port:0x%02x) has failed", |
|---|
| 7599 | | - ioc->name, le16_to_cpu(event_data->DevHandle), |
|---|
| 7600 | | - (unsigned long long)le64_to_cpu(event_data->SASAddress), |
|---|
| 7601 | | - event_data->PhysicalPort); |
|---|
| 7887 | + ioc_warn(ioc, "SMP command sent to the expander (handle:0x%04x, sas_address:0x%016llx, physical_port:0x%02x) has failed\n", |
|---|
| 7888 | + le16_to_cpu(event_data->DevHandle), |
|---|
| 7889 | + (u64)le64_to_cpu(event_data->SASAddress), |
|---|
| 7890 | + event_data->PhysicalPort); |
|---|
| 7602 | 7891 | break; |
|---|
| 7603 | 7892 | case MPI25_EVENT_SAS_DISC_ERR_SMP_TIMEOUT: |
|---|
| 7604 | | - pr_warn(MPT3SAS_FMT "SMP command sent to the expander" |
|---|
| 7605 | | - "(handle:0x%04x, sas_address:0x%016llx," |
|---|
| 7606 | | - "physical_port:0x%02x) has timed out", |
|---|
| 7607 | | - ioc->name, le16_to_cpu(event_data->DevHandle), |
|---|
| 7608 | | - (unsigned long long)le64_to_cpu(event_data->SASAddress), |
|---|
| 7609 | | - event_data->PhysicalPort); |
|---|
| 7893 | + ioc_warn(ioc, "SMP command sent to the expander (handle:0x%04x, sas_address:0x%016llx, physical_port:0x%02x) has timed out\n", |
|---|
| 7894 | + le16_to_cpu(event_data->DevHandle), |
|---|
| 7895 | + (u64)le64_to_cpu(event_data->SASAddress), |
|---|
| 7896 | + event_data->PhysicalPort); |
|---|
| 7610 | 7897 | break; |
|---|
| 7611 | 7898 | default: |
|---|
| 7612 | 7899 | break; |
|---|
| .. | .. |
|---|
| 7629 | 7916 | if (!(ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK)) |
|---|
| 7630 | 7917 | return; |
|---|
| 7631 | 7918 | |
|---|
| 7632 | | - pr_info(MPT3SAS_FMT "pcie enumeration event: (%s) Flag 0x%02x", |
|---|
| 7633 | | - ioc->name, |
|---|
| 7634 | | - (event_data->ReasonCode == MPI26_EVENT_PCIE_ENUM_RC_STARTED) ? |
|---|
| 7635 | | - "started" : "completed", |
|---|
| 7636 | | - event_data->Flags); |
|---|
| 7919 | + ioc_info(ioc, "pcie enumeration event: (%s) Flag 0x%02x", |
|---|
| 7920 | + (event_data->ReasonCode == MPI26_EVENT_PCIE_ENUM_RC_STARTED) ? |
|---|
| 7921 | + "started" : "completed", |
|---|
| 7922 | + event_data->Flags); |
|---|
| 7637 | 7923 | if (event_data->EnumerationStatus) |
|---|
| 7638 | 7924 | pr_cont("enumeration_status(0x%08x)", |
|---|
| 7639 | 7925 | le32_to_cpu(event_data->EnumerationStatus)); |
|---|
| .. | .. |
|---|
| 7665 | 7951 | mutex_lock(&ioc->scsih_cmds.mutex); |
|---|
| 7666 | 7952 | |
|---|
| 7667 | 7953 | if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) { |
|---|
| 7668 | | - pr_err(MPT3SAS_FMT "%s: scsih_cmd in use\n", |
|---|
| 7669 | | - ioc->name, __func__); |
|---|
| 7954 | + ioc_err(ioc, "%s: scsih_cmd in use\n", __func__); |
|---|
| 7670 | 7955 | rc = -EAGAIN; |
|---|
| 7671 | 7956 | goto out; |
|---|
| 7672 | 7957 | } |
|---|
| .. | .. |
|---|
| 7674 | 7959 | |
|---|
| 7675 | 7960 | smid = mpt3sas_base_get_smid(ioc, ioc->scsih_cb_idx); |
|---|
| 7676 | 7961 | if (!smid) { |
|---|
| 7677 | | - pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n", |
|---|
| 7678 | | - ioc->name, __func__); |
|---|
| 7962 | + ioc_err(ioc, "%s: failed obtaining a smid\n", __func__); |
|---|
| 7679 | 7963 | ioc->scsih_cmds.status = MPT3_CMD_NOT_USED; |
|---|
| 7680 | 7964 | rc = -EAGAIN; |
|---|
| 7681 | 7965 | goto out; |
|---|
| .. | .. |
|---|
| 7689 | 7973 | mpi_request->Action = MPI2_RAID_ACTION_PHYSDISK_HIDDEN; |
|---|
| 7690 | 7974 | mpi_request->PhysDiskNum = phys_disk_num; |
|---|
| 7691 | 7975 | |
|---|
| 7692 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT "IR RAID_ACTION: turning fast "\ |
|---|
| 7693 | | - "path on for handle(0x%04x), phys_disk_num (0x%02x)\n", ioc->name, |
|---|
| 7694 | | - handle, phys_disk_num)); |
|---|
| 7976 | + dewtprintk(ioc, |
|---|
| 7977 | + ioc_info(ioc, "IR RAID_ACTION: turning fast path on for handle(0x%04x), phys_disk_num (0x%02x)\n", |
|---|
| 7978 | + handle, phys_disk_num)); |
|---|
| 7695 | 7979 | |
|---|
| 7696 | 7980 | init_completion(&ioc->scsih_cmds.done); |
|---|
| 7697 | | - mpt3sas_base_put_smid_default(ioc, smid); |
|---|
| 7981 | + ioc->put_smid_default(ioc, smid); |
|---|
| 7698 | 7982 | wait_for_completion_timeout(&ioc->scsih_cmds.done, 10*HZ); |
|---|
| 7699 | 7983 | |
|---|
| 7700 | 7984 | if (!(ioc->scsih_cmds.status & MPT3_CMD_COMPLETE)) { |
|---|
| 7701 | | - issue_reset = |
|---|
| 7702 | | - mpt3sas_base_check_cmd_timeout(ioc, |
|---|
| 7703 | | - ioc->scsih_cmds.status, mpi_request, |
|---|
| 7704 | | - sizeof(Mpi2RaidActionRequest_t)/4); |
|---|
| 7985 | + mpt3sas_check_cmd_timeout(ioc, |
|---|
| 7986 | + ioc->scsih_cmds.status, mpi_request, |
|---|
| 7987 | + sizeof(Mpi2RaidActionRequest_t)/4, issue_reset); |
|---|
| 7705 | 7988 | rc = -EFAULT; |
|---|
| 7706 | 7989 | goto out; |
|---|
| 7707 | 7990 | } |
|---|
| .. | .. |
|---|
| 7716 | 7999 | log_info = 0; |
|---|
| 7717 | 8000 | ioc_status &= MPI2_IOCSTATUS_MASK; |
|---|
| 7718 | 8001 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 7719 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 7720 | | - "IR RAID_ACTION: failed: ioc_status(0x%04x), " |
|---|
| 7721 | | - "loginfo(0x%08x)!!!\n", ioc->name, ioc_status, |
|---|
| 7722 | | - log_info)); |
|---|
| 8002 | + dewtprintk(ioc, |
|---|
| 8003 | + ioc_info(ioc, "IR RAID_ACTION: failed: ioc_status(0x%04x), loginfo(0x%08x)!!!\n", |
|---|
| 8004 | + ioc_status, log_info)); |
|---|
| 7723 | 8005 | rc = -EFAULT; |
|---|
| 7724 | 8006 | } else |
|---|
| 7725 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 7726 | | - "IR RAID_ACTION: completed successfully\n", |
|---|
| 7727 | | - ioc->name)); |
|---|
| 8007 | + dewtprintk(ioc, |
|---|
| 8008 | + ioc_info(ioc, "IR RAID_ACTION: completed successfully\n")); |
|---|
| 7728 | 8009 | } |
|---|
| 7729 | 8010 | |
|---|
| 7730 | 8011 | out: |
|---|
| .. | .. |
|---|
| 7769 | 8050 | |
|---|
| 7770 | 8051 | mpt3sas_config_get_volume_wwid(ioc, handle, &wwid); |
|---|
| 7771 | 8052 | if (!wwid) { |
|---|
| 7772 | | - pr_err(MPT3SAS_FMT |
|---|
| 7773 | | - "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 7774 | | - __FILE__, __LINE__, __func__); |
|---|
| 8053 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 8054 | + __FILE__, __LINE__, __func__); |
|---|
| 7775 | 8055 | return; |
|---|
| 7776 | 8056 | } |
|---|
| 7777 | 8057 | |
|---|
| .. | .. |
|---|
| 7784 | 8064 | |
|---|
| 7785 | 8065 | raid_device = kzalloc(sizeof(struct _raid_device), GFP_KERNEL); |
|---|
| 7786 | 8066 | if (!raid_device) { |
|---|
| 7787 | | - pr_err(MPT3SAS_FMT |
|---|
| 7788 | | - "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 7789 | | - __FILE__, __LINE__, __func__); |
|---|
| 8067 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 8068 | + __FILE__, __LINE__, __func__); |
|---|
| 7790 | 8069 | return; |
|---|
| 7791 | 8070 | } |
|---|
| 7792 | 8071 | |
|---|
| .. | .. |
|---|
| 7829 | 8108 | sas_target_priv_data = starget->hostdata; |
|---|
| 7830 | 8109 | sas_target_priv_data->deleted = 1; |
|---|
| 7831 | 8110 | } |
|---|
| 7832 | | - pr_info(MPT3SAS_FMT "removing handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 7833 | | - ioc->name, raid_device->handle, |
|---|
| 7834 | | - (unsigned long long) raid_device->wwid); |
|---|
| 8111 | + ioc_info(ioc, "removing handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 8112 | + raid_device->handle, (u64)raid_device->wwid); |
|---|
| 7835 | 8113 | list_del(&raid_device->list); |
|---|
| 7836 | 8114 | kfree(raid_device); |
|---|
| 7837 | 8115 | } |
|---|
| .. | .. |
|---|
| 7973 | 8251 | |
|---|
| 7974 | 8252 | if ((mpt3sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0, |
|---|
| 7975 | 8253 | MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) { |
|---|
| 7976 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 7977 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 8254 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 8255 | + __FILE__, __LINE__, __func__); |
|---|
| 7978 | 8256 | return; |
|---|
| 7979 | 8257 | } |
|---|
| 7980 | 8258 | |
|---|
| 7981 | 8259 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 7982 | 8260 | MPI2_IOCSTATUS_MASK; |
|---|
| 7983 | 8261 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 7984 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 7985 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 8262 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 8263 | + __FILE__, __LINE__, __func__); |
|---|
| 7986 | 8264 | return; |
|---|
| 7987 | 8265 | } |
|---|
| 7988 | 8266 | |
|---|
| .. | .. |
|---|
| 8012 | 8290 | |
|---|
| 8013 | 8291 | element = (Mpi2EventIrConfigElement_t *)&event_data->ConfigElement[0]; |
|---|
| 8014 | 8292 | |
|---|
| 8015 | | - pr_info(MPT3SAS_FMT "raid config change: (%s), elements(%d)\n", |
|---|
| 8016 | | - ioc->name, (le32_to_cpu(event_data->Flags) & |
|---|
| 8017 | | - MPI2_EVENT_IR_CHANGE_FLAGS_FOREIGN_CONFIG) ? |
|---|
| 8018 | | - "foreign" : "native", event_data->NumElements); |
|---|
| 8293 | + ioc_info(ioc, "raid config change: (%s), elements(%d)\n", |
|---|
| 8294 | + le32_to_cpu(event_data->Flags) & MPI2_EVENT_IR_CHANGE_FLAGS_FOREIGN_CONFIG ? |
|---|
| 8295 | + "foreign" : "native", |
|---|
| 8296 | + event_data->NumElements); |
|---|
| 8019 | 8297 | for (i = 0; i < event_data->NumElements; i++, element++) { |
|---|
| 8020 | 8298 | switch (element->ReasonCode) { |
|---|
| 8021 | 8299 | case MPI2_EVENT_IR_CHANGE_RC_ADDED: |
|---|
| .. | .. |
|---|
| 8171 | 8449 | handle = le16_to_cpu(event_data->VolDevHandle); |
|---|
| 8172 | 8450 | state = le32_to_cpu(event_data->NewValue); |
|---|
| 8173 | 8451 | if (!ioc->hide_ir_msg) |
|---|
| 8174 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 8175 | | - "%s: handle(0x%04x), old(0x%08x), new(0x%08x)\n", |
|---|
| 8176 | | - ioc->name, __func__, handle, |
|---|
| 8177 | | - le32_to_cpu(event_data->PreviousValue), state)); |
|---|
| 8452 | + dewtprintk(ioc, |
|---|
| 8453 | + ioc_info(ioc, "%s: handle(0x%04x), old(0x%08x), new(0x%08x)\n", |
|---|
| 8454 | + __func__, handle, |
|---|
| 8455 | + le32_to_cpu(event_data->PreviousValue), |
|---|
| 8456 | + state)); |
|---|
| 8178 | 8457 | switch (state) { |
|---|
| 8179 | 8458 | case MPI2_RAID_VOL_STATE_MISSING: |
|---|
| 8180 | 8459 | case MPI2_RAID_VOL_STATE_FAILED: |
|---|
| .. | .. |
|---|
| 8194 | 8473 | |
|---|
| 8195 | 8474 | mpt3sas_config_get_volume_wwid(ioc, handle, &wwid); |
|---|
| 8196 | 8475 | if (!wwid) { |
|---|
| 8197 | | - pr_err(MPT3SAS_FMT |
|---|
| 8198 | | - "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 8199 | | - __FILE__, __LINE__, __func__); |
|---|
| 8476 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 8477 | + __FILE__, __LINE__, __func__); |
|---|
| 8200 | 8478 | break; |
|---|
| 8201 | 8479 | } |
|---|
| 8202 | 8480 | |
|---|
| 8203 | 8481 | raid_device = kzalloc(sizeof(struct _raid_device), GFP_KERNEL); |
|---|
| 8204 | 8482 | if (!raid_device) { |
|---|
| 8205 | | - pr_err(MPT3SAS_FMT |
|---|
| 8206 | | - "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 8207 | | - __FILE__, __LINE__, __func__); |
|---|
| 8483 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 8484 | + __FILE__, __LINE__, __func__); |
|---|
| 8208 | 8485 | break; |
|---|
| 8209 | 8486 | } |
|---|
| 8210 | 8487 | |
|---|
| .. | .. |
|---|
| 8255 | 8532 | state = le32_to_cpu(event_data->NewValue); |
|---|
| 8256 | 8533 | |
|---|
| 8257 | 8534 | if (!ioc->hide_ir_msg) |
|---|
| 8258 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 8259 | | - "%s: handle(0x%04x), old(0x%08x), new(0x%08x)\n", |
|---|
| 8260 | | - ioc->name, __func__, handle, |
|---|
| 8261 | | - le32_to_cpu(event_data->PreviousValue), state)); |
|---|
| 8535 | + dewtprintk(ioc, |
|---|
| 8536 | + ioc_info(ioc, "%s: handle(0x%04x), old(0x%08x), new(0x%08x)\n", |
|---|
| 8537 | + __func__, handle, |
|---|
| 8538 | + le32_to_cpu(event_data->PreviousValue), |
|---|
| 8539 | + state)); |
|---|
| 8262 | 8540 | |
|---|
| 8263 | 8541 | switch (state) { |
|---|
| 8264 | 8542 | case MPI2_RAID_PD_STATE_ONLINE: |
|---|
| .. | .. |
|---|
| 8279 | 8557 | if ((mpt3sas_config_get_sas_device_pg0(ioc, &mpi_reply, |
|---|
| 8280 | 8558 | &sas_device_pg0, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, |
|---|
| 8281 | 8559 | handle))) { |
|---|
| 8282 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 8283 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 8560 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 8561 | + __FILE__, __LINE__, __func__); |
|---|
| 8284 | 8562 | return; |
|---|
| 8285 | 8563 | } |
|---|
| 8286 | 8564 | |
|---|
| 8287 | 8565 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 8288 | 8566 | MPI2_IOCSTATUS_MASK; |
|---|
| 8289 | 8567 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 8290 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 8291 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 8568 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 8569 | + __FILE__, __LINE__, __func__); |
|---|
| 8292 | 8570 | return; |
|---|
| 8293 | 8571 | } |
|---|
| 8294 | 8572 | |
|---|
| .. | .. |
|---|
| 8342 | 8620 | if (!reason_str) |
|---|
| 8343 | 8621 | return; |
|---|
| 8344 | 8622 | |
|---|
| 8345 | | - pr_info(MPT3SAS_FMT "raid operational status: (%s)" \ |
|---|
| 8346 | | - "\thandle(0x%04x), percent complete(%d)\n", |
|---|
| 8347 | | - ioc->name, reason_str, |
|---|
| 8348 | | - le16_to_cpu(event_data->VolDevHandle), |
|---|
| 8349 | | - event_data->PercentComplete); |
|---|
| 8623 | + ioc_info(ioc, "raid operational status: (%s)\thandle(0x%04x), percent complete(%d)\n", |
|---|
| 8624 | + reason_str, |
|---|
| 8625 | + le16_to_cpu(event_data->VolDevHandle), |
|---|
| 8626 | + event_data->PercentComplete); |
|---|
| 8350 | 8627 | } |
|---|
| 8351 | 8628 | |
|---|
| 8352 | 8629 | /** |
|---|
| .. | .. |
|---|
| 8427 | 8704 | mpt3sas_scsih_enclosure_find_by_handle(ioc, |
|---|
| 8428 | 8705 | le16_to_cpu(sas_device_pg0->EnclosureHandle)); |
|---|
| 8429 | 8706 | if (enclosure_dev == NULL) |
|---|
| 8430 | | - pr_info(MPT3SAS_FMT "Enclosure handle(0x%04x)" |
|---|
| 8431 | | - "doesn't match with enclosure device!\n", |
|---|
| 8432 | | - ioc->name, sas_device_pg0->EnclosureHandle); |
|---|
| 8707 | + ioc_info(ioc, "Enclosure handle(0x%04x) doesn't match with enclosure device!\n", |
|---|
| 8708 | + sas_device_pg0->EnclosureHandle); |
|---|
| 8433 | 8709 | } |
|---|
| 8434 | 8710 | spin_lock_irqsave(&ioc->sas_device_lock, flags); |
|---|
| 8435 | 8711 | list_for_each_entry(sas_device, &ioc->sas_device_list, list) { |
|---|
| .. | .. |
|---|
| 8523 | 8799 | enclosure_dev = |
|---|
| 8524 | 8800 | kzalloc(sizeof(struct _enclosure_node), GFP_KERNEL); |
|---|
| 8525 | 8801 | if (!enclosure_dev) { |
|---|
| 8526 | | - pr_err(MPT3SAS_FMT |
|---|
| 8527 | | - "failure at %s:%d/%s()!\n", ioc->name, |
|---|
| 8802 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 8528 | 8803 | __FILE__, __LINE__, __func__); |
|---|
| 8529 | 8804 | return; |
|---|
| 8530 | 8805 | } |
|---|
| .. | .. |
|---|
| 8561 | 8836 | u16 handle; |
|---|
| 8562 | 8837 | u32 device_info; |
|---|
| 8563 | 8838 | |
|---|
| 8564 | | - pr_info(MPT3SAS_FMT "search for end-devices: start\n", ioc->name); |
|---|
| 8839 | + ioc_info(ioc, "search for end-devices: start\n"); |
|---|
| 8565 | 8840 | |
|---|
| 8566 | 8841 | if (list_empty(&ioc->sas_device_list)) |
|---|
| 8567 | 8842 | goto out; |
|---|
| .. | .. |
|---|
| 8582 | 8857 | } |
|---|
| 8583 | 8858 | |
|---|
| 8584 | 8859 | out: |
|---|
| 8585 | | - pr_info(MPT3SAS_FMT "search for end-devices: complete\n", |
|---|
| 8586 | | - ioc->name); |
|---|
| 8860 | + ioc_info(ioc, "search for end-devices: complete\n"); |
|---|
| 8587 | 8861 | } |
|---|
| 8588 | 8862 | |
|---|
| 8589 | 8863 | /** |
|---|
| .. | .. |
|---|
| 8608 | 8882 | if ((pcie_device->wwid == le64_to_cpu(pcie_device_pg0->WWID)) |
|---|
| 8609 | 8883 | && (pcie_device->slot == le16_to_cpu( |
|---|
| 8610 | 8884 | pcie_device_pg0->Slot))) { |
|---|
| 8885 | + pcie_device->access_status = |
|---|
| 8886 | + pcie_device_pg0->AccessStatus; |
|---|
| 8611 | 8887 | pcie_device->responding = 1; |
|---|
| 8612 | 8888 | starget = pcie_device->starget; |
|---|
| 8613 | 8889 | if (starget && starget->hostdata) { |
|---|
| .. | .. |
|---|
| 8676 | 8952 | u16 handle; |
|---|
| 8677 | 8953 | u32 device_info; |
|---|
| 8678 | 8954 | |
|---|
| 8679 | | - pr_info(MPT3SAS_FMT "search for end-devices: start\n", ioc->name); |
|---|
| 8955 | + ioc_info(ioc, "search for end-devices: start\n"); |
|---|
| 8680 | 8956 | |
|---|
| 8681 | 8957 | if (list_empty(&ioc->pcie_device_list)) |
|---|
| 8682 | 8958 | goto out; |
|---|
| .. | .. |
|---|
| 8688 | 8964 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 8689 | 8965 | MPI2_IOCSTATUS_MASK; |
|---|
| 8690 | 8966 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 8691 | | - pr_info(MPT3SAS_FMT "\tbreak from %s: " |
|---|
| 8692 | | - "ioc_status(0x%04x), loginfo(0x%08x)\n", ioc->name, |
|---|
| 8693 | | - __func__, ioc_status, |
|---|
| 8694 | | - le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 8967 | + ioc_info(ioc, "\tbreak from %s: ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 8968 | + __func__, ioc_status, |
|---|
| 8969 | + le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 8695 | 8970 | break; |
|---|
| 8696 | 8971 | } |
|---|
| 8697 | 8972 | handle = le16_to_cpu(pcie_device_pg0.DevHandle); |
|---|
| 8698 | 8973 | device_info = le32_to_cpu(pcie_device_pg0.DeviceInfo); |
|---|
| 8699 | | - if (!(_scsih_is_nvme_device(device_info))) |
|---|
| 8974 | + if (!(_scsih_is_nvme_pciescsi_device(device_info))) |
|---|
| 8700 | 8975 | continue; |
|---|
| 8701 | 8976 | _scsih_mark_responding_pcie_device(ioc, &pcie_device_pg0); |
|---|
| 8702 | 8977 | } |
|---|
| 8703 | 8978 | out: |
|---|
| 8704 | | - pr_info(MPT3SAS_FMT "search for PCIe end-devices: complete\n", |
|---|
| 8705 | | - ioc->name); |
|---|
| 8979 | + ioc_info(ioc, "search for PCIe end-devices: complete\n"); |
|---|
| 8706 | 8980 | } |
|---|
| 8707 | 8981 | |
|---|
| 8708 | 8982 | /** |
|---|
| .. | .. |
|---|
| 8783 | 9057 | if (!ioc->ir_firmware) |
|---|
| 8784 | 9058 | return; |
|---|
| 8785 | 9059 | |
|---|
| 8786 | | - pr_info(MPT3SAS_FMT "search for raid volumes: start\n", |
|---|
| 8787 | | - ioc->name); |
|---|
| 9060 | + ioc_info(ioc, "search for raid volumes: start\n"); |
|---|
| 8788 | 9061 | |
|---|
| 8789 | 9062 | if (list_empty(&ioc->raid_device_list)) |
|---|
| 8790 | 9063 | goto out; |
|---|
| .. | .. |
|---|
| 8827 | 9100 | } |
|---|
| 8828 | 9101 | } |
|---|
| 8829 | 9102 | out: |
|---|
| 8830 | | - pr_info(MPT3SAS_FMT "search for responding raid volumes: complete\n", |
|---|
| 8831 | | - ioc->name); |
|---|
| 9103 | + ioc_info(ioc, "search for responding raid volumes: complete\n"); |
|---|
| 8832 | 9104 | } |
|---|
| 8833 | 9105 | |
|---|
| 8834 | 9106 | /** |
|---|
| .. | .. |
|---|
| 8900 | 9172 | u64 sas_address; |
|---|
| 8901 | 9173 | u16 handle; |
|---|
| 8902 | 9174 | |
|---|
| 8903 | | - pr_info(MPT3SAS_FMT "search for expanders: start\n", ioc->name); |
|---|
| 9175 | + ioc_info(ioc, "search for expanders: start\n"); |
|---|
| 8904 | 9176 | |
|---|
| 8905 | 9177 | if (list_empty(&ioc->sas_expander_list)) |
|---|
| 8906 | 9178 | goto out; |
|---|
| .. | .. |
|---|
| 8923 | 9195 | } |
|---|
| 8924 | 9196 | |
|---|
| 8925 | 9197 | out: |
|---|
| 8926 | | - pr_info(MPT3SAS_FMT "search for expanders: complete\n", ioc->name); |
|---|
| 9198 | + ioc_info(ioc, "search for expanders: complete\n"); |
|---|
| 8927 | 9199 | } |
|---|
| 8928 | 9200 | |
|---|
| 8929 | 9201 | /** |
|---|
| .. | .. |
|---|
| 8941 | 9213 | unsigned long flags; |
|---|
| 8942 | 9214 | LIST_HEAD(head); |
|---|
| 8943 | 9215 | |
|---|
| 8944 | | - pr_info(MPT3SAS_FMT "removing unresponding devices: start\n", |
|---|
| 8945 | | - ioc->name); |
|---|
| 9216 | + ioc_info(ioc, "removing unresponding devices: start\n"); |
|---|
| 8946 | 9217 | |
|---|
| 8947 | 9218 | /* removing unresponding end devices */ |
|---|
| 8948 | | - pr_info(MPT3SAS_FMT "removing unresponding devices: end-devices\n", |
|---|
| 8949 | | - ioc->name); |
|---|
| 9219 | + ioc_info(ioc, "removing unresponding devices: end-devices\n"); |
|---|
| 8950 | 9220 | /* |
|---|
| 8951 | 9221 | * Iterate, pulling off devices marked as non-responding. We become the |
|---|
| 8952 | 9222 | * owner for the reference the list had on any object we prune. |
|---|
| .. | .. |
|---|
| 8970 | 9240 | sas_device_put(sas_device); |
|---|
| 8971 | 9241 | } |
|---|
| 8972 | 9242 | |
|---|
| 8973 | | - pr_info(MPT3SAS_FMT |
|---|
| 8974 | | - " Removing unresponding devices: pcie end-devices\n" |
|---|
| 8975 | | - , ioc->name); |
|---|
| 9243 | + ioc_info(ioc, "Removing unresponding devices: pcie end-devices\n"); |
|---|
| 8976 | 9244 | INIT_LIST_HEAD(&head); |
|---|
| 8977 | 9245 | spin_lock_irqsave(&ioc->pcie_device_lock, flags); |
|---|
| 8978 | 9246 | list_for_each_entry_safe(pcie_device, pcie_device_next, |
|---|
| .. | .. |
|---|
| 8992 | 9260 | |
|---|
| 8993 | 9261 | /* removing unresponding volumes */ |
|---|
| 8994 | 9262 | if (ioc->ir_firmware) { |
|---|
| 8995 | | - pr_info(MPT3SAS_FMT "removing unresponding devices: volumes\n", |
|---|
| 8996 | | - ioc->name); |
|---|
| 9263 | + ioc_info(ioc, "removing unresponding devices: volumes\n"); |
|---|
| 8997 | 9264 | list_for_each_entry_safe(raid_device, raid_device_next, |
|---|
| 8998 | 9265 | &ioc->raid_device_list, list) { |
|---|
| 8999 | 9266 | if (!raid_device->responding) |
|---|
| .. | .. |
|---|
| 9005 | 9272 | } |
|---|
| 9006 | 9273 | |
|---|
| 9007 | 9274 | /* removing unresponding expanders */ |
|---|
| 9008 | | - pr_info(MPT3SAS_FMT "removing unresponding devices: expanders\n", |
|---|
| 9009 | | - ioc->name); |
|---|
| 9275 | + ioc_info(ioc, "removing unresponding devices: expanders\n"); |
|---|
| 9010 | 9276 | spin_lock_irqsave(&ioc->sas_node_lock, flags); |
|---|
| 9011 | 9277 | INIT_LIST_HEAD(&tmp_list); |
|---|
| 9012 | 9278 | list_for_each_entry_safe(sas_expander, sas_expander_next, |
|---|
| .. | .. |
|---|
| 9022 | 9288 | _scsih_expander_node_remove(ioc, sas_expander); |
|---|
| 9023 | 9289 | } |
|---|
| 9024 | 9290 | |
|---|
| 9025 | | - pr_info(MPT3SAS_FMT "removing unresponding devices: complete\n", |
|---|
| 9026 | | - ioc->name); |
|---|
| 9291 | + ioc_info(ioc, "removing unresponding devices: complete\n"); |
|---|
| 9027 | 9292 | |
|---|
| 9028 | 9293 | /* unblock devices */ |
|---|
| 9029 | 9294 | _scsih_ublock_io_all_device(ioc); |
|---|
| .. | .. |
|---|
| 9040 | 9305 | for (i = 0 ; i < sas_expander->num_phys ; i++) { |
|---|
| 9041 | 9306 | if ((mpt3sas_config_get_expander_pg1(ioc, &mpi_reply, |
|---|
| 9042 | 9307 | &expander_pg1, i, handle))) { |
|---|
| 9043 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 9044 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 9308 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 9309 | + __FILE__, __LINE__, __func__); |
|---|
| 9045 | 9310 | return; |
|---|
| 9046 | 9311 | } |
|---|
| 9047 | 9312 | |
|---|
| .. | .. |
|---|
| 9077 | 9342 | u8 retry_count; |
|---|
| 9078 | 9343 | unsigned long flags; |
|---|
| 9079 | 9344 | |
|---|
| 9080 | | - pr_info(MPT3SAS_FMT "scan devices: start\n", ioc->name); |
|---|
| 9345 | + ioc_info(ioc, "scan devices: start\n"); |
|---|
| 9081 | 9346 | |
|---|
| 9082 | 9347 | _scsih_sas_host_refresh(ioc); |
|---|
| 9083 | 9348 | |
|---|
| 9084 | | - pr_info(MPT3SAS_FMT "\tscan devices: expanders start\n", ioc->name); |
|---|
| 9349 | + ioc_info(ioc, "\tscan devices: expanders start\n"); |
|---|
| 9085 | 9350 | |
|---|
| 9086 | 9351 | /* expanders */ |
|---|
| 9087 | 9352 | handle = 0xFFFF; |
|---|
| .. | .. |
|---|
| 9090 | 9355 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 9091 | 9356 | MPI2_IOCSTATUS_MASK; |
|---|
| 9092 | 9357 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 9093 | | - pr_info(MPT3SAS_FMT "\tbreak from expander scan: " \ |
|---|
| 9094 | | - "ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9095 | | - ioc->name, ioc_status, |
|---|
| 9096 | | - le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9358 | + ioc_info(ioc, "\tbreak from expander scan: ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9359 | + ioc_status, le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9097 | 9360 | break; |
|---|
| 9098 | 9361 | } |
|---|
| 9099 | 9362 | handle = le16_to_cpu(expander_pg0.DevHandle); |
|---|
| .. | .. |
|---|
| 9105 | 9368 | _scsih_refresh_expander_links(ioc, expander_device, |
|---|
| 9106 | 9369 | handle); |
|---|
| 9107 | 9370 | else { |
|---|
| 9108 | | - pr_info(MPT3SAS_FMT "\tBEFORE adding expander: " \ |
|---|
| 9109 | | - "handle (0x%04x), sas_addr(0x%016llx)\n", ioc->name, |
|---|
| 9110 | | - handle, (unsigned long long) |
|---|
| 9111 | | - le64_to_cpu(expander_pg0.SASAddress)); |
|---|
| 9371 | + ioc_info(ioc, "\tBEFORE adding expander: handle (0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9372 | + handle, |
|---|
| 9373 | + (u64)le64_to_cpu(expander_pg0.SASAddress)); |
|---|
| 9112 | 9374 | _scsih_expander_add(ioc, handle); |
|---|
| 9113 | | - pr_info(MPT3SAS_FMT "\tAFTER adding expander: " \ |
|---|
| 9114 | | - "handle (0x%04x), sas_addr(0x%016llx)\n", ioc->name, |
|---|
| 9115 | | - handle, (unsigned long long) |
|---|
| 9116 | | - le64_to_cpu(expander_pg0.SASAddress)); |
|---|
| 9375 | + ioc_info(ioc, "\tAFTER adding expander: handle (0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9376 | + handle, |
|---|
| 9377 | + (u64)le64_to_cpu(expander_pg0.SASAddress)); |
|---|
| 9117 | 9378 | } |
|---|
| 9118 | 9379 | } |
|---|
| 9119 | 9380 | |
|---|
| 9120 | | - pr_info(MPT3SAS_FMT "\tscan devices: expanders complete\n", |
|---|
| 9121 | | - ioc->name); |
|---|
| 9381 | + ioc_info(ioc, "\tscan devices: expanders complete\n"); |
|---|
| 9122 | 9382 | |
|---|
| 9123 | 9383 | if (!ioc->ir_firmware) |
|---|
| 9124 | 9384 | goto skip_to_sas; |
|---|
| 9125 | 9385 | |
|---|
| 9126 | | - pr_info(MPT3SAS_FMT "\tscan devices: phys disk start\n", ioc->name); |
|---|
| 9386 | + ioc_info(ioc, "\tscan devices: phys disk start\n"); |
|---|
| 9127 | 9387 | |
|---|
| 9128 | 9388 | /* phys disk */ |
|---|
| 9129 | 9389 | phys_disk_num = 0xFF; |
|---|
| .. | .. |
|---|
| 9133 | 9393 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 9134 | 9394 | MPI2_IOCSTATUS_MASK; |
|---|
| 9135 | 9395 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 9136 | | - pr_info(MPT3SAS_FMT "\tbreak from phys disk scan: "\ |
|---|
| 9137 | | - "ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9138 | | - ioc->name, ioc_status, |
|---|
| 9139 | | - le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9396 | + ioc_info(ioc, "\tbreak from phys disk scan: ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9397 | + ioc_status, le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9140 | 9398 | break; |
|---|
| 9141 | 9399 | } |
|---|
| 9142 | 9400 | phys_disk_num = pd_pg0.PhysDiskNum; |
|---|
| .. | .. |
|---|
| 9153 | 9411 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 9154 | 9412 | MPI2_IOCSTATUS_MASK; |
|---|
| 9155 | 9413 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 9156 | | - pr_info(MPT3SAS_FMT "\tbreak from phys disk scan " \ |
|---|
| 9157 | | - "ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9158 | | - ioc->name, ioc_status, |
|---|
| 9159 | | - le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9414 | + ioc_info(ioc, "\tbreak from phys disk scan ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9415 | + ioc_status, le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9160 | 9416 | break; |
|---|
| 9161 | 9417 | } |
|---|
| 9162 | 9418 | parent_handle = le16_to_cpu(sas_device_pg0.ParentDevHandle); |
|---|
| 9163 | 9419 | if (!_scsih_get_sas_address(ioc, parent_handle, |
|---|
| 9164 | 9420 | &sas_address)) { |
|---|
| 9165 | | - pr_info(MPT3SAS_FMT "\tBEFORE adding phys disk: " \ |
|---|
| 9166 | | - " handle (0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9167 | | - ioc->name, handle, (unsigned long long) |
|---|
| 9168 | | - le64_to_cpu(sas_device_pg0.SASAddress)); |
|---|
| 9421 | + ioc_info(ioc, "\tBEFORE adding phys disk: handle (0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9422 | + handle, |
|---|
| 9423 | + (u64)le64_to_cpu(sas_device_pg0.SASAddress)); |
|---|
| 9169 | 9424 | mpt3sas_transport_update_links(ioc, sas_address, |
|---|
| 9170 | 9425 | handle, sas_device_pg0.PhyNum, |
|---|
| 9171 | 9426 | MPI2_SAS_NEG_LINK_RATE_1_5); |
|---|
| .. | .. |
|---|
| 9179 | 9434 | 1)) { |
|---|
| 9180 | 9435 | ssleep(1); |
|---|
| 9181 | 9436 | } |
|---|
| 9182 | | - pr_info(MPT3SAS_FMT "\tAFTER adding phys disk: " \ |
|---|
| 9183 | | - " handle (0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9184 | | - ioc->name, handle, (unsigned long long) |
|---|
| 9185 | | - le64_to_cpu(sas_device_pg0.SASAddress)); |
|---|
| 9437 | + ioc_info(ioc, "\tAFTER adding phys disk: handle (0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9438 | + handle, |
|---|
| 9439 | + (u64)le64_to_cpu(sas_device_pg0.SASAddress)); |
|---|
| 9186 | 9440 | } |
|---|
| 9187 | 9441 | } |
|---|
| 9188 | 9442 | |
|---|
| 9189 | | - pr_info(MPT3SAS_FMT "\tscan devices: phys disk complete\n", |
|---|
| 9190 | | - ioc->name); |
|---|
| 9443 | + ioc_info(ioc, "\tscan devices: phys disk complete\n"); |
|---|
| 9191 | 9444 | |
|---|
| 9192 | | - pr_info(MPT3SAS_FMT "\tscan devices: volumes start\n", ioc->name); |
|---|
| 9445 | + ioc_info(ioc, "\tscan devices: volumes start\n"); |
|---|
| 9193 | 9446 | |
|---|
| 9194 | 9447 | /* volumes */ |
|---|
| 9195 | 9448 | handle = 0xFFFF; |
|---|
| .. | .. |
|---|
| 9198 | 9451 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 9199 | 9452 | MPI2_IOCSTATUS_MASK; |
|---|
| 9200 | 9453 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 9201 | | - pr_info(MPT3SAS_FMT "\tbreak from volume scan: " \ |
|---|
| 9202 | | - "ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9203 | | - ioc->name, ioc_status, |
|---|
| 9204 | | - le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9454 | + ioc_info(ioc, "\tbreak from volume scan: ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9455 | + ioc_status, le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9205 | 9456 | break; |
|---|
| 9206 | 9457 | } |
|---|
| 9207 | 9458 | handle = le16_to_cpu(volume_pg1.DevHandle); |
|---|
| .. | .. |
|---|
| 9218 | 9469 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 9219 | 9470 | MPI2_IOCSTATUS_MASK; |
|---|
| 9220 | 9471 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 9221 | | - pr_info(MPT3SAS_FMT "\tbreak from volume scan: " \ |
|---|
| 9222 | | - "ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9223 | | - ioc->name, ioc_status, |
|---|
| 9224 | | - le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9472 | + ioc_info(ioc, "\tbreak from volume scan: ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9473 | + ioc_status, le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9225 | 9474 | break; |
|---|
| 9226 | 9475 | } |
|---|
| 9227 | 9476 | if (volume_pg0.VolumeState == MPI2_RAID_VOL_STATE_OPTIMAL || |
|---|
| .. | .. |
|---|
| 9230 | 9479 | memset(&element, 0, sizeof(Mpi2EventIrConfigElement_t)); |
|---|
| 9231 | 9480 | element.ReasonCode = MPI2_EVENT_IR_CHANGE_RC_ADDED; |
|---|
| 9232 | 9481 | element.VolDevHandle = volume_pg1.DevHandle; |
|---|
| 9233 | | - pr_info(MPT3SAS_FMT |
|---|
| 9234 | | - "\tBEFORE adding volume: handle (0x%04x)\n", |
|---|
| 9235 | | - ioc->name, volume_pg1.DevHandle); |
|---|
| 9482 | + ioc_info(ioc, "\tBEFORE adding volume: handle (0x%04x)\n", |
|---|
| 9483 | + volume_pg1.DevHandle); |
|---|
| 9236 | 9484 | _scsih_sas_volume_add(ioc, &element); |
|---|
| 9237 | | - pr_info(MPT3SAS_FMT |
|---|
| 9238 | | - "\tAFTER adding volume: handle (0x%04x)\n", |
|---|
| 9239 | | - ioc->name, volume_pg1.DevHandle); |
|---|
| 9485 | + ioc_info(ioc, "\tAFTER adding volume: handle (0x%04x)\n", |
|---|
| 9486 | + volume_pg1.DevHandle); |
|---|
| 9240 | 9487 | } |
|---|
| 9241 | 9488 | } |
|---|
| 9242 | 9489 | |
|---|
| 9243 | | - pr_info(MPT3SAS_FMT "\tscan devices: volumes complete\n", |
|---|
| 9244 | | - ioc->name); |
|---|
| 9490 | + ioc_info(ioc, "\tscan devices: volumes complete\n"); |
|---|
| 9245 | 9491 | |
|---|
| 9246 | 9492 | skip_to_sas: |
|---|
| 9247 | 9493 | |
|---|
| 9248 | | - pr_info(MPT3SAS_FMT "\tscan devices: end devices start\n", |
|---|
| 9249 | | - ioc->name); |
|---|
| 9494 | + ioc_info(ioc, "\tscan devices: end devices start\n"); |
|---|
| 9250 | 9495 | |
|---|
| 9251 | 9496 | /* sas devices */ |
|---|
| 9252 | 9497 | handle = 0xFFFF; |
|---|
| .. | .. |
|---|
| 9256 | 9501 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & |
|---|
| 9257 | 9502 | MPI2_IOCSTATUS_MASK; |
|---|
| 9258 | 9503 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 9259 | | - pr_info(MPT3SAS_FMT "\tbreak from end device scan:"\ |
|---|
| 9260 | | - " ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9261 | | - ioc->name, ioc_status, |
|---|
| 9262 | | - le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9504 | + ioc_info(ioc, "\tbreak from end device scan: ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9505 | + ioc_status, le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9263 | 9506 | break; |
|---|
| 9264 | 9507 | } |
|---|
| 9265 | 9508 | handle = le16_to_cpu(sas_device_pg0.DevHandle); |
|---|
| .. | .. |
|---|
| 9274 | 9517 | } |
|---|
| 9275 | 9518 | parent_handle = le16_to_cpu(sas_device_pg0.ParentDevHandle); |
|---|
| 9276 | 9519 | if (!_scsih_get_sas_address(ioc, parent_handle, &sas_address)) { |
|---|
| 9277 | | - pr_info(MPT3SAS_FMT "\tBEFORE adding end device: " \ |
|---|
| 9278 | | - "handle (0x%04x), sas_addr(0x%016llx)\n", ioc->name, |
|---|
| 9279 | | - handle, (unsigned long long) |
|---|
| 9280 | | - le64_to_cpu(sas_device_pg0.SASAddress)); |
|---|
| 9520 | + ioc_info(ioc, "\tBEFORE adding end device: handle (0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9521 | + handle, |
|---|
| 9522 | + (u64)le64_to_cpu(sas_device_pg0.SASAddress)); |
|---|
| 9281 | 9523 | mpt3sas_transport_update_links(ioc, sas_address, handle, |
|---|
| 9282 | 9524 | sas_device_pg0.PhyNum, MPI2_SAS_NEG_LINK_RATE_1_5); |
|---|
| 9283 | 9525 | retry_count = 0; |
|---|
| .. | .. |
|---|
| 9289 | 9531 | 0)) { |
|---|
| 9290 | 9532 | ssleep(1); |
|---|
| 9291 | 9533 | } |
|---|
| 9292 | | - pr_info(MPT3SAS_FMT "\tAFTER adding end device: " \ |
|---|
| 9293 | | - "handle (0x%04x), sas_addr(0x%016llx)\n", ioc->name, |
|---|
| 9294 | | - handle, (unsigned long long) |
|---|
| 9295 | | - le64_to_cpu(sas_device_pg0.SASAddress)); |
|---|
| 9534 | + ioc_info(ioc, "\tAFTER adding end device: handle (0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9535 | + handle, |
|---|
| 9536 | + (u64)le64_to_cpu(sas_device_pg0.SASAddress)); |
|---|
| 9296 | 9537 | } |
|---|
| 9297 | 9538 | } |
|---|
| 9298 | | - pr_info(MPT3SAS_FMT "\tscan devices: end devices complete\n", |
|---|
| 9299 | | - ioc->name); |
|---|
| 9300 | | - pr_info(MPT3SAS_FMT "\tscan devices: pcie end devices start\n", |
|---|
| 9301 | | - ioc->name); |
|---|
| 9539 | + ioc_info(ioc, "\tscan devices: end devices complete\n"); |
|---|
| 9540 | + ioc_info(ioc, "\tscan devices: pcie end devices start\n"); |
|---|
| 9302 | 9541 | |
|---|
| 9303 | 9542 | /* pcie devices */ |
|---|
| 9304 | 9543 | handle = 0xFFFF; |
|---|
| .. | .. |
|---|
| 9308 | 9547 | ioc_status = le16_to_cpu(mpi_reply.IOCStatus) |
|---|
| 9309 | 9548 | & MPI2_IOCSTATUS_MASK; |
|---|
| 9310 | 9549 | if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { |
|---|
| 9311 | | - pr_info(MPT3SAS_FMT "\tbreak from pcie end device" |
|---|
| 9312 | | - " scan: ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9313 | | - ioc->name, ioc_status, |
|---|
| 9314 | | - le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9550 | + ioc_info(ioc, "\tbreak from pcie end device scan: ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9551 | + ioc_status, le32_to_cpu(mpi_reply.IOCLogInfo)); |
|---|
| 9315 | 9552 | break; |
|---|
| 9316 | 9553 | } |
|---|
| 9317 | 9554 | handle = le16_to_cpu(pcie_device_pg0.DevHandle); |
|---|
| 9318 | | - if (!(_scsih_is_nvme_device( |
|---|
| 9555 | + if (!(_scsih_is_nvme_pciescsi_device( |
|---|
| 9319 | 9556 | le32_to_cpu(pcie_device_pg0.DeviceInfo)))) |
|---|
| 9320 | 9557 | continue; |
|---|
| 9321 | 9558 | pcie_device = mpt3sas_get_pdev_by_wwid(ioc, |
|---|
| .. | .. |
|---|
| 9328 | 9565 | parent_handle = le16_to_cpu(pcie_device_pg0.ParentDevHandle); |
|---|
| 9329 | 9566 | _scsih_pcie_add_device(ioc, handle); |
|---|
| 9330 | 9567 | |
|---|
| 9331 | | - pr_info(MPT3SAS_FMT "\tAFTER adding pcie end device: " |
|---|
| 9332 | | - "handle (0x%04x), wwid(0x%016llx)\n", ioc->name, |
|---|
| 9333 | | - handle, |
|---|
| 9334 | | - (unsigned long long) le64_to_cpu(pcie_device_pg0.WWID)); |
|---|
| 9568 | + ioc_info(ioc, "\tAFTER adding pcie end device: handle (0x%04x), wwid(0x%016llx)\n", |
|---|
| 9569 | + handle, (u64)le64_to_cpu(pcie_device_pg0.WWID)); |
|---|
| 9335 | 9570 | } |
|---|
| 9336 | | - pr_info(MPT3SAS_FMT "\tpcie devices: pcie end devices complete\n", |
|---|
| 9337 | | - ioc->name); |
|---|
| 9338 | | - pr_info(MPT3SAS_FMT "scan devices: complete\n", ioc->name); |
|---|
| 9571 | + ioc_info(ioc, "\tpcie devices: pcie end devices complete\n"); |
|---|
| 9572 | + ioc_info(ioc, "scan devices: complete\n"); |
|---|
| 9339 | 9573 | } |
|---|
| 9340 | 9574 | |
|---|
| 9341 | 9575 | /** |
|---|
| .. | .. |
|---|
| 9346 | 9580 | */ |
|---|
| 9347 | 9581 | void mpt3sas_scsih_pre_reset_handler(struct MPT3SAS_ADAPTER *ioc) |
|---|
| 9348 | 9582 | { |
|---|
| 9349 | | - dtmprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 9350 | | - "%s: MPT3_IOC_PRE_RESET\n", ioc->name, __func__)); |
|---|
| 9583 | + dtmprintk(ioc, ioc_info(ioc, "%s: MPT3_IOC_PRE_RESET\n", __func__)); |
|---|
| 9351 | 9584 | } |
|---|
| 9352 | 9585 | |
|---|
| 9353 | 9586 | /** |
|---|
| 9354 | | - * mpt3sas_scsih_after_reset_handler - reset callback handler (for scsih) |
|---|
| 9587 | + * mpt3sas_scsih_clear_outstanding_scsi_tm_commands - clears outstanding |
|---|
| 9588 | + * scsi & tm cmds. |
|---|
| 9355 | 9589 | * @ioc: per adapter object |
|---|
| 9356 | 9590 | * |
|---|
| 9357 | 9591 | * The handler for doing any required cleanup or initialization. |
|---|
| 9358 | 9592 | */ |
|---|
| 9359 | 9593 | void |
|---|
| 9360 | | -mpt3sas_scsih_after_reset_handler(struct MPT3SAS_ADAPTER *ioc) |
|---|
| 9594 | +mpt3sas_scsih_clear_outstanding_scsi_tm_commands(struct MPT3SAS_ADAPTER *ioc) |
|---|
| 9361 | 9595 | { |
|---|
| 9362 | | - dtmprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 9363 | | - "%s: MPT3_IOC_AFTER_RESET\n", ioc->name, __func__)); |
|---|
| 9596 | + dtmprintk(ioc, |
|---|
| 9597 | + ioc_info(ioc, "%s: clear outstanding scsi & tm cmds\n", __func__)); |
|---|
| 9364 | 9598 | if (ioc->scsih_cmds.status & MPT3_CMD_PENDING) { |
|---|
| 9365 | 9599 | ioc->scsih_cmds.status |= MPT3_CMD_RESET; |
|---|
| 9366 | 9600 | mpt3sas_base_free_smid(ioc, ioc->scsih_cmds.smid); |
|---|
| .. | .. |
|---|
| 9388 | 9622 | void |
|---|
| 9389 | 9623 | mpt3sas_scsih_reset_done_handler(struct MPT3SAS_ADAPTER *ioc) |
|---|
| 9390 | 9624 | { |
|---|
| 9391 | | - dtmprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 9392 | | - "%s: MPT3_IOC_DONE_RESET\n", ioc->name, __func__)); |
|---|
| 9625 | + dtmprintk(ioc, ioc_info(ioc, "%s: MPT3_IOC_DONE_RESET\n", __func__)); |
|---|
| 9393 | 9626 | if ((!ioc->is_driver_loading) && !(disable_discovery > 0 && |
|---|
| 9394 | 9627 | !ioc->sas_hba.num_phys)) { |
|---|
| 9395 | 9628 | _scsih_prep_device_scan(ioc); |
|---|
| .. | .. |
|---|
| 9411 | 9644 | static void |
|---|
| 9412 | 9645 | _mpt3sas_fw_work(struct MPT3SAS_ADAPTER *ioc, struct fw_event_work *fw_event) |
|---|
| 9413 | 9646 | { |
|---|
| 9647 | + ioc->current_event = fw_event; |
|---|
| 9414 | 9648 | _scsih_fw_event_del_from_list(ioc, fw_event); |
|---|
| 9415 | 9649 | |
|---|
| 9416 | 9650 | /* the queue is being flushed so ignore this event */ |
|---|
| 9417 | 9651 | if (ioc->remove_host || ioc->pci_error_recovery) { |
|---|
| 9418 | 9652 | fw_event_work_put(fw_event); |
|---|
| 9653 | + ioc->current_event = NULL; |
|---|
| 9419 | 9654 | return; |
|---|
| 9420 | 9655 | } |
|---|
| 9421 | 9656 | |
|---|
| .. | .. |
|---|
| 9429 | 9664 | while (scsi_host_in_recovery(ioc->shost) || |
|---|
| 9430 | 9665 | ioc->shost_recovery) { |
|---|
| 9431 | 9666 | /* |
|---|
| 9432 | | - * If we're unloading, bail. Otherwise, this can become |
|---|
| 9433 | | - * an infinite loop. |
|---|
| 9667 | + * If we're unloading or cancelling the work, bail. |
|---|
| 9668 | + * Otherwise, this can become an infinite loop. |
|---|
| 9434 | 9669 | */ |
|---|
| 9435 | | - if (ioc->remove_host) |
|---|
| 9670 | + if (ioc->remove_host || ioc->fw_events_cleanup) |
|---|
| 9436 | 9671 | goto out; |
|---|
| 9437 | 9672 | ssleep(1); |
|---|
| 9438 | 9673 | } |
|---|
| 9439 | 9674 | _scsih_remove_unresponding_devices(ioc); |
|---|
| 9440 | 9675 | _scsih_scan_for_devices_after_reset(ioc); |
|---|
| 9676 | + _scsih_set_nvme_max_shutdown_latency(ioc); |
|---|
| 9441 | 9677 | break; |
|---|
| 9442 | 9678 | case MPT3SAS_PORT_ENABLE_COMPLETE: |
|---|
| 9443 | 9679 | ioc->start_scan = 0; |
|---|
| 9444 | 9680 | if (missing_delay[0] != -1 && missing_delay[1] != -1) |
|---|
| 9445 | 9681 | mpt3sas_base_update_missing_delay(ioc, missing_delay[0], |
|---|
| 9446 | 9682 | missing_delay[1]); |
|---|
| 9447 | | - dewtprintk(ioc, pr_info(MPT3SAS_FMT |
|---|
| 9448 | | - "port enable: complete from worker thread\n", |
|---|
| 9449 | | - ioc->name)); |
|---|
| 9683 | + dewtprintk(ioc, |
|---|
| 9684 | + ioc_info(ioc, "port enable: complete from worker thread\n")); |
|---|
| 9450 | 9685 | break; |
|---|
| 9451 | 9686 | case MPT3SAS_TURN_ON_PFA_LED: |
|---|
| 9452 | 9687 | _scsih_turn_on_pfa_led(ioc, fw_event->device_handle); |
|---|
| .. | .. |
|---|
| 9455 | 9690 | _scsih_sas_topology_change_event(ioc, fw_event); |
|---|
| 9456 | 9691 | break; |
|---|
| 9457 | 9692 | case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE: |
|---|
| 9458 | | - _scsih_sas_device_status_change_event(ioc, fw_event); |
|---|
| 9693 | + if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) |
|---|
| 9694 | + _scsih_sas_device_status_change_event_debug(ioc, |
|---|
| 9695 | + (Mpi2EventDataSasDeviceStatusChange_t *) |
|---|
| 9696 | + fw_event->event_data); |
|---|
| 9459 | 9697 | break; |
|---|
| 9460 | 9698 | case MPI2_EVENT_SAS_DISCOVERY: |
|---|
| 9461 | 9699 | _scsih_sas_discovery_event(ioc, fw_event); |
|---|
| .. | .. |
|---|
| 9490 | 9728 | break; |
|---|
| 9491 | 9729 | case MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST: |
|---|
| 9492 | 9730 | _scsih_pcie_topology_change_event(ioc, fw_event); |
|---|
| 9731 | + ioc->current_event = NULL; |
|---|
| 9493 | 9732 | return; |
|---|
| 9494 | 9733 | break; |
|---|
| 9495 | 9734 | } |
|---|
| 9496 | 9735 | out: |
|---|
| 9497 | 9736 | fw_event_work_put(fw_event); |
|---|
| 9737 | + ioc->current_event = NULL; |
|---|
| 9498 | 9738 | } |
|---|
| 9499 | 9739 | |
|---|
| 9500 | 9740 | /** |
|---|
| .. | .. |
|---|
| 9544 | 9784 | mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply); |
|---|
| 9545 | 9785 | |
|---|
| 9546 | 9786 | if (unlikely(!mpi_reply)) { |
|---|
| 9547 | | - pr_err(MPT3SAS_FMT "mpi_reply not valid at %s:%d/%s()!\n", |
|---|
| 9548 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 9787 | + ioc_err(ioc, "mpi_reply not valid at %s:%d/%s()!\n", |
|---|
| 9788 | + __FILE__, __LINE__, __func__); |
|---|
| 9549 | 9789 | return 1; |
|---|
| 9550 | 9790 | } |
|---|
| 9551 | 9791 | |
|---|
| .. | .. |
|---|
| 9612 | 9852 | |
|---|
| 9613 | 9853 | switch (le32_to_cpu(*log_code)) { |
|---|
| 9614 | 9854 | case MPT2_WARPDRIVE_LC_SSDT: |
|---|
| 9615 | | - pr_warn(MPT3SAS_FMT "WarpDrive Warning: " |
|---|
| 9616 | | - "IO Throttling has occurred in the WarpDrive " |
|---|
| 9617 | | - "subsystem. Check WarpDrive documentation for " |
|---|
| 9618 | | - "additional details.\n", ioc->name); |
|---|
| 9855 | + ioc_warn(ioc, "WarpDrive Warning: IO Throttling has occurred in the WarpDrive subsystem. Check WarpDrive documentation for additional details.\n"); |
|---|
| 9619 | 9856 | break; |
|---|
| 9620 | 9857 | case MPT2_WARPDRIVE_LC_SSDLW: |
|---|
| 9621 | | - pr_warn(MPT3SAS_FMT "WarpDrive Warning: " |
|---|
| 9622 | | - "Program/Erase Cycles for the WarpDrive subsystem " |
|---|
| 9623 | | - "in degraded range. Check WarpDrive documentation " |
|---|
| 9624 | | - "for additional details.\n", ioc->name); |
|---|
| 9858 | + ioc_warn(ioc, "WarpDrive Warning: Program/Erase Cycles for the WarpDrive subsystem in degraded range. Check WarpDrive documentation for additional details.\n"); |
|---|
| 9625 | 9859 | break; |
|---|
| 9626 | 9860 | case MPT2_WARPDRIVE_LC_SSDLF: |
|---|
| 9627 | | - pr_err(MPT3SAS_FMT "WarpDrive Fatal Error: " |
|---|
| 9628 | | - "There are no Program/Erase Cycles for the " |
|---|
| 9629 | | - "WarpDrive subsystem. The storage device will be " |
|---|
| 9630 | | - "in read-only mode. Check WarpDrive documentation " |
|---|
| 9631 | | - "for additional details.\n", ioc->name); |
|---|
| 9861 | + ioc_err(ioc, "WarpDrive Fatal Error: There are no Program/Erase Cycles for the WarpDrive subsystem. The storage device will be in read-only mode. Check WarpDrive documentation for additional details.\n"); |
|---|
| 9632 | 9862 | break; |
|---|
| 9633 | 9863 | case MPT2_WARPDRIVE_LC_BRMF: |
|---|
| 9634 | | - pr_err(MPT3SAS_FMT "WarpDrive Fatal Error: " |
|---|
| 9635 | | - "The Backup Rail Monitor has failed on the " |
|---|
| 9636 | | - "WarpDrive subsystem. Check WarpDrive " |
|---|
| 9637 | | - "documentation for additional details.\n", |
|---|
| 9638 | | - ioc->name); |
|---|
| 9864 | + ioc_err(ioc, "WarpDrive Fatal Error: The Backup Rail Monitor has failed on the WarpDrive subsystem. Check WarpDrive documentation for additional details.\n"); |
|---|
| 9639 | 9865 | break; |
|---|
| 9640 | 9866 | } |
|---|
| 9641 | 9867 | |
|---|
| 9642 | 9868 | break; |
|---|
| 9643 | 9869 | } |
|---|
| 9644 | 9870 | case MPI2_EVENT_SAS_DEVICE_STATUS_CHANGE: |
|---|
| 9871 | + _scsih_sas_device_status_change_event(ioc, |
|---|
| 9872 | + (Mpi2EventDataSasDeviceStatusChange_t *) |
|---|
| 9873 | + mpi_reply->EventData); |
|---|
| 9874 | + break; |
|---|
| 9645 | 9875 | case MPI2_EVENT_IR_OPERATION_STATUS: |
|---|
| 9646 | 9876 | case MPI2_EVENT_SAS_DISCOVERY: |
|---|
| 9647 | 9877 | case MPI2_EVENT_SAS_DEVICE_DISCOVERY_ERROR: |
|---|
| .. | .. |
|---|
| 9661 | 9891 | (Mpi26EventDataActiveCableExcept_t *) mpi_reply->EventData; |
|---|
| 9662 | 9892 | switch (ActiveCableEventData->ReasonCode) { |
|---|
| 9663 | 9893 | case MPI26_EVENT_ACTIVE_CABLE_INSUFFICIENT_POWER: |
|---|
| 9664 | | - pr_notice(MPT3SAS_FMT |
|---|
| 9665 | | - "Currently an active cable with ReceptacleID %d\n", |
|---|
| 9666 | | - ioc->name, ActiveCableEventData->ReceptacleID); |
|---|
| 9894 | + ioc_notice(ioc, "Currently an active cable with ReceptacleID %d\n", |
|---|
| 9895 | + ActiveCableEventData->ReceptacleID); |
|---|
| 9667 | 9896 | pr_notice("cannot be powered and devices connected\n"); |
|---|
| 9668 | 9897 | pr_notice("to this active cable will not be seen\n"); |
|---|
| 9669 | 9898 | pr_notice("This active cable requires %d mW of power\n", |
|---|
| .. | .. |
|---|
| 9671 | 9900 | break; |
|---|
| 9672 | 9901 | |
|---|
| 9673 | 9902 | case MPI26_EVENT_ACTIVE_CABLE_DEGRADED: |
|---|
| 9674 | | - pr_notice(MPT3SAS_FMT |
|---|
| 9675 | | - "Currently a cable with ReceptacleID %d\n", |
|---|
| 9676 | | - ioc->name, ActiveCableEventData->ReceptacleID); |
|---|
| 9903 | + ioc_notice(ioc, "Currently a cable with ReceptacleID %d\n", |
|---|
| 9904 | + ActiveCableEventData->ReceptacleID); |
|---|
| 9677 | 9905 | pr_notice( |
|---|
| 9678 | 9906 | "is not running at optimal speed(12 Gb/s rate)\n"); |
|---|
| 9679 | 9907 | break; |
|---|
| .. | .. |
|---|
| 9688 | 9916 | sz = le16_to_cpu(mpi_reply->EventDataLength) * 4; |
|---|
| 9689 | 9917 | fw_event = alloc_fw_event_work(sz); |
|---|
| 9690 | 9918 | if (!fw_event) { |
|---|
| 9691 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 9692 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 9919 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 9920 | + __FILE__, __LINE__, __func__); |
|---|
| 9693 | 9921 | return 1; |
|---|
| 9694 | 9922 | } |
|---|
| 9695 | 9923 | |
|---|
| .. | .. |
|---|
| 9738 | 9966 | mpt3sas_transport_port_remove(ioc, sas_expander->sas_address, |
|---|
| 9739 | 9967 | sas_expander->sas_address_parent); |
|---|
| 9740 | 9968 | |
|---|
| 9741 | | - pr_info(MPT3SAS_FMT |
|---|
| 9742 | | - "expander_remove: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9743 | | - ioc->name, |
|---|
| 9744 | | - sas_expander->handle, (unsigned long long) |
|---|
| 9745 | | - sas_expander->sas_address); |
|---|
| 9969 | + ioc_info(ioc, "expander_remove: handle(0x%04x), sas_addr(0x%016llx)\n", |
|---|
| 9970 | + sas_expander->handle, (unsigned long long) |
|---|
| 9971 | + sas_expander->sas_address); |
|---|
| 9746 | 9972 | |
|---|
| 9747 | 9973 | spin_lock_irqsave(&ioc->sas_node_lock, flags); |
|---|
| 9748 | 9974 | list_del(&sas_expander->list); |
|---|
| .. | .. |
|---|
| 9751 | 9977 | kfree(sas_expander->phy); |
|---|
| 9752 | 9978 | kfree(sas_expander); |
|---|
| 9753 | 9979 | } |
|---|
| 9980 | + |
|---|
| 9981 | +/** |
|---|
| 9982 | + * _scsih_nvme_shutdown - NVMe shutdown notification |
|---|
| 9983 | + * @ioc: per adapter object |
|---|
| 9984 | + * |
|---|
| 9985 | + * Sending IoUnitControl request with shutdown operation code to alert IOC that |
|---|
| 9986 | + * the host system is shutting down so that IOC can issue NVMe shutdown to |
|---|
| 9987 | + * NVMe drives attached to it. |
|---|
| 9988 | + */ |
|---|
| 9989 | +static void |
|---|
| 9990 | +_scsih_nvme_shutdown(struct MPT3SAS_ADAPTER *ioc) |
|---|
| 9991 | +{ |
|---|
| 9992 | + Mpi26IoUnitControlRequest_t *mpi_request; |
|---|
| 9993 | + Mpi26IoUnitControlReply_t *mpi_reply; |
|---|
| 9994 | + u16 smid; |
|---|
| 9995 | + |
|---|
| 9996 | + /* are there any NVMe devices ? */ |
|---|
| 9997 | + if (list_empty(&ioc->pcie_device_list)) |
|---|
| 9998 | + return; |
|---|
| 9999 | + |
|---|
| 10000 | + mutex_lock(&ioc->scsih_cmds.mutex); |
|---|
| 10001 | + |
|---|
| 10002 | + if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) { |
|---|
| 10003 | + ioc_err(ioc, "%s: scsih_cmd in use\n", __func__); |
|---|
| 10004 | + goto out; |
|---|
| 10005 | + } |
|---|
| 10006 | + |
|---|
| 10007 | + ioc->scsih_cmds.status = MPT3_CMD_PENDING; |
|---|
| 10008 | + |
|---|
| 10009 | + smid = mpt3sas_base_get_smid(ioc, ioc->scsih_cb_idx); |
|---|
| 10010 | + if (!smid) { |
|---|
| 10011 | + ioc_err(ioc, |
|---|
| 10012 | + "%s: failed obtaining a smid\n", __func__); |
|---|
| 10013 | + ioc->scsih_cmds.status = MPT3_CMD_NOT_USED; |
|---|
| 10014 | + goto out; |
|---|
| 10015 | + } |
|---|
| 10016 | + |
|---|
| 10017 | + mpi_request = mpt3sas_base_get_msg_frame(ioc, smid); |
|---|
| 10018 | + ioc->scsih_cmds.smid = smid; |
|---|
| 10019 | + memset(mpi_request, 0, sizeof(Mpi26IoUnitControlRequest_t)); |
|---|
| 10020 | + mpi_request->Function = MPI2_FUNCTION_IO_UNIT_CONTROL; |
|---|
| 10021 | + mpi_request->Operation = MPI26_CTRL_OP_SHUTDOWN; |
|---|
| 10022 | + |
|---|
| 10023 | + init_completion(&ioc->scsih_cmds.done); |
|---|
| 10024 | + ioc->put_smid_default(ioc, smid); |
|---|
| 10025 | + /* Wait for max_shutdown_latency seconds */ |
|---|
| 10026 | + ioc_info(ioc, |
|---|
| 10027 | + "Io Unit Control shutdown (sending), Shutdown latency %d sec\n", |
|---|
| 10028 | + ioc->max_shutdown_latency); |
|---|
| 10029 | + wait_for_completion_timeout(&ioc->scsih_cmds.done, |
|---|
| 10030 | + ioc->max_shutdown_latency*HZ); |
|---|
| 10031 | + |
|---|
| 10032 | + if (!(ioc->scsih_cmds.status & MPT3_CMD_COMPLETE)) { |
|---|
| 10033 | + ioc_err(ioc, "%s: timeout\n", __func__); |
|---|
| 10034 | + goto out; |
|---|
| 10035 | + } |
|---|
| 10036 | + |
|---|
| 10037 | + if (ioc->scsih_cmds.status & MPT3_CMD_REPLY_VALID) { |
|---|
| 10038 | + mpi_reply = ioc->scsih_cmds.reply; |
|---|
| 10039 | + ioc_info(ioc, "Io Unit Control shutdown (complete):" |
|---|
| 10040 | + "ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 10041 | + le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 10042 | + le32_to_cpu(mpi_reply->IOCLogInfo)); |
|---|
| 10043 | + } |
|---|
| 10044 | + out: |
|---|
| 10045 | + ioc->scsih_cmds.status = MPT3_CMD_NOT_USED; |
|---|
| 10046 | + mutex_unlock(&ioc->scsih_cmds.mutex); |
|---|
| 10047 | +} |
|---|
| 10048 | + |
|---|
| 9754 | 10049 | |
|---|
| 9755 | 10050 | /** |
|---|
| 9756 | 10051 | * _scsih_ir_shutdown - IR shutdown notification |
|---|
| .. | .. |
|---|
| 9777 | 10072 | mutex_lock(&ioc->scsih_cmds.mutex); |
|---|
| 9778 | 10073 | |
|---|
| 9779 | 10074 | if (ioc->scsih_cmds.status != MPT3_CMD_NOT_USED) { |
|---|
| 9780 | | - pr_err(MPT3SAS_FMT "%s: scsih_cmd in use\n", |
|---|
| 9781 | | - ioc->name, __func__); |
|---|
| 10075 | + ioc_err(ioc, "%s: scsih_cmd in use\n", __func__); |
|---|
| 9782 | 10076 | goto out; |
|---|
| 9783 | 10077 | } |
|---|
| 9784 | 10078 | ioc->scsih_cmds.status = MPT3_CMD_PENDING; |
|---|
| 9785 | 10079 | |
|---|
| 9786 | 10080 | smid = mpt3sas_base_get_smid(ioc, ioc->scsih_cb_idx); |
|---|
| 9787 | 10081 | if (!smid) { |
|---|
| 9788 | | - pr_err(MPT3SAS_FMT "%s: failed obtaining a smid\n", |
|---|
| 9789 | | - ioc->name, __func__); |
|---|
| 10082 | + ioc_err(ioc, "%s: failed obtaining a smid\n", __func__); |
|---|
| 9790 | 10083 | ioc->scsih_cmds.status = MPT3_CMD_NOT_USED; |
|---|
| 9791 | 10084 | goto out; |
|---|
| 9792 | 10085 | } |
|---|
| .. | .. |
|---|
| 9799 | 10092 | mpi_request->Action = MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED; |
|---|
| 9800 | 10093 | |
|---|
| 9801 | 10094 | if (!ioc->hide_ir_msg) |
|---|
| 9802 | | - pr_info(MPT3SAS_FMT "IR shutdown (sending)\n", ioc->name); |
|---|
| 10095 | + ioc_info(ioc, "IR shutdown (sending)\n"); |
|---|
| 9803 | 10096 | init_completion(&ioc->scsih_cmds.done); |
|---|
| 9804 | | - mpt3sas_base_put_smid_default(ioc, smid); |
|---|
| 10097 | + ioc->put_smid_default(ioc, smid); |
|---|
| 9805 | 10098 | wait_for_completion_timeout(&ioc->scsih_cmds.done, 10*HZ); |
|---|
| 9806 | 10099 | |
|---|
| 9807 | 10100 | if (!(ioc->scsih_cmds.status & MPT3_CMD_COMPLETE)) { |
|---|
| 9808 | | - pr_err(MPT3SAS_FMT "%s: timeout\n", |
|---|
| 9809 | | - ioc->name, __func__); |
|---|
| 10101 | + ioc_err(ioc, "%s: timeout\n", __func__); |
|---|
| 9810 | 10102 | goto out; |
|---|
| 9811 | 10103 | } |
|---|
| 9812 | 10104 | |
|---|
| 9813 | 10105 | if (ioc->scsih_cmds.status & MPT3_CMD_REPLY_VALID) { |
|---|
| 9814 | 10106 | mpi_reply = ioc->scsih_cmds.reply; |
|---|
| 9815 | 10107 | if (!ioc->hide_ir_msg) |
|---|
| 9816 | | - pr_info(MPT3SAS_FMT "IR shutdown " |
|---|
| 9817 | | - "(complete): ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 9818 | | - ioc->name, le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 9819 | | - le32_to_cpu(mpi_reply->IOCLogInfo)); |
|---|
| 10108 | + ioc_info(ioc, "IR shutdown (complete): ioc_status(0x%04x), loginfo(0x%08x)\n", |
|---|
| 10109 | + le16_to_cpu(mpi_reply->IOCStatus), |
|---|
| 10110 | + le32_to_cpu(mpi_reply->IOCLogInfo)); |
|---|
| 9820 | 10111 | } |
|---|
| 9821 | 10112 | |
|---|
| 9822 | 10113 | out: |
|---|
| 9823 | 10114 | ioc->scsih_cmds.status = MPT3_CMD_NOT_USED; |
|---|
| 9824 | 10115 | mutex_unlock(&ioc->scsih_cmds.mutex); |
|---|
| 10116 | +} |
|---|
| 10117 | + |
|---|
| 10118 | +/** |
|---|
| 10119 | + * _scsih_get_shost_and_ioc - get shost and ioc |
|---|
| 10120 | + * and verify whether they are NULL or not |
|---|
| 10121 | + * @pdev: PCI device struct |
|---|
| 10122 | + * @shost: address of scsi host pointer |
|---|
| 10123 | + * @ioc: address of HBA adapter pointer |
|---|
| 10124 | + * |
|---|
| 10125 | + * Return zero if *shost and *ioc are not NULL otherwise return error number. |
|---|
| 10126 | + */ |
|---|
| 10127 | +static int |
|---|
| 10128 | +_scsih_get_shost_and_ioc(struct pci_dev *pdev, |
|---|
| 10129 | + struct Scsi_Host **shost, struct MPT3SAS_ADAPTER **ioc) |
|---|
| 10130 | +{ |
|---|
| 10131 | + *shost = pci_get_drvdata(pdev); |
|---|
| 10132 | + if (*shost == NULL) { |
|---|
| 10133 | + dev_err(&pdev->dev, "pdev's driver data is null\n"); |
|---|
| 10134 | + return -ENXIO; |
|---|
| 10135 | + } |
|---|
| 10136 | + |
|---|
| 10137 | + *ioc = shost_priv(*shost); |
|---|
| 10138 | + if (*ioc == NULL) { |
|---|
| 10139 | + dev_err(&pdev->dev, "shost's private data is null\n"); |
|---|
| 10140 | + return -ENXIO; |
|---|
| 10141 | + } |
|---|
| 10142 | + |
|---|
| 10143 | + return 0; |
|---|
| 9825 | 10144 | } |
|---|
| 9826 | 10145 | |
|---|
| 9827 | 10146 | /** |
|---|
| .. | .. |
|---|
| 9832 | 10151 | */ |
|---|
| 9833 | 10152 | static void scsih_remove(struct pci_dev *pdev) |
|---|
| 9834 | 10153 | { |
|---|
| 9835 | | - struct Scsi_Host *shost = pci_get_drvdata(pdev); |
|---|
| 9836 | | - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
|---|
| 10154 | + struct Scsi_Host *shost; |
|---|
| 10155 | + struct MPT3SAS_ADAPTER *ioc; |
|---|
| 9837 | 10156 | struct _sas_port *mpt3sas_port, *next_port; |
|---|
| 9838 | 10157 | struct _raid_device *raid_device, *next; |
|---|
| 9839 | 10158 | struct MPT3SAS_TARGET *sas_target_priv_data; |
|---|
| 9840 | 10159 | struct _pcie_device *pcie_device, *pcienext; |
|---|
| 9841 | 10160 | struct workqueue_struct *wq; |
|---|
| 9842 | 10161 | unsigned long flags; |
|---|
| 10162 | + Mpi2ConfigReply_t mpi_reply; |
|---|
| 10163 | + |
|---|
| 10164 | + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) |
|---|
| 10165 | + return; |
|---|
| 9843 | 10166 | |
|---|
| 9844 | 10167 | ioc->remove_host = 1; |
|---|
| 9845 | 10168 | |
|---|
| .. | .. |
|---|
| 9854 | 10177 | spin_unlock_irqrestore(&ioc->fw_event_lock, flags); |
|---|
| 9855 | 10178 | if (wq) |
|---|
| 9856 | 10179 | destroy_workqueue(wq); |
|---|
| 9857 | | - |
|---|
| 10180 | + /* |
|---|
| 10181 | + * Copy back the unmodified ioc page1. so that on next driver load, |
|---|
| 10182 | + * current modified changes on ioc page1 won't take effect. |
|---|
| 10183 | + */ |
|---|
| 10184 | + if (ioc->is_aero_ioc) |
|---|
| 10185 | + mpt3sas_config_set_ioc_pg1(ioc, &mpi_reply, |
|---|
| 10186 | + &ioc->ioc_pg1_copy); |
|---|
| 9858 | 10187 | /* release all the volumes */ |
|---|
| 9859 | 10188 | _scsih_ir_shutdown(ioc); |
|---|
| 10189 | + mpt3sas_destroy_debugfs(ioc); |
|---|
| 9860 | 10190 | sas_remove_host(shost); |
|---|
| 9861 | 10191 | list_for_each_entry_safe(raid_device, next, &ioc->raid_device_list, |
|---|
| 9862 | 10192 | list) { |
|---|
| .. | .. |
|---|
| 9866 | 10196 | sas_target_priv_data->deleted = 1; |
|---|
| 9867 | 10197 | scsi_remove_target(&raid_device->starget->dev); |
|---|
| 9868 | 10198 | } |
|---|
| 9869 | | - pr_info(MPT3SAS_FMT "removing handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 9870 | | - ioc->name, raid_device->handle, |
|---|
| 9871 | | - (unsigned long long) raid_device->wwid); |
|---|
| 10199 | + ioc_info(ioc, "removing handle(0x%04x), wwid(0x%016llx)\n", |
|---|
| 10200 | + raid_device->handle, (u64)raid_device->wwid); |
|---|
| 9872 | 10201 | _scsih_raid_device_remove(ioc, raid_device); |
|---|
| 9873 | 10202 | } |
|---|
| 9874 | 10203 | list_for_each_entry_safe(pcie_device, pcienext, &ioc->pcie_device_list, |
|---|
| .. | .. |
|---|
| 9914 | 10243 | static void |
|---|
| 9915 | 10244 | scsih_shutdown(struct pci_dev *pdev) |
|---|
| 9916 | 10245 | { |
|---|
| 9917 | | - struct Scsi_Host *shost = pci_get_drvdata(pdev); |
|---|
| 9918 | | - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
|---|
| 10246 | + struct Scsi_Host *shost; |
|---|
| 10247 | + struct MPT3SAS_ADAPTER *ioc; |
|---|
| 9919 | 10248 | struct workqueue_struct *wq; |
|---|
| 9920 | 10249 | unsigned long flags; |
|---|
| 10250 | + Mpi2ConfigReply_t mpi_reply; |
|---|
| 10251 | + |
|---|
| 10252 | + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) |
|---|
| 10253 | + return; |
|---|
| 9921 | 10254 | |
|---|
| 9922 | 10255 | ioc->remove_host = 1; |
|---|
| 9923 | 10256 | |
|---|
| .. | .. |
|---|
| 9932 | 10265 | spin_unlock_irqrestore(&ioc->fw_event_lock, flags); |
|---|
| 9933 | 10266 | if (wq) |
|---|
| 9934 | 10267 | destroy_workqueue(wq); |
|---|
| 10268 | + /* |
|---|
| 10269 | + * Copy back the unmodified ioc page1 so that on next driver load, |
|---|
| 10270 | + * current modified changes on ioc page1 won't take effect. |
|---|
| 10271 | + */ |
|---|
| 10272 | + if (ioc->is_aero_ioc) |
|---|
| 10273 | + mpt3sas_config_set_ioc_pg1(ioc, &mpi_reply, |
|---|
| 10274 | + &ioc->ioc_pg1_copy); |
|---|
| 9935 | 10275 | |
|---|
| 9936 | 10276 | _scsih_ir_shutdown(ioc); |
|---|
| 10277 | + _scsih_nvme_shutdown(ioc); |
|---|
| 9937 | 10278 | mpt3sas_base_detach(ioc); |
|---|
| 9938 | 10279 | } |
|---|
| 9939 | 10280 | |
|---|
| .. | .. |
|---|
| 10194 | 10535 | pcie_device_put(pcie_device); |
|---|
| 10195 | 10536 | continue; |
|---|
| 10196 | 10537 | } |
|---|
| 10538 | + if (pcie_device->access_status == |
|---|
| 10539 | + MPI26_PCIEDEV0_ASTATUS_DEVICE_BLOCKED) { |
|---|
| 10540 | + pcie_device_make_active(ioc, pcie_device); |
|---|
| 10541 | + pcie_device_put(pcie_device); |
|---|
| 10542 | + continue; |
|---|
| 10543 | + } |
|---|
| 10197 | 10544 | rc = scsi_add_device(ioc->shost, PCIE_CHANNEL, |
|---|
| 10198 | 10545 | pcie_device->id, 0); |
|---|
| 10199 | 10546 | if (rc) { |
|---|
| .. | .. |
|---|
| 10270 | 10617 | int rc; |
|---|
| 10271 | 10618 | if (diag_buffer_enable != -1 && diag_buffer_enable != 0) |
|---|
| 10272 | 10619 | mpt3sas_enable_diag_buffer(ioc, diag_buffer_enable); |
|---|
| 10620 | + else if (ioc->manu_pg11.HostTraceBufferMaxSizeKB != 0) |
|---|
| 10621 | + mpt3sas_enable_diag_buffer(ioc, 1); |
|---|
| 10273 | 10622 | |
|---|
| 10274 | 10623 | if (disable_discovery > 0) |
|---|
| 10275 | 10624 | return; |
|---|
| .. | .. |
|---|
| 10278 | 10627 | rc = mpt3sas_port_enable(ioc); |
|---|
| 10279 | 10628 | |
|---|
| 10280 | 10629 | if (rc != 0) |
|---|
| 10281 | | - pr_info(MPT3SAS_FMT "port enable: FAILED\n", ioc->name); |
|---|
| 10630 | + ioc_info(ioc, "port enable: FAILED\n"); |
|---|
| 10282 | 10631 | } |
|---|
| 10283 | 10632 | |
|---|
| 10284 | 10633 | /** |
|---|
| .. | .. |
|---|
| 10303 | 10652 | |
|---|
| 10304 | 10653 | if (time >= (300 * HZ)) { |
|---|
| 10305 | 10654 | ioc->port_enable_cmds.status = MPT3_CMD_NOT_USED; |
|---|
| 10306 | | - pr_info(MPT3SAS_FMT |
|---|
| 10307 | | - "port enable: FAILED with timeout (timeout=300s)\n", |
|---|
| 10308 | | - ioc->name); |
|---|
| 10655 | + ioc_info(ioc, "port enable: FAILED with timeout (timeout=300s)\n"); |
|---|
| 10309 | 10656 | ioc->is_driver_loading = 0; |
|---|
| 10310 | 10657 | return 1; |
|---|
| 10311 | 10658 | } |
|---|
| .. | .. |
|---|
| 10314 | 10661 | return 0; |
|---|
| 10315 | 10662 | |
|---|
| 10316 | 10663 | if (ioc->start_scan_failed) { |
|---|
| 10317 | | - pr_info(MPT3SAS_FMT |
|---|
| 10318 | | - "port enable: FAILED with (ioc_status=0x%08x)\n", |
|---|
| 10319 | | - ioc->name, ioc->start_scan_failed); |
|---|
| 10664 | + ioc_info(ioc, "port enable: FAILED with (ioc_status=0x%08x)\n", |
|---|
| 10665 | + ioc->start_scan_failed); |
|---|
| 10320 | 10666 | ioc->is_driver_loading = 0; |
|---|
| 10321 | 10667 | ioc->wait_for_discovery_to_complete = 0; |
|---|
| 10322 | 10668 | ioc->remove_host = 1; |
|---|
| 10323 | 10669 | return 1; |
|---|
| 10324 | 10670 | } |
|---|
| 10325 | 10671 | |
|---|
| 10326 | | - pr_info(MPT3SAS_FMT "port enable: SUCCESS\n", ioc->name); |
|---|
| 10672 | + ioc_info(ioc, "port enable: SUCCESS\n"); |
|---|
| 10327 | 10673 | ioc->port_enable_cmds.status = MPT3_CMD_NOT_USED; |
|---|
| 10328 | 10674 | |
|---|
| 10329 | 10675 | if (ioc->wait_for_discovery_to_complete) { |
|---|
| .. | .. |
|---|
| 10359 | 10705 | .sg_tablesize = MPT2SAS_SG_DEPTH, |
|---|
| 10360 | 10706 | .max_sectors = 32767, |
|---|
| 10361 | 10707 | .cmd_per_lun = 7, |
|---|
| 10362 | | - .use_clustering = ENABLE_CLUSTERING, |
|---|
| 10363 | 10708 | .shost_attrs = mpt3sas_host_attrs, |
|---|
| 10364 | 10709 | .sdev_attrs = mpt3sas_dev_attrs, |
|---|
| 10365 | 10710 | .track_queue_depth = 1, |
|---|
| .. | .. |
|---|
| 10397 | 10742 | .this_id = -1, |
|---|
| 10398 | 10743 | .sg_tablesize = MPT3SAS_SG_DEPTH, |
|---|
| 10399 | 10744 | .max_sectors = 32767, |
|---|
| 10745 | + .max_segment_size = 0xffffffff, |
|---|
| 10400 | 10746 | .cmd_per_lun = 7, |
|---|
| 10401 | | - .use_clustering = ENABLE_CLUSTERING, |
|---|
| 10402 | 10747 | .shost_attrs = mpt3sas_host_attrs, |
|---|
| 10403 | 10748 | .sdev_attrs = mpt3sas_dev_attrs, |
|---|
| 10404 | 10749 | .track_queue_depth = 1, |
|---|
| .. | .. |
|---|
| 10444 | 10789 | case MPI2_MFGPAGE_DEVID_SAS2308_1: |
|---|
| 10445 | 10790 | case MPI2_MFGPAGE_DEVID_SAS2308_2: |
|---|
| 10446 | 10791 | case MPI2_MFGPAGE_DEVID_SAS2308_3: |
|---|
| 10447 | | - case MPI2_MFGPAGE_DEVID_SAS2308_MPI_EP: |
|---|
| 10792 | + case MPI2_MFGPAGE_DEVID_SWITCH_MPI_EP: |
|---|
| 10793 | + case MPI2_MFGPAGE_DEVID_SWITCH_MPI_EP_1: |
|---|
| 10448 | 10794 | return MPI2_VERSION; |
|---|
| 10449 | 10795 | case MPI25_MFGPAGE_DEVID_SAS3004: |
|---|
| 10450 | 10796 | case MPI25_MFGPAGE_DEVID_SAS3008: |
|---|
| .. | .. |
|---|
| 10470 | 10816 | case MPI26_MFGPAGE_DEVID_SAS3516_1: |
|---|
| 10471 | 10817 | case MPI26_MFGPAGE_DEVID_SAS3416: |
|---|
| 10472 | 10818 | case MPI26_MFGPAGE_DEVID_SAS3616: |
|---|
| 10819 | + case MPI26_ATLAS_PCIe_SWITCH_DEVID: |
|---|
| 10820 | + case MPI26_MFGPAGE_DEVID_CFG_SEC_3916: |
|---|
| 10821 | + case MPI26_MFGPAGE_DEVID_HARD_SEC_3916: |
|---|
| 10822 | + case MPI26_MFGPAGE_DEVID_CFG_SEC_3816: |
|---|
| 10823 | + case MPI26_MFGPAGE_DEVID_HARD_SEC_3816: |
|---|
| 10824 | + case MPI26_MFGPAGE_DEVID_INVALID0_3916: |
|---|
| 10825 | + case MPI26_MFGPAGE_DEVID_INVALID1_3916: |
|---|
| 10826 | + case MPI26_MFGPAGE_DEVID_INVALID0_3816: |
|---|
| 10827 | + case MPI26_MFGPAGE_DEVID_INVALID1_3816: |
|---|
| 10473 | 10828 | return MPI26_VERSION; |
|---|
| 10474 | 10829 | } |
|---|
| 10475 | 10830 | return 0; |
|---|
| .. | .. |
|---|
| 10527 | 10882 | ioc->is_warpdrive = 1; |
|---|
| 10528 | 10883 | ioc->hide_ir_msg = 1; |
|---|
| 10529 | 10884 | break; |
|---|
| 10530 | | - case MPI2_MFGPAGE_DEVID_SAS2308_MPI_EP: |
|---|
| 10885 | + case MPI2_MFGPAGE_DEVID_SWITCH_MPI_EP: |
|---|
| 10886 | + case MPI2_MFGPAGE_DEVID_SWITCH_MPI_EP_1: |
|---|
| 10531 | 10887 | ioc->is_mcpu_endpoint = 1; |
|---|
| 10532 | 10888 | break; |
|---|
| 10533 | 10889 | default: |
|---|
| .. | .. |
|---|
| 10555 | 10911 | case MPI26_MFGPAGE_DEVID_SAS3516_1: |
|---|
| 10556 | 10912 | case MPI26_MFGPAGE_DEVID_SAS3416: |
|---|
| 10557 | 10913 | case MPI26_MFGPAGE_DEVID_SAS3616: |
|---|
| 10914 | + case MPI26_ATLAS_PCIe_SWITCH_DEVID: |
|---|
| 10558 | 10915 | ioc->is_gen35_ioc = 1; |
|---|
| 10559 | 10916 | break; |
|---|
| 10917 | + case MPI26_MFGPAGE_DEVID_INVALID0_3816: |
|---|
| 10918 | + case MPI26_MFGPAGE_DEVID_INVALID0_3916: |
|---|
| 10919 | + dev_err(&pdev->dev, |
|---|
| 10920 | + "HBA with DeviceId 0x%04x, sub VendorId 0x%04x, sub DeviceId 0x%04x is Invalid", |
|---|
| 10921 | + pdev->device, pdev->subsystem_vendor, |
|---|
| 10922 | + pdev->subsystem_device); |
|---|
| 10923 | + return 1; |
|---|
| 10924 | + case MPI26_MFGPAGE_DEVID_INVALID1_3816: |
|---|
| 10925 | + case MPI26_MFGPAGE_DEVID_INVALID1_3916: |
|---|
| 10926 | + dev_err(&pdev->dev, |
|---|
| 10927 | + "HBA with DeviceId 0x%04x, sub VendorId 0x%04x, sub DeviceId 0x%04x is Tampered", |
|---|
| 10928 | + pdev->device, pdev->subsystem_vendor, |
|---|
| 10929 | + pdev->subsystem_device); |
|---|
| 10930 | + return 1; |
|---|
| 10931 | + case MPI26_MFGPAGE_DEVID_CFG_SEC_3816: |
|---|
| 10932 | + case MPI26_MFGPAGE_DEVID_CFG_SEC_3916: |
|---|
| 10933 | + dev_info(&pdev->dev, |
|---|
| 10934 | + "HBA is in Configurable Secure mode\n"); |
|---|
| 10935 | + fallthrough; |
|---|
| 10936 | + case MPI26_MFGPAGE_DEVID_HARD_SEC_3816: |
|---|
| 10937 | + case MPI26_MFGPAGE_DEVID_HARD_SEC_3916: |
|---|
| 10938 | + ioc->is_aero_ioc = ioc->is_gen35_ioc = 1; |
|---|
| 10939 | + break; |
|---|
| 10560 | 10940 | default: |
|---|
| 10561 | | - ioc->is_gen35_ioc = 0; |
|---|
| 10941 | + ioc->is_gen35_ioc = ioc->is_aero_ioc = 0; |
|---|
| 10562 | 10942 | } |
|---|
| 10563 | 10943 | if ((ioc->hba_mpi_version_belonged == MPI25_VERSION && |
|---|
| 10564 | 10944 | pdev->revision >= SAS3_PCI_DEVICE_C0_REVISION) || |
|---|
| .. | .. |
|---|
| 10595 | 10975 | ioc->tm_sas_control_cb_idx = tm_sas_control_cb_idx; |
|---|
| 10596 | 10976 | ioc->logging_level = logging_level; |
|---|
| 10597 | 10977 | ioc->schedule_dead_ioc_flush_running_cmds = &_scsih_flush_running_cmds; |
|---|
| 10978 | + /* Host waits for minimum of six seconds */ |
|---|
| 10979 | + ioc->max_shutdown_latency = IO_UNIT_CONTROL_SHUTDOWN_TIMEOUT; |
|---|
| 10980 | + /* |
|---|
| 10981 | + * Enable MEMORY MOVE support flag. |
|---|
| 10982 | + */ |
|---|
| 10983 | + ioc->drv_support_bitmap |= MPT_DRV_SUPPORT_BITMAP_MEMMOVE; |
|---|
| 10984 | + |
|---|
| 10985 | + ioc->enable_sdev_max_qd = enable_sdev_max_qd; |
|---|
| 10986 | + |
|---|
| 10598 | 10987 | /* misc semaphores and spin locks */ |
|---|
| 10599 | 10988 | mutex_init(&ioc->reset_in_progress_mutex); |
|---|
| 10600 | 10989 | /* initializing pci_access_mutex lock */ |
|---|
| .. | .. |
|---|
| 10634 | 11023 | if (ioc->is_mcpu_endpoint) { |
|---|
| 10635 | 11024 | /* mCPU MPI support 64K max IO */ |
|---|
| 10636 | 11025 | shost->max_sectors = 128; |
|---|
| 10637 | | - pr_info(MPT3SAS_FMT |
|---|
| 10638 | | - "The max_sectors value is set to %d\n", |
|---|
| 10639 | | - ioc->name, shost->max_sectors); |
|---|
| 11026 | + ioc_info(ioc, "The max_sectors value is set to %d\n", |
|---|
| 11027 | + shost->max_sectors); |
|---|
| 10640 | 11028 | } else { |
|---|
| 10641 | 11029 | if (max_sectors != 0xFFFF) { |
|---|
| 10642 | 11030 | if (max_sectors < 64) { |
|---|
| 10643 | 11031 | shost->max_sectors = 64; |
|---|
| 10644 | | - pr_warn(MPT3SAS_FMT "Invalid value %d passed " \ |
|---|
| 10645 | | - "for max_sectors, range is 64 to 32767. " \ |
|---|
| 10646 | | - "Assigning value of 64.\n", \ |
|---|
| 10647 | | - ioc->name, max_sectors); |
|---|
| 11032 | + ioc_warn(ioc, "Invalid value %d passed for max_sectors, range is 64 to 32767. Assigning value of 64.\n", |
|---|
| 11033 | + max_sectors); |
|---|
| 10648 | 11034 | } else if (max_sectors > 32767) { |
|---|
| 10649 | 11035 | shost->max_sectors = 32767; |
|---|
| 10650 | | - pr_warn(MPT3SAS_FMT "Invalid value %d passed " \ |
|---|
| 10651 | | - "for max_sectors, range is 64 to 32767." \ |
|---|
| 10652 | | - "Assigning default value of 32767.\n", \ |
|---|
| 10653 | | - ioc->name, max_sectors); |
|---|
| 11036 | + ioc_warn(ioc, "Invalid value %d passed for max_sectors, range is 64 to 32767.Assigning default value of 32767.\n", |
|---|
| 11037 | + max_sectors); |
|---|
| 10654 | 11038 | } else { |
|---|
| 10655 | 11039 | shost->max_sectors = max_sectors & 0xFFFE; |
|---|
| 10656 | | - pr_info(MPT3SAS_FMT |
|---|
| 10657 | | - "The max_sectors value is set to %d\n", |
|---|
| 10658 | | - ioc->name, shost->max_sectors); |
|---|
| 11040 | + ioc_info(ioc, "The max_sectors value is set to %d\n", |
|---|
| 11041 | + shost->max_sectors); |
|---|
| 10659 | 11042 | } |
|---|
| 10660 | 11043 | } |
|---|
| 10661 | 11044 | } |
|---|
| 10662 | 11045 | /* register EEDP capabilities with SCSI layer */ |
|---|
| 10663 | | - if (prot_mask > 0) |
|---|
| 10664 | | - scsi_host_set_prot(shost, prot_mask); |
|---|
| 11046 | + if (prot_mask >= 0) |
|---|
| 11047 | + scsi_host_set_prot(shost, (prot_mask & 0x07)); |
|---|
| 10665 | 11048 | else |
|---|
| 10666 | 11049 | scsi_host_set_prot(shost, SHOST_DIF_TYPE1_PROTECTION |
|---|
| 10667 | 11050 | | SHOST_DIF_TYPE2_PROTECTION |
|---|
| .. | .. |
|---|
| 10675 | 11058 | ioc->firmware_event_thread = alloc_ordered_workqueue( |
|---|
| 10676 | 11059 | ioc->firmware_event_name, 0); |
|---|
| 10677 | 11060 | if (!ioc->firmware_event_thread) { |
|---|
| 10678 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 10679 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 11061 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 11062 | + __FILE__, __LINE__, __func__); |
|---|
| 10680 | 11063 | rv = -ENODEV; |
|---|
| 10681 | 11064 | goto out_thread_fail; |
|---|
| 10682 | 11065 | } |
|---|
| 10683 | 11066 | |
|---|
| 10684 | 11067 | ioc->is_driver_loading = 1; |
|---|
| 10685 | 11068 | if ((mpt3sas_base_attach(ioc))) { |
|---|
| 10686 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 10687 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 11069 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 11070 | + __FILE__, __LINE__, __func__); |
|---|
| 10688 | 11071 | rv = -ENODEV; |
|---|
| 10689 | 11072 | goto out_attach_fail; |
|---|
| 10690 | 11073 | } |
|---|
| .. | .. |
|---|
| 10705 | 11088 | |
|---|
| 10706 | 11089 | rv = scsi_add_host(shost, &pdev->dev); |
|---|
| 10707 | 11090 | if (rv) { |
|---|
| 10708 | | - pr_err(MPT3SAS_FMT "failure at %s:%d/%s()!\n", |
|---|
| 10709 | | - ioc->name, __FILE__, __LINE__, __func__); |
|---|
| 11091 | + ioc_err(ioc, "failure at %s:%d/%s()!\n", |
|---|
| 11092 | + __FILE__, __LINE__, __func__); |
|---|
| 10710 | 11093 | goto out_add_shost_fail; |
|---|
| 10711 | 11094 | } |
|---|
| 10712 | 11095 | |
|---|
| 10713 | 11096 | scsi_scan_host(shost); |
|---|
| 11097 | + mpt3sas_setup_debugfs(ioc); |
|---|
| 10714 | 11098 | return 0; |
|---|
| 10715 | 11099 | out_add_shost_fail: |
|---|
| 10716 | 11100 | mpt3sas_base_detach(ioc); |
|---|
| .. | .. |
|---|
| 10735 | 11119 | static int |
|---|
| 10736 | 11120 | scsih_suspend(struct pci_dev *pdev, pm_message_t state) |
|---|
| 10737 | 11121 | { |
|---|
| 10738 | | - struct Scsi_Host *shost = pci_get_drvdata(pdev); |
|---|
| 10739 | | - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
|---|
| 11122 | + struct Scsi_Host *shost; |
|---|
| 11123 | + struct MPT3SAS_ADAPTER *ioc; |
|---|
| 10740 | 11124 | pci_power_t device_state; |
|---|
| 11125 | + int rc; |
|---|
| 11126 | + |
|---|
| 11127 | + rc = _scsih_get_shost_and_ioc(pdev, &shost, &ioc); |
|---|
| 11128 | + if (rc) |
|---|
| 11129 | + return rc; |
|---|
| 10741 | 11130 | |
|---|
| 10742 | 11131 | mpt3sas_base_stop_watchdog(ioc); |
|---|
| 10743 | 11132 | flush_scheduled_work(); |
|---|
| 10744 | 11133 | scsi_block_requests(shost); |
|---|
| 11134 | + _scsih_nvme_shutdown(ioc); |
|---|
| 10745 | 11135 | device_state = pci_choose_state(pdev, state); |
|---|
| 10746 | | - pr_info(MPT3SAS_FMT |
|---|
| 10747 | | - "pdev=0x%p, slot=%s, entering operating state [D%d]\n", |
|---|
| 10748 | | - ioc->name, pdev, pci_name(pdev), device_state); |
|---|
| 11136 | + ioc_info(ioc, "pdev=0x%p, slot=%s, entering operating state [D%d]\n", |
|---|
| 11137 | + pdev, pci_name(pdev), device_state); |
|---|
| 10749 | 11138 | |
|---|
| 10750 | 11139 | pci_save_state(pdev); |
|---|
| 10751 | 11140 | mpt3sas_base_free_resources(ioc); |
|---|
| .. | .. |
|---|
| 10762 | 11151 | static int |
|---|
| 10763 | 11152 | scsih_resume(struct pci_dev *pdev) |
|---|
| 10764 | 11153 | { |
|---|
| 10765 | | - struct Scsi_Host *shost = pci_get_drvdata(pdev); |
|---|
| 10766 | | - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
|---|
| 11154 | + struct Scsi_Host *shost; |
|---|
| 11155 | + struct MPT3SAS_ADAPTER *ioc; |
|---|
| 10767 | 11156 | pci_power_t device_state = pdev->current_state; |
|---|
| 10768 | 11157 | int r; |
|---|
| 10769 | 11158 | |
|---|
| 10770 | | - pr_info(MPT3SAS_FMT |
|---|
| 10771 | | - "pdev=0x%p, slot=%s, previous operating state [D%d]\n", |
|---|
| 10772 | | - ioc->name, pdev, pci_name(pdev), device_state); |
|---|
| 11159 | + r = _scsih_get_shost_and_ioc(pdev, &shost, &ioc); |
|---|
| 11160 | + if (r) |
|---|
| 11161 | + return r; |
|---|
| 11162 | + |
|---|
| 11163 | + ioc_info(ioc, "pdev=0x%p, slot=%s, previous operating state [D%d]\n", |
|---|
| 11164 | + pdev, pci_name(pdev), device_state); |
|---|
| 10773 | 11165 | |
|---|
| 10774 | 11166 | pci_set_power_state(pdev, PCI_D0); |
|---|
| 10775 | 11167 | pci_enable_wake(pdev, PCI_D0, 0); |
|---|
| .. | .. |
|---|
| 10778 | 11170 | r = mpt3sas_base_map_resources(ioc); |
|---|
| 10779 | 11171 | if (r) |
|---|
| 10780 | 11172 | return r; |
|---|
| 10781 | | - |
|---|
| 11173 | + ioc_info(ioc, "Issuing Hard Reset as part of OS Resume\n"); |
|---|
| 10782 | 11174 | mpt3sas_base_hard_reset_handler(ioc, SOFT_RESET); |
|---|
| 10783 | 11175 | scsi_unblock_requests(shost); |
|---|
| 10784 | 11176 | mpt3sas_base_start_watchdog(ioc); |
|---|
| .. | .. |
|---|
| 10798 | 11190 | static pci_ers_result_t |
|---|
| 10799 | 11191 | scsih_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state) |
|---|
| 10800 | 11192 | { |
|---|
| 10801 | | - struct Scsi_Host *shost = pci_get_drvdata(pdev); |
|---|
| 10802 | | - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
|---|
| 11193 | + struct Scsi_Host *shost; |
|---|
| 11194 | + struct MPT3SAS_ADAPTER *ioc; |
|---|
| 10803 | 11195 | |
|---|
| 10804 | | - pr_info(MPT3SAS_FMT "PCI error: detected callback, state(%d)!!\n", |
|---|
| 10805 | | - ioc->name, state); |
|---|
| 11196 | + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) |
|---|
| 11197 | + return PCI_ERS_RESULT_DISCONNECT; |
|---|
| 11198 | + |
|---|
| 11199 | + ioc_info(ioc, "PCI error: detected callback, state(%d)!!\n", state); |
|---|
| 10806 | 11200 | |
|---|
| 10807 | 11201 | switch (state) { |
|---|
| 10808 | 11202 | case pci_channel_io_normal: |
|---|
| .. | .. |
|---|
| 10835 | 11229 | static pci_ers_result_t |
|---|
| 10836 | 11230 | scsih_pci_slot_reset(struct pci_dev *pdev) |
|---|
| 10837 | 11231 | { |
|---|
| 10838 | | - struct Scsi_Host *shost = pci_get_drvdata(pdev); |
|---|
| 10839 | | - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
|---|
| 11232 | + struct Scsi_Host *shost; |
|---|
| 11233 | + struct MPT3SAS_ADAPTER *ioc; |
|---|
| 10840 | 11234 | int rc; |
|---|
| 10841 | 11235 | |
|---|
| 10842 | | - pr_info(MPT3SAS_FMT "PCI error: slot reset callback!!\n", |
|---|
| 10843 | | - ioc->name); |
|---|
| 11236 | + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) |
|---|
| 11237 | + return PCI_ERS_RESULT_DISCONNECT; |
|---|
| 11238 | + |
|---|
| 11239 | + ioc_info(ioc, "PCI error: slot reset callback!!\n"); |
|---|
| 10844 | 11240 | |
|---|
| 10845 | 11241 | ioc->pci_error_recovery = 0; |
|---|
| 10846 | 11242 | ioc->pdev = pdev; |
|---|
| .. | .. |
|---|
| 10849 | 11245 | if (rc) |
|---|
| 10850 | 11246 | return PCI_ERS_RESULT_DISCONNECT; |
|---|
| 10851 | 11247 | |
|---|
| 11248 | + ioc_info(ioc, "Issuing Hard Reset as part of PCI Slot Reset\n"); |
|---|
| 10852 | 11249 | rc = mpt3sas_base_hard_reset_handler(ioc, FORCE_BIG_HAMMER); |
|---|
| 10853 | 11250 | |
|---|
| 10854 | | - pr_warn(MPT3SAS_FMT "hard reset: %s\n", ioc->name, |
|---|
| 10855 | | - (rc == 0) ? "success" : "failed"); |
|---|
| 11251 | + ioc_warn(ioc, "hard reset: %s\n", |
|---|
| 11252 | + (rc == 0) ? "success" : "failed"); |
|---|
| 10856 | 11253 | |
|---|
| 10857 | 11254 | if (!rc) |
|---|
| 10858 | 11255 | return PCI_ERS_RESULT_RECOVERED; |
|---|
| .. | .. |
|---|
| 10871 | 11268 | static void |
|---|
| 10872 | 11269 | scsih_pci_resume(struct pci_dev *pdev) |
|---|
| 10873 | 11270 | { |
|---|
| 10874 | | - struct Scsi_Host *shost = pci_get_drvdata(pdev); |
|---|
| 10875 | | - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
|---|
| 11271 | + struct Scsi_Host *shost; |
|---|
| 11272 | + struct MPT3SAS_ADAPTER *ioc; |
|---|
| 10876 | 11273 | |
|---|
| 10877 | | - pr_info(MPT3SAS_FMT "PCI error: resume callback!!\n", ioc->name); |
|---|
| 11274 | + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) |
|---|
| 11275 | + return; |
|---|
| 10878 | 11276 | |
|---|
| 10879 | | - pci_cleanup_aer_uncorrect_error_status(pdev); |
|---|
| 11277 | + ioc_info(ioc, "PCI error: resume callback!!\n"); |
|---|
| 11278 | + |
|---|
| 10880 | 11279 | mpt3sas_base_start_watchdog(ioc); |
|---|
| 10881 | 11280 | scsi_unblock_requests(ioc->shost); |
|---|
| 10882 | 11281 | } |
|---|
| .. | .. |
|---|
| 10888 | 11287 | static pci_ers_result_t |
|---|
| 10889 | 11288 | scsih_pci_mmio_enabled(struct pci_dev *pdev) |
|---|
| 10890 | 11289 | { |
|---|
| 10891 | | - struct Scsi_Host *shost = pci_get_drvdata(pdev); |
|---|
| 10892 | | - struct MPT3SAS_ADAPTER *ioc = shost_priv(shost); |
|---|
| 11290 | + struct Scsi_Host *shost; |
|---|
| 11291 | + struct MPT3SAS_ADAPTER *ioc; |
|---|
| 10893 | 11292 | |
|---|
| 10894 | | - pr_info(MPT3SAS_FMT "PCI error: mmio enabled callback!!\n", |
|---|
| 10895 | | - ioc->name); |
|---|
| 11293 | + if (_scsih_get_shost_and_ioc(pdev, &shost, &ioc)) |
|---|
| 11294 | + return PCI_ERS_RESULT_DISCONNECT; |
|---|
| 11295 | + |
|---|
| 11296 | + ioc_info(ioc, "PCI error: mmio enabled callback!!\n"); |
|---|
| 10896 | 11297 | |
|---|
| 10897 | 11298 | /* TODO - dump whatever for debugging purposes */ |
|---|
| 10898 | 11299 | |
|---|
| .. | .. |
|---|
| 10970 | 11371 | PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 10971 | 11372 | { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_3, |
|---|
| 10972 | 11373 | PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 10973 | | - { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_MPI_EP, |
|---|
| 11374 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SWITCH_MPI_EP, |
|---|
| 11375 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11376 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SWITCH_MPI_EP_1, |
|---|
| 10974 | 11377 | PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 10975 | 11378 | /* SSS6200 */ |
|---|
| 10976 | 11379 | { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SSS6200, |
|---|
| .. | .. |
|---|
| 11027 | 11430 | /* Mercator ~ 3616*/ |
|---|
| 11028 | 11431 | { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3616, |
|---|
| 11029 | 11432 | PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11433 | + |
|---|
| 11434 | + /* Aero SI 0x00E1 Configurable Secure |
|---|
| 11435 | + * 0x00E2 Hard Secure |
|---|
| 11436 | + */ |
|---|
| 11437 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_CFG_SEC_3916, |
|---|
| 11438 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11439 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_HARD_SEC_3916, |
|---|
| 11440 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11441 | + |
|---|
| 11442 | + /* |
|---|
| 11443 | + * Aero SI –> 0x00E0 Invalid, 0x00E3 Tampered |
|---|
| 11444 | + */ |
|---|
| 11445 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID0_3916, |
|---|
| 11446 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11447 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID1_3916, |
|---|
| 11448 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11449 | + |
|---|
| 11450 | + /* Atlas PCIe Switch Management Port */ |
|---|
| 11451 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_ATLAS_PCIe_SWITCH_DEVID, |
|---|
| 11452 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11453 | + |
|---|
| 11454 | + /* Sea SI 0x00E5 Configurable Secure |
|---|
| 11455 | + * 0x00E6 Hard Secure |
|---|
| 11456 | + */ |
|---|
| 11457 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_CFG_SEC_3816, |
|---|
| 11458 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11459 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_HARD_SEC_3816, |
|---|
| 11460 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11461 | + |
|---|
| 11462 | + /* |
|---|
| 11463 | + * Sea SI –> 0x00E4 Invalid, 0x00E7 Tampered |
|---|
| 11464 | + */ |
|---|
| 11465 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID0_3816, |
|---|
| 11466 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11467 | + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID1_3816, |
|---|
| 11468 | + PCI_ANY_ID, PCI_ANY_ID }, |
|---|
| 11469 | + |
|---|
| 11030 | 11470 | {0} /* Terminating entry */ |
|---|
| 11031 | 11471 | }; |
|---|
| 11032 | 11472 | MODULE_DEVICE_TABLE(pci, mpt3sas_pci_table); |
|---|
| .. | .. |
|---|
| 11098 | 11538 | tm_sas_control_cb_idx = mpt3sas_base_register_callback_handler( |
|---|
| 11099 | 11539 | _scsih_sas_control_complete); |
|---|
| 11100 | 11540 | |
|---|
| 11541 | + mpt3sas_init_debugfs(); |
|---|
| 11101 | 11542 | return 0; |
|---|
| 11102 | 11543 | } |
|---|
| 11103 | 11544 | |
|---|
| .. | .. |
|---|
| 11129 | 11570 | if (hbas_to_enumerate != 2) |
|---|
| 11130 | 11571 | raid_class_release(mpt2sas_raid_template); |
|---|
| 11131 | 11572 | sas_release_transport(mpt3sas_transport_template); |
|---|
| 11573 | + mpt3sas_exit_debugfs(); |
|---|
| 11132 | 11574 | } |
|---|
| 11133 | 11575 | |
|---|
| 11134 | 11576 | /** |
|---|