mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
misc: mods: update from Perforce to 4.20
Change-Id: I7ea45fb5aa393372299648e326e81ecf62913b40 Signed-off-by: Chris Dragan <kdragan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2955034 Reviewed-by: Lael Jones <lajones@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
6f90c6d858
commit
1a3e4521c8
@@ -100,4 +100,13 @@
|
||||
# define MODS_HAS_FB_SET_SUSPEND 1
|
||||
#endif
|
||||
|
||||
#ifndef IS_BUILTIN
|
||||
# define IS_BUILTIN(c) 0
|
||||
#endif
|
||||
|
||||
#if (defined(CONFIG_ARM_FFA_TRANSPORT) && defined(ALLOW_ARM_FFA_TRANSPORT_AS_MODULE)) || \
|
||||
IS_BUILTIN(CONFIG_ARM_FFA_TRANSPORT)
|
||||
# define MODS_HAS_ARM_FFA
|
||||
#endif
|
||||
|
||||
#endif /* _MODS_CONFIG_H_ */
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
|
||||
static struct dentry *mods_debugfs_dir;
|
||||
|
||||
#ifdef CONFIG_ARCH_TEGRA_19x_SOC
|
||||
#include "mods_ras.h"
|
||||
#endif
|
||||
|
||||
#if defined(MODS_HAS_TEGRA) && defined(CONFIG_TEGRA_KFUSE)
|
||||
#include <soc/tegra/kfuse.h>
|
||||
#endif
|
||||
@@ -76,40 +72,20 @@ static int mods_mi_set(void *data, u64 val)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARCH_TEGRA_19x_SOC
|
||||
static int mods_set_err_sel(void *data, u64 val)
|
||||
{
|
||||
set_err_sel(val);
|
||||
return 0;
|
||||
}
|
||||
DEFINE_SIMPLE_ATTRIBUTE(mods_err_sel_fops, 0, mods_set_err_sel, "%llu\n");
|
||||
|
||||
static int mods_set_err_ctrl(void *data, u64 val)
|
||||
{
|
||||
set_err_ctrl(val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mods_get_err_ctrl(void *data, u64 *val)
|
||||
{
|
||||
*val = get_err_ctrl();
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_SIMPLE_ATTRIBUTE(mods_err_ctrl_fops, mods_get_err_ctrl,
|
||||
mods_set_err_ctrl, "%llu\n");
|
||||
|
||||
static int mods_enable_cpu_core_reporting(void *data, u64 val)
|
||||
{
|
||||
enable_cpu_core_reporting(val);
|
||||
return 0;
|
||||
}
|
||||
DEFINE_SIMPLE_ATTRIBUTE(mods_enable_cpu_fops, 0, mods_enable_cpu_core_reporting,
|
||||
"%llu\n");
|
||||
#endif
|
||||
|
||||
DEFINE_SIMPLE_ATTRIBUTE(mods_mi_fops, mods_mi_get, mods_mi_set, "%llu\n");
|
||||
|
||||
static int mods_ffa_get(void *data, u64 *val)
|
||||
{
|
||||
#if defined(MODS_HAS_ARM_FFA)
|
||||
*val = 1ULL;
|
||||
#else
|
||||
*val = 0ULL;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_SIMPLE_ATTRIBUTE(mods_ffa_fops, mods_ffa_get, NULL, "%llu\n");
|
||||
|
||||
void mods_remove_debugfs(void)
|
||||
{
|
||||
debugfs_remove_recursive(mods_debugfs_dir);
|
||||
@@ -118,9 +94,6 @@ void mods_remove_debugfs(void)
|
||||
|
||||
int mods_create_debugfs(struct miscdevice *modsdev)
|
||||
{
|
||||
#ifdef CONFIG_ARCH_TEGRA_19x_SOC
|
||||
struct dentry *ras_debugfs_entry;
|
||||
#endif
|
||||
struct dentry *retval;
|
||||
int err = 0;
|
||||
|
||||
@@ -131,36 +104,6 @@ int mods_create_debugfs(struct miscdevice *modsdev)
|
||||
goto remove_out;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARCH_TEGRA_19x_SOC
|
||||
if (of_find_node_by_name(NULL, "carmel_ras")) {
|
||||
ras_debugfs_entry = debugfs_create_dir("ras", mods_debugfs_dir);
|
||||
if (IS_ERR(ras_debugfs_entry)) {
|
||||
err = -EIO;
|
||||
goto remove_out;
|
||||
}
|
||||
|
||||
retval = debugfs_create_file("err_sel", 0644,
|
||||
ras_debugfs_entry, 0, &mods_err_sel_fops);
|
||||
if (IS_ERR(retval)) {
|
||||
err = -EIO;
|
||||
goto remove_out;
|
||||
}
|
||||
|
||||
retval = debugfs_create_file("err_ctrl", 0644,
|
||||
ras_debugfs_entry, 0, &mods_err_ctrl_fops);
|
||||
if (IS_ERR(retval)) {
|
||||
err = -EIO;
|
||||
goto remove_out;
|
||||
}
|
||||
retval = debugfs_create_file("ccplex_config", 0644,
|
||||
ras_debugfs_entry, 0, &mods_enable_cpu_fops);
|
||||
if (IS_ERR(retval)) {
|
||||
err = -EIO;
|
||||
goto remove_out;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
retval = debugfs_create_file("debug", 0644,
|
||||
mods_debugfs_dir, NULL, &mods_debug_fops);
|
||||
if (IS_ERR(retval)) {
|
||||
@@ -175,6 +118,13 @@ int mods_create_debugfs(struct miscdevice *modsdev)
|
||||
goto remove_out;
|
||||
}
|
||||
|
||||
retval = debugfs_create_file("ffa", 0444,
|
||||
mods_debugfs_dir, NULL, &mods_ffa_fops);
|
||||
if (IS_ERR(retval)) {
|
||||
err = -EIO;
|
||||
goto remove_out;
|
||||
}
|
||||
|
||||
#if defined(MODS_HAS_TEGRA) && defined(CONFIG_TEGRA_KFUSE)
|
||||
retval = debugfs_create_file("kfuse_data", 0444,
|
||||
mods_debugfs_dir, NULL, &mods_kfuse_fops);
|
||||
|
||||
@@ -677,7 +677,7 @@ int esc_mods_invoke_optee_ta(struct mods_client *client,
|
||||
#endif
|
||||
|
||||
/* MODS SP call */
|
||||
#if defined(CONFIG_ARM_FFA_TRANSPORT)
|
||||
#if defined(MODS_HAS_ARM_FFA)
|
||||
int esc_mods_arm_ffa_cmd(struct mods_client *client,
|
||||
struct MODS_FFA_PARAMS *p);
|
||||
#endif
|
||||
@@ -722,7 +722,7 @@ int mods_bpmpipc_init(struct mods_client *client,
|
||||
void mods_bpmpipc_cleanup(void);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARM_FFA_TRANSPORT)
|
||||
#if defined(MODS_HAS_ARM_FFA)
|
||||
int mods_ffa_abi_register(void);
|
||||
void mods_ffa_abi_unregister(void);
|
||||
#endif
|
||||
|
||||
@@ -787,8 +787,8 @@ static int mods_allocate_irqs(struct mods_client *client,
|
||||
flags);
|
||||
|
||||
/* Determine if the device supports requested interrupt type */
|
||||
if (irq_type == MODS_IRQ_TYPE_MSI) {
|
||||
#ifdef CONFIG_PCI_MSI
|
||||
if (irq_type == MODS_IRQ_TYPE_MSI) {
|
||||
if (pci_find_capability(dev, PCI_CAP_ID_MSI) == 0) {
|
||||
cl_error("dev %04x:%02x:%02x.%x does not support MSI\n",
|
||||
pci_domain_nr(dev->bus),
|
||||
@@ -798,13 +798,11 @@ static int mods_allocate_irqs(struct mods_client *client,
|
||||
LOG_EXT();
|
||||
return -ENOENT;
|
||||
}
|
||||
#else
|
||||
cl_error("the kernel does not support MSI\n");
|
||||
LOG_EXT();
|
||||
return -EINVAL;
|
||||
#endif
|
||||
} else if (irq_type == MODS_IRQ_TYPE_MSIX) {
|
||||
#ifdef CONFIG_PCI_MSI
|
||||
#ifdef MODS_HAS_MSIX_RANGE
|
||||
int cnt;
|
||||
#endif
|
||||
|
||||
if (pci_find_capability(dev, PCI_CAP_ID_MSIX) == 0) {
|
||||
cl_error(
|
||||
"dev %04x:%02x:%02x.%x does not support MSI-X\n",
|
||||
@@ -815,12 +813,38 @@ static int mods_allocate_irqs(struct mods_client *client,
|
||||
LOG_EXT();
|
||||
return -ENOENT;
|
||||
}
|
||||
#else
|
||||
cl_error("the kernel does not support MSI-X\n");
|
||||
|
||||
#ifdef MODS_HAS_MSIX_RANGE
|
||||
cnt = pci_msix_vec_count(dev);
|
||||
if (cnt < 0) {
|
||||
cl_error("MSI-X is not available on dev %04x:%02x:%02x.%x\n",
|
||||
pci_domain_nr(dev->bus),
|
||||
dev->bus->number,
|
||||
PCI_SLOT(dev->devfn),
|
||||
PCI_FUNC(dev->devfn));
|
||||
LOG_EXT();
|
||||
return cnt;
|
||||
}
|
||||
if (nvecs > (u32)cnt) {
|
||||
cl_error("cannot allocate %u MSI-X vectors on dev %04x:%02x:%02x.%x, only %d supported\n",
|
||||
nvecs,
|
||||
pci_domain_nr(dev->bus),
|
||||
dev->bus->number,
|
||||
PCI_SLOT(dev->devfn),
|
||||
PCI_FUNC(dev->devfn),
|
||||
cnt);
|
||||
LOG_EXT();
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
if (irq_type == MODS_IRQ_TYPE_MSI || irq_type == MODS_IRQ_TYPE_MSIX) {
|
||||
cl_error("the kernel does not support MSI\n");
|
||||
LOG_EXT();
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Enable device on the PCI bus */
|
||||
err = mods_enable_device(client, dev, &dpriv);
|
||||
@@ -864,14 +888,14 @@ static int mods_allocate_irqs(struct mods_client *client,
|
||||
dpriv->nvecs = 1;
|
||||
} else if (irq_type == MODS_IRQ_TYPE_MSIX) {
|
||||
struct msix_entry *entries;
|
||||
int i = 0, cnt = 1;
|
||||
int i;
|
||||
int cnt;
|
||||
|
||||
entries = kcalloc(nvecs, sizeof(struct msix_entry),
|
||||
GFP_KERNEL | __GFP_NORETRY);
|
||||
|
||||
if (!entries) {
|
||||
cl_error("could not allocate %d MSI-X entries\n",
|
||||
nvecs);
|
||||
cl_error("could not allocate memory\n");
|
||||
LOG_EXT();
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -884,17 +908,19 @@ static int mods_allocate_irqs(struct mods_client *client,
|
||||
cnt = pci_enable_msix_range(dev, entries, nvecs, nvecs);
|
||||
|
||||
if (cnt < 0) {
|
||||
/* returns number of interrupts allocated
|
||||
* < 0 indicates a failure.
|
||||
*/
|
||||
cl_error(
|
||||
"could not allocate the requested number of MSI-X vectors=%d return=%d!\n",
|
||||
nvecs, cnt);
|
||||
cl_error("failed to allocate %u MSI-X vectors on dev %04x:%02x:%02x.%x\n",
|
||||
nvecs,
|
||||
pci_domain_nr(dev->bus),
|
||||
dev->bus->number,
|
||||
PCI_SLOT(dev->devfn),
|
||||
PCI_FUNC(dev->devfn));
|
||||
kfree(entries);
|
||||
atomic_dec(&client->num_allocs);
|
||||
LOG_EXT();
|
||||
return cnt;
|
||||
}
|
||||
|
||||
nvecs = (u32)cnt;
|
||||
#else
|
||||
cnt = pci_enable_msix(dev, entries, nvecs);
|
||||
|
||||
@@ -904,9 +930,12 @@ static int mods_allocate_irqs(struct mods_client *client,
|
||||
* exceeding the number of irqs or MSI-X
|
||||
* vectors available
|
||||
*/
|
||||
cl_error(
|
||||
"could not allocate the requested number of MSI-X vectors=%d return=%d!\n",
|
||||
nvecs, cnt);
|
||||
cl_error("failed to allocate %u MSI-X vectors on dev %04x:%02x:%02x.%x\n",
|
||||
nvecs,
|
||||
pci_domain_nr(dev->bus),
|
||||
dev->bus->number,
|
||||
PCI_SLOT(dev->devfn),
|
||||
PCI_FUNC(dev->devfn));
|
||||
kfree(entries);
|
||||
atomic_dec(&client->num_allocs);
|
||||
LOG_EXT();
|
||||
|
||||
@@ -24,10 +24,6 @@
|
||||
# include <asm/msr.h>
|
||||
#endif
|
||||
|
||||
#ifndef IS_BUILTIN
|
||||
# define IS_BUILTIN(c) 0
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* mods_krnl_* functions, driver interfaces called by the Linux kernel *
|
||||
***********************************************************************/
|
||||
@@ -548,7 +544,7 @@ static int __init mods_init_module(void)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if IS_BUILTIN(CONFIG_ARM_FFA_TRANSPORT)
|
||||
#if defined(MODS_HAS_ARM_FFA)
|
||||
rc = mods_ffa_abi_register();
|
||||
if (rc < 0)
|
||||
mods_warning_printk("error on mods_ffa_abi_register returned %d\n", rc);
|
||||
@@ -599,7 +595,7 @@ static void __exit mods_exit_module(void)
|
||||
mods_shutdown_clock_api();
|
||||
#endif
|
||||
|
||||
#if IS_BUILTIN(CONFIG_ARM_FFA_TRANSPORT)
|
||||
#if defined(MODS_HAS_ARM_FFA)
|
||||
mods_ffa_abi_unregister();
|
||||
#endif
|
||||
mods_info_printk("driver unloaded\n");
|
||||
@@ -2753,11 +2749,14 @@ static long mods_krnl_ioctl(struct file *fp,
|
||||
|
||||
#endif
|
||||
|
||||
#if IS_BUILTIN(CONFIG_ARM_FFA_TRANSPORT)
|
||||
case MODS_ESC_FFA_CMD:
|
||||
#if defined(MODS_HAS_ARM_FFA)
|
||||
MODS_IOCTL(MODS_ESC_FFA_CMD, esc_mods_arm_ffa_cmd, MODS_FFA_PARAMS);
|
||||
break;
|
||||
#else
|
||||
cl_debug(DEBUG_IOCTL, "ioctl(MODS_ESC_FFA_CMD is not supported)\n");
|
||||
err = -EINVAL;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case MODS_ESC_ACQUIRE_ACCESS_TOKEN:
|
||||
MODS_IOCTL(MODS_ESC_ACQUIRE_ACCESS_TOKEN,
|
||||
|
||||
@@ -551,6 +551,9 @@ static int restore_cache_one_chunk(struct page *p_page, u8 order)
|
||||
|
||||
if (likely(!final_err))
|
||||
final_err = err;
|
||||
|
||||
/* Avoid superficial lockups */
|
||||
cond_resched();
|
||||
}
|
||||
|
||||
return final_err;
|
||||
@@ -2479,6 +2482,7 @@ static void clear_contiguous_cache(struct mods_client *client,
|
||||
asm volatile("dc civac, %0" : : "r" (cur) : "memory");
|
||||
|
||||
/* Avoid superficial lockups */
|
||||
if (!(cur & ((1U << 16) - 1U)))
|
||||
cond_resched();
|
||||
} while (cur += d_size, cur < end);
|
||||
asm volatile("dsb sy" : : : "memory");
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
/* Driver version */
|
||||
#define MODS_DRIVER_VERSION_MAJOR 4
|
||||
#define MODS_DRIVER_VERSION_MINOR 17
|
||||
#define MODS_DRIVER_VERSION_MINOR 20
|
||||
#define MODS_DRIVER_VERSION ((MODS_DRIVER_VERSION_MAJOR << 8) | \
|
||||
((MODS_DRIVER_VERSION_MINOR / 10) << 4) | \
|
||||
(MODS_DRIVER_VERSION_MINOR % 10))
|
||||
@@ -2007,8 +2007,10 @@ struct MODS_BPMP_UPHY_LANE_EOM_SCAN_PARAMS {
|
||||
#define MODS_ESC_DEVICE_ALLOC_PAGES MODSIO(WR, 45, MODS_DEVICE_ALLOC_PAGES)
|
||||
/* Deprecated */
|
||||
#define MODS_ESC_DEVICE_NUMA_INFO MODSIO(WR, 46, MODS_DEVICE_NUMA_INFO)
|
||||
/* Deprecated */
|
||||
#define MODS_ESC_TEGRA_DC_CONFIG_POSSIBLE MODSIO(WR, 47, \
|
||||
MODS_TEGRA_DC_CONFIG_POSSIBLE)
|
||||
/* Deprecated */
|
||||
#define MODS_ESC_TEGRA_DC_SETUP_SD MODSIO(W, 48, MODS_TEGRA_DC_SETUP_SD)
|
||||
#define MODS_ESC_DMABUF_GET_PHYSICAL_ADDRESS MODSIO(WR, 49, \
|
||||
MODS_DMABUF_GET_PHYSICAL_ADDRESS)
|
||||
|
||||
Reference in New Issue
Block a user