diff options
author | Sreekanth Reddy <sreekanth.reddy@avagotech.com> | 2015-11-11 07:00:28 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2015-11-11 18:56:10 -0500 |
commit | 7786ab6aff9cea97eb0a8d67705c68e97a664bf3 (patch) | |
tree | 32a590d09b52e29d5f4a75162abb4aa12c4caff2 /drivers/scsi/mpt3sas/mpt3sas_base.c | |
parent | 16e179bda58f0931854a669c9a70fd9139015899 (diff) |
mpt3sas: Ported WarpDrive product SSS6200 support
Ported the following list of WarpDrive-specific patches:
1. commit 0bdccdb0a090ad8dc5f851cad5e843244c410ee8 ("mpt2sas: WarpDrive
New product SSS6200 support added")
2. commit 82a452581230b3ffc9d6475dffdb2568497b5fec ("mpt2sas: WarpDrive
Infinite command retries due to wrong scsi command entry in MPI
message")
3. commit ba96bd0b1d4a4e11f23671e1f375a5c8f46b0fe7 ("mpt2sas: Support
for greater than 2TB capacity WarpDrive")
4. commit 4da7af9494b2f98a1503a2634059300c3e4615e6 ("mpt2sas: Do not
retry a timed out direct IO for Warpdrive")
5. commit daeaa9df92bd742f4e6d4d6039d689277a8e31bd ("mpt2sas: Avoid type
casting for direct I/O commands").
Also set the mpt2_ioctl_iocinfo adapter_type to:
1. MPT3_IOCTL_INTERFACE_SAS3 for Gen3 HBAs
2. MPT2_IOCTL_INTERFACE_SAS2_SSS6200 for Warp Drive
3. MPT2_IOCTL_INTERFACE_SAS2 for other Gen2 HBAs
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>
Diffstat (limited to 'drivers/scsi/mpt3sas/mpt3sas_base.c')
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_base.c | 68 |
1 files changed, 61 insertions, 7 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index b5b1eb260750..f7f2ab5ecc4f 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c | |||
@@ -593,7 +593,8 @@ _base_display_event_data(struct MPT3SAS_ADAPTER *ioc, | |||
593 | desc = "Device Status Change"; | 593 | desc = "Device Status Change"; |
594 | break; | 594 | break; |
595 | case MPI2_EVENT_IR_OPERATION_STATUS: | 595 | case MPI2_EVENT_IR_OPERATION_STATUS: |
596 | desc = "IR Operation Status"; | 596 | if (!ioc->hide_ir_msg) |
597 | desc = "IR Operation Status"; | ||
597 | break; | 598 | break; |
598 | case MPI2_EVENT_SAS_DISCOVERY: | 599 | case MPI2_EVENT_SAS_DISCOVERY: |
599 | { | 600 | { |
@@ -624,16 +625,20 @@ _base_display_event_data(struct MPT3SAS_ADAPTER *ioc, | |||
624 | desc = "SAS Enclosure Device Status Change"; | 625 | desc = "SAS Enclosure Device Status Change"; |
625 | break; | 626 | break; |
626 | case MPI2_EVENT_IR_VOLUME: | 627 | case MPI2_EVENT_IR_VOLUME: |
627 | desc = "IR Volume"; | 628 | if (!ioc->hide_ir_msg) |
629 | desc = "IR Volume"; | ||
628 | break; | 630 | break; |
629 | case MPI2_EVENT_IR_PHYSICAL_DISK: | 631 | case MPI2_EVENT_IR_PHYSICAL_DISK: |
630 | desc = "IR Physical Disk"; | 632 | if (!ioc->hide_ir_msg) |
633 | desc = "IR Physical Disk"; | ||
631 | break; | 634 | break; |
632 | case MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST: | 635 | case MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST: |
633 | desc = "IR Configuration Change List"; | 636 | if (!ioc->hide_ir_msg) |
637 | desc = "IR Configuration Change List"; | ||
634 | break; | 638 | break; |
635 | case MPI2_EVENT_LOG_ENTRY_ADDED: | 639 | case MPI2_EVENT_LOG_ENTRY_ADDED: |
636 | desc = "Log Entry Added"; | 640 | if (!ioc->hide_ir_msg) |
641 | desc = "Log Entry Added"; | ||
637 | break; | 642 | break; |
638 | case MPI2_EVENT_TEMP_THRESHOLD: | 643 | case MPI2_EVENT_TEMP_THRESHOLD: |
639 | desc = "Temperature Threshold"; | 644 | desc = "Temperature Threshold"; |
@@ -689,7 +694,10 @@ _base_sas_log_info(struct MPT3SAS_ADAPTER *ioc , u32 log_info) | |||
689 | originator_str = "PL"; | 694 | originator_str = "PL"; |
690 | break; | 695 | break; |
691 | case 2: | 696 | case 2: |
692 | originator_str = "IR"; | 697 | if (!ioc->hide_ir_msg) |
698 | originator_str = "IR"; | ||
699 | else | ||
700 | originator_str = "WarpDrive"; | ||
693 | break; | 701 | break; |
694 | } | 702 | } |
695 | 703 | ||
@@ -1023,6 +1031,12 @@ _base_interrupt(int irq, void *bus_id) | |||
1023 | } | 1031 | } |
1024 | 1032 | ||
1025 | wmb(); | 1033 | wmb(); |
1034 | if (ioc->is_warpdrive) { | ||
1035 | writel(reply_q->reply_post_host_index, | ||
1036 | ioc->reply_post_host_index[msix_index]); | ||
1037 | atomic_dec(&reply_q->busy); | ||
1038 | return IRQ_HANDLED; | ||
1039 | } | ||
1026 | 1040 | ||
1027 | /* Update Reply Post Host Index. | 1041 | /* Update Reply Post Host Index. |
1028 | * For those HBA's which support combined reply queue feature | 1042 | * For those HBA's which support combined reply queue feature |
@@ -2333,6 +2347,7 @@ mpt3sas_base_free_smid(struct MPT3SAS_ADAPTER *ioc, u16 smid) | |||
2333 | } | 2347 | } |
2334 | ioc->scsi_lookup[i].cb_idx = 0xFF; | 2348 | ioc->scsi_lookup[i].cb_idx = 0xFF; |
2335 | ioc->scsi_lookup[i].scmd = NULL; | 2349 | ioc->scsi_lookup[i].scmd = NULL; |
2350 | ioc->scsi_lookup[i].direct_io = 0; | ||
2336 | list_add(&ioc->scsi_lookup[i].tracker_list, &ioc->free_list); | 2351 | list_add(&ioc->scsi_lookup[i].tracker_list, &ioc->free_list); |
2337 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); | 2352 | spin_unlock_irqrestore(&ioc->scsi_lookup_lock, flags); |
2338 | 2353 | ||
@@ -2683,10 +2698,12 @@ _base_display_ioc_capabilities(struct MPT3SAS_ADAPTER *ioc) | |||
2683 | pr_info("), "); | 2698 | pr_info("), "); |
2684 | pr_info("Capabilities=("); | 2699 | pr_info("Capabilities=("); |
2685 | 2700 | ||
2686 | if (ioc->facts.IOCCapabilities & | 2701 | if (!ioc->hide_ir_msg) { |
2702 | if (ioc->facts.IOCCapabilities & | ||
2687 | MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID) { | 2703 | MPI2_IOCFACTS_CAPABILITY_INTEGRATED_RAID) { |
2688 | pr_info("Raid"); | 2704 | pr_info("Raid"); |
2689 | i++; | 2705 | i++; |
2706 | } | ||
2690 | } | 2707 | } |
2691 | 2708 | ||
2692 | if (ioc->facts.IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR) { | 2709 | if (ioc->facts.IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR) { |
@@ -4834,6 +4851,7 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
4834 | u32 reply_address; | 4851 | u32 reply_address; |
4835 | u16 smid; | 4852 | u16 smid; |
4836 | struct _tr_list *delayed_tr, *delayed_tr_next; | 4853 | struct _tr_list *delayed_tr, *delayed_tr_next; |
4854 | u8 hide_flag; | ||
4837 | struct adapter_reply_queue *reply_q; | 4855 | struct adapter_reply_queue *reply_q; |
4838 | long reply_post_free; | 4856 | long reply_post_free; |
4839 | u32 reply_post_free_sz, index = 0; | 4857 | u32 reply_post_free_sz, index = 0; |
@@ -4864,6 +4882,7 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
4864 | ioc->scsi_lookup[i].cb_idx = 0xFF; | 4882 | ioc->scsi_lookup[i].cb_idx = 0xFF; |
4865 | ioc->scsi_lookup[i].smid = smid; | 4883 | ioc->scsi_lookup[i].smid = smid; |
4866 | ioc->scsi_lookup[i].scmd = NULL; | 4884 | ioc->scsi_lookup[i].scmd = NULL; |
4885 | ioc->scsi_lookup[i].direct_io = 0; | ||
4867 | list_add_tail(&ioc->scsi_lookup[i].tracker_list, | 4886 | list_add_tail(&ioc->scsi_lookup[i].tracker_list, |
4868 | &ioc->free_list); | 4887 | &ioc->free_list); |
4869 | } | 4888 | } |
@@ -4966,6 +4985,16 @@ _base_make_ioc_operational(struct MPT3SAS_ADAPTER *ioc, int sleep_flag) | |||
4966 | 4985 | ||
4967 | 4986 | ||
4968 | if (ioc->is_driver_loading) { | 4987 | if (ioc->is_driver_loading) { |
4988 | |||
4989 | if (ioc->is_warpdrive && ioc->manu_pg10.OEMIdentifier | ||
4990 | == 0x80) { | ||
4991 | hide_flag = (u8) ( | ||
4992 | le32_to_cpu(ioc->manu_pg10.OEMSpecificFlags0) & | ||
4993 | MFG_PAGE10_HIDE_SSDS_MASK); | ||
4994 | if (hide_flag != MFG_PAGE10_HIDE_SSDS_MASK) | ||
4995 | ioc->mfg_pg10_hide_flag = hide_flag; | ||
4996 | } | ||
4997 | |||
4969 | ioc->wait_for_discovery_to_complete = | 4998 | ioc->wait_for_discovery_to_complete = |
4970 | _base_determine_wait_on_discovery(ioc); | 4999 | _base_determine_wait_on_discovery(ioc); |
4971 | 5000 | ||
@@ -5032,12 +5061,33 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) | |||
5032 | goto out_free_resources; | 5061 | goto out_free_resources; |
5033 | } | 5062 | } |
5034 | 5063 | ||
5064 | if (ioc->is_warpdrive) { | ||
5065 | ioc->reply_post_host_index = kcalloc(ioc->cpu_msix_table_sz, | ||
5066 | sizeof(resource_size_t *), GFP_KERNEL); | ||
5067 | if (!ioc->reply_post_host_index) { | ||
5068 | dfailprintk(ioc, pr_info(MPT3SAS_FMT "allocation " | ||
5069 | "for cpu_msix_table failed!!!\n", ioc->name)); | ||
5070 | r = -ENOMEM; | ||
5071 | goto out_free_resources; | ||
5072 | } | ||
5073 | } | ||
5074 | |||
5035 | ioc->rdpq_array_enable_assigned = 0; | 5075 | ioc->rdpq_array_enable_assigned = 0; |
5036 | ioc->dma_mask = 0; | 5076 | ioc->dma_mask = 0; |
5037 | r = mpt3sas_base_map_resources(ioc); | 5077 | r = mpt3sas_base_map_resources(ioc); |
5038 | if (r) | 5078 | if (r) |
5039 | goto out_free_resources; | 5079 | goto out_free_resources; |
5040 | 5080 | ||
5081 | if (ioc->is_warpdrive) { | ||
5082 | ioc->reply_post_host_index[0] = (resource_size_t __iomem *) | ||
5083 | &ioc->chip->ReplyPostHostIndex; | ||
5084 | |||
5085 | for (i = 1; i < ioc->cpu_msix_table_sz; i++) | ||
5086 | ioc->reply_post_host_index[i] = | ||
5087 | (resource_size_t __iomem *) | ||
5088 | ((u8 __iomem *)&ioc->chip->Doorbell + (0x4000 + ((i - 1) | ||
5089 | * 4))); | ||
5090 | } | ||
5041 | 5091 | ||
5042 | pci_set_drvdata(ioc->pdev, ioc->shost); | 5092 | pci_set_drvdata(ioc->pdev, ioc->shost); |
5043 | r = _base_get_ioc_facts(ioc, CAN_SLEEP); | 5093 | r = _base_get_ioc_facts(ioc, CAN_SLEEP); |
@@ -5189,6 +5239,8 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc) | |||
5189 | _base_release_memory_pools(ioc); | 5239 | _base_release_memory_pools(ioc); |
5190 | pci_set_drvdata(ioc->pdev, NULL); | 5240 | pci_set_drvdata(ioc->pdev, NULL); |
5191 | kfree(ioc->cpu_msix_table); | 5241 | kfree(ioc->cpu_msix_table); |
5242 | if (ioc->is_warpdrive) | ||
5243 | kfree(ioc->reply_post_host_index); | ||
5192 | kfree(ioc->pd_handles); | 5244 | kfree(ioc->pd_handles); |
5193 | kfree(ioc->blocking_handles); | 5245 | kfree(ioc->blocking_handles); |
5194 | kfree(ioc->tm_cmds.reply); | 5246 | kfree(ioc->tm_cmds.reply); |
@@ -5228,6 +5280,8 @@ mpt3sas_base_detach(struct MPT3SAS_ADAPTER *ioc) | |||
5228 | _base_release_memory_pools(ioc); | 5280 | _base_release_memory_pools(ioc); |
5229 | pci_set_drvdata(ioc->pdev, NULL); | 5281 | pci_set_drvdata(ioc->pdev, NULL); |
5230 | kfree(ioc->cpu_msix_table); | 5282 | kfree(ioc->cpu_msix_table); |
5283 | if (ioc->is_warpdrive) | ||
5284 | kfree(ioc->reply_post_host_index); | ||
5231 | kfree(ioc->pd_handles); | 5285 | kfree(ioc->pd_handles); |
5232 | kfree(ioc->blocking_handles); | 5286 | kfree(ioc->blocking_handles); |
5233 | kfree(ioc->pfacts); | 5287 | kfree(ioc->pfacts); |