diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2005-08-26 22:08:00 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-09-04 20:53:02 -0400 |
commit | 7524f9b9e72cd36f0a70defcd424eba81c180f42 (patch) | |
tree | bca4f0b98ae82020f001a1681954624c761c2865 | |
parent | c6678e0cfb41b029c3600c54b5bb65954de1230a (diff) |
[SCSI] qla2xxx: Use dma_get_required_mask() in determining the 'ideal' DMA mask.
In order to efficiently utilise the ISP's IOCB
request-queue, use the dma_get_required_mask() function to
determine the use of command-type 2 or 3 IOCBs when queueing
SCSI commands. This applies to ISP2[123]xx chips only, as
the ISP24xx uses command-type 7 IOCBs which use 64bit DSDs.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 9000659bfbcf..995e521b07de 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1113,36 +1113,23 @@ qla2xxx_slave_destroy(struct scsi_device *sdev) | |||
1113 | static void | 1113 | static void |
1114 | qla2x00_config_dma_addressing(scsi_qla_host_t *ha) | 1114 | qla2x00_config_dma_addressing(scsi_qla_host_t *ha) |
1115 | { | 1115 | { |
1116 | /* Assume 32bit DMA address */ | 1116 | /* Assume a 32bit DMA mask. */ |
1117 | ha->flags.enable_64bit_addressing = 0; | 1117 | ha->flags.enable_64bit_addressing = 0; |
1118 | 1118 | ||
1119 | /* | 1119 | if (!dma_set_mask(&ha->pdev->dev, DMA_64BIT_MASK)) { |
1120 | * Given the two variants pci_set_dma_mask(), allow the compiler to | 1120 | /* Any upper-dword bits set? */ |
1121 | * assist in setting the proper dma mask. | 1121 | if (MSD(dma_get_required_mask(&ha->pdev->dev)) && |
1122 | */ | 1122 | !pci_set_consistent_dma_mask(ha->pdev, DMA_64BIT_MASK)) { |
1123 | if (sizeof(dma_addr_t) > 4) { | 1123 | /* Ok, a 64bit DMA mask is applicable. */ |
1124 | if (pci_set_dma_mask(ha->pdev, DMA_64BIT_MASK) == 0) { | ||
1125 | ha->flags.enable_64bit_addressing = 1; | 1124 | ha->flags.enable_64bit_addressing = 1; |
1126 | ha->isp_ops.calc_req_entries = qla2x00_calc_iocbs_64; | 1125 | ha->isp_ops.calc_req_entries = qla2x00_calc_iocbs_64; |
1127 | ha->isp_ops.build_iocbs = qla2x00_build_scsi_iocbs_64; | 1126 | ha->isp_ops.build_iocbs = qla2x00_build_scsi_iocbs_64; |
1128 | 1127 | return; | |
1129 | if (pci_set_consistent_dma_mask(ha->pdev, | ||
1130 | DMA_64BIT_MASK)) { | ||
1131 | qla_printk(KERN_DEBUG, ha, | ||
1132 | "Failed to set 64 bit PCI consistent mask; " | ||
1133 | "using 32 bit.\n"); | ||
1134 | pci_set_consistent_dma_mask(ha->pdev, | ||
1135 | DMA_32BIT_MASK); | ||
1136 | } | ||
1137 | } else { | ||
1138 | qla_printk(KERN_DEBUG, ha, | ||
1139 | "Failed to set 64 bit PCI DMA mask, falling back " | ||
1140 | "to 32 bit MASK.\n"); | ||
1141 | pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK); | ||
1142 | } | 1128 | } |
1143 | } else { | ||
1144 | pci_set_dma_mask(ha->pdev, DMA_32BIT_MASK); | ||
1145 | } | 1129 | } |
1130 | |||
1131 | dma_set_mask(&ha->pdev->dev, DMA_32BIT_MASK); | ||
1132 | pci_set_consistent_dma_mask(ha->pdev, DMA_32BIT_MASK); | ||
1146 | } | 1133 | } |
1147 | 1134 | ||
1148 | static int | 1135 | static int |