virt: tegra: Disable hypervisor driver for Linux v6.2+

Upstream Linux commit 4c1e0a97351a ("firmware: tegra: bpmp: Use
iosys-map helpers") updated the Tegra IVC driver to use the
iosys-map helpers for Linux v6.2. This causes the Tegra Hypervisor
driver build to fail. Temporarily disable the building of this
driver while this build issue is fixed. Stub functions are added to
permit other drivers that use this driver to build.

Bug 3936429
Bug 3974855

Change-Id: I182ab544f2d628f0159b303c15ade7428e416c86
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2861311
Reviewed-by: Rohit Khanna <rokhanna@nvidia.com>
Tested-by: Rohit Khanna <rokhanna@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-02-21 13:54:07 +00:00
committed by mobile promotions
parent 4a7bb89d97
commit 1c31e80d60
2 changed files with 157 additions and 2 deletions

View File

@@ -1,11 +1,17 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# #
# Makefile for Hypervisor interface # Makefile for Hypervisor interface
# #
LINUX_VERSION := $(shell expr $(VERSION) \* 256 + $(PATCHLEVEL))
LINUX_VERSION_6_2 := $(shell expr 6 \* 256 + 2)
# tegra_hv is currently broken for Linux v6.2 and so skip for Linux v6.2+
ifeq ($(shell test $(LINUX_VERSION) -lt $(LINUX_VERSION_6_2); echo $$?),0)
obj-m += tegra_hv.o obj-m += tegra_hv.o
endif
obj-m += tegra_hv_pm_ctl.o obj-m += tegra_hv_pm_ctl.o
obj-m += hvc_sysfs.o obj-m += hvc_sysfs.o
obj-m += ivc-cdev.o obj-m += ivc-cdev.o

View File

@@ -1,12 +1,13 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* SPDX-License-Identifier: GPL-2.0-only */
/* /*
* Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
*/ */
#ifndef __TEGRA_HV_IVC_H #ifndef __TEGRA_HV_IVC_H
#define __TEGRA_HV_IVC_H #define __TEGRA_HV_IVC_H
#include <linux/of.h> #include <linux/of.h>
#include <linux/version.h>
struct tegra_hv_ivc_cookie { struct tegra_hv_ivc_cookie {
/* some fields that might be useful */ /* some fields that might be useful */
@@ -31,6 +32,7 @@ struct tegra_hv_ivm_cookie {
void *reserved; void *reserved;
}; };
#if (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE)
bool is_tegra_hypervisor_mode(void); bool is_tegra_hypervisor_mode(void);
/** /**
@@ -304,4 +306,151 @@ int tegra_hv_ivc_get_info(struct tegra_hv_ivc_cookie *ivck, uint64_t *pa,
void tegra_hv_ivc_notify(struct tegra_hv_ivc_cookie *ivck); void tegra_hv_ivc_notify(struct tegra_hv_ivc_cookie *ivck);
struct tegra_ivc *tegra_hv_ivc_convert_cookie(struct tegra_hv_ivc_cookie *ivck); struct tegra_ivc *tegra_hv_ivc_convert_cookie(struct tegra_hv_ivc_cookie *ivck);
#else
static inline bool is_tegra_hypervisor_mode(void)
{
return false;
}
static inline struct tegra_hv_ivc_cookie *tegra_hv_ivc_reserve(
struct device_node *dn, int id,
const struct tegra_hv_ivc_ops *ops)
{
return ERR_PTR(-ENOTSUPP);
};
static inline int tegra_hv_ivc_unreserve(struct tegra_hv_ivc_cookie *ivck)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_write(struct tegra_hv_ivc_cookie *ivck,
const void *buf, int size)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_write_user(struct tegra_hv_ivc_cookie *ivck,
const void __user *buf, int size)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_read(struct tegra_hv_ivc_cookie *ivck, void *buf,
int size)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_read_user(struct tegra_hv_ivc_cookie *ivck,
void __user *buf, int size)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_can_read(struct tegra_hv_ivc_cookie *ivck)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_can_write(struct tegra_hv_ivc_cookie *ivck)
{
return -ENOTSUPP;
};
static inline uint32_t tegra_hv_ivc_tx_frames_available(
struct tegra_hv_ivc_cookie *ivck)
{
return 0;
};
static inline int tegra_hv_ivc_tx_empty(struct tegra_hv_ivc_cookie *ivck)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_set_loopback(struct tegra_hv_ivc_cookie *ivck,
int mode)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_dump(struct tegra_hv_ivc_cookie *ivck)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_read_peek(struct tegra_hv_ivc_cookie *ivck,
void *buf, int off, int count)
{
return -ENOTSUPP;
};
static inline void *tegra_hv_ivc_read_get_next_frame(
struct tegra_hv_ivc_cookie *ivck)
{
return ERR_PTR(-ENOTSUPP);
};
static inline int tegra_hv_ivc_read_advance(struct tegra_hv_ivc_cookie *ivck)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_write_poke(struct tegra_hv_ivc_cookie *ivck,
const void *buf, int off, int count)
{
return -ENOTSUPP;
};
static inline void *tegra_hv_ivc_write_get_next_frame(
struct tegra_hv_ivc_cookie *ivck)
{
return ERR_PTR(-ENOTSUPP);
};
static inline int tegra_hv_ivc_write_advance(struct tegra_hv_ivc_cookie *ivck)
{
return -ENOTSUPP;
};
static inline struct tegra_hv_ivm_cookie *tegra_hv_mempool_reserve(unsigned id)
{
return ERR_PTR(-ENOTSUPP);
};
static inline int tegra_hv_mempool_unreserve(struct tegra_hv_ivm_cookie *ck)
{
return -ENOTSUPP;
};
static inline int tegra_hv_ivc_channel_notified(
struct tegra_hv_ivc_cookie *ivck)
{
return -ENOTSUPP;
};
static inline void tegra_hv_ivc_channel_reset(struct tegra_hv_ivc_cookie *ivck)
{
return;
};
static inline int tegra_hv_ivc_get_info(struct tegra_hv_ivc_cookie *ivck,
uint64_t *pa, uint64_t *size)
{
return -ENOTSUPP;
};
static inline void tegra_hv_ivc_notify(struct tegra_hv_ivc_cookie *ivck)
{
return;
};
static inline struct tegra_ivc *tegra_hv_ivc_convert_cookie(
struct tegra_hv_ivc_cookie *ivck)
{
return ERR_PTR(-ENOTSUPP);
};
#endif /* (KERNEL_VERSION(6, 2, 0) > LINUX_VERSION_CODE) */
#endif /* __TEGRA_HV_IVC_H */ #endif /* __TEGRA_HV_IVC_H */