nvadsp: fix build errors on v5.9

Following build errors are seen when ADSP configs CONFIG_TEGRA_ADSP_FILEIO
and CONFIG_TEGRA_ADSP_LPTHREAD are enabled.

* Error due to "segment.h"

  adsp_lpthread.c:14:10: fatal error: asm/segment.h: No such file or
    directory
  adspff.c:17:10: fatal error: asm/segment.h: No such file or directory

  (asm/segment.h inclusion is removed as asm/uaccess.h already takes care
   of required dependencies)

* Error due to unavailable structure "sched_param"

  adspff.c:517:21: error: variable ‘param’ has initializer but incomplete
    type
  adspff.c:518:3: error: ‘const struct sched_param’ has no member named
    ‘sched_priority’

  (Replace <linux/sched/types.h> with <uapi/linux/sched/types.h> to fix
   this build issue)

* Error due to unavailable "get_ds()"

  adspff.c:63:9: error: implicit declaration of function ‘get_ds’; did you
    mean ‘get_fs’? [-Werror=implicit-function-declaration]

  (Fixed by replacing get_ds() with KERNEL_DS. The get_ds() support is
   removed from upstream kernel)

Bug 200593718
Bug 200657500

Change-Id: I8b9cbed5ee42f34cf3731ea2d2f06aa760c28358
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2412299
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-by: Sharad Gupta <sharadg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Sameer Pujar
2020-09-11 20:52:13 +05:30
committed by Laxman Dewangan
parent 08391815ee
commit 4614098993
2 changed files with 7 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2020, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -11,7 +11,6 @@
* more details.
*/
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <linux/fs.h>

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2020, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -14,7 +14,6 @@
#define pr_fmt(fmt) "adspff: " fmt
#include <linux/fs.h>
#include <asm/segment.h>
#include <asm/uaccess.h>
#include <linux/slab.h>
@@ -22,13 +21,13 @@
#include <linux/sched.h>
#include <linux/sched/rt.h>
#include <linux/sched/task.h>
#include <linux/sched/types.h>
#include <linux/semaphore.h>
#include <linux/debugfs.h>
#include <linux/platform_device.h>
#include <linux/list.h>
#include <linux/tegra_nvadsp.h>
#include <uapi/linux/sched/types.h>
#include "adspff.h"
#include "dev.h"
@@ -60,7 +59,7 @@ struct file *file_open(const char *path, int flags, int rights)
int err = 0;
oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
filp = filp_open(path, flags, rights);
set_fs(oldfs);
if (IS_ERR(filp)) {
@@ -82,7 +81,7 @@ int file_write(struct file *file, unsigned long long *offset,
int ret = 0;
oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
ret = vfs_write(file, data, size, offset);
@@ -97,7 +96,7 @@ uint32_t file_read(struct file *file, unsigned long long *offset,
uint32_t ret = 0;
oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
ret = vfs_read(file, data, size, offset);
@@ -112,7 +111,7 @@ uint32_t file_size(struct file *file)
uint32_t size = 0;
oldfs = get_fs();
set_fs(get_ds());
set_fs(KERNEL_DS);
size = vfs_llseek(file, 0, SEEK_END);