Commit e0e0747d authored by Sreekanth Reddy's avatar Sreekanth Reddy Committed by Martin K. Petersen
Browse files

scsi: mpt3sas: Fix return value check of dma_get_required_mask()

Fix the incorrect return value check of dma_get_required_mask().  Due to
this incorrect check, the driver was always setting the DMA mask to 63 bit.

Link: https://lore.kernel.org/r/20220913120538.18759-2-sreekanth.reddy@broadcom.com


Fixes: ba27c5cf ("scsi: mpt3sas: Don't change the DMA coherent mask after allocations")
Signed-off-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 601be20f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2993,7 +2993,7 @@ _base_config_dma_addressing(struct MPT3SAS_ADAPTER *ioc, struct pci_dev *pdev)

	if (ioc->is_mcpu_endpoint ||
	    sizeof(dma_addr_t) == 4 || ioc->use_32bit_dma ||
	    dma_get_required_mask(&pdev->dev) <= 32)
	    dma_get_required_mask(&pdev->dev) <= DMA_BIT_MASK(32))
		ioc->dma_mask = 32;
	/* Set 63 bit DMA mask for all SAS3 and SAS35 controllers */
	else if (ioc->hba_mpi_version_belonged > MPI2_VERSION)