hisi_sas: Set dev DMA mask
authorJohn Garry <john.garry@huawei.com>
Tue, 17 Nov 2015 16:50:39 +0000 (00:50 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 26 Nov 2015 03:12:56 +0000 (22:12 -0500)
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_main.c

index 8cd1b551abb6a6c23c8bc7770c448e1565c1765f..d7d9516385a7f931849865dedd332d552ab8512d 100644 (file)
@@ -311,6 +311,14 @@ int hisi_sas_probe(struct platform_device *pdev,
        sha = SHOST_TO_SAS_HA(shost);
        hisi_hba = shost_priv(shost);
        platform_set_drvdata(pdev, sha);
+
+       if (dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)) &&
+           dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32))) {
+               dev_err(dev, "No usable DMA addressing method\n");
+               rc = -EIO;
+               goto err_out_ha;
+       }
+
        phy_nr = port_nr = hisi_hba->n_phy;
 
        arr_phy = devm_kcalloc(dev, phy_nr, sizeof(void *), GFP_KERNEL);