diff options
author | Sumit.Saxena@lsi.com <Sumit.Saxena@lsi.com> | 2014-02-12 13:08:44 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2014-03-15 13:19:20 -0400 |
commit | 46de63e260c3fa3ff2b6810de2ebe7ed9a882995 (patch) | |
tree | a03504360b41ead2b3d4315503e4b4d902c4f478 /drivers/scsi/megaraid | |
parent | be26374beff8b4442b042033613055fae4b0a56e (diff) |
[SCSI] megaraid_sas: Set 32-bit DMA mask
If consistent DMA mask is set to 64 bit, fall back to 32bit DMA mask and 32bit consistent DMA mask.
64bit consistent DMA mask may be set on some 64bit DMA slot, which causes DMA offset "10000000000000" and
MFI_INIT and IOCTL frames will have high memory addresses, leads to firmware FAULT.
Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: Sumit Saxena <sumit.saxena@lsi.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 3cf97a388e4a..db58bbe4f952 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c | |||
@@ -4221,6 +4221,19 @@ megasas_set_dma_mask(struct pci_dev *pdev) | |||
4221 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) | 4221 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) |
4222 | goto fail_set_dma_mask; | 4222 | goto fail_set_dma_mask; |
4223 | } | 4223 | } |
4224 | /* | ||
4225 | * Ensure that all data structures are allocated in 32-bit | ||
4226 | * memory. | ||
4227 | */ | ||
4228 | if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) { | ||
4229 | /* Try 32bit DMA mask and 32 bit Consistent dma mask */ | ||
4230 | if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) | ||
4231 | && !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) | ||
4232 | dev_info(&pdev->dev, "set 32bit DMA mask" | ||
4233 | "and 32 bit consistent mask\n"); | ||
4234 | else | ||
4235 | goto fail_set_dma_mask; | ||
4236 | } | ||
4224 | 4237 | ||
4225 | return 0; | 4238 | return 0; |
4226 | 4239 | ||