aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid/megaraid_sas_fusion.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 20:54:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-17 20:54:40 -0400
commitc55d267de274d308927b60c3e740c1a826832317 (patch)
tree21b53a8c725d9f9650f60d94b349459d5b8dae10 /drivers/scsi/megaraid/megaraid_sas_fusion.c
parent61ef46fd45c3c62dc7c880a45dd2aa841b9af8fb (diff)
parentbc898c97f7ba24def788d9f80786cf028a197122 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (170 commits) [SCSI] scsi_dh_rdac: Add MD36xxf into device list [SCSI] scsi_debug: add consecutive medium errors [SCSI] libsas: fix ata list corruption issue [SCSI] hpsa: export resettable host attribute [SCSI] hpsa: move device attributes to avoid forward declarations [SCSI] scsi_debug: Logical Block Provisioning (SBC3r26) [SCSI] sd: Logical Block Provisioning update [SCSI] Include protection operation in SCSI command trace [SCSI] hpsa: fix incorrect PCI IDs and add two new ones (2nd try) [SCSI] target: Fix volume size misreporting for volumes > 2TB [SCSI] bnx2fc: Broadcom FCoE offload driver [SCSI] fcoe: fix broken fcoe interface reset [SCSI] fcoe: precedence bug in fcoe_filter_frames() [SCSI] libfcoe: Remove stale fcoe-netdev entries [SCSI] libfcoe: Move FCOE_MTU definition from fcoe.h to libfcoe.h [SCSI] libfc: introduce __fc_fill_fc_hdr that accepts fc_hdr as an argument [SCSI] fcoe, libfc: initialize EM anchors list and then update npiv EMs [SCSI] Revert "[SCSI] libfc: fix exchange being deleted when the abort itself is timed out" [SCSI] libfc: Fixing a memory leak when destroying an interface [SCSI] megaraid_sas: Version and Changelog update ... Fix up trivial conflicts due to whitespace differences in drivers/scsi/libsas/{sas_ata.c,sas_scsi_host.c}
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas_fusion.c')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_fusion.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index d6e2a663b16..145a8cffb1f 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -81,6 +81,10 @@ u16 MR_TargetIdToLdGet(u32 ldTgtId, struct MR_FW_RAID_MAP_ALL *map);
81struct MR_LD_RAID *MR_LdRaidGet(u32 ld, struct MR_FW_RAID_MAP_ALL *map); 81struct MR_LD_RAID *MR_LdRaidGet(u32 ld, struct MR_FW_RAID_MAP_ALL *map);
82 82
83u16 MR_GetLDTgtId(u32 ld, struct MR_FW_RAID_MAP_ALL *map); 83u16 MR_GetLDTgtId(u32 ld, struct MR_FW_RAID_MAP_ALL *map);
84
85void
86megasas_check_and_restore_queue_depth(struct megasas_instance *instance);
87
84u8 MR_ValidateMapInfo(struct MR_FW_RAID_MAP_ALL *map, 88u8 MR_ValidateMapInfo(struct MR_FW_RAID_MAP_ALL *map,
85 struct LD_LOAD_BALANCE_INFO *lbInfo); 89 struct LD_LOAD_BALANCE_INFO *lbInfo);
86u16 get_updated_dev_handle(struct LD_LOAD_BALANCE_INFO *lbInfo, 90u16 get_updated_dev_handle(struct LD_LOAD_BALANCE_INFO *lbInfo,
@@ -983,13 +987,15 @@ megasas_init_adapter_fusion(struct megasas_instance *instance)
983 987
984 return 0; 988 return 0;
985 989
986fail_alloc_cmds:
987fail_alloc_mfi_cmds:
988fail_map_info: 990fail_map_info:
989 if (i == 1) 991 if (i == 1)
990 dma_free_coherent(&instance->pdev->dev, fusion->map_sz, 992 dma_free_coherent(&instance->pdev->dev, fusion->map_sz,
991 fusion->ld_map[0], fusion->ld_map_phys[0]); 993 fusion->ld_map[0], fusion->ld_map_phys[0]);
992fail_ioc_init: 994fail_ioc_init:
995 megasas_free_cmds_fusion(instance);
996fail_alloc_cmds:
997 megasas_free_cmds(instance);
998fail_alloc_mfi_cmds:
993 return 1; 999 return 1;
994} 1000}
995 1001
@@ -1431,8 +1437,7 @@ megasas_build_dcdb_fusion(struct megasas_instance *instance,
1431 local_map_ptr = fusion->ld_map[(instance->map_id & 1)]; 1437 local_map_ptr = fusion->ld_map[(instance->map_id & 1)];
1432 1438
1433 /* Check if this is a system PD I/O */ 1439 /* Check if this is a system PD I/O */
1434 if ((instance->pd_list[pd_index].driveState == MR_PD_STATE_SYSTEM) && 1440 if (instance->pd_list[pd_index].driveState == MR_PD_STATE_SYSTEM) {
1435 (instance->pd_list[pd_index].driveType == TYPE_DISK)) {
1436 io_request->Function = 0; 1441 io_request->Function = 0;
1437 io_request->DevHandle = 1442 io_request->DevHandle =
1438 local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl; 1443 local_map_ptr->raidMap.devHndlInfo[device_id].curDevHdl;
@@ -1455,7 +1460,7 @@ megasas_build_dcdb_fusion(struct megasas_instance *instance,
1455 MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); 1460 MEGASAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT);
1456 } 1461 }
1457 io_request->RaidContext.VirtualDiskTgtId = device_id; 1462 io_request->RaidContext.VirtualDiskTgtId = device_id;
1458 io_request->LUN[0] = scmd->device->lun; 1463 io_request->LUN[1] = scmd->device->lun;
1459 io_request->DataLength = scsi_bufflen(scmd); 1464 io_request->DataLength = scsi_bufflen(scmd);
1460} 1465}
1461 1466
@@ -1479,7 +1484,7 @@ megasas_build_io_fusion(struct megasas_instance *instance,
1479 device_id = MEGASAS_DEV_INDEX(instance, scp); 1484 device_id = MEGASAS_DEV_INDEX(instance, scp);
1480 1485
1481 /* Zero out some fields so they don't get reused */ 1486 /* Zero out some fields so they don't get reused */
1482 io_request->LUN[0] = 0; 1487 io_request->LUN[1] = 0;
1483 io_request->CDB.EEDP32.PrimaryReferenceTag = 0; 1488 io_request->CDB.EEDP32.PrimaryReferenceTag = 0;
1484 io_request->CDB.EEDP32.PrimaryApplicationTagMask = 0; 1489 io_request->CDB.EEDP32.PrimaryApplicationTagMask = 0;
1485 io_request->EEDPFlags = 0; 1490 io_request->EEDPFlags = 0;
@@ -1743,7 +1748,7 @@ complete_cmd_fusion(struct megasas_instance *instance)
1743 wmb(); 1748 wmb();
1744 writel(fusion->last_reply_idx, 1749 writel(fusion->last_reply_idx,
1745 &instance->reg_set->reply_post_host_index); 1750 &instance->reg_set->reply_post_host_index);
1746 1751 megasas_check_and_restore_queue_depth(instance);
1747 return IRQ_HANDLED; 1752 return IRQ_HANDLED;
1748} 1753}
1749 1754