[chrome-os:chromeos-5.10 1/35] drivers/remoteproc/mtk_scp.c:854:37: warning: unused variable 'mt8183_of_data'
by kernel test robot
Hi Guenter,
FYI, the error/warning still remains.
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head: e20fbb376bc6e238611a61cc84c070f5c73bf70c
commit: e2ab415f43ccbb60df9c64cf69ba6881d13738ad [1/35] FIXUP: FROMGIT: remoteproc/mtk_scp: surround DT device IDs with CONFIG_OF
config: x86_64-randconfig-a002-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.10
git checkout e2ab415f43ccbb60df9c64cf69ba6881d13738ad
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/remoteproc/mtk_scp.c:854:37: warning: unused variable 'mt8183_of_data' [-Wunused-const-variable]
static const struct mtk_scp_of_data mt8183_of_data = {
^
>> drivers/remoteproc/mtk_scp.c:866:37: warning: unused variable 'mt8192_of_data' [-Wunused-const-variable]
static const struct mtk_scp_of_data mt8192_of_data = {
^
2 warnings generated.
vim +/mt8183_of_data +854 drivers/remoteproc/mtk_scp.c
63c13d61eafe46 Erin Lo 2019-11-12 853
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 @854 static const struct mtk_scp_of_data mt8183_of_data = {
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 855 .scp_before_load = mt8183_scp_before_load,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 856 .scp_irq_handler = mt8183_scp_irq_handler,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 857 .scp_reset_assert = mt8183_scp_reset_assert,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 858 .scp_reset_deassert = mt8183_scp_reset_deassert,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 859 .scp_stop = mt8183_scp_stop,
1f52378f9cd441 Tzung-Bi Shih 2021-01-27 860 .scp_da_to_va = mt8183_scp_da_to_va,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 861 .host_to_scp_reg = MT8183_HOST_TO_SCP,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 862 .host_to_scp_int_bit = MT8183_HOST_IPC_INT_BIT,
2d98bf34a9d96b Tzung-Bi Shih 2020-12-02 863 .ipi_buf_offset = 0x7bdb0,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 864 };
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 865
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 @866 static const struct mtk_scp_of_data mt8192_of_data = {
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 867 .scp_before_load = mt8192_scp_before_load,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 868 .scp_irq_handler = mt8192_scp_irq_handler,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 869 .scp_reset_assert = mt8192_scp_reset_assert,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 870 .scp_reset_deassert = mt8192_scp_reset_deassert,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 871 .scp_stop = mt8192_scp_stop,
1f52378f9cd441 Tzung-Bi Shih 2021-01-27 872 .scp_da_to_va = mt8192_scp_da_to_va,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 873 .host_to_scp_reg = MT8192_GIPC_IN_SET,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 874 .host_to_scp_int_bit = MT8192_HOST_IPC_INT_BIT,
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 875 };
fd0b6c1ff85a48 Pi-Hsun Shih 2020-09-21 876
:::::: The code at line 854 was first introduced by commit
:::::: fd0b6c1ff85a489bcf1bcf58af64da1aeffd39f0 remoteproc/mediatek: Add support for mt8192 SCP
:::::: TO: Pi-Hsun Shih <pihsun(a)chromium.org>
:::::: CC: Bjorn Andersson <bjorn.andersson(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[android-common:android13-5.10 6729/10616] arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq'
by kernel test robot
tree: https://android.googlesource.com/kernel/common android13-5.10
head: 2637b5e5c6b68f2e91a3285187141ec3408040e7
commit: 1105b4d1cef4bc19ad20129a716194268c937eaf [6729/10616] BACKPORT: FROMGIT: KVM: arm64: Rework SVE host-save/guest-restore
config: arm64-randconfig-r003-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git remote add android-common https://android.googlesource.com/kernel/common
git fetch --no-tags android-common android13-5.10
git checkout 1105b4d1cef4bc19ad20129a716194268c937eaf
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from arch/arm64/kvm/hyp/vhe/switch.c:8:
>> arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq' [-Werror,-Wimplicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
^
arch/arm64/kvm/hyp/vhe/switch.c:227:17: warning: no previous prototype for function 'kvm_unexpected_el2_exception' [-Wmissing-prototypes]
asmlinkage void kvm_unexpected_el2_exception(void)
^
arch/arm64/kvm/hyp/vhe/switch.c:227:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage void kvm_unexpected_el2_exception(void)
^
static
1 warning and 1 error generated.
--
In file included from arch/arm64/kvm/hyp/nvhe/switch.c:8:
>> arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq' [-Werror,-Wimplicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
^
arch/arm64/kvm/hyp/nvhe/switch.c:282:17: warning: no previous prototype for function 'kvm_unexpected_el2_exception' [-Wmissing-prototypes]
asmlinkage void kvm_unexpected_el2_exception(void)
^
arch/arm64/kvm/hyp/nvhe/switch.c:282:12: note: declare 'static' if the function is not intended to be used outside of this translation unit
asmlinkage void kvm_unexpected_el2_exception(void)
^
static
1 warning and 1 error generated.
--
In file included from arch/arm64/kvm/hyp/nvhe/hyp-main.c:7:
>> arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq' [-Werror,-Wimplicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
^
arch/arm64/kvm/hyp/nvhe/hyp-main.c:233:6: warning: no previous prototype for function 'handle_trap' [-Wmissing-prototypes]
void handle_trap(struct kvm_cpu_context *host_ctxt)
^
arch/arm64/kvm/hyp/nvhe/hyp-main.c:233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void handle_trap(struct kvm_cpu_context *host_ctxt)
^
static
1 warning and 1 error generated.
--
In file included from arch/arm64/kvm/hyp/nvhe/mem_protect.c:15:
>> arch/arm64/kvm/hyp/include/hyp/switch.h:216:2: error: implicit declaration of function 'sve_cond_update_zcr_vq' [-Werror,-Wimplicit-function-declaration]
sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
^
1 error generated.
vim +/sve_cond_update_zcr_vq +216 arch/arm64/kvm/hyp/include/hyp/switch.h
213
214 static inline void __hyp_sve_restore_guest(struct kvm_vcpu *vcpu)
215 {
> 216 sve_cond_update_zcr_vq(vcpu_sve_max_vq(vcpu) - 1, SYS_ZCR_EL2);
217 __sve_restore_state(vcpu_sve_pffr(vcpu),
218 &vcpu->arch.ctxt.fp_regs.fpsr);
219 write_sysreg_el1(__vcpu_sys_reg(vcpu, ZCR_EL1), SYS_ZCR);
220 }
221
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[integrity:next-integrity-testing 13/13] security/integrity/evm/evm_crypto.c:181:41: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git next-integrity-testing
head: 5b5aed323646d2240eb70913841ef06c94d6e9a5
commit: 5b5aed323646d2240eb70913841ef06c94d6e9a5 [13/13] evm: output EVM digest calculation info
config: riscv-randconfig-r003-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git...
git remote add integrity https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git
git fetch --no-tags integrity next-integrity-testing
git checkout 5b5aed323646d2240eb70913841ef06c94d6e9a5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> security/integrity/evm/evm_crypto.c:181:41: warning: format specifies type 'unsigned long' but the argument has type 'unsigned int' [-Wformat]
pr_debug("hmac_misc: (%lu) [%*phN]\n", sizeof(struct h_misc),
~~~ ^~~~~~~~~~~~~~~~~~~~~
%u
include/linux/printk.h:430:38: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:140:17: note: expanded from macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
>> security/integrity/evm/evm_crypto.c:261:7: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
req_xattr_value_len,
^~~~~~~~~~~~~~~~~~~
include/linux/printk.h:430:38: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:140:17: note: expanded from macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
security/integrity/evm/evm_crypto.c:286:47: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
pr_debug("%s: (%lu) [%*phN]", xattr->name, xattr_size,
~~~ ^~~~~~~~~~
%u
include/linux/printk.h:430:38: note: expanded from macro 'pr_debug'
no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/printk.h:140:17: note: expanded from macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
3 warnings generated.
vim +181 security/integrity/evm/evm_crypto.c
138
139 /* Protect against 'cutting & pasting' security.evm xattr, include inode
140 * specific info.
141 *
142 * (Additional directory/file metadata needs to be added for more complete
143 * protection.)
144 */
145 static void hmac_add_misc(struct shash_desc *desc, struct inode *inode,
146 char type, char *digest)
147 {
148 struct h_misc {
149 unsigned long ino;
150 __u32 generation;
151 uid_t uid;
152 gid_t gid;
153 umode_t mode;
154 } hmac_misc;
155
156 memset(&hmac_misc, 0, sizeof(hmac_misc));
157 /* Don't include the inode or generation number in portable
158 * signatures
159 */
160 if (type != EVM_XATTR_PORTABLE_DIGSIG) {
161 hmac_misc.ino = inode->i_ino;
162 hmac_misc.generation = inode->i_generation;
163 }
164 /* The hmac uid and gid must be encoded in the initial user
165 * namespace (not the filesystems user namespace) as encoding
166 * them in the filesystems user namespace allows an attack
167 * where first they are written in an unprivileged fuse mount
168 * of a filesystem and then the system is tricked to mount the
169 * filesystem for real on next boot and trust it because
170 * everything is signed.
171 */
172 hmac_misc.uid = from_kuid(&init_user_ns, inode->i_uid);
173 hmac_misc.gid = from_kgid(&init_user_ns, inode->i_gid);
174 hmac_misc.mode = inode->i_mode;
175 crypto_shash_update(desc, (const u8 *)&hmac_misc, sizeof(hmac_misc));
176 if ((evm_hmac_attrs & EVM_ATTR_FSUUID) &&
177 type != EVM_XATTR_PORTABLE_DIGSIG)
178 crypto_shash_update(desc, (u8 *)&inode->i_sb->s_uuid, UUID_SIZE);
179 crypto_shash_final(desc, digest);
180
> 181 pr_debug("hmac_misc: (%lu) [%*phN]\n", sizeof(struct h_misc),
182 (int) sizeof(struct h_misc), &hmac_misc);
183 }
184
185 /*
186 * Dump large security xattr values as a continuous ascii hexademical string.
187 * (pr_debug is limited to 64 bytes.)
188 */
189 static void dump_security_xattr(const char *prefix, const void *src, size_t count)
190 {
191 #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
192 char *asciihex, *p;
193
194 p = asciihex = kmalloc(count * 2 + 1, GFP_KERNEL);
195 if (!asciihex)
196 return;
197
198 p = bin2hex(p, src, count);
199 *p = 0;
200 pr_debug("%s: (%lu) %.*s\n", prefix, count, (int) count * 2, asciihex);
201 kfree(asciihex);
202 #endif
203 }
204
205 /*
206 * Calculate the HMAC value across the set of protected security xattrs.
207 *
208 * Instead of retrieving the requested xattr, for performance, calculate
209 * the hmac using the requested xattr value. Don't alloc/free memory for
210 * each xattr, but attempt to re-use the previously allocated memory.
211 */
212 static int evm_calc_hmac_or_hash(struct dentry *dentry,
213 const char *req_xattr_name,
214 const char *req_xattr_value,
215 size_t req_xattr_value_len,
216 uint8_t type, struct evm_digest *data)
217 {
218 struct inode *inode = d_backing_inode(dentry);
219 struct xattr_list *xattr;
220 struct shash_desc *desc;
221 size_t xattr_size = 0;
222 char *xattr_value = NULL;
223 int error;
224 int size;
225 bool ima_present = false;
226
227 if (!(inode->i_opflags & IOP_XATTR) ||
228 inode->i_sb->s_user_ns != &init_user_ns)
229 return -EOPNOTSUPP;
230
231 desc = init_desc(type, data->hdr.algo);
232 if (IS_ERR(desc))
233 return PTR_ERR(desc);
234
235 data->hdr.length = crypto_shash_digestsize(desc->tfm);
236
237 error = -ENODATA;
238 list_for_each_entry_lockless(xattr, &evm_config_xattrnames, list) {
239 bool is_ima = false;
240
241 if (strcmp(xattr->name, XATTR_NAME_IMA) == 0)
242 is_ima = true;
243
244 /*
245 * Skip non-enabled xattrs for locally calculated
246 * signatures/HMACs.
247 */
248 if (type != EVM_XATTR_PORTABLE_DIGSIG && !xattr->enabled)
249 continue;
250
251 if ((req_xattr_name && req_xattr_value)
252 && !strcmp(xattr->name, req_xattr_name)) {
253 error = 0;
254 crypto_shash_update(desc, (const u8 *)req_xattr_value,
255 req_xattr_value_len);
256 if (is_ima)
257 ima_present = true;
258
259 if (req_xattr_value_len < 64)
260 pr_debug("%s: (%lu) [%*phN]\n", req_xattr_name,
> 261 req_xattr_value_len,
262 (int)req_xattr_value_len,
263 req_xattr_value);
264 else
265 dump_security_xattr(req_xattr_name,
266 req_xattr_value,
267 req_xattr_value_len);
268 continue;
269 }
270 size = vfs_getxattr_alloc(&init_user_ns, dentry, xattr->name,
271 &xattr_value, xattr_size, GFP_NOFS);
272 if (size == -ENOMEM) {
273 error = -ENOMEM;
274 goto out;
275 }
276 if (size < 0)
277 continue;
278
279 error = 0;
280 xattr_size = size;
281 crypto_shash_update(desc, (const u8 *)xattr_value, xattr_size);
282 if (is_ima)
283 ima_present = true;
284
285 if (xattr_size < 64)
286 pr_debug("%s: (%lu) [%*phN]", xattr->name, xattr_size,
287 (int)xattr_size, xattr_value);
288 else
289 dump_security_xattr(xattr->name, xattr_value,
290 xattr_size);
291 }
292 hmac_add_misc(desc, inode, type, data->digest);
293
294 /* Portable EVM signatures must include an IMA hash */
295 if (type == EVM_XATTR_PORTABLE_DIGSIG && !ima_present)
296 error = -EPERM;
297 out:
298 kfree(xattr_value);
299 kfree(desc);
300 return error;
301 }
302
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[chrome-os:chromeos-5.4 60/60] drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:312:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute
by kernel test robot
tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.4
head: e22d97f8d4f8fae5de0ce382aeeea450bda8c08f
commit: e22d97f8d4f8fae5de0ce382aeeea450bda8c08f [60/60] CHROMIUM: camx: Re-enable COMPILE_TEST
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add chrome-os https://chromium.googlesource.com/chromiumos/third_party/kernel
git fetch --no-tags chrome-os chromeos-5.4
git checkout e22d97f8d4f8fae5de0ce382aeeea450bda8c08f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
>> drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:312:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
312 | cdm_get_cmd_header_size,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:312:2: note: (near initialization for 'CDM170_ops')
>> drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:312:2: error: invalid initializer
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:312:2: note: (near initialization for 'CDM170_ops.<anonymous>')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:313:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
313 | cdm_required_size_reg_continuous,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:313:2: note: (near initialization for 'CDM170_ops')
>> drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:313:2: error: initialization of 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} from incompatible pointer type 'uint32_t (*)(uint32_t)' {aka 'unsigned int (*)(unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:313:2: note: (near initialization for 'CDM170_ops.cdm_required_size_dmi')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:314:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
314 | cdm_required_size_reg_random,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:314:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:314:2: error: initialization of 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} from incompatible pointer type 'uint32_t (*)(uint32_t)' {aka 'unsigned int (*)(unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:314:2: note: (near initialization for 'CDM170_ops.cdm_offsetof_indirect_addr')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:315:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
315 | cdm_required_size_dmi,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:315:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:316:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
316 | cdm_required_size_genirq,
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:316:2: note: (near initialization for 'CDM170_ops')
>> drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:316:2: error: initialization of 'uint32_t (*)(uint32_t)' {aka 'unsigned int (*)(unsigned int)'} from incompatible pointer type 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:316:2: note: (near initialization for 'CDM170_ops.cdm_required_size_reg_random')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:317:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
317 | cdm_required_size_indirect,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:317:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:317:2: error: initialization of 'uint32_t (*)(unsigned int)' {aka 'unsigned int (*)(unsigned int)'} from incompatible pointer type 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:317:2: note: (near initialization for 'CDM170_ops.cdm_get_cmd_header_size')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:318:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
318 | cdm_required_size_changebase,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:318:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:319:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
319 | cdm_offsetof_dmi_addr,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:319:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:319:2: error: initialization of 'uint32_t * (*)(uint32_t *, uint32_t)' {aka 'unsigned int * (*)(unsigned int *, unsigned int)'} from incompatible pointer type 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:319:2: note: (near initialization for 'CDM170_ops.cdm_write_changebase')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:320:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
320 | cdm_offsetof_indirect_addr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:320:2: note: (near initialization for 'CDM170_ops')
>> drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:320:2: error: initialization of 'uint32_t * (*)(uint32_t *, uint32_t, uint32_t, uint32_t *)' {aka 'unsigned int * (*)(unsigned int *, unsigned int, unsigned int, unsigned int *)'} from incompatible pointer type 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:320:2: note: (near initialization for 'CDM170_ops.cdm_write_regcontinuous')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:321:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
321 | cdm_write_regcontinuous,
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:321:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:321:2: error: initialization of 'uint32_t (*)(uint32_t)' {aka 'unsigned int (*)(unsigned int)'} from incompatible pointer type 'uint32_t * (*)(uint32_t *, uint32_t, uint32_t, uint32_t *)' {aka 'unsigned int * (*)(unsigned int *, unsigned int, unsigned int, unsigned int *)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:321:2: note: (near initialization for 'CDM170_ops.cdm_required_size_reg_continuous')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:322:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
322 | cdm_write_regrandom,
| ^~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:322:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:323:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
323 | cdm_write_dmi,
| ^~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:323:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:324:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
324 | cdm_write_indirect,
| ^~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:324:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:324:2: error: initialization of 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} from incompatible pointer type 'uint32_t * (*)(uint32_t *, uint32_t, uint32_t)' {aka 'unsigned int * (*)(unsigned int *, unsigned int, unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:324:2: note: (near initialization for 'CDM170_ops.cdm_required_size_indirect')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:325:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
325 | cdm_write_changebase,
| ^~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:325:2: note: (near initialization for 'CDM170_ops')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:325:2: error: initialization of 'uint32_t * (*)(uint32_t *, uint32_t, uint32_t)' {aka 'unsigned int * (*)(unsigned int *, unsigned int, unsigned int)'} from incompatible pointer type 'uint32_t * (*)(uint32_t *, uint32_t)' {aka 'unsigned int * (*)(unsigned int *, unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:325:2: note: (near initialization for 'CDM170_ops.cdm_write_indirect')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:326:2: error: positional initialization of field in 'struct' declared with 'designated_init' attribute [-Werror=designated-init]
326 | cdm_write_genirq,
| ^~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:326:2: note: (near initialization for 'CDM170_ops')
>> drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:326:2: error: initialization of 'uint32_t (*)(void)' {aka 'unsigned int (*)(void)'} from incompatible pointer type 'void (*)(uint32_t *, uint32_t)' {aka 'void (*)(unsigned int *, unsigned int)'} [-Werror=incompatible-pointer-types]
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:326:2: note: (near initialization for 'CDM170_ops.cdm_offsetof_dmi_addr')
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c: In function 'cam_cdm_util_reg_cont_write':
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:368:45: warning: comparison is always false due to limited range of data type [-Wtype-limits]
368 | if ((!reg_cont->count) || (reg_cont->count > 0x10000) ||
| ^
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c: In function 'cam_cdm_util_reg_random_write':
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:399:49: warning: comparison is always false due to limited range of data type [-Wtype-limits]
399 | if ((!reg_random->count) || (reg_random->count > 0x10000) ||
| ^
drivers/media/platform/camx/cam_cdm/cam_cdm_util.c: In function 'cam_cdm_util_cmd_buf_write':
>> drivers/media/platform/camx/cam_cdm/cam_cdm_util.c:466:29: warning: variable 'total_cmd_buf_size' set but not used [-Wunused-but-set-variable]
466 | uint32_t cdm_cmd_type = 0, total_cmd_buf_size = 0;
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
--
drivers/media/platform/camx/cam_cdm/cam_cdm_core_common.c: In function 'cam_cdm_process_cmd':
>> drivers/media/platform/camx/cam_cdm/cam_cdm_core_common.c:406:26: warning: variable 'soc_data' set but not used [-Wunused-but-set-variable]
406 | struct cam_hw_soc_info *soc_data = NULL;
| ^~~~~~~~
--
drivers/media/platform/camx/cam_cdm/cam_cdm_hw_core.c: In function 'cam_hw_cdm_deinit':
>> drivers/media/platform/camx/cam_cdm/cam_cdm_hw_core.c:789:18: warning: variable 'cdm_core' set but not used [-Wunused-but-set-variable]
789 | struct cam_cdm *cdm_core = NULL;
| ^~~~~~~~
--
drivers/media/platform/camx/cam_core/cam_node.c: In function 'cam_node_shutdown':
>> drivers/media/platform/camx/cam_core/cam_node.c:602:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
602 | int rc = 0;
| ^~
--
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:503:7: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
503 | if (!CAM_CPAS_CLIENT_VALID(client_indx))
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:35:4: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
35 | ((CAM_CPAS_CLIENT_VALID(indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:38:4: note: in expansion of macro 'CAM_CPAS_CLIENT_REGISTERED'
38 | ((CAM_CPAS_CLIENT_REGISTERED(cpas_core, indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:509:7: note: in expansion of macro 'CAM_CPAS_CLIENT_STARTED'
509 | if (!CAM_CPAS_CLIENT_STARTED(cpas_core, client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c: In function 'cam_cpas_hw_reg_read':
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:551:7: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
551 | if (!CAM_CPAS_CLIENT_VALID(client_indx))
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:35:4: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
35 | ((CAM_CPAS_CLIENT_VALID(indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:38:4: note: in expansion of macro 'CAM_CPAS_CLIENT_REGISTERED'
38 | ((CAM_CPAS_CLIENT_REGISTERED(cpas_core, indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:557:7: note: in expansion of macro 'CAM_CPAS_CLIENT_STARTED'
557 | if (!CAM_CPAS_CLIENT_STARTED(cpas_core, client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c: In function 'cam_cpas_hw_update_axi_vote':
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:758:7: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
758 | if (!CAM_CPAS_CLIENT_VALID(client_indx))
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:35:4: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
35 | ((CAM_CPAS_CLIENT_VALID(indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:38:4: note: in expansion of macro 'CAM_CPAS_CLIENT_REGISTERED'
38 | ((CAM_CPAS_CLIENT_REGISTERED(cpas_core, indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:765:7: note: in expansion of macro 'CAM_CPAS_CLIENT_STARTED'
765 | if (!CAM_CPAS_CLIENT_STARTED(cpas_core, client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c: In function 'cam_cpas_hw_update_ahb_vote':
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:916:7: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
916 | if (!CAM_CPAS_CLIENT_VALID(client_indx))
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:35:4: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
35 | ((CAM_CPAS_CLIENT_VALID(indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:38:4: note: in expansion of macro 'CAM_CPAS_CLIENT_REGISTERED'
38 | ((CAM_CPAS_CLIENT_REGISTERED(cpas_core, indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:923:7: note: in expansion of macro 'CAM_CPAS_CLIENT_STARTED'
923 | if (!CAM_CPAS_CLIENT_STARTED(cpas_core, client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c: In function 'cam_cpas_hw_start':
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:993:7: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
993 | if (!CAM_CPAS_CLIENT_VALID(client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:35:4: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
35 | ((CAM_CPAS_CLIENT_VALID(indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:1002:7: note: in expansion of macro 'CAM_CPAS_CLIENT_REGISTERED'
1002 | if (!CAM_CPAS_CLIENT_REGISTERED(cpas_core, client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:35:4: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
35 | ((CAM_CPAS_CLIENT_VALID(indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:38:4: note: in expansion of macro 'CAM_CPAS_CLIENT_REGISTERED'
38 | ((CAM_CPAS_CLIENT_REGISTERED(cpas_core, indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:1009:6: note: in expansion of macro 'CAM_CPAS_CLIENT_STARTED'
1009 | if (CAM_CPAS_CLIENT_STARTED(cpas_core, client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:959:31: warning: variable 'soc_private' set but not used [-Wunused-but-set-variable]
959 | struct cam_cpas_private_soc *soc_private = NULL;
| ^~~~~~~~~~~
In file included from drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:22:
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c: In function 'cam_cpas_hw_stop':
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:1115:7: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
1115 | if (!CAM_CPAS_CLIENT_VALID(client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:35:4: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
35 | ((CAM_CPAS_CLIENT_VALID(indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:38:4: note: in expansion of macro 'CAM_CPAS_CLIENT_REGISTERED'
38 | ((CAM_CPAS_CLIENT_REGISTERED(cpas_core, indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:1128:7: note: in expansion of macro 'CAM_CPAS_CLIENT_STARTED'
1128 | if (!CAM_CPAS_CLIENT_STARTED(cpas_core, client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:1092:31: warning: variable 'soc_private' set but not used [-Wunused-but-set-variable]
1092 | struct cam_cpas_private_soc *soc_private = NULL;
| ^~~~~~~~~~~
In file included from drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:22:
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c: In function 'cam_cpas_hw_unregister_client':
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:1326:7: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
1326 | if (!CAM_CPAS_CLIENT_VALID(client_indx))
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:35:4: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
35 | ((CAM_CPAS_CLIENT_VALID(indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:1333:7: note: in expansion of macro 'CAM_CPAS_CLIENT_REGISTERED'
1333 | if (!CAM_CPAS_CLIENT_REGISTERED(cpas_core, client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:33:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
33 | ((indx >= 0) && (indx < CAM_CPAS_MAX_CLIENTS))
| ^~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:35:4: note: in expansion of macro 'CAM_CPAS_CLIENT_VALID'
35 | ((CAM_CPAS_CLIENT_VALID(indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.h:38:4: note: in expansion of macro 'CAM_CPAS_CLIENT_REGISTERED'
38 | ((CAM_CPAS_CLIENT_REGISTERED(cpas_core, indx)) && \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/platform/camx/cam_cpas/cam_cpas_hw.c:1341:6: note: in expansion of macro 'CAM_CPAS_CLIENT_STARTED'
1341 | if (CAM_CPAS_CLIENT_STARTED(cpas_core, client_indx)) {
| ^~~~~~~~~~~~~~~~~~~~~~~
--
drivers/media/platform/camx/cam_isp/cam_isp_context.c: In function '__cam_isp_ctx_dump_req_info':
>> drivers/media/platform/camx/cam_isp/cam_isp_context.c:2267:26: warning: variable 'ctx_isp' set but not used [-Wunused-but-set-variable]
2267 | struct cam_isp_context *ctx_isp;
| ^~~~~~~
drivers/media/platform/camx/cam_isp/cam_isp_context.c: In function 'cam_isp_context_dump_active_request':
>> drivers/media/platform/camx/cam_isp/cam_isp_context.c:4348:41: warning: variable 'hw_update_data' set but not used [-Wunused-but-set-variable]
4348 | struct cam_isp_prepare_hw_update_data *hw_update_data = NULL;
| ^~~~~~~~~~~~~~
--
drivers/media/platform/camx/cam_cpas/cpas_top/cam_cpastop_hw.c: In function 'cam_cpastop_init_hw_version':
>> drivers/media/platform/camx/cam_cpas/cpas_top/cam_cpastop_hw.c:584:6: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
584 | int rc = 0;
| ^~
--
drivers/media/platform/camx/cam_jpeg/cam_jpeg_context.c: In function 'cam_jpeg_context_dump_active_request':
>> drivers/media/platform/camx/cam_jpeg/cam_jpeg_context.c:37:6: warning: variable 'closest_port' set but not used [-Wunused-but-set-variable]
37 | int closest_port;
| ^~~~~~~~~~~~
--
drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c: In function 'cam_ife_hw_mgr_acquire_res_ife_csid_pxl':
>> drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:1569:44: warning: variable 'ife_hw_mgr' set but not used [-Wunused-but-set-variable]
1569 | struct cam_ife_hw_mgr *ife_hw_mgr;
| ^~~~~~~~~~
drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c: In function 'cam_ife_hw_mgr_acquire_res_ife_csid_rdi':
drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:1709:39: warning: variable 'ife_hw_mgr' set but not used [-Wunused-but-set-variable]
1709 | struct cam_ife_hw_mgr *ife_hw_mgr;
| ^~~~~~~~~~
drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c: In function 'cam_ife_hw_mgr_preprocess_port':
drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:1892:37: warning: variable 'ife_hw_mgr' set but not used [-Wunused-but-set-variable]
1892 | struct cam_ife_hw_mgr *ife_hw_mgr;
| ^~~~~~~~~~
drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c: In function 'cam_ife_mgr_acquire_hw_for_ctx':
>> drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:1930:6: warning: variable 'is_dual_vfe' set but not used [-Wunused-but-set-variable]
1930 | int is_dual_vfe = 0;
| ^~~~~~~~~~~
drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c: In function 'cam_ife_hw_mgr_handle_buf_done_for_hw_res':
>> drivers/media/platform/camx/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c:5877:12: warning: variable 'error_resc_handle' set but not used [-Wunused-but-set-variable]
5877 | uint32_t error_resc_handle[CAM_IFE_HW_OUT_RES_MAX];
| ^~~~~~~~~~~~~~~~~
..
vim +312 drivers/media/platform/camx/cam_cdm/cam_cdm_util.c
46ba272ec14153 Atanas Filipov 2020-06-11 310
46ba272ec14153 Atanas Filipov 2020-06-11 311 struct cam_cdm_utils_ops CDM170_ops = {
46ba272ec14153 Atanas Filipov 2020-06-11 @312 cdm_get_cmd_header_size,
46ba272ec14153 Atanas Filipov 2020-06-11 @313 cdm_required_size_reg_continuous,
46ba272ec14153 Atanas Filipov 2020-06-11 314 cdm_required_size_reg_random,
46ba272ec14153 Atanas Filipov 2020-06-11 315 cdm_required_size_dmi,
46ba272ec14153 Atanas Filipov 2020-06-11 @316 cdm_required_size_genirq,
46ba272ec14153 Atanas Filipov 2020-06-11 317 cdm_required_size_indirect,
46ba272ec14153 Atanas Filipov 2020-06-11 318 cdm_required_size_changebase,
46ba272ec14153 Atanas Filipov 2020-06-11 319 cdm_offsetof_dmi_addr,
46ba272ec14153 Atanas Filipov 2020-06-11 @320 cdm_offsetof_indirect_addr,
46ba272ec14153 Atanas Filipov 2020-06-11 321 cdm_write_regcontinuous,
46ba272ec14153 Atanas Filipov 2020-06-11 322 cdm_write_regrandom,
46ba272ec14153 Atanas Filipov 2020-06-11 323 cdm_write_dmi,
46ba272ec14153 Atanas Filipov 2020-06-11 324 cdm_write_indirect,
46ba272ec14153 Atanas Filipov 2020-06-11 325 cdm_write_changebase,
46ba272ec14153 Atanas Filipov 2020-06-11 @326 cdm_write_genirq,
46ba272ec14153 Atanas Filipov 2020-06-11 327 };
46ba272ec14153 Atanas Filipov 2020-06-11 328
8c8872014dc856 Ricardo Ribalda 2021-05-28 329 static int
8c8872014dc856 Ricardo Ribalda 2021-05-28 330 cam_cdm_get_ioremap_from_base(
8c8872014dc856 Ricardo Ribalda 2021-05-28 331 uint32_t hw_base,
46ba272ec14153 Atanas Filipov 2020-06-11 332 uint32_t base_array_size,
46ba272ec14153 Atanas Filipov 2020-06-11 333 struct cam_soc_reg_map *base_table[CAM_SOC_MAX_BLOCK],
46ba272ec14153 Atanas Filipov 2020-06-11 334 void __iomem **device_base)
46ba272ec14153 Atanas Filipov 2020-06-11 335 {
46ba272ec14153 Atanas Filipov 2020-06-11 336 int ret = -EINVAL, i;
46ba272ec14153 Atanas Filipov 2020-06-11 337
46ba272ec14153 Atanas Filipov 2020-06-11 338 for (i = 0; i < base_array_size; i++) {
46ba272ec14153 Atanas Filipov 2020-06-11 339 if (base_table[i])
46ba272ec14153 Atanas Filipov 2020-06-11 340 CAM_DBG(CAM_CDM, "In loop %d ioremap for %x addr=%x",
46ba272ec14153 Atanas Filipov 2020-06-11 341 i, (base_table[i])->mem_cam_base, hw_base);
46ba272ec14153 Atanas Filipov 2020-06-11 342 if ((base_table[i]) &&
46ba272ec14153 Atanas Filipov 2020-06-11 343 ((base_table[i])->mem_cam_base == hw_base)) {
46ba272ec14153 Atanas Filipov 2020-06-11 344 *device_base = (base_table[i])->mem_base;
46ba272ec14153 Atanas Filipov 2020-06-11 345 ret = 0;
46ba272ec14153 Atanas Filipov 2020-06-11 346 break;
46ba272ec14153 Atanas Filipov 2020-06-11 347 }
46ba272ec14153 Atanas Filipov 2020-06-11 348 }
46ba272ec14153 Atanas Filipov 2020-06-11 349
46ba272ec14153 Atanas Filipov 2020-06-11 350 return ret;
46ba272ec14153 Atanas Filipov 2020-06-11 351 }
46ba272ec14153 Atanas Filipov 2020-06-11 352
46ba272ec14153 Atanas Filipov 2020-06-11 353 static int cam_cdm_util_reg_cont_write(void __iomem *base_addr,
46ba272ec14153 Atanas Filipov 2020-06-11 354 uint32_t *cmd_buf, uint32_t cmd_buf_size, uint32_t *used_bytes)
46ba272ec14153 Atanas Filipov 2020-06-11 355 {
46ba272ec14153 Atanas Filipov 2020-06-11 356 int ret = 0;
46ba272ec14153 Atanas Filipov 2020-06-11 357 uint32_t *data;
46ba272ec14153 Atanas Filipov 2020-06-11 358 struct cdm_regcontinuous_cmd *reg_cont;
46ba272ec14153 Atanas Filipov 2020-06-11 359
46ba272ec14153 Atanas Filipov 2020-06-11 360 if ((cmd_buf_size < cdm_get_cmd_header_size(CAM_CDM_CMD_REG_CONT)) ||
46ba272ec14153 Atanas Filipov 2020-06-11 361 (!base_addr)) {
46ba272ec14153 Atanas Filipov 2020-06-11 362 CAM_ERR(CAM_CDM, "invalid base addr and data length %d %pK",
46ba272ec14153 Atanas Filipov 2020-06-11 363 cmd_buf_size, base_addr);
46ba272ec14153 Atanas Filipov 2020-06-11 364 return -EINVAL;
46ba272ec14153 Atanas Filipov 2020-06-11 365 }
46ba272ec14153 Atanas Filipov 2020-06-11 366
46ba272ec14153 Atanas Filipov 2020-06-11 367 reg_cont = (struct cdm_regcontinuous_cmd *)cmd_buf;
46ba272ec14153 Atanas Filipov 2020-06-11 368 if ((!reg_cont->count) || (reg_cont->count > 0x10000) ||
46ba272ec14153 Atanas Filipov 2020-06-11 369 (((reg_cont->count * sizeof(uint32_t)) +
46ba272ec14153 Atanas Filipov 2020-06-11 370 cdm_get_cmd_header_size(CAM_CDM_CMD_REG_CONT)) >
46ba272ec14153 Atanas Filipov 2020-06-11 371 cmd_buf_size)) {
46ba272ec14153 Atanas Filipov 2020-06-11 372 CAM_ERR(CAM_CDM, "buffer size %d is not sufficient for count%d",
46ba272ec14153 Atanas Filipov 2020-06-11 373 cmd_buf_size, reg_cont->count);
46ba272ec14153 Atanas Filipov 2020-06-11 374 return -EINVAL;
46ba272ec14153 Atanas Filipov 2020-06-11 375 }
46ba272ec14153 Atanas Filipov 2020-06-11 376 data = cmd_buf + cdm_get_cmd_header_size(CAM_CDM_CMD_REG_CONT);
46ba272ec14153 Atanas Filipov 2020-06-11 377 cam_io_memcpy(base_addr + reg_cont->offset, data,
46ba272ec14153 Atanas Filipov 2020-06-11 378 reg_cont->count * sizeof(uint32_t));
46ba272ec14153 Atanas Filipov 2020-06-11 379
46ba272ec14153 Atanas Filipov 2020-06-11 380 *used_bytes = (reg_cont->count * sizeof(uint32_t)) +
46ba272ec14153 Atanas Filipov 2020-06-11 381 (4 * cdm_get_cmd_header_size(CAM_CDM_CMD_REG_CONT));
46ba272ec14153 Atanas Filipov 2020-06-11 382
46ba272ec14153 Atanas Filipov 2020-06-11 383 return ret;
46ba272ec14153 Atanas Filipov 2020-06-11 384 }
46ba272ec14153 Atanas Filipov 2020-06-11 385
46ba272ec14153 Atanas Filipov 2020-06-11 386 static int cam_cdm_util_reg_random_write(void __iomem *base_addr,
46ba272ec14153 Atanas Filipov 2020-06-11 387 uint32_t *cmd_buf, uint32_t cmd_buf_size, uint32_t *used_bytes)
46ba272ec14153 Atanas Filipov 2020-06-11 388 {
46ba272ec14153 Atanas Filipov 2020-06-11 389 uint32_t i;
46ba272ec14153 Atanas Filipov 2020-06-11 390 struct cdm_regrandom_cmd *reg_random;
46ba272ec14153 Atanas Filipov 2020-06-11 391 uint32_t *data;
46ba272ec14153 Atanas Filipov 2020-06-11 392
46ba272ec14153 Atanas Filipov 2020-06-11 393 if (!base_addr) {
46ba272ec14153 Atanas Filipov 2020-06-11 394 CAM_ERR(CAM_CDM, "invalid base address");
46ba272ec14153 Atanas Filipov 2020-06-11 395 return -EINVAL;
46ba272ec14153 Atanas Filipov 2020-06-11 396 }
46ba272ec14153 Atanas Filipov 2020-06-11 397
46ba272ec14153 Atanas Filipov 2020-06-11 398 reg_random = (struct cdm_regrandom_cmd *) cmd_buf;
46ba272ec14153 Atanas Filipov 2020-06-11 399 if ((!reg_random->count) || (reg_random->count > 0x10000) ||
46ba272ec14153 Atanas Filipov 2020-06-11 400 (((reg_random->count * (sizeof(uint32_t) * 2)) +
46ba272ec14153 Atanas Filipov 2020-06-11 401 cdm_get_cmd_header_size(CAM_CDM_CMD_REG_RANDOM)) >
46ba272ec14153 Atanas Filipov 2020-06-11 402 cmd_buf_size)) {
46ba272ec14153 Atanas Filipov 2020-06-11 403 CAM_ERR(CAM_CDM, "invalid reg_count %d cmd_buf_size %d",
46ba272ec14153 Atanas Filipov 2020-06-11 404 reg_random->count, cmd_buf_size);
46ba272ec14153 Atanas Filipov 2020-06-11 405 return -EINVAL;
46ba272ec14153 Atanas Filipov 2020-06-11 406 }
46ba272ec14153 Atanas Filipov 2020-06-11 407 data = cmd_buf + cdm_get_cmd_header_size(CAM_CDM_CMD_REG_RANDOM);
46ba272ec14153 Atanas Filipov 2020-06-11 408
46ba272ec14153 Atanas Filipov 2020-06-11 409 for (i = 0; i < reg_random->count; i++) {
46ba272ec14153 Atanas Filipov 2020-06-11 410 CAM_DBG(CAM_CDM, "reg random: offset %pK, value 0x%x",
46ba272ec14153 Atanas Filipov 2020-06-11 411 ((void __iomem *)(base_addr + data[0])),
46ba272ec14153 Atanas Filipov 2020-06-11 412 data[1]);
46ba272ec14153 Atanas Filipov 2020-06-11 413 cam_io_w(data[1], base_addr + data[0]);
46ba272ec14153 Atanas Filipov 2020-06-11 414 data += 2;
46ba272ec14153 Atanas Filipov 2020-06-11 415 }
46ba272ec14153 Atanas Filipov 2020-06-11 416
46ba272ec14153 Atanas Filipov 2020-06-11 417 *used_bytes = ((reg_random->count * (sizeof(uint32_t) * 2)) +
46ba272ec14153 Atanas Filipov 2020-06-11 418 (4 * cdm_get_cmd_header_size(CAM_CDM_CMD_REG_RANDOM)));
46ba272ec14153 Atanas Filipov 2020-06-11 419
46ba272ec14153 Atanas Filipov 2020-06-11 420 return 0;
46ba272ec14153 Atanas Filipov 2020-06-11 421 }
46ba272ec14153 Atanas Filipov 2020-06-11 422
46ba272ec14153 Atanas Filipov 2020-06-11 423 static int cam_cdm_util_swd_dmi_write(uint32_t cdm_cmd_type,
46ba272ec14153 Atanas Filipov 2020-06-11 424 void __iomem *base_addr, uint32_t *cmd_buf, uint32_t cmd_buf_size,
46ba272ec14153 Atanas Filipov 2020-06-11 425 uint32_t *used_bytes)
46ba272ec14153 Atanas Filipov 2020-06-11 426 {
46ba272ec14153 Atanas Filipov 2020-06-11 427 uint32_t i;
46ba272ec14153 Atanas Filipov 2020-06-11 428 struct cdm_dmi_cmd *swd_dmi;
46ba272ec14153 Atanas Filipov 2020-06-11 429 uint32_t *data;
46ba272ec14153 Atanas Filipov 2020-06-11 430
46ba272ec14153 Atanas Filipov 2020-06-11 431 swd_dmi = (struct cdm_dmi_cmd *)cmd_buf;
46ba272ec14153 Atanas Filipov 2020-06-11 432
46ba272ec14153 Atanas Filipov 2020-06-11 433 if (cmd_buf_size < (cdm_required_size_dmi() + swd_dmi->length + 1)) {
46ba272ec14153 Atanas Filipov 2020-06-11 434 CAM_ERR(CAM_CDM, "invalid CDM_SWD_DMI length %d",
46ba272ec14153 Atanas Filipov 2020-06-11 435 swd_dmi->length + 1);
46ba272ec14153 Atanas Filipov 2020-06-11 436 return -EINVAL;
46ba272ec14153 Atanas Filipov 2020-06-11 437 }
46ba272ec14153 Atanas Filipov 2020-06-11 438 data = cmd_buf + cdm_required_size_dmi();
46ba272ec14153 Atanas Filipov 2020-06-11 439
46ba272ec14153 Atanas Filipov 2020-06-11 440 if (cdm_cmd_type == CAM_CDM_CMD_SWD_DMI_64) {
46ba272ec14153 Atanas Filipov 2020-06-11 441 for (i = 0; i < (swd_dmi->length + 1)/8; i++) {
46ba272ec14153 Atanas Filipov 2020-06-11 442 cam_io_w_mb(data[0], base_addr +
46ba272ec14153 Atanas Filipov 2020-06-11 443 swd_dmi->DMIAddr + CAM_CDM_DMI_DATA_LO_OFFSET);
46ba272ec14153 Atanas Filipov 2020-06-11 444 cam_io_w_mb(data[1], base_addr +
46ba272ec14153 Atanas Filipov 2020-06-11 445 swd_dmi->DMIAddr + CAM_CDM_DMI_DATA_HI_OFFSET);
46ba272ec14153 Atanas Filipov 2020-06-11 446 data += 2;
46ba272ec14153 Atanas Filipov 2020-06-11 447 }
46ba272ec14153 Atanas Filipov 2020-06-11 448 } else {
46ba272ec14153 Atanas Filipov 2020-06-11 449 for (i = 0; i < (swd_dmi->length + 1)/4; i++) {
46ba272ec14153 Atanas Filipov 2020-06-11 450 cam_io_w_mb(data[0], base_addr +
46ba272ec14153 Atanas Filipov 2020-06-11 451 swd_dmi->DMIAddr + CAM_CDM_DMI_DATA_LO_OFFSET);
46ba272ec14153 Atanas Filipov 2020-06-11 452 data += 1;
46ba272ec14153 Atanas Filipov 2020-06-11 453 }
46ba272ec14153 Atanas Filipov 2020-06-11 454 }
46ba272ec14153 Atanas Filipov 2020-06-11 455 *used_bytes = (4 * cdm_required_size_dmi()) + swd_dmi->length + 1;
46ba272ec14153 Atanas Filipov 2020-06-11 456
46ba272ec14153 Atanas Filipov 2020-06-11 457 return 0;
46ba272ec14153 Atanas Filipov 2020-06-11 458 }
46ba272ec14153 Atanas Filipov 2020-06-11 459
46ba272ec14153 Atanas Filipov 2020-06-11 460 int cam_cdm_util_cmd_buf_write(void __iomem **current_device_base,
46ba272ec14153 Atanas Filipov 2020-06-11 461 uint32_t *cmd_buf, uint32_t cmd_buf_size,
46ba272ec14153 Atanas Filipov 2020-06-11 462 struct cam_soc_reg_map *base_table[CAM_SOC_MAX_BLOCK],
46ba272ec14153 Atanas Filipov 2020-06-11 463 uint32_t base_array_size, uint8_t bl_tag)
46ba272ec14153 Atanas Filipov 2020-06-11 464 {
46ba272ec14153 Atanas Filipov 2020-06-11 465 int ret = 0;
46ba272ec14153 Atanas Filipov 2020-06-11 @466 uint32_t cdm_cmd_type = 0, total_cmd_buf_size = 0;
46ba272ec14153 Atanas Filipov 2020-06-11 467 uint32_t used_bytes = 0;
46ba272ec14153 Atanas Filipov 2020-06-11 468
46ba272ec14153 Atanas Filipov 2020-06-11 469 total_cmd_buf_size = cmd_buf_size;
46ba272ec14153 Atanas Filipov 2020-06-11 470
46ba272ec14153 Atanas Filipov 2020-06-11 471 while (cmd_buf_size > 0) {
46ba272ec14153 Atanas Filipov 2020-06-11 472 CAM_DBG(CAM_CDM, "cmd data=%x", *cmd_buf);
46ba272ec14153 Atanas Filipov 2020-06-11 473 cdm_cmd_type = (*cmd_buf >> CAM_CDM_COMMAND_OFFSET);
46ba272ec14153 Atanas Filipov 2020-06-11 474 switch (cdm_cmd_type) {
46ba272ec14153 Atanas Filipov 2020-06-11 475 case CAM_CDM_CMD_REG_CONT: {
46ba272ec14153 Atanas Filipov 2020-06-11 476 ret = cam_cdm_util_reg_cont_write(*current_device_base,
46ba272ec14153 Atanas Filipov 2020-06-11 477 cmd_buf, cmd_buf_size, &used_bytes);
46ba272ec14153 Atanas Filipov 2020-06-11 478 if (ret)
46ba272ec14153 Atanas Filipov 2020-06-11 479 break;
46ba272ec14153 Atanas Filipov 2020-06-11 480
46ba272ec14153 Atanas Filipov 2020-06-11 481 if (used_bytes > 0) {
46ba272ec14153 Atanas Filipov 2020-06-11 482 cmd_buf_size -= used_bytes;
46ba272ec14153 Atanas Filipov 2020-06-11 483 cmd_buf += used_bytes/4;
46ba272ec14153 Atanas Filipov 2020-06-11 484 }
46ba272ec14153 Atanas Filipov 2020-06-11 485 }
46ba272ec14153 Atanas Filipov 2020-06-11 486 break;
46ba272ec14153 Atanas Filipov 2020-06-11 487 case CAM_CDM_CMD_REG_RANDOM: {
46ba272ec14153 Atanas Filipov 2020-06-11 488 ret = cam_cdm_util_reg_random_write(
46ba272ec14153 Atanas Filipov 2020-06-11 489 *current_device_base, cmd_buf, cmd_buf_size,
46ba272ec14153 Atanas Filipov 2020-06-11 490 &used_bytes);
46ba272ec14153 Atanas Filipov 2020-06-11 491 if (ret)
46ba272ec14153 Atanas Filipov 2020-06-11 492 break;
46ba272ec14153 Atanas Filipov 2020-06-11 493
46ba272ec14153 Atanas Filipov 2020-06-11 494 if (used_bytes > 0) {
46ba272ec14153 Atanas Filipov 2020-06-11 495 cmd_buf_size -= used_bytes;
46ba272ec14153 Atanas Filipov 2020-06-11 496 cmd_buf += used_bytes / 4;
46ba272ec14153 Atanas Filipov 2020-06-11 497 }
46ba272ec14153 Atanas Filipov 2020-06-11 498 }
46ba272ec14153 Atanas Filipov 2020-06-11 499 break;
46ba272ec14153 Atanas Filipov 2020-06-11 500 case CAM_CDM_CMD_SWD_DMI_32:
46ba272ec14153 Atanas Filipov 2020-06-11 501 case CAM_CDM_CMD_SWD_DMI_64: {
46ba272ec14153 Atanas Filipov 2020-06-11 502 if (*current_device_base == 0) {
46ba272ec14153 Atanas Filipov 2020-06-11 503 CAM_ERR(CAM_CDM,
46ba272ec14153 Atanas Filipov 2020-06-11 504 "Got SWI DMI cmd =%d for invalid hw",
46ba272ec14153 Atanas Filipov 2020-06-11 505 cdm_cmd_type);
46ba272ec14153 Atanas Filipov 2020-06-11 506 ret = -EINVAL;
46ba272ec14153 Atanas Filipov 2020-06-11 507 break;
46ba272ec14153 Atanas Filipov 2020-06-11 508 }
46ba272ec14153 Atanas Filipov 2020-06-11 509 ret = cam_cdm_util_swd_dmi_write(cdm_cmd_type,
46ba272ec14153 Atanas Filipov 2020-06-11 510 *current_device_base, cmd_buf, cmd_buf_size,
46ba272ec14153 Atanas Filipov 2020-06-11 511 &used_bytes);
46ba272ec14153 Atanas Filipov 2020-06-11 512 if (ret)
46ba272ec14153 Atanas Filipov 2020-06-11 513 break;
46ba272ec14153 Atanas Filipov 2020-06-11 514
46ba272ec14153 Atanas Filipov 2020-06-11 515 if (used_bytes > 0) {
46ba272ec14153 Atanas Filipov 2020-06-11 516 cmd_buf_size -= used_bytes;
46ba272ec14153 Atanas Filipov 2020-06-11 517 cmd_buf += used_bytes / 4;
46ba272ec14153 Atanas Filipov 2020-06-11 518 }
46ba272ec14153 Atanas Filipov 2020-06-11 519 }
46ba272ec14153 Atanas Filipov 2020-06-11 520 break;
46ba272ec14153 Atanas Filipov 2020-06-11 521 case CAM_CDM_CMD_CHANGE_BASE: {
46ba272ec14153 Atanas Filipov 2020-06-11 522 struct cdm_changebase_cmd *change_base_cmd =
46ba272ec14153 Atanas Filipov 2020-06-11 523 (struct cdm_changebase_cmd *)cmd_buf;
46ba272ec14153 Atanas Filipov 2020-06-11 524
46ba272ec14153 Atanas Filipov 2020-06-11 525 ret = cam_cdm_get_ioremap_from_base(
46ba272ec14153 Atanas Filipov 2020-06-11 526 change_base_cmd->base, base_array_size,
46ba272ec14153 Atanas Filipov 2020-06-11 527 base_table, current_device_base);
46ba272ec14153 Atanas Filipov 2020-06-11 528 if (ret != 0) {
46ba272ec14153 Atanas Filipov 2020-06-11 529 CAM_ERR(CAM_CDM,
46ba272ec14153 Atanas Filipov 2020-06-11 530 "Get ioremap change base failed %x",
46ba272ec14153 Atanas Filipov 2020-06-11 531 change_base_cmd->base);
46ba272ec14153 Atanas Filipov 2020-06-11 532 break;
46ba272ec14153 Atanas Filipov 2020-06-11 533 }
46ba272ec14153 Atanas Filipov 2020-06-11 534 CAM_DBG(CAM_CDM, "Got ioremap for %x addr=%pK",
46ba272ec14153 Atanas Filipov 2020-06-11 535 change_base_cmd->base,
46ba272ec14153 Atanas Filipov 2020-06-11 536 current_device_base);
46ba272ec14153 Atanas Filipov 2020-06-11 537 cmd_buf_size -= (4 *
46ba272ec14153 Atanas Filipov 2020-06-11 538 cdm_required_size_changebase());
46ba272ec14153 Atanas Filipov 2020-06-11 539 cmd_buf += cdm_required_size_changebase();
46ba272ec14153 Atanas Filipov 2020-06-11 540 }
46ba272ec14153 Atanas Filipov 2020-06-11 541 break;
46ba272ec14153 Atanas Filipov 2020-06-11 542 default:
46ba272ec14153 Atanas Filipov 2020-06-11 543 CAM_ERR(CAM_CDM, "unsupported cdm_cmd_type type 0%x",
46ba272ec14153 Atanas Filipov 2020-06-11 544 cdm_cmd_type);
46ba272ec14153 Atanas Filipov 2020-06-11 545 ret = -EINVAL;
46ba272ec14153 Atanas Filipov 2020-06-11 546 break;
46ba272ec14153 Atanas Filipov 2020-06-11 547 }
46ba272ec14153 Atanas Filipov 2020-06-11 548
46ba272ec14153 Atanas Filipov 2020-06-11 549 if (ret < 0)
46ba272ec14153 Atanas Filipov 2020-06-11 550 break;
46ba272ec14153 Atanas Filipov 2020-06-11 551 }
46ba272ec14153 Atanas Filipov 2020-06-11 552
46ba272ec14153 Atanas Filipov 2020-06-11 553 return ret;
46ba272ec14153 Atanas Filipov 2020-06-11 554 }
46ba272ec14153 Atanas Filipov 2020-06-11 555
:::::: The code at line 312 was first introduced by commit
:::::: 46ba272ec141535d56c5a9117d7b3775c84cd466 CHROMIUM: media: camx: soc: Add initial drivers
:::::: TO: Atanas Filipov <afilipov(a)mm-sol.com>
:::::: CC: Commit Bot <commit-bot(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
Re: [PATCH] net: add pf_family_names[] for protocol family
by kernel test robot
Hi Yejune,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
[also build test ERROR on net/master linus/master sparc-next/master v5.13-rc6 next-20210618]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Yejune-Deng/net-add-pf_family_na...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 8fe088bd4fd12f4c8899b51d5bc3daad98767d49
config: sparc64-randconfig-r032-20210618 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/f385a306caae1deea33a32795753f9cb8...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yejune-Deng/net-add-pf_family_names-for-protocol-family/20210618-223434
git checkout f385a306caae1deea33a32795753f9cb883fb7d0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sparc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/net.h:27,
from include/linux/skbuff.h:26,
from include/linux/filter.h:13,
from arch/sparc/kernel/sys_sparc32.c:29:
>> include/uapi/linux/net.h:58:27: error: 'pf_family_names' defined but not used [-Werror=unused-const-variable=]
58 | static const char * const pf_family_names[] = {
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
arch/sparc/kernel/setup_64.c:615:13: error: no previous prototype for 'alloc_irqstack_bootmem' [-Werror=missing-prototypes]
615 | void __init alloc_irqstack_bootmem(void)
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/net.h:27,
from include/linux/skbuff.h:26,
from include/net/net_namespace.h:39,
from include/linux/inet.h:42,
from arch/sparc/kernel/setup_64.c:27:
>> include/uapi/linux/net.h:58:27: error: 'pf_family_names' defined but not used [-Werror=unused-const-variable=]
58 | static const char * const pf_family_names[] = {
| ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for LOCKDEP
Depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && (FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86)
Selected by
- DEBUG_LOCK_ALLOC && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
vim +/pf_family_names +58 include/uapi/linux/net.h
57
> 58 static const char * const pf_family_names[] = {
59 [PF_UNSPEC] = "PF_UNSPEC",
60 [PF_UNIX] = "PF_UNIX/PF_LOCAL",
61 [PF_INET] = "PF_INET",
62 [PF_AX25] = "PF_AX25",
63 [PF_IPX] = "PF_IPX",
64 [PF_APPLETALK] = "PF_APPLETALK",
65 [PF_NETROM] = "PF_NETROM",
66 [PF_BRIDGE] = "PF_BRIDGE",
67 [PF_ATMPVC] = "PF_ATMPVC",
68 [PF_X25] = "PF_X25",
69 [PF_INET6] = "PF_INET6",
70 [PF_ROSE] = "PF_ROSE",
71 [PF_DECnet] = "PF_DECnet",
72 [PF_NETBEUI] = "PF_NETBEUI",
73 [PF_SECURITY] = "PF_SECURITY",
74 [PF_KEY] = "PF_KEY",
75 [PF_NETLINK] = "PF_NETLINK/PF_ROUTE",
76 [PF_PACKET] = "PF_PACKET",
77 [PF_ASH] = "PF_ASH",
78 [PF_ECONET] = "PF_ECONET",
79 [PF_ATMSVC] = "PF_ATMSVC",
80 [PF_RDS] = "PF_RDS",
81 [PF_SNA] = "PF_SNA",
82 [PF_IRDA] = "PF_IRDA",
83 [PF_PPPOX] = "PF_PPPOX",
84 [PF_WANPIPE] = "PF_WANPIPE",
85 [PF_LLC] = "PF_LLC",
86 [PF_IB] = "PF_IB",
87 [PF_MPLS] = "PF_MPLS",
88 [PF_CAN] = "PF_CAN",
89 [PF_TIPC] = "PF_TIPC",
90 [PF_BLUETOOTH] = "PF_BLUETOOTH",
91 [PF_IUCV] = "PF_IUCV",
92 [PF_RXRPC] = "PF_RXRPC",
93 [PF_ISDN] = "PF_ISDN",
94 [PF_PHONET] = "PF_PHONET",
95 [PF_IEEE802154] = "PF_IEEE802154",
96 [PF_CAIF] = "PF_CAIF",
97 [PF_ALG] = "PF_ALG",
98 [PF_NFC] = "PF_NFC",
99 [PF_VSOCK] = "PF_VSOCK",
100 [PF_KCM] = "PF_KCM",
101 [PF_QIPCRTR] = "PF_QIPCRTR",
102 [PF_SMC] = "PF_SMC",
103 [PF_XDP] = "PF_XDP",
104 };
105
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[intel-linux-intel-lts:4.19/android 8/8] drivers/soc/qcom/smem.c:491:21: error: no member named 'global_partition' in 'struct qcom_smem'
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 4.19/android
head: 412ae5100f1356b2a509a62ab14093ff6f26acfd
commit: 412ae5100f1356b2a509a62ab14093ff6f26acfd [8/8] soc: qcom: smem: validate fields of shared structures Structures in shared memory that can be modified by remote processors may have untrusted values, they should be validated before use.
config: arm64-randconfig-r003-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/intel/linux-intel-lts/commit/412ae5100f1356b2a509a62ab...
git remote add intel-linux-intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-linux-intel-lts 4.19/android
git checkout 412ae5100f1356b2a509a62ab14093ff6f26acfd
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
drivers/soc/qcom/smem.c:416:3: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
le16_to_cpu(phdr->host0), le16_to_cpu(phdr->host1));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:1450:32: note: expanded from macro 'dev_err'
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/byteorder/generic.h:91:21: note: expanded from macro 'le16_to_cpu'
#define le16_to_cpu __le16_to_cpu
^
include/uapi/linux/byteorder/big_endian.h:36:26: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/soc/qcom/smem.c:416:29: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
le16_to_cpu(phdr->host0), le16_to_cpu(phdr->host1));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:1450:32: note: expanded from macro 'dev_err'
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/byteorder/generic.h:91:21: note: expanded from macro 'le16_to_cpu'
#define le16_to_cpu __le16_to_cpu
^
include/uapi/linux/byteorder/big_endian.h:36:26: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/soc/qcom/smem.c:491:21: error: no member named 'global_partition' in 'struct qcom_smem'
} else if (__smem->global_partition) {
~~~~~~ ^
>> drivers/soc/qcom/smem.c:492:9: error: assigning to 'struct smem_ptable_entry *' from incompatible type 'struct smem_ptable_entry'; take the address with &
entry = __smem->global_ptable_entries[host];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&
>> drivers/soc/qcom/smem.c:549:36: error: expected ';' at end of declaration
struct smem_partition_header *phdr
^
;
>> drivers/soc/qcom/smem.c:581:15: error: implicit declaration of function 'entry_to_item' [-Werror,-Wimplicit-function-declaration]
item_ptr = entry_to_item(e);
^
>> drivers/soc/qcom/smem.c:581:13: warning: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
item_ptr = entry_to_item(e);
^ ~~~~~~~~~~~~~~~~
drivers/soc/qcom/smem.c:616:4: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
le16_to_cpu(phdr->host0), le16_to_cpu(phdr->host1));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:1450:32: note: expanded from macro 'dev_err'
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/byteorder/generic.h:91:21: note: expanded from macro 'le16_to_cpu'
#define le16_to_cpu __le16_to_cpu
^
include/uapi/linux/byteorder/big_endian.h:36:26: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/soc/qcom/smem.c:616:30: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
le16_to_cpu(phdr->host0), le16_to_cpu(phdr->host1));
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/device.h:1450:32: note: expanded from macro 'dev_err'
_dev_err(dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/byteorder/generic.h:91:21: note: expanded from macro 'le16_to_cpu'
#define le16_to_cpu __le16_to_cpu
^
include/uapi/linux/byteorder/big_endian.h:36:26: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:105:2: note: expanded from macro '__swab16'
(__builtin_constant_p((__u16)(x)) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/soc/qcom/smem.c:655:21: error: no member named 'global_partition' in 'struct qcom_smem'
} else if (__smem->global_partition) {
~~~~~~ ^
drivers/soc/qcom/smem.c:656:9: error: assigning to 'struct smem_ptable_entry *' from incompatible type 'struct smem_ptable_entry'; take the address with &
entry = __smem->global_ptable_entries[host];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&
>> drivers/soc/qcom/smem.c:696:8: error: incompatible pointer types assigning to 'struct smem_partition_header *' from 'struct smem_ptable_entry *' [-Werror,-Wincompatible-pointer-types]
phdr = __smem->global_ptable_entries;
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/soc/qcom/smem.c:791:12: error: no member named 'global_partition' in 'struct qcom_smem'
if (smem->global_partition) {
~~~~ ^
drivers/soc/qcom/smem.c:847:8: error: no member named 'global_partition' in 'struct qcom_smem'
smem->global_partition = header;
~~~~ ^
5 warnings and 9 errors generated.
vim +491 drivers/soc/qcom/smem.c
4b638df4c9d556a Bjorn Andersson 2015-06-26 453
4b638df4c9d556a Bjorn Andersson 2015-06-26 454 /**
4b638df4c9d556a Bjorn Andersson 2015-06-26 455 * qcom_smem_alloc() - allocate space for a smem item
4b638df4c9d556a Bjorn Andersson 2015-06-26 456 * @host: remote processor id, or -1
4b638df4c9d556a Bjorn Andersson 2015-06-26 457 * @item: smem item handle
4b638df4c9d556a Bjorn Andersson 2015-06-26 458 * @size: number of bytes to be allocated
4b638df4c9d556a Bjorn Andersson 2015-06-26 459 *
4b638df4c9d556a Bjorn Andersson 2015-06-26 460 * Allocate space for a given smem item of size @size, given that the item is
4b638df4c9d556a Bjorn Andersson 2015-06-26 461 * not yet allocated.
4b638df4c9d556a Bjorn Andersson 2015-06-26 462 */
4b638df4c9d556a Bjorn Andersson 2015-06-26 463 int qcom_smem_alloc(unsigned host, unsigned item, size_t size)
4b638df4c9d556a Bjorn Andersson 2015-06-26 464 {
d52e404874369f1 Chris Lew 2017-10-11 465 struct smem_partition_header *phdr;
412ae5100f1356b nanli2x 2020-09-22 466 struct smem_ptable_entry *entry;
4b638df4c9d556a Bjorn Andersson 2015-06-26 467 unsigned long flags;
4b638df4c9d556a Bjorn Andersson 2015-06-26 468 int ret;
4b638df4c9d556a Bjorn Andersson 2015-06-26 469
4b638df4c9d556a Bjorn Andersson 2015-06-26 470 if (!__smem)
4b638df4c9d556a Bjorn Andersson 2015-06-26 471 return -EPROBE_DEFER;
4b638df4c9d556a Bjorn Andersson 2015-06-26 472
4b638df4c9d556a Bjorn Andersson 2015-06-26 473 if (item < SMEM_ITEM_LAST_FIXED) {
4b638df4c9d556a Bjorn Andersson 2015-06-26 474 dev_err(__smem->dev,
4b638df4c9d556a Bjorn Andersson 2015-06-26 475 "Rejecting allocation of static entry %d\n", item);
4b638df4c9d556a Bjorn Andersson 2015-06-26 476 return -EINVAL;
4b638df4c9d556a Bjorn Andersson 2015-06-26 477 }
4b638df4c9d556a Bjorn Andersson 2015-06-26 478
5b3940676107dd6 Chris Lew 2017-10-11 479 if (WARN_ON(item >= __smem->item_count))
5b3940676107dd6 Chris Lew 2017-10-11 480 return -EINVAL;
5b3940676107dd6 Chris Lew 2017-10-11 481
4b638df4c9d556a Bjorn Andersson 2015-06-26 482 ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
4b638df4c9d556a Bjorn Andersson 2015-06-26 483 HWSPINLOCK_TIMEOUT,
4b638df4c9d556a Bjorn Andersson 2015-06-26 484 &flags);
4b638df4c9d556a Bjorn Andersson 2015-06-26 485 if (ret)
4b638df4c9d556a Bjorn Andersson 2015-06-26 486 return ret;
4b638df4c9d556a Bjorn Andersson 2015-06-26 487
412ae5100f1356b nanli2x 2020-09-22 488 if (host < SMEM_HOST_COUNT && __smem->ptable_entries[host]) {
412ae5100f1356b nanli2x 2020-09-22 489 entry = __smem->ptable_entries[host];
412ae5100f1356b nanli2x 2020-09-22 490 ret = qcom_smem_alloc_private(__smem, entry, item, size);
d52e404874369f1 Chris Lew 2017-10-11 @491 } else if (__smem->global_partition) {
412ae5100f1356b nanli2x 2020-09-22 @492 entry = __smem->global_ptable_entries[host];
412ae5100f1356b nanli2x 2020-09-22 493 ret = qcom_smem_alloc_private(__smem, entry, item, size);
d52e404874369f1 Chris Lew 2017-10-11 494 } else {
4b638df4c9d556a Bjorn Andersson 2015-06-26 495 ret = qcom_smem_alloc_global(__smem, item, size);
d52e404874369f1 Chris Lew 2017-10-11 496 }
4b638df4c9d556a Bjorn Andersson 2015-06-26 497
4b638df4c9d556a Bjorn Andersson 2015-06-26 498 hwspin_unlock_irqrestore(__smem->hwlock, &flags);
4b638df4c9d556a Bjorn Andersson 2015-06-26 499
4b638df4c9d556a Bjorn Andersson 2015-06-26 500 return ret;
4b638df4c9d556a Bjorn Andersson 2015-06-26 501 }
4b638df4c9d556a Bjorn Andersson 2015-06-26 502 EXPORT_SYMBOL(qcom_smem_alloc);
4b638df4c9d556a Bjorn Andersson 2015-06-26 503
1a03964dec3cecb Stephen Boyd 2015-09-02 504 static void *qcom_smem_get_global(struct qcom_smem *smem,
4b638df4c9d556a Bjorn Andersson 2015-06-26 505 unsigned item,
4b638df4c9d556a Bjorn Andersson 2015-06-26 506 size_t *size)
4b638df4c9d556a Bjorn Andersson 2015-06-26 507 {
412ae5100f1356b nanli2x 2020-09-22 508 struct smem_global_entry *entry;
4b638df4c9d556a Bjorn Andersson 2015-06-26 509 struct smem_header *header;
4b638df4c9d556a Bjorn Andersson 2015-06-26 510 struct smem_region *area;
412ae5100f1356b nanli2x 2020-09-22 511 u64 entry_offset;
412ae5100f1356b nanli2x 2020-09-22 512 u32 e_size;
4b638df4c9d556a Bjorn Andersson 2015-06-26 513 u32 aux_base;
4b638df4c9d556a Bjorn Andersson 2015-06-26 514 unsigned i;
4b638df4c9d556a Bjorn Andersson 2015-06-26 515
4b638df4c9d556a Bjorn Andersson 2015-06-26 516 header = smem->regions[0].virt_base;
4b638df4c9d556a Bjorn Andersson 2015-06-26 517 entry = &header->toc[item];
4b638df4c9d556a Bjorn Andersson 2015-06-26 518 if (!entry->allocated)
1a03964dec3cecb Stephen Boyd 2015-09-02 519 return ERR_PTR(-ENXIO);
4b638df4c9d556a Bjorn Andersson 2015-06-26 520
9806884d8cd552e Stephen Boyd 2015-09-02 521 aux_base = le32_to_cpu(entry->aux_base) & AUX_BASE_MASK;
4b638df4c9d556a Bjorn Andersson 2015-06-26 522
4b638df4c9d556a Bjorn Andersson 2015-06-26 523 for (i = 0; i < smem->num_regions; i++) {
4b638df4c9d556a Bjorn Andersson 2015-06-26 524 area = &smem->regions[i];
4b638df4c9d556a Bjorn Andersson 2015-06-26 525
4b638df4c9d556a Bjorn Andersson 2015-06-26 526 if (area->aux_base == aux_base || !aux_base) {
412ae5100f1356b nanli2x 2020-09-22 527 e_size = le32_to_cpu(entry->size);
412ae5100f1356b nanli2x 2020-09-22 528 entry_offset = le32_to_cpu(entry->offset);
412ae5100f1356b nanli2x 2020-09-22 529
412ae5100f1356b nanli2x 2020-09-22 530 if (WARN_ON(e_size + entry_offset > area->size))
412ae5100f1356b nanli2x 2020-09-22 531 return ERR_PTR(-EINVAL);
412ae5100f1356b nanli2x 2020-09-22 532
4b638df4c9d556a Bjorn Andersson 2015-06-26 533 if (size != NULL)
412ae5100f1356b nanli2x 2020-09-22 534 *size = e_size;
412ae5100f1356b nanli2x 2020-09-22 535
412ae5100f1356b nanli2x 2020-09-22 536 return area->virt_base + entry_offset;
1a03964dec3cecb Stephen Boyd 2015-09-02 537 }
1a03964dec3cecb Stephen Boyd 2015-09-02 538 }
4b638df4c9d556a Bjorn Andersson 2015-06-26 539
1a03964dec3cecb Stephen Boyd 2015-09-02 540 return ERR_PTR(-ENOENT);
4b638df4c9d556a Bjorn Andersson 2015-06-26 541 }
4b638df4c9d556a Bjorn Andersson 2015-06-26 542
1a03964dec3cecb Stephen Boyd 2015-09-02 543 static void *qcom_smem_get_private(struct qcom_smem *smem,
412ae5100f1356b nanli2x 2020-09-22 544 struct smem_ptable_entry *entry,
d52e404874369f1 Chris Lew 2017-10-11 545 size_t cacheline,
4b638df4c9d556a Bjorn Andersson 2015-06-26 546 unsigned item,
4b638df4c9d556a Bjorn Andersson 2015-06-26 547 size_t *size)
4b638df4c9d556a Bjorn Andersson 2015-06-26 548 {
412ae5100f1356b nanli2x 2020-09-22 @549 struct smem_partition_header *phdr
9806884d8cd552e Stephen Boyd 2015-09-02 550 struct smem_private_entry *e, *end;
412ae5100f1356b nanli2x 2020-09-22 551 void *item_ptr, *p_end;
412ae5100f1356b nanli2x 2020-09-22 552 u32 partition_size;
412ae5100f1356b nanli2x 2020-09-22 553 u32 padding_data;
412ae5100f1356b nanli2x 2020-09-22 554 u32 e_size;
412ae5100f1356b nanli2x 2020-09-22 555
412ae5100f1356b nanli2x 2020-09-22 556 phdr = ptable_entry_to_phdr(entry);
412ae5100f1356b nanli2x 2020-09-22 557 partition_size = le32_to_cpu(entry->size);
412ae5100f1356b nanli2x 2020-09-22 558 p_end = (void *)phdr + partition_size;
c7c1dc35871378e Bjorn Andersson 2017-10-04 559
01f141544413aa5 Bjorn Andersson 2017-10-04 560 e = phdr_to_first_uncached_entry(phdr);
01f141544413aa5 Bjorn Andersson 2017-10-04 561 end = phdr_to_last_uncached_entry(phdr);
412ae5100f1356b nanli2x 2020-09-22 562 if (WARN_ON((void *)end > p_end))
412ae5100f1356b nanli2x 2020-09-22 563 return ERR_PTR(-EINVAL);
4b638df4c9d556a Bjorn Andersson 2015-06-26 564
9806884d8cd552e Stephen Boyd 2015-09-02 565 while (e < end) {
c7c1dc35871378e Bjorn Andersson 2017-10-04 566 if (e->canary != SMEM_PRIVATE_CANARY)
c7c1dc35871378e Bjorn Andersson 2017-10-04 567 goto invalid_canary;
4b638df4c9d556a Bjorn Andersson 2015-06-26 568
9806884d8cd552e Stephen Boyd 2015-09-02 569 if (le16_to_cpu(e->item) == item) {
412ae5100f1356b nanli2x 2020-09-22 570 if (size != NULL) {
412ae5100f1356b nanli2x 2020-09-22 571 e_size = le32_to_cpu(e->size);
412ae5100f1356b nanli2x 2020-09-22 572 padding_data = le16_to_cpu(e->padding_data);
4b638df4c9d556a Bjorn Andersson 2015-06-26 573
412ae5100f1356b nanli2x 2020-09-22 574 if (e_size < partition_size
412ae5100f1356b nanli2x 2020-09-22 575 && padding_data < e_size)
412ae5100f1356b nanli2x 2020-09-22 576 *size = e_size - padding_data;
412ae5100f1356b nanli2x 2020-09-22 577 else
412ae5100f1356b nanli2x 2020-09-22 578 return ERR_PTR(-EINVAL);
4b638df4c9d556a Bjorn Andersson 2015-06-26 579 }
4b638df4c9d556a Bjorn Andersson 2015-06-26 580
412ae5100f1356b nanli2x 2020-09-22 @581 item_ptr = entry_to_item(e);
412ae5100f1356b nanli2x 2020-09-22 582 if (WARN_ON(item_ptr > p_end))
412ae5100f1356b nanli2x 2020-09-22 583 return ERR_PTR(-EINVAL);
412ae5100f1356b nanli2x 2020-09-22 584
412ae5100f1356b nanli2x 2020-09-22 585 return item_ptr;
412ae5100f1356b nanli2x 2020-09-22 586 }
01f141544413aa5 Bjorn Andersson 2017-10-04 587 e = uncached_entry_next(e);
4b638df4c9d556a Bjorn Andersson 2015-06-26 588 }
412ae5100f1356b nanli2x 2020-09-22 589 if (WARN_ON((void *)e > p_end))
412ae5100f1356b nanli2x 2020-09-22 590 return ERR_PTR(-EINVAL);
4b638df4c9d556a Bjorn Andersson 2015-06-26 591
c7c1dc35871378e Bjorn Andersson 2017-10-04 592 /* Item was not found in the uncached list, search the cached list */
c7c1dc35871378e Bjorn Andersson 2017-10-04 593
c7c1dc35871378e Bjorn Andersson 2017-10-04 594 e = phdr_to_first_cached_entry(phdr, cacheline);
c7c1dc35871378e Bjorn Andersson 2017-10-04 595 end = phdr_to_last_cached_entry(phdr);
c7c1dc35871378e Bjorn Andersson 2017-10-04 596
c7c1dc35871378e Bjorn Andersson 2017-10-04 597 while (e > end) {
c7c1dc35871378e Bjorn Andersson 2017-10-04 598 if (e->canary != SMEM_PRIVATE_CANARY)
c7c1dc35871378e Bjorn Andersson 2017-10-04 599 goto invalid_canary;
c7c1dc35871378e Bjorn Andersson 2017-10-04 600
c7c1dc35871378e Bjorn Andersson 2017-10-04 601 if (le16_to_cpu(e->item) == item) {
c7c1dc35871378e Bjorn Andersson 2017-10-04 602 if (size != NULL)
c7c1dc35871378e Bjorn Andersson 2017-10-04 603 *size = le32_to_cpu(e->size) -
c7c1dc35871378e Bjorn Andersson 2017-10-04 604 le16_to_cpu(e->padding_data);
c7c1dc35871378e Bjorn Andersson 2017-10-04 605
c7c1dc35871378e Bjorn Andersson 2017-10-04 606 return cached_entry_to_item(e);
c7c1dc35871378e Bjorn Andersson 2017-10-04 607 }
c7c1dc35871378e Bjorn Andersson 2017-10-04 608
c7c1dc35871378e Bjorn Andersson 2017-10-04 609 e = cached_entry_next(e, cacheline);
c7c1dc35871378e Bjorn Andersson 2017-10-04 610 }
c7c1dc35871378e Bjorn Andersson 2017-10-04 611
1a03964dec3cecb Stephen Boyd 2015-09-02 612 return ERR_PTR(-ENOENT);
c7c1dc35871378e Bjorn Andersson 2017-10-04 613
c7c1dc35871378e Bjorn Andersson 2017-10-04 614 invalid_canary:
04a512fea333369 Alex Elder 2018-04-10 615 dev_err(smem->dev, "Found invalid canary in hosts %hu:%hu partition\n",
04a512fea333369 Alex Elder 2018-04-10 616 le16_to_cpu(phdr->host0), le16_to_cpu(phdr->host1));
c7c1dc35871378e Bjorn Andersson 2017-10-04 617
c7c1dc35871378e Bjorn Andersson 2017-10-04 618 return ERR_PTR(-EINVAL);
4b638df4c9d556a Bjorn Andersson 2015-06-26 619 }
4b638df4c9d556a Bjorn Andersson 2015-06-26 620
4b638df4c9d556a Bjorn Andersson 2015-06-26 621 /**
4b638df4c9d556a Bjorn Andersson 2015-06-26 622 * qcom_smem_get() - resolve ptr of size of a smem item
4b638df4c9d556a Bjorn Andersson 2015-06-26 623 * @host: the remote processor, or -1
4b638df4c9d556a Bjorn Andersson 2015-06-26 624 * @item: smem item handle
4b638df4c9d556a Bjorn Andersson 2015-06-26 625 * @size: pointer to be filled out with size of the item
4b638df4c9d556a Bjorn Andersson 2015-06-26 626 *
1a03964dec3cecb Stephen Boyd 2015-09-02 627 * Looks up smem item and returns pointer to it. Size of smem
1a03964dec3cecb Stephen Boyd 2015-09-02 628 * item is returned in @size.
4b638df4c9d556a Bjorn Andersson 2015-06-26 629 */
1a03964dec3cecb Stephen Boyd 2015-09-02 630 void *qcom_smem_get(unsigned host, unsigned item, size_t *size)
4b638df4c9d556a Bjorn Andersson 2015-06-26 631 {
d52e404874369f1 Chris Lew 2017-10-11 632 struct smem_partition_header *phdr;
412ae5100f1356b nanli2x 2020-09-22 633 struct smem_ptable_entry *entry;
4b638df4c9d556a Bjorn Andersson 2015-06-26 634 unsigned long flags;
d52e404874369f1 Chris Lew 2017-10-11 635 size_t cacheln;
4b638df4c9d556a Bjorn Andersson 2015-06-26 636 int ret;
1a03964dec3cecb Stephen Boyd 2015-09-02 637 void *ptr = ERR_PTR(-EPROBE_DEFER);
4b638df4c9d556a Bjorn Andersson 2015-06-26 638
4b638df4c9d556a Bjorn Andersson 2015-06-26 639 if (!__smem)
1a03964dec3cecb Stephen Boyd 2015-09-02 640 return ptr;
4b638df4c9d556a Bjorn Andersson 2015-06-26 641
5b3940676107dd6 Chris Lew 2017-10-11 642 if (WARN_ON(item >= __smem->item_count))
5b3940676107dd6 Chris Lew 2017-10-11 643 return ERR_PTR(-EINVAL);
5b3940676107dd6 Chris Lew 2017-10-11 644
4b638df4c9d556a Bjorn Andersson 2015-06-26 645 ret = hwspin_lock_timeout_irqsave(__smem->hwlock,
4b638df4c9d556a Bjorn Andersson 2015-06-26 646 HWSPINLOCK_TIMEOUT,
4b638df4c9d556a Bjorn Andersson 2015-06-26 647 &flags);
4b638df4c9d556a Bjorn Andersson 2015-06-26 648 if (ret)
1a03964dec3cecb Stephen Boyd 2015-09-02 649 return ERR_PTR(ret);
4b638df4c9d556a Bjorn Andersson 2015-06-26 650
412ae5100f1356b nanli2x 2020-09-22 651 if (host < SMEM_HOST_COUNT && __smem->ptable_entries[host]) {
412ae5100f1356b nanli2x 2020-09-22 652 entry = __smem->ptable_entries[host];
d52e404874369f1 Chris Lew 2017-10-11 653 cacheln = __smem->cacheline[host];
412ae5100f1356b nanli2x 2020-09-22 654 ptr = qcom_smem_get_private(__smem, entry, cacheln, item, size);
d52e404874369f1 Chris Lew 2017-10-11 @655 } else if (__smem->global_partition) {
412ae5100f1356b nanli2x 2020-09-22 656 entry = __smem->global_ptable_entries[host];
d52e404874369f1 Chris Lew 2017-10-11 657 cacheln = __smem->global_cacheline;
412ae5100f1356b nanli2x 2020-09-22 658 ptr = qcom_smem_get_private(__smem, entry, cacheln, item, size);
d52e404874369f1 Chris Lew 2017-10-11 659 } else {
1a03964dec3cecb Stephen Boyd 2015-09-02 660 ptr = qcom_smem_get_global(__smem, item, size);
d52e404874369f1 Chris Lew 2017-10-11 661 }
4b638df4c9d556a Bjorn Andersson 2015-06-26 662
4b638df4c9d556a Bjorn Andersson 2015-06-26 663 hwspin_unlock_irqrestore(__smem->hwlock, &flags);
1a03964dec3cecb Stephen Boyd 2015-09-02 664
1a03964dec3cecb Stephen Boyd 2015-09-02 665 return ptr;
4b638df4c9d556a Bjorn Andersson 2015-06-26 666
:::::: The code at line 491 was first introduced by commit
:::::: d52e404874369f10d20519f4095478d9cb4d6aad soc: qcom: smem: Support global partition
:::::: TO: Chris Lew <clew(a)codeaurora.org>
:::::: CC: Andy Gross <andy.gross(a)linaro.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months
[ojeda-linux:sync 1/1] ld.lld: error: kallsyms.c:(function kallsyms_lookup: .text+0x6B8): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_names
by kernel test robot
CC: Miguel Ojeda <ojeda(a)kernel.org>
tree: https://github.com/ojeda/linux.git sync
head: 8d71e364c035c1a7afc95fe8251a809bde9b3f28
commit: 8d71e364c035c1a7afc95fe8251a809bde9b3f28 [1/1] treewide: sync with `v5.13-rc5`
config: riscv-randconfig-r031-20210618 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/ojeda/linux/commit/8d71e364c035c1a7afc95fe8251a809bde9...
git remote add ojeda-linux https://github.com/ojeda/linux.git
git fetch --no-tags ojeda-linux sync
git checkout 8d71e364c035c1a7afc95fe8251a809bde9b3f28
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> ld.lld: error: kallsyms.c:(function kallsyms_lookup: .text+0x6B8): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_names
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function kallsyms_lookup: .text+0x77A): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_token_table
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function lookup_symbol_name: .text+0x97A): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_names
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function lookup_symbol_name: .text+0xA3E): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_token_index
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function lookup_symbol_name: .text+0xA46): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_token_table
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function lookup_symbol_attrs: .text+0xC26): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_markers
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function lookup_symbol_attrs: .text+0xC34): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_names
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function lookup_symbol_attrs: .text+0xCFC): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_token_index
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function kallsyms_lookup_name: .text+0x7C): relocation R_RISCV_PCREL_HI20 out of range: -524505 is not in [-524288, 524287]; references kallsyms_token_table
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function kallsyms_lookup_name: .text+0x24A): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_relative_base
>>> defined in kernel/built-in.a(kallsyms.o)
--
>> ld.lld: error: kallsyms.c:(function get_symbol_pos: .text+0x3D0): relocation R_RISCV_PCREL_HI20 out of range: -524506 is not in [-524288, 524287]; references kallsyms_offsets
>>> defined in kernel/built-in.a(kallsyms.o)
..
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for LOCKDEP
Depends on DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT && (FRAME_POINTER || MIPS || PPC || S390 || MICROBLAZE || ARM || ARC || X86)
Selected by
- PROVE_LOCKING && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
- LOCK_STAT && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
- DEBUG_LOCK_ALLOC && DEBUG_KERNEL && LOCK_DEBUGGING_SUPPORT
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 3 months