Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mpt2sas, mpt3sas: Remove SCSI_MPTXSAS_LOGGING entry from Kconfig

Currently there is a logging level option provided for each of our
drivers in the kernel configuration utility. Users can enable this
option to get more verbose information. By default it is enabled.

Only when this option is enabled will the functions which display the
required information get compiled in.

As we are merging the both drivers we can no longer provide this
configuration option. Remove the SCSI_MPTXSAS_LOGGING entry from Kconfig
and unconditionally enable logging (by removing the #ifdef
CONFIG_SCSI_MPT3SAS_LOGGING preprocessor check conditions) so that all
functions which are defined to display more verbose information get
compiled in.

Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Sreekanth Reddy and committed by
Martin K. Petersen
af009411 d357e84d

+10 -83
-6
drivers/scsi/mpt2sas/Kconfig
··· 59 59 SAFE_PHYS_SEGMENTS. However, it may decreased down to 16. 60 60 Decreasing this parameter will reduce memory requirements 61 61 on a per controller instance. 62 - 63 - config SCSI_MPT2SAS_LOGGING 64 - bool "LSI MPT Fusion logging facility" 65 - depends on PCI && SCSI && SCSI_MPT2SAS 66 - ---help--- 67 - This turns on a logging facility.
-6
drivers/scsi/mpt3sas/Kconfig
··· 59 59 MAX_PHYS_SEGMENTS in most kernels. However in SuSE kernels this 60 60 can be 256. However, it may decreased down to 16. Decreasing this 61 61 parameter will reduce memory requirements on a per controller instance. 62 - 63 - config SCSI_MPT3SAS_LOGGING 64 - bool "LSI MPT Fusion logging facility" 65 - depends on PCI && SCSI && SCSI_MPT3SAS 66 - ---help--- 67 - This turns on a logging facility.
+4 -6
drivers/scsi/mpt3sas/mpt3sas_base.c
··· 324 324 panic("panic in %s\n", __func__); 325 325 } 326 326 327 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 328 327 /** 329 328 * _base_sas_ioc_info - verbose translation of the ioc status 330 329 * @ioc: per adapter object ··· 629 630 630 631 pr_info(MPT3SAS_FMT "%s\n", ioc->name, desc); 631 632 } 632 - #endif 633 633 634 634 /** 635 635 * _base_sas_log_info - verbose translation of firmware log info ··· 708 710 return; 709 711 } 710 712 ioc_status = le16_to_cpu(mpi_reply->IOCStatus); 711 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 713 + 712 714 if ((ioc_status & MPI2_IOCSTATUS_MASK) && 713 715 (ioc->logging_level & MPT_DEBUG_REPLY)) { 714 716 _base_sas_ioc_info(ioc , mpi_reply, 715 717 mpt3sas_base_get_msg_frame(ioc, smid)); 716 718 } 717 - #endif 719 + 718 720 if (ioc_status & MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE) { 719 721 loginfo = le32_to_cpu(mpi_reply->IOCLogInfo); 720 722 _base_sas_log_info(ioc, loginfo); ··· 781 783 return 1; 782 784 if (mpi_reply->Function != MPI2_FUNCTION_EVENT_NOTIFICATION) 783 785 return 1; 784 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 786 + 785 787 _base_display_event_data(ioc, mpi_reply); 786 - #endif 788 + 787 789 if (!(mpi_reply->AckRequired & MPI2_EVENT_NOTIFICATION_ACK_REQUIRED)) 788 790 goto out; 789 791 smid = mpt3sas_base_get_smid(ioc, ioc->base_cb_idx);
-6
drivers/scsi/mpt3sas/mpt3sas_config.c
··· 83 83 dma_addr_t page_dma; 84 84 }; 85 85 86 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 87 86 /** 88 87 * _config_display_some_debug - debug routine 89 88 * @ioc: per adapter object ··· 172 173 ioc->name, le16_to_cpu(mpi_reply->IOCStatus), 173 174 le32_to_cpu(mpi_reply->IOCLogInfo)); 174 175 } 175 - #endif 176 176 177 177 /** 178 178 * _config_alloc_config_dma_memory - obtain physical memory ··· 253 255 mpi_reply->MsgLength*4); 254 256 } 255 257 ioc->config_cmds.status &= ~MPT3_CMD_PENDING; 256 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 257 258 _config_display_some_debug(ioc, smid, "config_done", mpi_reply); 258 - #endif 259 259 ioc->config_cmds.smid = USHRT_MAX; 260 260 complete(&ioc->config_cmds.done); 261 261 return 1; ··· 383 387 config_request = mpt3sas_base_get_msg_frame(ioc, smid); 384 388 ioc->config_cmds.smid = smid; 385 389 memcpy(config_request, mpi_request, sizeof(Mpi2ConfigRequest_t)); 386 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 387 390 _config_display_some_debug(ioc, smid, "config_request", NULL); 388 - #endif 389 391 init_completion(&ioc->config_cmds.done); 390 392 mpt3sas_base_put_smid_default(ioc, smid); 391 393 timeleft = wait_for_completion_timeout(&ioc->config_cmds.done,
+1 -9
drivers/scsi/mpt3sas/mpt3sas_ctl.c
··· 78 78 BLOCKING, 79 79 }; 80 80 81 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 82 81 /** 83 82 * _ctl_sas_device_find_by_handle - sas device search 84 83 * @ioc: per adapter object ··· 253 254 } 254 255 } 255 256 256 - #endif 257 - 258 257 /** 259 258 * mpt3sas_ctl_done - ctl module completion routine 260 259 * @ioc: per adapter object ··· 299 302 } 300 303 } 301 304 } 302 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 303 305 _ctl_display_some_debug(ioc, smid, "ctl_done", mpi_reply); 304 - #endif 305 306 ioc->ctl_cmds.status &= ~MPT3_CMD_PENDING; 306 307 complete(&ioc->ctl_cmds.done); 307 308 return 1; ··· 754 759 psge = (void *)request + (karg.data_sge_offset*4); 755 760 756 761 /* send command to firmware */ 757 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 758 762 _ctl_display_some_debug(ioc, smid, "ctl_request", NULL); 759 - #endif 760 763 761 764 init_completion(&ioc->ctl_cmds.done); 762 765 switch (mpi_request->Function) { ··· 909 916 mpi_reply = ioc->ctl_cmds.reply; 910 917 ioc_status = le16_to_cpu(mpi_reply->IOCStatus) & MPI2_IOCSTATUS_MASK; 911 918 912 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 913 919 if (mpi_reply->Function == MPI2_FUNCTION_SCSI_TASK_MGMT && 914 920 (ioc->logging_level & MPT_DEBUG_TM)) { 915 921 Mpi2SCSITaskManagementReply_t *tm_reply = ··· 921 929 le32_to_cpu(tm_reply->IOCLogInfo), 922 930 le32_to_cpu(tm_reply->TerminationCount)); 923 931 } 924 - #endif 932 + 925 933 /* copy out xdata to user */ 926 934 if (data_in_sz) { 927 935 if (copy_to_user(karg.data_in_buf_ptr, data_in,
+1 -15
drivers/scsi/mpt3sas/mpt3sas_debug.h
··· 68 68 #define MPT_DEBUG_TRIGGER_DIAG 0x00200000 69 69 70 70 71 - /* 72 - * CONFIG_SCSI_MPT3SAS_LOGGING - enabled in Kconfig 73 - */ 74 - 75 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 76 71 #define MPT_CHECK_LOGGING(IOC, CMD, BITS) \ 77 72 { \ 78 73 if (IOC->logging_level & BITS) \ 79 74 CMD; \ 80 75 } 81 - #else 82 - #define MPT_CHECK_LOGGING(IOC, CMD, BITS) 83 - #endif /* CONFIG_SCSI_MPT3SAS_LOGGING */ 84 - 85 76 86 77 /* 87 78 * debug macros ··· 144 153 145 154 146 155 /* inline functions for dumping debug data*/ 147 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 156 + 148 157 /** 149 158 * _debug_dump_mf - print message frame contents 150 159 * @mpi_request: pointer to message frame ··· 202 211 } 203 212 pr_info("\n"); 204 213 } 205 - #else 206 - #define _debug_dump_mf(mpi_request, sz) 207 - #define _debug_dump_reply(mpi_request, sz) 208 - #define _debug_dump_config(mpi_request, sz) 209 - #endif /* CONFIG_SCSI_MPT3SAS_LOGGING */ 210 214 211 215 #endif /* MPT3SAS_DEBUG_H_INCLUDED */
+4 -35
drivers/scsi/mpt3sas/mpt3sas_scsih.c
··· 3624 3624 u16 smid; 3625 3625 u16 handle; 3626 3626 3627 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 3628 3627 if (ioc->logging_level & MPT_DEBUG_SCSI) 3629 3628 scsi_print_command(scmd); 3630 - #endif 3631 3629 3632 3630 sas_device_priv_data = scmd->device->hostdata; 3633 3631 if (!sas_device_priv_data || !sas_device_priv_data->sas_target) { ··· 3756 3758 } 3757 3759 } 3758 3760 3759 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 3760 3761 /** 3761 3762 * _scsih_scsi_ioc_info - translated non-succesfull SCSI_IO request 3762 3763 * @ioc: per adapter object ··· 3968 3971 _scsih_response_code(ioc, response_bytes[0]); 3969 3972 } 3970 3973 } 3971 - #endif 3972 3974 3973 3975 /** 3974 3976 * _scsih_turn_on_pfa_led - illuminate PFA LED ··· 4235 4239 le16_to_cpu(mpi_reply->DevHandle)); 4236 4240 mpt3sas_trigger_scsi(ioc, data.skey, data.asc, data.ascq); 4237 4241 4238 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 4239 4242 if (!(ioc->logging_level & MPT_DEBUG_REPLY) && 4240 4243 ((scmd->sense_buffer[2] == UNIT_ATTENTION) || 4241 4244 (scmd->sense_buffer[2] == MEDIUM_ERROR) || 4242 4245 (scmd->sense_buffer[2] == HARDWARE_ERROR))) 4243 4246 _scsih_scsi_ioc_info(ioc, scmd, mpi_reply, smid); 4244 - #endif 4245 4247 } 4246 4248 switch (ioc_status) { 4247 4249 case MPI2_IOCSTATUS_BUSY: ··· 4346 4352 4347 4353 } 4348 4354 4349 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 4350 4355 if (scmd->result && (ioc->logging_level & MPT_DEBUG_REPLY)) 4351 4356 _scsih_scsi_ioc_info(ioc , scmd, mpi_reply, smid); 4352 - #endif 4353 4357 4354 4358 out: 4355 4359 ··· 5144 5152 kfree(sas_device); 5145 5153 } 5146 5154 5147 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 5148 5155 /** 5149 5156 * _scsih_sas_topology_change_event_debug - debug for topology event 5150 5157 * @ioc: per adapter object ··· 5221 5230 5222 5231 } 5223 5232 } 5224 - #endif 5225 5233 5226 5234 /** 5227 5235 * _scsih_sas_topology_change_event - handle topology changes ··· 5245 5255 (Mpi2EventDataSasTopologyChangeList_t *) 5246 5256 fw_event->event_data; 5247 5257 5248 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 5249 5258 if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) 5250 5259 _scsih_sas_topology_change_event_debug(ioc, event_data); 5251 - #endif 5252 5260 5253 5261 if (ioc->shost_recovery || ioc->remove_host || ioc->pci_error_recovery) 5254 5262 return 0; ··· 5352 5364 return 0; 5353 5365 } 5354 5366 5355 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 5356 5367 /** 5357 5368 * _scsih_sas_device_status_change_event_debug - debug for device event 5358 5369 * @event_data: event data payload ··· 5419 5432 event_data->ASC, event_data->ASCQ); 5420 5433 pr_info("\n"); 5421 5434 } 5422 - #endif 5423 5435 5424 5436 /** 5425 5437 * _scsih_sas_device_status_change_event - handle device status change ··· 5440 5454 (Mpi2EventDataSasDeviceStatusChange_t *) 5441 5455 fw_event->event_data; 5442 5456 5443 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 5444 5457 if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) 5445 5458 _scsih_sas_device_status_change_event_debug(ioc, 5446 5459 event_data); 5447 - #endif 5448 5460 5449 5461 /* In MPI Revision K (0xC), the internal device reset complete was 5450 5462 * implemented, so avoid setting tm_busy flag for older firmware. ··· 5480 5496 spin_unlock_irqrestore(&ioc->sas_device_lock, flags); 5481 5497 } 5482 5498 5483 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 5484 5499 /** 5485 5500 * _scsih_sas_enclosure_dev_status_change_event_debug - debug for enclosure 5486 5501 * event ··· 5514 5531 (unsigned long long)le64_to_cpu(event_data->EnclosureLogicalID), 5515 5532 le16_to_cpu(event_data->StartSlot)); 5516 5533 } 5517 - #endif 5518 5534 5519 5535 /** 5520 5536 * _scsih_sas_enclosure_dev_status_change_event - handle enclosure events ··· 5527 5545 _scsih_sas_enclosure_dev_status_change_event(struct MPT3SAS_ADAPTER *ioc, 5528 5546 struct fw_event_work *fw_event) 5529 5547 { 5530 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 5531 5548 if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) 5532 5549 _scsih_sas_enclosure_dev_status_change_event_debug(ioc, 5533 5550 (Mpi2EventDataSasEnclDevStatusChange_t *) 5534 5551 fw_event->event_data); 5535 - #endif 5536 5552 } 5537 5553 5538 5554 /** ··· 5710 5730 Mpi2EventDataSasDiscovery_t *event_data = 5711 5731 (Mpi2EventDataSasDiscovery_t *) fw_event->event_data; 5712 5732 5713 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 5714 5733 if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) { 5715 5734 pr_info(MPT3SAS_FMT "discovery event: (%s)", ioc->name, 5716 5735 (event_data->ReasonCode == MPI2_EVENT_SAS_DISC_RC_STARTED) ? 5717 5736 "start" : "stop"); 5718 - if (event_data->DiscoveryStatus) 5719 - pr_info("discovery_status(0x%08x)", 5720 - le32_to_cpu(event_data->DiscoveryStatus)); 5721 - pr_info("\n"); 5737 + if (event_data->DiscoveryStatus) 5738 + pr_info("discovery_status(0x%08x)", 5739 + le32_to_cpu(event_data->DiscoveryStatus)); 5740 + pr_info("\n"); 5722 5741 } 5723 - #endif 5724 5742 5725 5743 if (event_data->ReasonCode == MPI2_EVENT_SAS_DISC_RC_STARTED && 5726 5744 !ioc->sas_hba.num_phys) { ··· 6095 6117 _scsih_add_device(ioc, handle, 0, 1); 6096 6118 } 6097 6119 6098 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 6099 6120 /** 6100 6121 * _scsih_sas_ir_config_change_event_debug - debug for IR Config Change events 6101 6122 * @ioc: per adapter object ··· 6174 6197 element->PhysDiskNum); 6175 6198 } 6176 6199 } 6177 - #endif 6178 6200 6179 6201 /** 6180 6202 * _scsih_sas_ir_config_change_event - handle ir configuration change events ··· 6194 6218 (Mpi2EventDataIrConfigChangeList_t *) 6195 6219 fw_event->event_data; 6196 6220 6197 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 6198 6221 if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) 6199 6222 _scsih_sas_ir_config_change_event_debug(ioc, event_data); 6200 - 6201 - #endif 6202 6223 6203 6224 foreign_config = (le32_to_cpu(event_data->Flags) & 6204 6225 MPI2_EVENT_IR_CHANGE_FLAGS_FOREIGN_CONFIG) ? 1 : 0; ··· 6408 6435 } 6409 6436 } 6410 6437 6411 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 6412 6438 /** 6413 6439 * _scsih_sas_ir_operation_status_event_debug - debug for IR op event 6414 6440 * @ioc: per adapter object ··· 6449 6477 le16_to_cpu(event_data->VolDevHandle), 6450 6478 event_data->PercentComplete); 6451 6479 } 6452 - #endif 6453 6480 6454 6481 /** 6455 6482 * _scsih_sas_ir_operation_status_event - handle RAID operation events ··· 6469 6498 unsigned long flags; 6470 6499 u16 handle; 6471 6500 6472 - #ifdef CONFIG_SCSI_MPT3SAS_LOGGING 6473 6501 if (ioc->logging_level & MPT_DEBUG_EVENT_WORK_TASK) 6474 6502 _scsih_sas_ir_operation_status_event_debug(ioc, 6475 6503 event_data); 6476 - #endif 6477 6504 6478 6505 /* code added for raid transport support */ 6479 6506 if (event_data->RAIDOperation == MPI2_EVENT_IR_RAIDOP_RESYNC) {