aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ufs/ufshcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.c')
-rw-r--r--drivers/scsi/ufs/ufshcd.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index af1bffc1eac8..d41233914336 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -3259,6 +3259,22 @@ void ufshcd_remove(struct ufs_hba *hba)
3259EXPORT_SYMBOL_GPL(ufshcd_remove); 3259EXPORT_SYMBOL_GPL(ufshcd_remove);
3260 3260
3261/** 3261/**
3262 * ufshcd_set_dma_mask - Set dma mask based on the controller
3263 * addressing capability
3264 * @hba: per adapter instance
3265 *
3266 * Returns 0 for success, non-zero for failure
3267 */
3268static int ufshcd_set_dma_mask(struct ufs_hba *hba)
3269{
3270 if (hba->capabilities & MASK_64_ADDRESSING_SUPPORT) {
3271 if (!dma_set_mask_and_coherent(hba->dev, DMA_BIT_MASK(64)))
3272 return 0;
3273 }
3274 return dma_set_mask_and_coherent(hba->dev, DMA_BIT_MASK(32));
3275}
3276
3277/**
3262 * ufshcd_init - Driver initialization routine 3278 * ufshcd_init - Driver initialization routine
3263 * @dev: pointer to device handle 3279 * @dev: pointer to device handle
3264 * @hba_handle: driver private handle 3280 * @hba_handle: driver private handle
@@ -3309,6 +3325,12 @@ int ufshcd_init(struct device *dev, struct ufs_hba **hba_handle,
3309 /* Get Interrupt bit mask per version */ 3325 /* Get Interrupt bit mask per version */
3310 hba->intr_mask = ufshcd_get_intr_mask(hba); 3326 hba->intr_mask = ufshcd_get_intr_mask(hba);
3311 3327
3328 err = ufshcd_set_dma_mask(hba);
3329 if (err) {
3330 dev_err(hba->dev, "set dma mask failed\n");
3331 goto out_disable;
3332 }
3333
3312 /* Allocate memory for host memory space */ 3334 /* Allocate memory for host memory space */
3313 err = ufshcd_memory_alloc(hba); 3335 err = ufshcd_memory_alloc(hba);
3314 if (err) { 3336 if (err) {