ufs: Fix Tegra UFS for Linux v6.13

In Linux v6.13, the quirk definition 'UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS'
was removed and replaced with a function pointer than can be used to set
the DMA mask as needed for a given device. Update the Tegra UFS driver
to fix support for Linux v6.13. Note that prior to Linux v6.13, the flag
'UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS' would set the DMA mask to 32-bits
and so this change is equivalent to the configuration of prior kernels.

Bug 4991705

Change-Id: I859331e9eea918d2438d68b871642fee5e4148e0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3283447
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
Jon Hunter
2025-01-14 14:37:58 +00:00
parent 82af289c71
commit ee357025ee
3 changed files with 40 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
PATH="${PATH}:/bin:/sbin:/usr/bin"
@@ -8497,6 +8497,24 @@ compile_test() {
compile_check_conftest "$CODE" "NV_TTY_OPERATIONS_STRUCT_SET_TERMIOS_HAS_CONST_KTERMIOS_ARG" "" "types"
;;
ufs_hba_variant_ops_has_set_dma_mask)
#
# Determine if the 'struct ufs_hba_variant_ops' has a 'set_dma_mask'
# function pointer.
#
# In Linux v6.13, commit 78bc671bd150 ("scsi: ufs: core: Make DMA
# mask configuration more flexible)" add a 'set_dma_mask' function
# pointer to the 'ufs_hba_variant_ops' structure.
#
CODE="
#include <ufs/ufshcd.h>
int conftest_ufs_hba_variant_ops_has_set_dma_mask(void) {
return offsetof(struct ufs_hba_variant_ops, set_dma_mask);
}"
compile_check_conftest "$CODE" "NV_UFS_HBA_VARIANT_OPS_HAS_SET_DMA_MASK" "" "types"
;;
ufs_hba_variant_ops_suspend_has_status_arg)
#
# Determine if the 'suspend' function for the