ANDROID: scsi: ufs: core: Add 36-bit DMA addressing support

Add support for 36-bit DMA addressing. This CL has the prefix "ANDROID:"
because a more flexible solution will be proposed for inclusion in the
upstream Linux kernel.

Bug: 368427699
Bug: 369330025
Change-Id: I2c062e176d0a6432af5f0b69c2622f9f8bd2adc2
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
Bart Van Assche 2024-09-23 09:44:39 -07:00
parent 9b212a6305
commit 96533d6ac8
2 changed files with 8 additions and 0 deletions

View File

@ -10322,6 +10322,8 @@ EXPORT_SYMBOL_GPL(ufshcd_dealloc_host);
*/
static int ufshcd_set_dma_mask(struct ufs_hba *hba)
{
if (hba->android_quirks & UFSHCD_ANDROID_QUIRK_36BIT_ADDRESS_DMA)
return dma_set_mask_and_coherent(hba->dev, DMA_BIT_MASK(36));
if (hba->capabilities & MASK_64_ADDRESSING_SUPPORT) {
if (!dma_set_mask_and_coherent(hba->dev, DMA_BIT_MASK(64)))
return 0;

View File

@ -685,6 +685,12 @@ enum ufshcd_android_quirks {
* keys were stored in it.
*/
UFSHCD_ANDROID_QUIRK_KEYS_IN_PRDT = 1 << 2,
/*
* Use 36-bit DMA no matter whether or not the controller reports
* 64-bit addressing support.
*/
UFSHCD_ANDROID_QUIRK_36BIT_ADDRESS_DMA = 1 << 3,
};
enum ufshcd_caps {