diff options
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r-- | drivers/message/fusion/mptsas.c | 253 |
1 files changed, 144 insertions, 109 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 4333449ae654..ecaa1d6b0759 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -100,19 +100,25 @@ static void mptsas_hotplug_work(struct work_struct *work); | |||
100 | static void mptsas_print_phy_data(MPT_ADAPTER *ioc, | 100 | static void mptsas_print_phy_data(MPT_ADAPTER *ioc, |
101 | MPI_SAS_IO_UNIT0_PHY_DATA *phy_data) | 101 | MPI_SAS_IO_UNIT0_PHY_DATA *phy_data) |
102 | { | 102 | { |
103 | dsasprintk(ioc, printk(KERN_DEBUG "---- IO UNIT PAGE 0 ------------\n")); | 103 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
104 | dsasprintk(ioc, printk(KERN_DEBUG "Handle=0x%X\n", | 104 | "---- IO UNIT PAGE 0 ------------\n", ioc->name)); |
105 | le16_to_cpu(phy_data->AttachedDeviceHandle))); | 105 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handle=0x%X\n", |
106 | dsasprintk(ioc, printk(KERN_DEBUG "Controller Handle=0x%X\n", | 106 | ioc->name, le16_to_cpu(phy_data->AttachedDeviceHandle))); |
107 | le16_to_cpu(phy_data->ControllerDevHandle))); | 107 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Controller Handle=0x%X\n", |
108 | dsasprintk(ioc, printk(KERN_DEBUG "Port=0x%X\n", phy_data->Port)); | 108 | ioc->name, le16_to_cpu(phy_data->ControllerDevHandle))); |
109 | dsasprintk(ioc, printk(KERN_DEBUG "Port Flags=0x%X\n", phy_data->PortFlags)); | 109 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Port=0x%X\n", |
110 | dsasprintk(ioc, printk(KERN_DEBUG "PHY Flags=0x%X\n", phy_data->PhyFlags)); | 110 | ioc->name, phy_data->Port)); |
111 | dsasprintk(ioc, printk(KERN_DEBUG "Negotiated Link Rate=0x%X\n", phy_data->NegotiatedLinkRate)); | 111 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Port Flags=0x%X\n", |
112 | dsasprintk(ioc, printk(KERN_DEBUG "Controller PHY Device Info=0x%X\n", | 112 | ioc->name, phy_data->PortFlags)); |
113 | le32_to_cpu(phy_data->ControllerPhyDeviceInfo))); | 113 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PHY Flags=0x%X\n", |
114 | dsasprintk(ioc, printk(KERN_DEBUG "DiscoveryStatus=0x%X\n\n", | 114 | ioc->name, phy_data->PhyFlags)); |
115 | le32_to_cpu(phy_data->DiscoveryStatus))); | 115 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Negotiated Link Rate=0x%X\n", |
116 | ioc->name, phy_data->NegotiatedLinkRate)); | ||
117 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT | ||
118 | "Controller PHY Device Info=0x%X\n", ioc->name, | ||
119 | le32_to_cpu(phy_data->ControllerPhyDeviceInfo))); | ||
120 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "DiscoveryStatus=0x%X\n\n", | ||
121 | ioc->name, le32_to_cpu(phy_data->DiscoveryStatus))); | ||
116 | } | 122 | } |
117 | 123 | ||
118 | static void mptsas_print_phy_pg0(MPT_ADAPTER *ioc, SasPhyPage0_t *pg0) | 124 | static void mptsas_print_phy_pg0(MPT_ADAPTER *ioc, SasPhyPage0_t *pg0) |
@@ -121,27 +127,41 @@ static void mptsas_print_phy_pg0(MPT_ADAPTER *ioc, SasPhyPage0_t *pg0) | |||
121 | 127 | ||
122 | memcpy(&sas_address, &pg0->SASAddress, sizeof(__le64)); | 128 | memcpy(&sas_address, &pg0->SASAddress, sizeof(__le64)); |
123 | 129 | ||
124 | dsasprintk(ioc, printk(KERN_DEBUG "---- SAS PHY PAGE 0 ------------\n")); | 130 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
125 | dsasprintk(ioc, printk(KERN_DEBUG "Attached Device Handle=0x%X\n", | 131 | "---- SAS PHY PAGE 0 ------------\n", ioc->name)); |
126 | le16_to_cpu(pg0->AttachedDevHandle))); | 132 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
127 | dsasprintk(ioc, printk(KERN_DEBUG "SAS Address=0x%llX\n", | 133 | "Attached Device Handle=0x%X\n", ioc->name, |
128 | (unsigned long long)le64_to_cpu(sas_address))); | 134 | le16_to_cpu(pg0->AttachedDevHandle))); |
129 | dsasprintk(ioc, printk(KERN_DEBUG "Attached PHY Identifier=0x%X\n", pg0->AttachedPhyIdentifier)); | 135 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "SAS Address=0x%llX\n", |
130 | dsasprintk(ioc, printk(KERN_DEBUG "Attached Device Info=0x%X\n", | 136 | ioc->name, (unsigned long long)le64_to_cpu(sas_address))); |
131 | le32_to_cpu(pg0->AttachedDeviceInfo))); | 137 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
132 | dsasprintk(ioc, printk(KERN_DEBUG "Programmed Link Rate=0x%X\n", pg0->ProgrammedLinkRate)); | 138 | "Attached PHY Identifier=0x%X\n", ioc->name, |
133 | dsasprintk(ioc, printk(KERN_DEBUG "Change Count=0x%X\n", pg0->ChangeCount)); | 139 | pg0->AttachedPhyIdentifier)); |
134 | dsasprintk(ioc, printk(KERN_DEBUG "PHY Info=0x%X\n\n", le32_to_cpu(pg0->PhyInfo))); | 140 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Attached Device Info=0x%X\n", |
141 | ioc->name, le32_to_cpu(pg0->AttachedDeviceInfo))); | ||
142 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Programmed Link Rate=0x%X\n", | ||
143 | ioc->name, pg0->ProgrammedLinkRate)); | ||
144 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Change Count=0x%X\n", | ||
145 | ioc->name, pg0->ChangeCount)); | ||
146 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PHY Info=0x%X\n\n", | ||
147 | ioc->name, le32_to_cpu(pg0->PhyInfo))); | ||
135 | } | 148 | } |
136 | 149 | ||
137 | static void mptsas_print_phy_pg1(MPT_ADAPTER *ioc, SasPhyPage1_t *pg1) | 150 | static void mptsas_print_phy_pg1(MPT_ADAPTER *ioc, SasPhyPage1_t *pg1) |
138 | { | 151 | { |
139 | dsasprintk(ioc, printk(KERN_DEBUG "---- SAS PHY PAGE 1 ------------\n")); | 152 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
140 | dsasprintk(ioc, printk(KERN_DEBUG "Invalid Dword Count=0x%x\n", pg1->InvalidDwordCount)); | 153 | "---- SAS PHY PAGE 1 ------------\n", ioc->name)); |
141 | dsasprintk(ioc, printk(KERN_DEBUG "Running Disparity Error Count=0x%x\n", | 154 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Invalid Dword Count=0x%x\n", |
142 | pg1->RunningDisparityErrorCount)); | 155 | ioc->name, pg1->InvalidDwordCount)); |
143 | dsasprintk(ioc, printk(KERN_DEBUG "Loss Dword Synch Count=0x%x\n", pg1->LossDwordSynchCount)); | 156 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
144 | dsasprintk(ioc, printk(KERN_DEBUG "PHY Reset Problem Count=0x%x\n\n", pg1->PhyResetProblemCount)); | 157 | "Running Disparity Error Count=0x%x\n", ioc->name, |
158 | pg1->RunningDisparityErrorCount)); | ||
159 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT | ||
160 | "Loss Dword Synch Count=0x%x\n", ioc->name, | ||
161 | pg1->LossDwordSynchCount)); | ||
162 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT | ||
163 | "PHY Reset Problem Count=0x%x\n\n", ioc->name, | ||
164 | pg1->PhyResetProblemCount)); | ||
145 | } | 165 | } |
146 | 166 | ||
147 | static void mptsas_print_device_pg0(MPT_ADAPTER *ioc, SasDevicePage0_t *pg0) | 167 | static void mptsas_print_device_pg0(MPT_ADAPTER *ioc, SasDevicePage0_t *pg0) |
@@ -150,37 +170,53 @@ static void mptsas_print_device_pg0(MPT_ADAPTER *ioc, SasDevicePage0_t *pg0) | |||
150 | 170 | ||
151 | memcpy(&sas_address, &pg0->SASAddress, sizeof(__le64)); | 171 | memcpy(&sas_address, &pg0->SASAddress, sizeof(__le64)); |
152 | 172 | ||
153 | dsasprintk(ioc, printk(KERN_DEBUG "---- SAS DEVICE PAGE 0 ---------\n")); | 173 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
154 | dsasprintk(ioc, printk(KERN_DEBUG "Handle=0x%X\n" ,le16_to_cpu(pg0->DevHandle))); | 174 | "---- SAS DEVICE PAGE 0 ---------\n", ioc->name)); |
155 | dsasprintk(ioc, printk(KERN_DEBUG "Parent Handle=0x%X\n" ,le16_to_cpu(pg0->ParentDevHandle))); | 175 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Handle=0x%X\n", |
156 | dsasprintk(ioc, printk(KERN_DEBUG "Enclosure Handle=0x%X\n", le16_to_cpu(pg0->EnclosureHandle))); | 176 | ioc->name, le16_to_cpu(pg0->DevHandle))); |
157 | dsasprintk(ioc, printk(KERN_DEBUG "Slot=0x%X\n", le16_to_cpu(pg0->Slot))); | 177 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Parent Handle=0x%X\n", |
158 | dsasprintk(ioc, printk(KERN_DEBUG "SAS Address=0x%llX\n", (unsigned long long) | 178 | ioc->name, le16_to_cpu(pg0->ParentDevHandle))); |
159 | le64_to_cpu(sas_address))); | 179 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Enclosure Handle=0x%X\n", |
160 | dsasprintk(ioc, printk(KERN_DEBUG "Target ID=0x%X\n", pg0->TargetID)); | 180 | ioc->name, le16_to_cpu(pg0->EnclosureHandle))); |
161 | dsasprintk(ioc, printk(KERN_DEBUG "Bus=0x%X\n", pg0->Bus)); | 181 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Slot=0x%X\n", |
162 | /* The PhyNum field specifies the PHY number of the parent | 182 | ioc->name, le16_to_cpu(pg0->Slot))); |
163 | * device this device is linked to | 183 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "SAS Address=0x%llX\n", |
164 | */ | 184 | ioc->name, (unsigned long long)le64_to_cpu(sas_address))); |
165 | dsasprintk(ioc, printk(KERN_DEBUG "Parent Phy Num=0x%X\n", pg0->PhyNum)); | 185 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Target ID=0x%X\n", |
166 | dsasprintk(ioc, printk(KERN_DEBUG "Access Status=0x%X\n", le16_to_cpu(pg0->AccessStatus))); | 186 | ioc->name, pg0->TargetID)); |
167 | dsasprintk(ioc, printk(KERN_DEBUG "Device Info=0x%X\n", le32_to_cpu(pg0->DeviceInfo))); | 187 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Bus=0x%X\n", |
168 | dsasprintk(ioc, printk(KERN_DEBUG "Flags=0x%X\n", le16_to_cpu(pg0->Flags))); | 188 | ioc->name, pg0->Bus)); |
169 | dsasprintk(ioc, printk(KERN_DEBUG "Physical Port=0x%X\n\n", pg0->PhysicalPort)); | 189 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Parent Phy Num=0x%X\n", |
190 | ioc->name, pg0->PhyNum)); | ||
191 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Access Status=0x%X\n", | ||
192 | ioc->name, le16_to_cpu(pg0->AccessStatus))); | ||
193 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Device Info=0x%X\n", | ||
194 | ioc->name, le32_to_cpu(pg0->DeviceInfo))); | ||
195 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Flags=0x%X\n", | ||
196 | ioc->name, le16_to_cpu(pg0->Flags))); | ||
197 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Physical Port=0x%X\n\n", | ||
198 | ioc->name, pg0->PhysicalPort)); | ||
170 | } | 199 | } |
171 | 200 | ||
172 | static void mptsas_print_expander_pg1(MPT_ADAPTER *ioc, SasExpanderPage1_t *pg1) | 201 | static void mptsas_print_expander_pg1(MPT_ADAPTER *ioc, SasExpanderPage1_t *pg1) |
173 | { | 202 | { |
174 | dsasprintk(ioc, printk(KERN_DEBUG "---- SAS EXPANDER PAGE 1 ------------\n")); | 203 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
175 | dsasprintk(ioc, printk(KERN_DEBUG "Physical Port=0x%X\n", pg1->PhysicalPort)); | 204 | "---- SAS EXPANDER PAGE 1 ------------\n", ioc->name)); |
176 | dsasprintk(ioc, printk(KERN_DEBUG "PHY Identifier=0x%X\n", pg1->PhyIdentifier)); | 205 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Physical Port=0x%X\n", |
177 | dsasprintk(ioc, printk(KERN_DEBUG "Negotiated Link Rate=0x%X\n", pg1->NegotiatedLinkRate)); | 206 | ioc->name, pg1->PhysicalPort)); |
178 | dsasprintk(ioc, printk(KERN_DEBUG "Programmed Link Rate=0x%X\n", pg1->ProgrammedLinkRate)); | 207 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "PHY Identifier=0x%X\n", |
179 | dsasprintk(ioc, printk(KERN_DEBUG "Hardware Link Rate=0x%X\n", pg1->HwLinkRate)); | 208 | ioc->name, pg1->PhyIdentifier)); |
180 | dsasprintk(ioc, printk(KERN_DEBUG "Owner Device Handle=0x%X\n", | 209 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Negotiated Link Rate=0x%X\n", |
181 | le16_to_cpu(pg1->OwnerDevHandle))); | 210 | ioc->name, pg1->NegotiatedLinkRate)); |
182 | dsasprintk(ioc, printk(KERN_DEBUG "Attached Device Handle=0x%X\n\n", | 211 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Programmed Link Rate=0x%X\n", |
183 | le16_to_cpu(pg1->AttachedDevHandle))); | 212 | ioc->name, pg1->ProgrammedLinkRate)); |
213 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Hardware Link Rate=0x%X\n", | ||
214 | ioc->name, pg1->HwLinkRate)); | ||
215 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT "Owner Device Handle=0x%X\n", | ||
216 | ioc->name, le16_to_cpu(pg1->OwnerDevHandle))); | ||
217 | dsasprintk(ioc, printk(MYIOC_s_DEBUG_FMT | ||
218 | "Attached Device Handle=0x%X\n\n", ioc->name, | ||
219 | le16_to_cpu(pg1->AttachedDevHandle))); | ||
184 | } | 220 | } |
185 | 221 | ||
186 | static inline MPT_ADAPTER *phy_to_ioc(struct sas_phy *phy) | 222 | static inline MPT_ADAPTER *phy_to_ioc(struct sas_phy *phy) |
@@ -250,8 +286,8 @@ mptsas_port_delete(MPT_ADAPTER *ioc, struct mptsas_portinfo_details * port_detai | |||
250 | port_info = port_details->port_info; | 286 | port_info = port_details->port_info; |
251 | phy_info = port_info->phy_info; | 287 | phy_info = port_info->phy_info; |
252 | 288 | ||
253 | dsaswideprintk(ioc, printk(KERN_DEBUG "%s: [%p]: num_phys=%02d " | 289 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "%s: [%p]: num_phys=%02d " |
254 | "bitmask=0x%016llX\n", __FUNCTION__, port_details, | 290 | "bitmask=0x%016llX\n", ioc->name, __FUNCTION__, port_details, |
255 | port_details->num_phys, (unsigned long long) | 291 | port_details->num_phys, (unsigned long long) |
256 | port_details->phy_bitmask)); | 292 | port_details->phy_bitmask)); |
257 | 293 | ||
@@ -278,14 +314,15 @@ mptsas_set_rphy(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, struct sas_rp | |||
278 | { | 314 | { |
279 | if (phy_info->port_details) { | 315 | if (phy_info->port_details) { |
280 | phy_info->port_details->rphy = rphy; | 316 | phy_info->port_details->rphy = rphy; |
281 | dsaswideprintk(ioc, printk(KERN_DEBUG "sas_rphy_add: rphy=%p\n", rphy)); | 317 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "sas_rphy_add: rphy=%p\n", |
318 | ioc->name, rphy)); | ||
282 | } | 319 | } |
283 | 320 | ||
284 | if (rphy) { | 321 | if (rphy) { |
285 | dsaswideprintk(ioc, dev_printk(KERN_DEBUG, | 322 | dsaswideprintk(ioc, dev_printk(MYIOC_s_DEBUG_FMT, |
286 | &rphy->dev, "add:")); | 323 | &rphy->dev, "add:", ioc->name)); |
287 | dsaswideprintk(ioc, printk(KERN_DEBUG "rphy=%p release=%p\n", | 324 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "rphy=%p release=%p\n", |
288 | rphy, rphy->dev.release)); | 325 | ioc->name, rphy, rphy->dev.release)); |
289 | } | 326 | } |
290 | } | 327 | } |
291 | 328 | ||
@@ -305,10 +342,10 @@ mptsas_set_port(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, struct sas_po | |||
305 | phy_info->port_details->port = port; | 342 | phy_info->port_details->port = port; |
306 | 343 | ||
307 | if (port) { | 344 | if (port) { |
308 | dsaswideprintk(ioc, dev_printk(KERN_DEBUG, | 345 | dsaswideprintk(ioc, dev_printk(MYIOC_s_DEBUG_FMT, |
309 | &port->dev, "add:")); | 346 | &port->dev, "add:", ioc->name)); |
310 | dsaswideprintk(ioc, printk(KERN_DEBUG "port=%p release=%p\n", | 347 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "port=%p release=%p\n", |
311 | port, port->dev.release)); | 348 | ioc->name, port, port->dev.release)); |
312 | } | 349 | } |
313 | } | 350 | } |
314 | 351 | ||
@@ -359,9 +396,9 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) | |||
359 | * Removing a phy from a port, letting the last | 396 | * Removing a phy from a port, letting the last |
360 | * phy be removed by firmware events. | 397 | * phy be removed by firmware events. |
361 | */ | 398 | */ |
362 | dsaswideprintk(ioc, printk(KERN_DEBUG | 399 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
363 | "%s: [%p]: deleting phy = %d\n", | 400 | "%s: [%p]: deleting phy = %d\n", |
364 | __FUNCTION__, port_details, i)); | 401 | ioc->name, __FUNCTION__, port_details, i)); |
365 | port_details->num_phys--; | 402 | port_details->num_phys--; |
366 | port_details->phy_bitmask &= ~ (1 << phy_info->phy_id); | 403 | port_details->phy_bitmask &= ~ (1 << phy_info->phy_id); |
367 | memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo)); | 404 | memset(&phy_info->attached, 0, sizeof(struct mptsas_devinfo)); |
@@ -375,8 +412,8 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) | |||
375 | phy_info = port_info->phy_info; | 412 | phy_info = port_info->phy_info; |
376 | for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) { | 413 | for (i = 0 ; i < port_info->num_phys ; i++, phy_info++) { |
377 | sas_address = phy_info->attached.sas_address; | 414 | sas_address = phy_info->attached.sas_address; |
378 | dsaswideprintk(ioc, printk(KERN_DEBUG "phy_id=%d sas_address=0x%018llX\n", | 415 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "phy_id=%d sas_address=0x%018llX\n", |
379 | i, (unsigned long long)sas_address)); | 416 | ioc->name, i, (unsigned long long)sas_address)); |
380 | if (!sas_address) | 417 | if (!sas_address) |
381 | continue; | 418 | continue; |
382 | port_details = phy_info->port_details; | 419 | port_details = phy_info->port_details; |
@@ -394,9 +431,9 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) | |||
394 | port_details->phy_bitmask |= | 431 | port_details->phy_bitmask |= |
395 | (1 << phy_info->phy_id); | 432 | (1 << phy_info->phy_id); |
396 | phy_info->sas_port_add_phy=1; | 433 | phy_info->sas_port_add_phy=1; |
397 | dsaswideprintk(ioc, printk(KERN_DEBUG "\t\tForming port\n\t\t" | 434 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "\t\tForming port\n\t\t" |
398 | "phy_id=%d sas_address=0x%018llX\n", | 435 | "phy_id=%d sas_address=0x%018llX\n", |
399 | i, (unsigned long long)sas_address)); | 436 | ioc->name, i, (unsigned long long)sas_address)); |
400 | phy_info->port_details = port_details; | 437 | phy_info->port_details = port_details; |
401 | } | 438 | } |
402 | 439 | ||
@@ -411,9 +448,9 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) | |||
411 | continue; | 448 | continue; |
412 | if (phy_info_cmp->port_details == port_details ) | 449 | if (phy_info_cmp->port_details == port_details ) |
413 | continue; | 450 | continue; |
414 | dsaswideprintk(ioc, printk(KERN_DEBUG | 451 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
415 | "\t\tphy_id=%d sas_address=0x%018llX\n", | 452 | "\t\tphy_id=%d sas_address=0x%018llX\n", |
416 | j, (unsigned long long) | 453 | ioc->name, j, (unsigned long long) |
417 | phy_info_cmp->attached.sas_address)); | 454 | phy_info_cmp->attached.sas_address)); |
418 | if (phy_info_cmp->port_details) { | 455 | if (phy_info_cmp->port_details) { |
419 | port_details->rphy = | 456 | port_details->rphy = |
@@ -445,15 +482,15 @@ mptsas_setup_wide_ports(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info) | |||
445 | port_details = port_info->phy_info[i].port_details; | 482 | port_details = port_info->phy_info[i].port_details; |
446 | if (!port_details) | 483 | if (!port_details) |
447 | continue; | 484 | continue; |
448 | dsaswideprintk(ioc, printk(KERN_DEBUG | 485 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
449 | "%s: [%p]: phy_id=%02d num_phys=%02d " | 486 | "%s: [%p]: phy_id=%02d num_phys=%02d " |
450 | "bitmask=0x%016llX\n", __FUNCTION__, | 487 | "bitmask=0x%016llX\n", ioc->name, __FUNCTION__, |
451 | port_details, i, port_details->num_phys, | 488 | port_details, i, port_details->num_phys, |
452 | (unsigned long long)port_details->phy_bitmask)); | 489 | (unsigned long long)port_details->phy_bitmask)); |
453 | dsaswideprintk(ioc, printk(KERN_DEBUG"\t\tport = %p rphy=%p\n", | 490 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "\t\tport = %p rphy=%p\n", |
454 | port_details->port, port_details->rphy)); | 491 | ioc->name, port_details->port, port_details->rphy)); |
455 | } | 492 | } |
456 | dsaswideprintk(ioc, printk(KERN_DEBUG"\n")); | 493 | dsaswideprintk(ioc, printk("\n")); |
457 | mutex_unlock(&ioc->sas_topology_mutex); | 494 | mutex_unlock(&ioc->sas_topology_mutex); |
458 | } | 495 | } |
459 | 496 | ||
@@ -1129,10 +1166,8 @@ static int mptsas_phy_reset(struct sas_phy *phy, int hard_reset) | |||
1129 | /* process the completed Reply Message Frame */ | 1166 | /* process the completed Reply Message Frame */ |
1130 | reply = (SasIoUnitControlReply_t *)ioc->sas_mgmt.reply; | 1167 | reply = (SasIoUnitControlReply_t *)ioc->sas_mgmt.reply; |
1131 | if (reply->IOCStatus != MPI_IOCSTATUS_SUCCESS) { | 1168 | if (reply->IOCStatus != MPI_IOCSTATUS_SUCCESS) { |
1132 | printk("%s: IOCStatus=0x%X IOCLogInfo=0x%X\n", | 1169 | printk(MYIOC_s_INFO_FMT "%s: IOCStatus=0x%X IOCLogInfo=0x%X\n", |
1133 | __FUNCTION__, | 1170 | ioc->name, __FUNCTION__, reply->IOCStatus, reply->IOCLogInfo); |
1134 | reply->IOCStatus, | ||
1135 | reply->IOCLogInfo); | ||
1136 | error = -ENXIO; | 1171 | error = -ENXIO; |
1137 | goto out_unlock; | 1172 | goto out_unlock; |
1138 | } | 1173 | } |
@@ -1218,16 +1253,16 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1218 | u64 sas_address = 0; | 1253 | u64 sas_address = 0; |
1219 | 1254 | ||
1220 | if (!rsp) { | 1255 | if (!rsp) { |
1221 | printk(KERN_ERR "%s: the smp response space is missing\n", | 1256 | printk(MYIOC_s_ERR_FMT "%s: the smp response space is missing\n", |
1222 | __FUNCTION__); | 1257 | ioc->name, __FUNCTION__); |
1223 | return -EINVAL; | 1258 | return -EINVAL; |
1224 | } | 1259 | } |
1225 | 1260 | ||
1226 | /* do we need to support multiple segments? */ | 1261 | /* do we need to support multiple segments? */ |
1227 | if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) { | 1262 | if (req->bio->bi_vcnt > 1 || rsp->bio->bi_vcnt > 1) { |
1228 | printk(KERN_ERR "%s: multiple segments req %u %u, rsp %u %u\n", | 1263 | printk(MYIOC_s_ERR_FMT "%s: multiple segments req %u %u, rsp %u %u\n", |
1229 | __FUNCTION__, req->bio->bi_vcnt, req->data_len, | 1264 | ioc->name, __FUNCTION__, req->bio->bi_vcnt, req->data_len, |
1230 | rsp->bio->bi_vcnt, rsp->data_len); | 1265 | rsp->bio->bi_vcnt, rsp->data_len); |
1231 | return -EINVAL; | 1266 | return -EINVAL; |
1232 | } | 1267 | } |
1233 | 1268 | ||
@@ -1292,7 +1327,7 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1292 | 1327 | ||
1293 | timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ); | 1328 | timeleft = wait_for_completion_timeout(&ioc->sas_mgmt.done, 10 * HZ); |
1294 | if (!timeleft) { | 1329 | if (!timeleft) { |
1295 | printk(KERN_ERR "%s: smp timeout!\n", __FUNCTION__); | 1330 | printk(MYIOC_s_ERR_FMT "%s: smp timeout!\n", ioc->name, __FUNCTION__); |
1296 | /* On timeout reset the board */ | 1331 | /* On timeout reset the board */ |
1297 | mpt_HardResetHandler(ioc, CAN_SLEEP); | 1332 | mpt_HardResetHandler(ioc, CAN_SLEEP); |
1298 | ret = -ETIMEDOUT; | 1333 | ret = -ETIMEDOUT; |
@@ -1307,8 +1342,8 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy, | |||
1307 | memcpy(req->sense, smprep, sizeof(*smprep)); | 1342 | memcpy(req->sense, smprep, sizeof(*smprep)); |
1308 | req->sense_len = sizeof(*smprep); | 1343 | req->sense_len = sizeof(*smprep); |
1309 | } else { | 1344 | } else { |
1310 | printk(KERN_ERR "%s: smp passthru reply failed to be returned\n", | 1345 | printk(MYIOC_s_ERR_FMT "%s: smp passthru reply failed to be returned\n", |
1311 | __FUNCTION__); | 1346 | ioc->name, __FUNCTION__); |
1312 | ret = -ENXIO; | 1347 | ret = -ENXIO; |
1313 | } | 1348 | } |
1314 | unmap: | 1349 | unmap: |
@@ -1952,12 +1987,12 @@ static int mptsas_probe_one_phy(struct device *dev, | |||
1952 | goto out; | 1987 | goto out; |
1953 | } | 1988 | } |
1954 | mptsas_set_port(ioc, phy_info, port); | 1989 | mptsas_set_port(ioc, phy_info, port); |
1955 | dsaswideprintk(ioc, printk(KERN_DEBUG | 1990 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT |
1956 | "sas_port_alloc: port=%p dev=%p port_id=%d\n", | 1991 | "sas_port_alloc: port=%p dev=%p port_id=%d\n", |
1957 | port, dev, port->port_identifier)); | 1992 | ioc->name, port, dev, port->port_identifier)); |
1958 | } | 1993 | } |
1959 | dsaswideprintk(ioc, printk(KERN_DEBUG "sas_port_add_phy: phy_id=%d\n", | 1994 | dsaswideprintk(ioc, printk(MYIOC_s_DEBUG_FMT "sas_port_add_phy: phy_id=%d\n", |
1960 | phy_info->phy_id)); | 1995 | ioc->name, phy_info->phy_id)); |
1961 | sas_port_add_phy(port, phy_info->phy); | 1996 | sas_port_add_phy(port, phy_info->phy); |
1962 | phy_info->sas_port_add_phy = 0; | 1997 | phy_info->sas_port_add_phy = 0; |
1963 | } | 1998 | } |
@@ -2259,8 +2294,8 @@ mptsas_delete_expander_phys(MPT_ADAPTER *ioc) | |||
2259 | expander_sas_address) | 2294 | expander_sas_address) |
2260 | continue; | 2295 | continue; |
2261 | dsaswideprintk(ioc, | 2296 | dsaswideprintk(ioc, |
2262 | dev_printk(KERN_DEBUG, &port->dev, | 2297 | dev_printk(MYIOC_s_DEBUG_FMT, &port->dev, |
2263 | "delete port (%d)\n", port->port_identifier)); | 2298 | "delete port (%d)\n", ioc->name, port->port_identifier)); |
2264 | sas_port_delete(port); | 2299 | sas_port_delete(port); |
2265 | mptsas_port_delete(ioc, phy_info->port_details); | 2300 | mptsas_port_delete(ioc, phy_info->port_details); |
2266 | } | 2301 | } |
@@ -2503,7 +2538,7 @@ mptsas_adding_inactive_raid_components(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
2503 | 2538 | ||
2504 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); | 2539 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); |
2505 | if (!ev) { | 2540 | if (!ev) { |
2506 | printk(KERN_WARNING "mptsas: lost hotplug event\n"); | 2541 | printk(MYIOC_s_WARN_FMT "mptsas: lost hotplug event\n", ioc->name); |
2507 | goto out; | 2542 | goto out; |
2508 | } | 2543 | } |
2509 | 2544 | ||
@@ -2644,8 +2679,8 @@ mptsas_hotplug_work(struct work_struct *work) | |||
2644 | printk(MYIOC_s_INFO_FMT | 2679 | printk(MYIOC_s_INFO_FMT |
2645 | "removing %s device, channel %d, id %d, phy %d\n", | 2680 | "removing %s device, channel %d, id %d, phy %d\n", |
2646 | ioc->name, ds, ev->channel, ev->id, phy_info->phy_id); | 2681 | ioc->name, ds, ev->channel, ev->id, phy_info->phy_id); |
2647 | dev_printk(KERN_DEBUG, &port->dev, | 2682 | dev_printk(MYIOC_s_DEBUG_FMT, &port->dev, |
2648 | "delete port (%d)\n", port->port_identifier); | 2683 | "delete port (%d)\n", ioc->name, port->port_identifier); |
2649 | sas_port_delete(port); | 2684 | sas_port_delete(port); |
2650 | mptsas_port_delete(ioc, phy_info->port_details); | 2685 | mptsas_port_delete(ioc, phy_info->port_details); |
2651 | break; | 2686 | break; |
@@ -2686,8 +2721,8 @@ mptsas_hotplug_work(struct work_struct *work) | |||
2686 | 2721 | ||
2687 | if (!vtarget) { | 2722 | if (!vtarget) { |
2688 | dfailprintk(ioc, printk(MYIOC_s_ERR_FMT | 2723 | dfailprintk(ioc, printk(MYIOC_s_ERR_FMT |
2689 | "%s: exit at line=%d\n", ioc->name, | 2724 | "%s: exit at line=%d\n", ioc->name, |
2690 | __FUNCTION__, __LINE__)); | 2725 | __FUNCTION__, __LINE__)); |
2691 | break; | 2726 | break; |
2692 | } | 2727 | } |
2693 | /* | 2728 | /* |
@@ -2820,7 +2855,7 @@ mptsas_send_sas_event(MPT_ADAPTER *ioc, | |||
2820 | case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: | 2855 | case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: |
2821 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); | 2856 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); |
2822 | if (!ev) { | 2857 | if (!ev) { |
2823 | printk(KERN_WARNING "mptsas: lost hotplug event\n"); | 2858 | printk(MYIOC_s_WARN_FMT "lost hotplug event\n", ioc->name); |
2824 | break; | 2859 | break; |
2825 | } | 2860 | } |
2826 | 2861 | ||
@@ -2879,7 +2914,7 @@ mptsas_send_raid_event(MPT_ADAPTER *ioc, | |||
2879 | 2914 | ||
2880 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); | 2915 | ev = kzalloc(sizeof(*ev), GFP_ATOMIC); |
2881 | if (!ev) { | 2916 | if (!ev) { |
2882 | printk(KERN_WARNING "mptsas: lost hotplug event\n"); | 2917 | printk(MYIOC_s_WARN_FMT "lost hotplug event\n", ioc->name); |
2883 | return; | 2918 | return; |
2884 | } | 2919 | } |
2885 | 2920 | ||
@@ -3230,8 +3265,8 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
3230 | 3265 | ||
3231 | error = scsi_add_host(sh, &ioc->pcidev->dev); | 3266 | error = scsi_add_host(sh, &ioc->pcidev->dev); |
3232 | if (error) { | 3267 | if (error) { |
3233 | dprintk(ioc, printk(KERN_ERR MYNAM | 3268 | dprintk(ioc, printk(MYIOC_s_ERR_FMT |
3234 | "scsi_add_host failed\n")); | 3269 | "scsi_add_host failed\n", ioc->name)); |
3235 | goto out_mptsas_probe; | 3270 | goto out_mptsas_probe; |
3236 | } | 3271 | } |
3237 | 3272 | ||