mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
ufs: Fix Tegra UFS for Linux v6.15
In Linux v6.15, the pwr_change_notify() function was updated making the 3rd argument of type const. Add a conftest to detect this and update the Tegra UFS driver accordingly. JIRA LINQPJ14-47 Change-Id: I83f22bf0961200d9078fb35d408dac9149d786d2 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330680 (cherry picked from commit d9c16e70c4bf468a5ddab8a434693a8e7b442625) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499757 Reviewed-by: Brad Griffis <bgriffis@nvidia.com> GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Tested-by: Brad Griffis <bgriffis@nvidia.com> Reviewed-by: svcacv <svcacv@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
3d26747166
commit
13ad68519d
@@ -1158,10 +1158,17 @@ static void ufs_tegra_scramble_enable(struct ufs_hba *hba)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(NV_UFS_HBA_VARIANT_OPS_PWR_CHANGE_NOTIFY_HAS_CONST_ARG) /* Linux v6.15 */
|
||||||
|
static int ufs_tegra_pwr_change_notify(struct ufs_hba *hba,
|
||||||
|
enum ufs_notify_change_status status,
|
||||||
|
const struct ufs_pa_layer_attr *dev_max_params,
|
||||||
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
|
#else
|
||||||
static int ufs_tegra_pwr_change_notify(struct ufs_hba *hba,
|
static int ufs_tegra_pwr_change_notify(struct ufs_hba *hba,
|
||||||
enum ufs_notify_change_status status,
|
enum ufs_notify_change_status status,
|
||||||
struct ufs_pa_layer_attr *dev_max_params,
|
struct ufs_pa_layer_attr *dev_max_params,
|
||||||
struct ufs_pa_layer_attr *dev_req_params)
|
struct ufs_pa_layer_attr *dev_req_params)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
struct ufs_tegra_host *ufs_tegra = hba->priv;
|
struct ufs_tegra_host *ufs_tegra = hba->priv;
|
||||||
u32 vs_save_config;
|
u32 vs_save_config;
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_send_xchar_has_u8_ar
|
|||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_write_has_u8_ptr_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_write_has_u8_ptr_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += tty_operations_struct_set_termios_has_const_ktermios_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_has_set_dma_mask
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_has_set_dma_mask
|
||||||
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_pwr_change_notify_has_const_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_suspend_has_status_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufs_hba_variant_ops_suspend_has_status_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufshcd_quirks_enum_has_ufshcd_quirk_broken_64bit_address
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ufshcd_quirks_enum_has_ufshcd_quirk_broken_64bit_address
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_connection_struct_present
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += v4l2_async_connection_struct_present
|
||||||
|
|||||||
@@ -8344,6 +8344,31 @@ compile_test() {
|
|||||||
compile_check_conftest "$CODE" "NV_UFS_HBA_VARIANT_OPS_HAS_SET_DMA_MASK" "" "types"
|
compile_check_conftest "$CODE" "NV_UFS_HBA_VARIANT_OPS_HAS_SET_DMA_MASK" "" "types"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
ufs_hba_variant_ops_pwr_change_notify_has_const_arg)
|
||||||
|
#
|
||||||
|
# Determine if the 3rd argument of pwr_change_notify() is const.
|
||||||
|
#
|
||||||
|
# In Linux v6.15, commit 3bcd901e4257 ("scsi: ufs: Constify the third
|
||||||
|
# pwr_change_notify() argument") updated the pwr_change_notify()
|
||||||
|
# function making the 3rd argument of type const.
|
||||||
|
#
|
||||||
|
CODE="
|
||||||
|
#if defined(NV_UFS_UFSHCD_H_PRESENT)
|
||||||
|
#include <ufs/ufshcd.h>
|
||||||
|
#else
|
||||||
|
#include \"../drivers/scsi/ufs/ufshcd.h\"
|
||||||
|
#endif
|
||||||
|
void conftest(struct ufs_hba_variant_ops *ops) {
|
||||||
|
int (*fn)(struct ufs_hba *hba,
|
||||||
|
enum ufs_notify_change_status status,
|
||||||
|
const struct ufs_pa_layer_attr *desired_pwr_mode,
|
||||||
|
struct ufs_pa_layer_attr *final_params) = ops->pwr_change_notify;
|
||||||
|
}"
|
||||||
|
|
||||||
|
compile_check_conftest "$CODE" \
|
||||||
|
"NV_UFS_HBA_VARIANT_OPS_PWR_CHANGE_NOTIFY_HAS_CONST_ARG" "" "types"
|
||||||
|
;;
|
||||||
|
|
||||||
ufs_hba_variant_ops_suspend_has_status_arg)
|
ufs_hba_variant_ops_suspend_has_status_arg)
|
||||||
#
|
#
|
||||||
# Determine if the 'suspend' function for the
|
# Determine if the 'suspend' function for the
|
||||||
|
|||||||
Reference in New Issue
Block a user