From 36b58c1309ba9b878ac409f6524ba3b406d1007d Mon Sep 17 00:00:00 2001 From: Himateja Reddy Date: Wed, 15 Jul 2020 17:37:07 -0700 Subject: [PATCH] msm: adsprpc: remove use of vfs_stat API in the fastrpc driver Currently, to check if a particular DSP is supported, vfs_stat on its device file is done in the kernel. Remove the usage of this API for GKI compliance. Change-Id: I5660ddd975354563bf319cefe931d5eac488191e Acked-by: Thyagarajan Venkatanarayanan Signed-off-by: Himateja Reddy --- drivers/char/adsprpc.c | 44 ++++-------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/drivers/char/adsprpc.c b/drivers/char/adsprpc.c index a06f2fdc1863..96e354562bb7 100644 --- a/drivers/char/adsprpc.c +++ b/drivers/char/adsprpc.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -32,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -3516,19 +3514,6 @@ bail: return err; } -static int fastrpc_kstat(const char *filename, struct kstat *stat) -{ - int result; - mm_segment_t fs_old; - - fs_old = get_fs(); - set_fs(KERNEL_DS); - result = vfs_stat((const char __user *)filename, stat); - set_fs(fs_old); - - return result; -} - static int fastrpc_send_cpuinfo_to_dsp(struct fastrpc_file *fl) { int err = 0; @@ -3571,35 +3556,14 @@ static int fastrpc_get_info_from_dsp(struct fastrpc_file *fl, uint32_t dsp_attr_buf_len, uint32_t domain) { - int err = 0, dsp_support = 0; + int err = 0; struct fastrpc_ioctl_invoke_async ioctl; remote_arg_t ra[2]; - struct kstat sb; - // Querying device about DSP support - switch (domain) { - case ADSP_DOMAIN_ID: - if (!fastrpc_kstat("/dev/subsys_adsp", &sb)) - dsp_support = 1; - break; - case MDSP_DOMAIN_ID: - //Modem not supported for fastRPC - break; - case SDSP_DOMAIN_ID: - if (!fastrpc_kstat("/dev/subsys_slpi", &sb)) - dsp_support = 1; - break; - case CDSP_DOMAIN_ID: - if (!fastrpc_kstat("/dev/subsys_cdsp", &sb)) - dsp_support = 1; - break; - default: - dsp_support = 0; - break; - } - dsp_attr_buf[0] = dsp_support; + dsp_attr_buf[0] = 0; // Capability filled in userspace - if (dsp_support == 0) + // Fastrpc to modem not supported + if (domain == MDSP_DOMAIN_ID) goto bail; err = fastrpc_channel_open(fl);