Commit Graph

8 Commits

Author SHA1 Message Date
Uday Gupta
b7dc4e8302 nvadsp: Add more error logs and fix crash
- Change adds more error logs in case of APP init failure.
- Also potentially fixes the crash issue

Bug 3374437
Bug 3498407

Change-Id: If6baf6e2e11250815cff4a6b8a2abe553e893e34
Signed-off-by: Uday Gupta <udayg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2593021
(cherry picked from commit b051fae2faffafbffed99b94914bbd9bc370240f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2731778
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Swati Sachdeva <ssachdeva@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
GVS: Gerrit_Virtual_Submit
2023-06-20 15:13:15 +00:00
Sameer Pujar
86b6ccfd04 nvadsp: fix v5.9-rc4 build error
After v5.9-rc4 merge in dev-main-5.9 many build errors are seen with
ADSP config CONFIG_TEGRA_ADSP_LPTHREAD. Some of these build errors
are listed below.

* kernel/nvidia/drivers/platform/tegra/nvadsp/adsp_lpthread.c:15:0:
  kernel-5.9/include/linux/uaccess.h: In function ‘force_uaccess_begin’:
  kernel-5.9/include/linux/uaccess.h:20:2: error: implicit declaration
      of function ‘set_fs’; did you mean ‘get_fs’?
      [-Werror=implicit-function-declaration]
      set_fs(USER_DS);
      ^~~~~~

* kernel-5.9/arch/arm64/include/asm/uaccess.h: In function
      ‘__uaccess_mask_ptr’:
  kernel-5.9/arch/arm64/include/asm/uaccess.h:240:41: error: invalid type
      argument of ‘->’ (have ‘int’) : "r" (ptr), "r"
      (current_thread_info()->addr_limit),
                            ^~

  ...

The errors appear to be related to 'uaccess.h' header and following
inclusion order is causing build failures for some reason. Checked with
other source files with below and same behavior is seen.

  #include <asm/uaccess.h>
  #include <linux/uaccess.h>
  ...

Issue goes away after replacing 'asm/uaccess.h' with 'linux/uaccess.h'.
It should be noted that latter header by default includes the former one.
For consistency this is done for other relevant ADSP files too.

Bug 200657500

Change-Id: I7ce98c46327a825711c4fa9ab791afc65b1cbf1b
Signed-off-by: Sameer Pujar <spujar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2417265
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mohan Kumar D <mkumard@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-by: Uday Gupta <udayg@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
2023-06-20 15:13:15 +00:00
Sameer Pujar
4614098993 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
2023-06-20 15:13:15 +00:00
Dipesh Gandhi
b72af873f4 ASoC: tegra-virt-alt: lpthread init via amixer
Change exposes lpthread/adsp usage trigger via
amixer. This is needed to make sound card aware
of lpthread state. Without this STR adsp feature
breaks as currently lpthread is written in such
a manner which does not allow adsp to suspend.

Bug 200552183

Change-Id: I2cc1e0fd805a982686bbd034b2c6e094b56df23b
Signed-off-by: Dipesh Gandhi <dipeshg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2198693
(cherry picked from commit e9bd14fd6eb0305cc583092752e6bdccc9c5e76a)
Reviewed-on: https://git-master.nvidia.com/r/2250202
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Swati Sachdeva <ssachdeva@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Uday Gupta <udayg@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Hariharan Sivaraman
a82f3515d6 tegra: nvadsp: adsp_lpthread patch cleanup
Patch to cleanup adsp_lpthread code
	- used enumerators instead of macros
	- Added unload of app during lpthread exit
	- Removed sprinkled print statements
	- Added comments for readability

Bug 1727014
Jira EMA-841
Jira EMA-854

Change-Id: Ifb3a1e60760013a52187a7ed54de27d35ff88c33
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1564217
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Hariharan Sivaraman
d593fa42f0 tegra: nvadsp: disable suspend when adsp usage log
Prevents adsp os from getting suspended when adsp_usage is being logged
Checks whether usage app is running and skips suspend accordingly

Bug 1727014

Change-Id: Iafd800d3d18d6292bee5d3376cec59dbb4557f2e
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: http://git-master/r/1142669
(cherry picked from commit 04660b149f1455f1e5e77f75aeb652a9dceae55f)
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1564184
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Hariharan Sivaraman
f9f361c265 tegra: nvadsp: adsp usage app changes
Combining adsp_lpthread_proc.c and adsp_lpthread.c
under one file adsp_lpthread.c

Bug 1727014

Change-Id: I45ab5e5a49fce29f151b81706fee8e9f3baffeef
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: http://git-master/r/1141833
(cherry picked from commit 8e9632c3bba854eb91fe406b1f67a1941da95292)
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1564175
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00
Hariharan Sivaraman
b3a66c2476 tegra: nvadsp: Include adsp usage functionality
Adds functionality to calculate adsp cpu usage
Inits, loads, starts and resume adsp_lpthread app

Bug 1727014

Change-Id: Icaf7a1ba9e91bff19d7fbc894bfdd0f884971d6c
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: http://git-master/r/1134173
(cherry picked from commit 256bd7180cefa523a9e480be315fbf47b9c8de4f)
Signed-off-by: Hariharan Sivaraman <hariharans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1564162
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ajay Nandakumar M <anandakumarm@nvidia.com>
Reviewed-by: Nitin Pai <npai@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-06-20 15:13:15 +00:00