[riscv:for-next 2/11] arch/riscv/kernel/vdso/vgettimeofday.c:12:5: warning: no previous prototype for function '__vdso_clock_gettime'
by kernel test robot
TO: Vincent Chen <vincent.chen(a)sifive.com>
CC: Palmer Dabbelt <palmerdabbelt(a)google.com>
CC: Atish Patra <atish.patra(a)wdc.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git for-next
head: 5cc38fa6fc7448d40ff214d5c087f508355e8446
commit: 6e3cfcf6ea031fe2a0068fa7c380c4cf7bcd8936 [2/11] riscv: use vDSO common flow to reduce the latency of the time-related functions
config: riscv-randconfig-r011-20200612 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3b43f006294971b8049d4807110032169780e5b8)
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
git checkout 6e3cfcf6ea031fe2a0068fa7c380c4cf7bcd8936
# 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 error/warnings (new ones prefixed by >>, old ones prefixed by <<):
>> arch/riscv/kernel/vdso/vgettimeofday.c:12:5: warning: no previous prototype for function '__vdso_clock_gettime' [-Wmissing-prototypes]
int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
^
arch/riscv/kernel/vdso/vgettimeofday.c:12:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
^
static
>> arch/riscv/kernel/vdso/vgettimeofday.c:17:5: warning: no previous prototype for function '__vdso_gettimeofday' [-Wmissing-prototypes]
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
^
arch/riscv/kernel/vdso/vgettimeofday.c:17:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
^
static
>> arch/riscv/kernel/vdso/vgettimeofday.c:22:5: warning: no previous prototype for function '__vdso_clock_getres' [-Wmissing-prototypes]
int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
^
arch/riscv/kernel/vdso/vgettimeofday.c:22:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
^
static
3 warnings generated.
--
clang-11: warning: argument unused during compilation: '-pg' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
/usr/bin/riscv64-linux-gnu-ld: arch/riscv/kernel/vdso/vgettimeofday.o: relocation R_RISCV_HI20 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
>> /usr/bin/riscv64-linux-gnu-ld: section .text LMA [0000000000000800,0000000000001d4f] overlaps section .eh_frame LMA [00000000000006f8,0000000000000823]
>> /usr/bin/riscv64-linux-gnu-ld: section .rodata LMA [0000000000000840,0000000000000b7f] overlaps section .text LMA [0000000000000800,0000000000001d4f]
/usr/bin/riscv64-linux-gnu-ld: arch/riscv/kernel/vdso/vdso.so.dbg.tmp: section .text lma 0x800 adjusted to 0x824
/usr/bin/riscv64-linux-gnu-ld: arch/riscv/kernel/vdso/vdso.so.dbg.tmp: section .rodata lma 0x840 adjusted to 0x1d74
/usr/bin/riscv64-linux-gnu-ld: arch/riscv/kernel/vdso/vdso.so.dbg.tmp: section .data lma 0x1d50 adjusted to 0x20b4
/usr/bin/riscv64-linux-gnu-ld: arch/riscv/kernel/vdso/vdso.so.dbg.tmp: section _ftrace_annotated_branch lma 0x1f60 adjusted to 0x22c4
/usr/bin/riscv64-linux-gnu-ld: arch/riscv/kernel/vdso/vdso.so.dbg.tmp: section _ftrace_branch lma 0x21a0 adjusted to 0x2504
/usr/bin/riscv64-linux-gnu-ld: arch/riscv/kernel/vdso/vdso.so.dbg.tmp: section .init_array.1 lma 0x2288 adjusted to 0x25ec
/usr/bin/riscv64-linux-gnu-ld: arch/riscv/kernel/vdso/vdso.so.dbg.tmp: section .fini_array.1 lma 0x2290 adjusted to 0x25f4
>> clang-11: error: unable to execute command: Segmentation fault
>> clang-11: error: linker command failed due to signal (use -v to see invocation)
vim +/__vdso_clock_gettime +12 arch/riscv/kernel/vdso/vgettimeofday.c
11
> 12 int __vdso_clock_gettime(clockid_t clock, struct __kernel_timespec *ts)
13 {
14 return __cvdso_clock_gettime(clock, ts);
15 }
16
> 17 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz)
18 {
19 return __cvdso_gettimeofday(tv, tz);
20 }
21
> 22 int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH v4] powerpc/fadump: fix race between pstore write and fadump crash trigger
by kernel test robot
Hi Sourabh,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master linux/master v5.7 next-20200611]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Sourabh-Jain/powerpc-fadump-fix-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-randconfig-r002-20200612 (attached as .config)
compiler: powerpc64le-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
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 >>, old ones prefixed by <<):
arch/powerpc/kernel/fadump.c: In function 'crash_fadump':
>> arch/powerpc/kernel/fadump.c:700:15: error: 'cpus_in_crash' undeclared (first use in this function)
700 | atomic_inc(&cpus_in_crash);
| ^~~~~~~~~~~~~
arch/powerpc/kernel/fadump.c:700:15: note: each undeclared identifier is reported only once for each function it appears in
arch/powerpc/kernel/fadump.c: In function 'fadump_update_elfcore_header':
arch/powerpc/kernel/fadump.c:755:17: warning: variable 'elf' set but not used [-Wunused-but-set-variable]
755 | struct elfhdr *elf;
| ^~~
arch/powerpc/kernel/fadump.c: At top level:
arch/powerpc/kernel/fadump.c:1706:22: warning: no previous prototype for 'arch_reserved_kernel_pages' [-Wmissing-prototypes]
1706 | unsigned long __init arch_reserved_kernel_pages(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/cpus_in_crash +700 arch/powerpc/kernel/fadump.c
678
679 void crash_fadump(struct pt_regs *regs, const char *str)
680 {
681 unsigned int msecs;
682 struct fadump_crash_info_header *fdh = NULL;
683 int old_cpu, this_cpu;
684 unsigned int ncpus = num_online_cpus() - 1; /* Do not include first CPU */
685
686 if (!should_fadump_crash())
687 return;
688
689 /*
690 * old_cpu == -1 means this is the first CPU which has come here,
691 * go ahead and trigger fadump.
692 *
693 * old_cpu != -1 means some other CPU has already on it's way
694 * to trigger fadump, just keep looping here.
695 */
696 this_cpu = smp_processor_id();
697 old_cpu = cmpxchg(&crashing_cpu, -1, this_cpu);
698
699 if (old_cpu != -1) {
> 700 atomic_inc(&cpus_in_crash);
701
702 /*
703 * We can't loop here indefinitely. Wait as long as fadump
704 * is in force. If we race with fadump un-registration this
705 * loop will break and then we go down to normal panic path
706 * and reboot. If fadump is in force the first crashing
707 * cpu will definitely trigger fadump.
708 */
709 while (fw_dump.dump_registered)
710 cpu_relax();
711 return;
712 }
713
714 fdh = __va(fw_dump.fadumphdr_addr);
715 fdh->crashing_cpu = crashing_cpu;
716 crash_save_vmcoreinfo();
717
718 if (regs)
719 fdh->regs = *regs;
720 else
721 ppc_save_regs(&fdh->regs);
722
723 fdh->online_mask = *cpu_online_mask;
724
725 /*
726 * If we came in via system reset, wait a while for the secondary
727 * CPUs to enter.
728 */
729 if (TRAP(&(fdh->regs)) == 0x100) {
730 msecs = CRASH_TIMEOUT;
731 while ((atomic_read(&cpus_in_crash) < ncpus) && (--msecs > 0))
732 mdelay(1);
733 }
734
735 fw_dump.ops->fadump_trigger(fdh, str);
736 }
737
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH v8 5/7] iommu/arm-smmu: Add implementation for the adreno GPU SMMU
by kernel test robot
Hi Jordan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on next-20200611]
[cannot apply to iommu/next robh/for-next arm/for-next keystone/next rockchip/for-next arm64/for-next/core shawnguo/for-next soc/for-next v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Jordan-Crouse/iommu-arm-smmu-Ena...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b961f8dc8976c091180839f4483d67b7c2ca2578
config: arm64-randconfig-s031-20200612 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-250-g42323db3-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=arm64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
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 >>, old ones prefixed by <<):
drivers/iommu/arm-smmu-qcom.c: In function 'qcom_adreno_smmu_is_gpu_device':
>> drivers/iommu/arm-smmu-qcom.c:17:49: error: 'smmu_domain->dev' is a pointer; did you mean to use '->'?
17 | return of_device_is_compatible(smmu_domain->dev.of_node, "qcom,adreno");
| ^
| ->
>> drivers/iommu/arm-smmu-qcom.c:18:1: warning: control reaches end of non-void function [-Wreturn-type]
18 | }
| ^
vim +17 drivers/iommu/arm-smmu-qcom.c
14
15 static bool qcom_adreno_smmu_is_gpu_device(struct arm_smmu_domain *smmu_domain)
16 {
> 17 return of_device_is_compatible(smmu_domain->dev.of_node, "qcom,adreno");
> 18 }
19
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1905:24: sparse: sparse: incorrect type in argument 1 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b791d1bdf9212d944d749a5c7ff6febdba241771
commit: 05933aac7b11911955de307a329dc2a7a14b7bd0 ia64: remove now unused machvec indirections
date: 10 months ago
config: ia64-randconfig-s031-20200612 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-250-g42323db3-dirty
git checkout 05933aac7b11911955de307a329dc2a7a14b7bd0
# save the attached .config to linux build tree
make W=1 C=1 ARCH=ia64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
./arch/ia64/include/generated/uapi/asm/unistd_64.h:348:39: sparse: sparse: no newline at end of file
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1925:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] clscode @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1925:28: sparse: expected unsigned short [assigned] [usertype] clscode
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1925:28: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1926:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] rsvd @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1926:25: sparse: expected unsigned short [assigned] [usertype] rsvd
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1926:25: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1928:29: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1928:29: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1928:29: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1928:29: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1928:29: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1928:29: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1939:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] clscode @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1939:29: sparse: expected unsigned short [assigned] [usertype] clscode
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1939:29: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1940:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [assigned] [usertype] rsvd @@ got restricted __be16 [usertype] @@
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1940:26: sparse: expected unsigned short [assigned] [usertype] rsvd
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1940:26: sparse: got restricted __be16 [usertype]
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1942:30: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1942:30: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1942:30: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1942:30: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1942:30: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1942:30: sparse: sparse: cast to restricted __be32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
>> drivers/net/ethernet/brocade/bna/bfa_ioc.c:1905:24: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
>> drivers/net/ethernet/brocade/bna/bfa_ioc.c:1905:24: sparse: expected unsigned int [usertype] value
drivers/net/ethernet/brocade/bna/bfa_ioc.c:1905:24: sparse: got restricted __le32 [usertype]
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2107:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2107:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2107:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2107:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2107:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2107:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2108:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2108:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2108:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2108:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2108:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2108:31: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2109:31: sparse: sparse: cast to restricted __be16
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2109:31: sparse: sparse: cast to restricted __be16
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2109:31: sparse: sparse: cast to restricted __be16
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2109:31: sparse: sparse: cast to restricted __be16
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2211:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2211:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2211:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2211:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2211:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2211:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2424:25: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [usertype] @@ got restricted __be32 [usertype] @@
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2424:25: sparse: expected unsigned int [usertype]
drivers/net/ethernet/brocade/bna/bfa_ioc.c:2424:25: sparse: got restricted __be32 [usertype]
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3064:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3064:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3064:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3064:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3064:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3064:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3066:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3066:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3066:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3066:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3066:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3066:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3069:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3069:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3069:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3069:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3069:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3069:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3097:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3097:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3097:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3097:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3097:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3097:21: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3099:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3099:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3099:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3099:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3099:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3099:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3102:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3102:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3102:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3102:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3102:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3102:23: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3136:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3136:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3136:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3136:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3136:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3136:26: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3143:40: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3143:40: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3143:40: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3143:40: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3143:40: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3143:40: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3144:39: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3144:39: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3144:39: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3144:39: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3144:39: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3144:39: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3147:41: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3147:41: sparse: sparse: cast to restricted __be32
drivers/net/ethernet/brocade/bna/bfa_ioc.c:3147:41: sparse: sparse: too many warnings
vim +1905 drivers/net/ethernet/brocade/bna/bfa_ioc.c
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1892
8a891429d1879a drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-25 1893 static void
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1894 bfa_ioc_mbox_send(struct bfa_ioc *ioc, void *ioc_msg, int len)
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1895 {
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1896 u32 *msgp = (u32 *) ioc_msg;
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1897 u32 i;
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1898
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1899 BUG_ON(!(len <= BFI_IOC_MSGLEN_MAX));
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1900
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1901 /*
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1902 * first write msg to mailbox registers
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1903 */
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1904 for (i = 0; i < len / sizeof(u32); i++)
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 @1905 writel(cpu_to_le32(msgp[i]),
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1906 ioc->ioc_regs.hfn_mbox + i * sizeof(u32));
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1907
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1908 for (; i < BFI_IOC_MSGLEN_MAX / sizeof(u32); i++)
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1909 writel(0, ioc->ioc_regs.hfn_mbox + i * sizeof(u32));
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1910
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1911 /*
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1912 * write 1 to mailbox CMD to trigger LPU event
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1913 */
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1914 writel(1, ioc->ioc_regs.hfn_mbox_cmd);
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1915 (void) readl(ioc->ioc_regs.hfn_mbox_cmd);
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1916 }
8b230ed8ec96c9 drivers/net/bna/bfa_ioc.c Rasesh Mody 2010-08-23 1917
:::::: The code at line 1905 was first introduced by commit
:::::: 8b230ed8ec96c933047dd0625cf95f739e4939a6 bna: Brocade 10Gb Ethernet device driver
:::::: TO: Rasesh Mody <rmody(a)brocade.com>
:::::: CC: David S. Miller <davem(a)davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[RFC PATCH] watchdog: f71808e_wdt: fintek_variants[] can be static
by kernel test robot
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
f71808e_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c
index c866d05e8788b..849620041c0ef 100644
--- a/drivers/watchdog/f71808e_wdt.c
+++ b/drivers/watchdog/f71808e_wdt.c
@@ -484,7 +484,7 @@ static void f81866_pinconf(struct fintek_wdog_data *wd)
superio_clear_bit(wd->sioaddr, SIO_F81866_REG_GPIO1, 5);
}
-struct fintek_variant fintek_variants[] = {
+static struct fintek_variant fintek_variants[] = {
{ SIO_F71808_ID, "f71808fg", f71808fg_pinconf },
{ SIO_F71862_ID, "f71862fg", f71862fg_pinconf },
{ SIO_F71868_ID, "f71868", f71868_pinconf },
2 years, 3 months
Re: [PATCH v8 6/7] drm/msm: Set the global virtual address range from the IOMMU domain
by kernel test robot
Hi Jordan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on next-20200611]
[cannot apply to iommu/next robh/for-next arm/for-next keystone/next rockchip/for-next arm64/for-next/core shawnguo/for-next soc/for-next v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Jordan-Crouse/iommu-arm-smmu-Ena...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b961f8dc8976c091180839f4483d67b7c2ca2578
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
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 >>, old ones prefixed by <<):
In file included from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/ascii85.h:11,
from drivers/gpu/drm/msm/adreno/adreno_gpu.c:9:
drivers/gpu/drm/msm/adreno/adreno_gpu.c: In function 'adreno_iommu_create_address_space':
include/linux/bits.h:37:11: warning: right shift count is negative [-Wshift-count-negative]
37 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/bits.h:39:31: note: in expansion of macro '__GENMASK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
>> drivers/gpu/drm/msm/adreno/adreno_gpu.c:206:11: note: in expansion of macro 'GENMASK'
206 | start & GENMASK(48, 0), size);
| ^~~~~~~
--
In file included from include/linux/bits.h:6,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from drivers/gpu/drm/msm/msm_drv.h:11,
from drivers/gpu/drm/msm/msm_iommu.c:7:
drivers/gpu/drm/msm/msm_iommu.c: In function 'msm_iommu_map':
>> include/vdso/bits.h:7:26: warning: left shift count >= width of type [-Wshift-count-overflow]
7 | #define BIT(nr) (UL(1) << (nr))
| ^~
>> drivers/gpu/drm/msm/msm_iommu.c:40:13: note: in expansion of macro 'BIT'
40 | if (iova & BIT(48))
| ^~~
In file included from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from drivers/gpu/drm/msm/msm_drv.h:11,
from drivers/gpu/drm/msm/msm_iommu.c:7:
>> include/linux/bits.h:36:22: warning: left shift count >= width of type [-Wshift-count-overflow]
36 | (((~UL(0)) - (UL(1) << (l)) + 1) & | ^~
include/linux/bits.h:39:31: note: in expansion of macro '__GENMASK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
>> drivers/gpu/drm/msm/msm_iommu.c:41:11: note: in expansion of macro 'GENMASK'
41 | iova |= GENMASK(63, 49);
| ^~~~~~~
include/linux/bits.h:37:11: warning: right shift count is negative [-Wshift-count-negative]
37 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/bits.h:39:31: note: in expansion of macro '__GENMASK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
>> drivers/gpu/drm/msm/msm_iommu.c:41:11: note: in expansion of macro 'GENMASK'
41 | iova |= GENMASK(63, 49);
| ^~~~~~~
In file included from include/linux/bits.h:6,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from drivers/gpu/drm/msm/msm_drv.h:11,
from drivers/gpu/drm/msm/msm_iommu.c:7:
drivers/gpu/drm/msm/msm_iommu.c: In function 'msm_iommu_unmap':
>> include/vdso/bits.h:7:26: warning: left shift count >= width of type [-Wshift-count-overflow]
7 | #define BIT(nr) (UL(1) << (nr))
| ^~
drivers/gpu/drm/msm/msm_iommu.c:53:13: note: in expansion of macro 'BIT'
53 | if (iova & BIT(48))
| ^~~
In file included from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from drivers/gpu/drm/msm/msm_drv.h:11,
from drivers/gpu/drm/msm/msm_iommu.c:7:
>> include/linux/bits.h:36:22: warning: left shift count >= width of type [-Wshift-count-overflow]
36 | (((~UL(0)) - (UL(1) << (l)) + 1) & | ^~
include/linux/bits.h:39:31: note: in expansion of macro '__GENMASK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/gpu/drm/msm/msm_iommu.c:54:11: note: in expansion of macro 'GENMASK'
54 | iova |= GENMASK(63, 49);
| ^~~~~~~
include/linux/bits.h:37:11: warning: right shift count is negative [-Wshift-count-negative]
37 | (~UL(0) >> (BITS_PER_LONG - 1 - (h))))
| ^~
include/linux/bits.h:39:31: note: in expansion of macro '__GENMASK'
39 | (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
| ^~~~~~~~~
drivers/gpu/drm/msm/msm_iommu.c:54:11: note: in expansion of macro 'GENMASK'
54 | iova |= GENMASK(63, 49);
| ^~~~~~~
vim +/GENMASK +206 drivers/gpu/drm/msm/adreno/adreno_gpu.c
> 9 #include <linux/ascii85.h>
10 #include <linux/interconnect.h>
11 #include <linux/qcom_scm.h>
12 #include <linux/kernel.h>
13 #include <linux/of_address.h>
14 #include <linux/pm_opp.h>
15 #include <linux/slab.h>
16 #include <linux/soc/qcom/mdt_loader.h>
17 #include <soc/qcom/ocmem.h>
18 #include "adreno_gpu.h"
19 #include "msm_gem.h"
20 #include "msm_mmu.h"
21
22 static bool zap_available = true;
23
24 static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
25 u32 pasid)
26 {
27 struct device *dev = &gpu->pdev->dev;
28 const struct firmware *fw;
29 const char *signed_fwname = NULL;
30 struct device_node *np, *mem_np;
31 struct resource r;
32 phys_addr_t mem_phys;
33 ssize_t mem_size;
34 void *mem_region = NULL;
35 int ret;
36
37 if (!IS_ENABLED(CONFIG_ARCH_QCOM)) {
38 zap_available = false;
39 return -EINVAL;
40 }
41
42 np = of_get_child_by_name(dev->of_node, "zap-shader");
43 if (!np) {
44 zap_available = false;
45 return -ENODEV;
46 }
47
48 mem_np = of_parse_phandle(np, "memory-region", 0);
49 of_node_put(np);
50 if (!mem_np) {
51 zap_available = false;
52 return -EINVAL;
53 }
54
55 ret = of_address_to_resource(mem_np, 0, &r);
56 of_node_put(mem_np);
57 if (ret)
58 return ret;
59
60 mem_phys = r.start;
61
62 /*
63 * Check for a firmware-name property. This is the new scheme
64 * to handle firmware that may be signed with device specific
65 * keys, allowing us to have a different zap fw path for different
66 * devices.
67 *
68 * If the firmware-name property is found, we bypass the
69 * adreno_request_fw() mechanism, because we don't need to handle
70 * the /lib/firmware/qcom/... vs /lib/firmware/... case.
71 *
72 * If the firmware-name property is not found, for backwards
73 * compatibility we fall back to the fwname from the gpulist
74 * table.
75 */
76 of_property_read_string_index(np, "firmware-name", 0, &signed_fwname);
77 if (signed_fwname) {
78 fwname = signed_fwname;
79 ret = request_firmware_direct(&fw, fwname, gpu->dev->dev);
80 if (ret)
81 fw = ERR_PTR(ret);
82 } else if (fwname) {
83 /* Request the MDT file from the default location: */
84 fw = adreno_request_fw(to_adreno_gpu(gpu), fwname);
85 } else {
86 /*
87 * For new targets, we require the firmware-name property,
88 * if a zap-shader is required, rather than falling back
89 * to a firmware name specified in gpulist.
90 *
91 * Because the firmware is signed with a (potentially)
92 * device specific key, having the name come from gpulist
93 * was a bad idea, and is only provided for backwards
94 * compatibility for older targets.
95 */
96 return -ENODEV;
97 }
98
99 if (IS_ERR(fw)) {
100 DRM_DEV_ERROR(dev, "Unable to load %s\n", fwname);
101 return PTR_ERR(fw);
102 }
103
104 /* Figure out how much memory we need */
105 mem_size = qcom_mdt_get_size(fw);
106 if (mem_size < 0) {
107 ret = mem_size;
108 goto out;
109 }
110
111 if (mem_size > resource_size(&r)) {
112 DRM_DEV_ERROR(dev,
113 "memory region is too small to load the MDT\n");
114 ret = -E2BIG;
115 goto out;
116 }
117
118 /* Allocate memory for the firmware image */
119 mem_region = memremap(mem_phys, mem_size, MEMREMAP_WC);
120 if (!mem_region) {
121 ret = -ENOMEM;
122 goto out;
123 }
124
125 /*
126 * Load the rest of the MDT
127 *
128 * Note that we could be dealing with two different paths, since
129 * with upstream linux-firmware it would be in a qcom/ subdir..
130 * adreno_request_fw() handles this, but qcom_mdt_load() does
131 * not. But since we've already gotten through adreno_request_fw()
132 * we know which of the two cases it is:
133 */
134 if (signed_fwname || (to_adreno_gpu(gpu)->fwloc == FW_LOCATION_LEGACY)) {
135 ret = qcom_mdt_load(dev, fw, fwname, pasid,
136 mem_region, mem_phys, mem_size, NULL);
137 } else {
138 char *newname;
139
140 newname = kasprintf(GFP_KERNEL, "qcom/%s", fwname);
141
142 ret = qcom_mdt_load(dev, fw, newname, pasid,
143 mem_region, mem_phys, mem_size, NULL);
144 kfree(newname);
145 }
146 if (ret)
147 goto out;
148
149 /* Send the image to the secure world */
150 ret = qcom_scm_pas_auth_and_reset(pasid);
151
152 /*
153 * If the scm call returns -EOPNOTSUPP we assume that this target
154 * doesn't need/support the zap shader so quietly fail
155 */
156 if (ret == -EOPNOTSUPP)
157 zap_available = false;
158 else if (ret)
159 DRM_DEV_ERROR(dev, "Unable to authorize the image\n");
160
161 out:
162 if (mem_region)
163 memunmap(mem_region);
164
165 release_firmware(fw);
166
167 return ret;
168 }
169
170 int adreno_zap_shader_load(struct msm_gpu *gpu, u32 pasid)
171 {
172 struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
173 struct platform_device *pdev = gpu->pdev;
174
175 /* Short cut if we determine the zap shader isn't available/needed */
176 if (!zap_available)
177 return -ENODEV;
178
179 /* We need SCM to be able to load the firmware */
180 if (!qcom_scm_is_available()) {
181 DRM_DEV_ERROR(&pdev->dev, "SCM is not available\n");
182 return -EPROBE_DEFER;
183 }
184
185 return zap_shader_load_mdt(gpu, adreno_gpu->info->zapfw, pasid);
186 }
187
188 struct msm_gem_address_space *
189 adreno_iommu_create_address_space(struct msm_gpu *gpu,
190 struct platform_device *pdev)
191 {
192 struct iommu_domain *iommu = iommu_domain_alloc(&platform_bus_type);
193 struct msm_mmu *mmu = msm_iommu_new(&pdev->dev, iommu);
194 struct msm_gem_address_space *aspace;
195 u64 start, size;
196
197 /*
198 * Use the aperture start or SZ_16M, whichever is greater. This will
199 * ensure that we align with the allocated pagetable range while still
200 * allowing room in the lower 32 bits for GMEM and whatnot
201 */
202 start = max_t(u64, SZ_16M, iommu->geometry.aperture_start);
203 size = iommu->geometry.aperture_end - start + 1;
204
205 aspace = msm_gem_address_space_create(mmu, "gpu",
> 206 start & GENMASK(48, 0), size);
207
208 if (IS_ERR(aspace) && !IS_ERR(mmu))
209 mmu->funcs->destroy(mmu);
210
211 return aspace;
212 }
213
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH] extend IMA boot_aggregate with kernel measurements
by kernel test robot
Hi Maurizio,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on integrity/next-integrity]
[also build test WARNING on next-20200611]
[cannot apply to v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Maurizio-Drocco/extend-IMA-boot_...
base: https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git next-integrity
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3b43f006294971b8049d4807110032169780e5b8)
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
# 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 >>, old ones prefixed by <<):
>> security/integrity/ima/ima_crypto.c:838:35: warning: size argument in 'memcmp' call is a comparison [-Wmemsize-comparison]
crypto_shash_digestsize(tfm) != 0))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
security/integrity/ima/ima_crypto.c:837:7: note: did you mean to compare the result of 'memcmp' instead?
if (memcmp(d.digest, d0.digest,
^
security/integrity/ima/ima_crypto.c:838:6: note: explicitly cast the argument to size_t to silence this warning
crypto_shash_digestsize(tfm) != 0))
^
(size_t)( )
1 warning generated.
vim +/memcmp +838 security/integrity/ima/ima_crypto.c
797
798 /*
799 * The boot_aggregate is a cumulative hash over TPM registers 0 - 7. With
800 * TPM 1.2 the boot_aggregate was based on reading the SHA1 PCRs, but with
801 * TPM 2.0 hash agility, TPM chips could support multiple TPM PCR banks,
802 * allowing firmware to configure and enable different banks.
803 *
804 * Knowing which TPM bank is read to calculate the boot_aggregate digest
805 * needs to be conveyed to a verifier. For this reason, use the same
806 * hash algorithm for reading the TPM PCRs as for calculating the boot
807 * aggregate digest as stored in the measurement list.
808 */
809 static int ima_calc_boot_aggregate_tfm(char *digest, u16 alg_id,
810 struct crypto_shash *tfm)
811 {
812 struct tpm_digest d = { .alg_id = alg_id, .digest = {0} }, d0 = d;
813 int rc;
814 u32 i;
815 SHASH_DESC_ON_STACK(shash, tfm);
816
817 shash->tfm = tfm;
818
819 pr_devel("calculating the boot-aggregate based on TPM bank: %04x\n",
820 d.alg_id);
821
822 rc = crypto_shash_init(shash);
823 if (rc != 0)
824 return rc;
825
826 /* cumulative sha1 over tpm registers 0-7 */
827 for (i = TPM_PCR0; i < TPM_PCR8; i++) {
828 ima_pcrread(i, &d);
829 /* now accumulate with current aggregate */
830 rc = crypto_shash_update(shash, d.digest,
831 crypto_shash_digestsize(tfm));
832 }
833 /* extend cumulative sha1 over tpm registers 8-9 */
834 for (i = TPM_PCR8; i < TPM_PCR10; i++) {
835 ima_pcrread(i, &d);
836 /* if not zero, accumulate with current aggregate */
837 if (memcmp(d.digest, d0.digest,
> 838 crypto_shash_digestsize(tfm) != 0))
839 rc = crypto_shash_update(shash, d.digest,
840 crypto_shash_digestsize(tfm));
841 }
842 if (!rc)
843 crypto_shash_final(shash, digest);
844 return rc;
845 }
846
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
sound/soc/fsl/fsl-asoc-card.c:684:45: sparse: sparse: incorrect type in argument 3 (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b791d1bdf9212d944d749a5c7ff6febdba241771
commit: 859e364302c510cfdd9abda13a3c4c1d1bc68c57 ASoC: fsl-asoc-card: Support new property fsl, asrc-format
date: 7 weeks ago
config: arm-randconfig-s032-20200612 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-250-g42323db3-dirty
git checkout 859e364302c510cfdd9abda13a3c4c1d1bc68c57
# save the attached .config to linux build tree
make W=1 C=1 ARCH=arm CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> sound/soc/fsl/fsl-asoc-card.c:684:45: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int [usertype] *out_value @@ got restricted snd_pcm_format_t * @@
>> sound/soc/fsl/fsl-asoc-card.c:684:45: sparse: expected unsigned int [usertype] *out_value
>> sound/soc/fsl/fsl-asoc-card.c:684:45: sparse: got restricted snd_pcm_format_t *
vim +684 sound/soc/fsl/fsl-asoc-card.c
480
481 static int fsl_asoc_card_probe(struct platform_device *pdev)
482 {
483 struct device_node *cpu_np, *codec_np, *asrc_np;
484 struct device_node *np = pdev->dev.of_node;
485 struct platform_device *asrc_pdev = NULL;
486 struct platform_device *cpu_pdev;
487 struct fsl_asoc_card_priv *priv;
488 struct i2c_client *codec_dev;
489 const char *codec_dai_name;
490 u32 width;
491 int ret;
492
493 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
494 if (!priv)
495 return -ENOMEM;
496
497 cpu_np = of_parse_phandle(np, "audio-cpu", 0);
498 /* Give a chance to old DT binding */
499 if (!cpu_np)
500 cpu_np = of_parse_phandle(np, "ssi-controller", 0);
501 if (!cpu_np) {
502 dev_err(&pdev->dev, "CPU phandle missing or invalid\n");
503 ret = -EINVAL;
504 goto fail;
505 }
506
507 cpu_pdev = of_find_device_by_node(cpu_np);
508 if (!cpu_pdev) {
509 dev_err(&pdev->dev, "failed to find CPU DAI device\n");
510 ret = -EINVAL;
511 goto fail;
512 }
513
514 codec_np = of_parse_phandle(np, "audio-codec", 0);
515 if (codec_np)
516 codec_dev = of_find_i2c_device_by_node(codec_np);
517 else
518 codec_dev = NULL;
519
520 asrc_np = of_parse_phandle(np, "audio-asrc", 0);
521 if (asrc_np)
522 asrc_pdev = of_find_device_by_node(asrc_np);
523
524 /* Get the MCLK rate only, and leave it controlled by CODEC drivers */
525 if (codec_dev) {
526 struct clk *codec_clk = clk_get(&codec_dev->dev, NULL);
527
528 if (!IS_ERR(codec_clk)) {
529 priv->codec_priv.mclk_freq = clk_get_rate(codec_clk);
530 clk_put(codec_clk);
531 }
532 }
533
534 /* Default sample rate and format, will be updated in hw_params() */
535 priv->sample_rate = 44100;
536 priv->sample_format = SNDRV_PCM_FORMAT_S16_LE;
537
538 /* Assign a default DAI format, and allow each card to overwrite it */
539 priv->dai_fmt = DAI_FMT_BASE;
540
541 /* Diversify the card configurations */
542 if (of_device_is_compatible(np, "fsl,imx-audio-cs42888")) {
543 codec_dai_name = "cs42888";
544 priv->card.set_bias_level = NULL;
545 priv->cpu_priv.sysclk_freq[TX] = priv->codec_priv.mclk_freq;
546 priv->cpu_priv.sysclk_freq[RX] = priv->codec_priv.mclk_freq;
547 priv->cpu_priv.sysclk_dir[TX] = SND_SOC_CLOCK_OUT;
548 priv->cpu_priv.sysclk_dir[RX] = SND_SOC_CLOCK_OUT;
549 priv->cpu_priv.slot_width = 32;
550 priv->dai_fmt |= SND_SOC_DAIFMT_CBS_CFS;
551 } else if (of_device_is_compatible(np, "fsl,imx-audio-cs427x")) {
552 codec_dai_name = "cs4271-hifi";
553 priv->codec_priv.mclk_id = CS427x_SYSCLK_MCLK;
554 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
555 } else if (of_device_is_compatible(np, "fsl,imx-audio-sgtl5000")) {
556 codec_dai_name = "sgtl5000";
557 priv->codec_priv.mclk_id = SGTL5000_SYSCLK;
558 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
559 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8962")) {
560 codec_dai_name = "wm8962";
561 priv->card.set_bias_level = fsl_asoc_card_set_bias_level;
562 priv->codec_priv.mclk_id = WM8962_SYSCLK_MCLK;
563 priv->codec_priv.fll_id = WM8962_SYSCLK_FLL;
564 priv->codec_priv.pll_id = WM8962_FLL;
565 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
566 } else if (of_device_is_compatible(np, "fsl,imx-audio-wm8960")) {
567 codec_dai_name = "wm8960-hifi";
568 priv->card.set_bias_level = fsl_asoc_card_set_bias_level;
569 priv->codec_priv.fll_id = WM8960_SYSCLK_AUTO;
570 priv->codec_priv.pll_id = WM8960_SYSCLK_AUTO;
571 priv->dai_fmt |= SND_SOC_DAIFMT_CBM_CFM;
572 } else if (of_device_is_compatible(np, "fsl,imx-audio-ac97")) {
573 codec_dai_name = "ac97-hifi";
574 priv->card.set_bias_level = NULL;
575 priv->dai_fmt = SND_SOC_DAIFMT_AC97;
576 } else {
577 dev_err(&pdev->dev, "unknown Device Tree compatible\n");
578 ret = -EINVAL;
579 goto asrc_fail;
580 }
581
582 if (!fsl_asoc_card_is_ac97(priv) && !codec_dev) {
583 dev_err(&pdev->dev, "failed to find codec device\n");
584 ret = -EINVAL;
585 goto asrc_fail;
586 }
587
588 /* Common settings for corresponding Freescale CPU DAI driver */
589 if (of_node_name_eq(cpu_np, "ssi")) {
590 /* Only SSI needs to configure AUDMUX */
591 ret = fsl_asoc_card_audmux_init(np, priv);
592 if (ret) {
593 dev_err(&pdev->dev, "failed to init audmux\n");
594 goto asrc_fail;
595 }
596 } else if (of_node_name_eq(cpu_np, "esai")) {
597 priv->cpu_priv.sysclk_id[1] = ESAI_HCKT_EXTAL;
598 priv->cpu_priv.sysclk_id[0] = ESAI_HCKR_EXTAL;
599 } else if (of_node_name_eq(cpu_np, "sai")) {
600 priv->cpu_priv.sysclk_id[1] = FSL_SAI_CLK_MAST1;
601 priv->cpu_priv.sysclk_id[0] = FSL_SAI_CLK_MAST1;
602 }
603
604 snprintf(priv->name, sizeof(priv->name), "%s-audio",
605 fsl_asoc_card_is_ac97(priv) ? "ac97" :
606 codec_dev->name);
607
608 /* Initialize sound card */
609 priv->pdev = pdev;
610 priv->card.dev = &pdev->dev;
611 priv->card.name = priv->name;
612 priv->card.dai_link = priv->dai_link;
613 priv->card.dapm_routes = fsl_asoc_card_is_ac97(priv) ?
614 audio_map_ac97 : audio_map;
615 priv->card.late_probe = fsl_asoc_card_late_probe;
616 priv->card.num_dapm_routes = ARRAY_SIZE(audio_map);
617 priv->card.dapm_widgets = fsl_asoc_card_dapm_widgets;
618 priv->card.num_dapm_widgets = ARRAY_SIZE(fsl_asoc_card_dapm_widgets);
619
620 /* Drop the second half of DAPM routes -- ASRC */
621 if (!asrc_pdev)
622 priv->card.num_dapm_routes /= 2;
623
624 memcpy(priv->dai_link, fsl_asoc_card_dai,
625 sizeof(struct snd_soc_dai_link) * ARRAY_SIZE(priv->dai_link));
626
627 ret = snd_soc_of_parse_audio_routing(&priv->card, "audio-routing");
628 if (ret) {
629 dev_err(&pdev->dev, "failed to parse audio-routing: %d\n", ret);
630 goto asrc_fail;
631 }
632
633 /* Normal DAI Link */
634 priv->dai_link[0].cpus->of_node = cpu_np;
635 priv->dai_link[0].codecs->dai_name = codec_dai_name;
636
637 if (!fsl_asoc_card_is_ac97(priv))
638 priv->dai_link[0].codecs->of_node = codec_np;
639 else {
640 u32 idx;
641
642 ret = of_property_read_u32(cpu_np, "cell-index", &idx);
643 if (ret) {
644 dev_err(&pdev->dev,
645 "cannot get CPU index property\n");
646 goto asrc_fail;
647 }
648
649 priv->dai_link[0].codecs->name =
650 devm_kasprintf(&pdev->dev, GFP_KERNEL,
651 "ac97-codec.%u",
652 (unsigned int)idx);
653 if (!priv->dai_link[0].codecs->name) {
654 ret = -ENOMEM;
655 goto asrc_fail;
656 }
657 }
658
659 priv->dai_link[0].platforms->of_node = cpu_np;
660 priv->dai_link[0].dai_fmt = priv->dai_fmt;
661 priv->card.num_links = 1;
662
663 if (asrc_pdev) {
664 /* DPCM DAI Links only if ASRC exsits */
665 priv->dai_link[1].cpus->of_node = asrc_np;
666 priv->dai_link[1].platforms->of_node = asrc_np;
667 priv->dai_link[2].codecs->dai_name = codec_dai_name;
668 priv->dai_link[2].codecs->of_node = codec_np;
669 priv->dai_link[2].codecs->name =
670 priv->dai_link[0].codecs->name;
671 priv->dai_link[2].cpus->of_node = cpu_np;
672 priv->dai_link[2].dai_fmt = priv->dai_fmt;
673 priv->card.num_links = 3;
674
675 ret = of_property_read_u32(asrc_np, "fsl,asrc-rate",
676 &priv->asrc_rate);
677 if (ret) {
678 dev_err(&pdev->dev, "failed to get output rate\n");
679 ret = -EINVAL;
680 goto asrc_fail;
681 }
682
683 ret = of_property_read_u32(asrc_np, "fsl,asrc-format",
> 684 &priv->asrc_format);
685 if (ret) {
686 /* Fallback to old binding; translate to asrc_format */
687 ret = of_property_read_u32(asrc_np, "fsl,asrc-width",
688 &width);
689 if (ret) {
690 dev_err(&pdev->dev,
691 "failed to decide output format\n");
692 goto asrc_fail;
693 }
694
695 if (width == 24)
696 priv->asrc_format = SNDRV_PCM_FORMAT_S24_LE;
697 else
698 priv->asrc_format = SNDRV_PCM_FORMAT_S16_LE;
699 }
700 }
701
702 /* Finish card registering */
703 platform_set_drvdata(pdev, priv);
704 snd_soc_card_set_drvdata(&priv->card, priv);
705
706 ret = devm_snd_soc_register_card(&pdev->dev, &priv->card);
707 if (ret && ret != -EPROBE_DEFER)
708 dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
709
710 asrc_fail:
711 of_node_put(asrc_np);
712 of_node_put(codec_np);
713 put_device(&cpu_pdev->dev);
714 fail:
715 of_node_put(cpu_np);
716
717 return ret;
718 }
719
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH v8 4/7] iommu/arm-smmu: Add a pointer to the attached device to smmu_domain
by kernel test robot
Hi Jordan,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v5.7 next-20200611]
[cannot apply to iommu/next robh/for-next arm/for-next keystone/next rockchip/for-next arm64/for-next/core shawnguo/for-next soc/for-next]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Jordan-Crouse/iommu-arm-smmu-Ena...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git b961f8dc8976c091180839f4483d67b7c2ca2578
config: arm64-randconfig-s031-20200612 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-250-g42323db3-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=arm64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
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 >>, old ones prefixed by <<):
drivers/iommu/arm-smmu.c: In function 'arm_smmu_init_domain_context':
>> drivers/iommu/arm-smmu.c:804:21: error: 'dev' undeclared (first use in this function); did you mean 'cdev'?
804 | smmu_domain->dev = dev;
| ^~~
| cdev
drivers/iommu/arm-smmu.c:804:21: note: each undeclared identifier is reported only once for each function it appears in
vim +804 drivers/iommu/arm-smmu.c
669
670 static int arm_smmu_init_domain_context(struct iommu_domain *domain,
671 struct arm_smmu_device *smmu)
672 {
673 int irq, start, ret = 0;
674 unsigned long ias, oas;
675 struct io_pgtable_ops *pgtbl_ops;
676 struct io_pgtable_cfg pgtbl_cfg;
677 enum io_pgtable_fmt fmt;
678 struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain);
679 struct arm_smmu_cfg *cfg = &smmu_domain->cfg;
680
681 mutex_lock(&smmu_domain->init_mutex);
682 if (smmu_domain->smmu)
683 goto out_unlock;
684
685 if (domain->type == IOMMU_DOMAIN_IDENTITY) {
686 smmu_domain->stage = ARM_SMMU_DOMAIN_BYPASS;
687 smmu_domain->smmu = smmu;
688 goto out_unlock;
689 }
690
691 /*
692 * Mapping the requested stage onto what we support is surprisingly
693 * complicated, mainly because the spec allows S1+S2 SMMUs without
694 * support for nested translation. That means we end up with the
695 * following table:
696 *
697 * Requested Supported Actual
698 * S1 N S1
699 * S1 S1+S2 S1
700 * S1 S2 S2
701 * S1 S1 S1
702 * N N N
703 * N S1+S2 S2
704 * N S2 S2
705 * N S1 S1
706 *
707 * Note that you can't actually request stage-2 mappings.
708 */
709 if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1))
710 smmu_domain->stage = ARM_SMMU_DOMAIN_S2;
711 if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S2))
712 smmu_domain->stage = ARM_SMMU_DOMAIN_S1;
713
714 /*
715 * Choosing a suitable context format is even more fiddly. Until we
716 * grow some way for the caller to express a preference, and/or move
717 * the decision into the io-pgtable code where it arguably belongs,
718 * just aim for the closest thing to the rest of the system, and hope
719 * that the hardware isn't esoteric enough that we can't assume AArch64
720 * support to be a superset of AArch32 support...
721 */
722 if (smmu->features & ARM_SMMU_FEAT_FMT_AARCH32_L)
723 cfg->fmt = ARM_SMMU_CTX_FMT_AARCH32_L;
724 if (IS_ENABLED(CONFIG_IOMMU_IO_PGTABLE_ARMV7S) &&
725 !IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_ARM_LPAE) &&
726 (smmu->features & ARM_SMMU_FEAT_FMT_AARCH32_S) &&
727 (smmu_domain->stage == ARM_SMMU_DOMAIN_S1))
728 cfg->fmt = ARM_SMMU_CTX_FMT_AARCH32_S;
729 if ((IS_ENABLED(CONFIG_64BIT) || cfg->fmt == ARM_SMMU_CTX_FMT_NONE) &&
730 (smmu->features & (ARM_SMMU_FEAT_FMT_AARCH64_64K |
731 ARM_SMMU_FEAT_FMT_AARCH64_16K |
732 ARM_SMMU_FEAT_FMT_AARCH64_4K)))
733 cfg->fmt = ARM_SMMU_CTX_FMT_AARCH64;
734
735 if (cfg->fmt == ARM_SMMU_CTX_FMT_NONE) {
736 ret = -EINVAL;
737 goto out_unlock;
738 }
739
740 switch (smmu_domain->stage) {
741 case ARM_SMMU_DOMAIN_S1:
742 cfg->cbar = CBAR_TYPE_S1_TRANS_S2_BYPASS;
743 start = smmu->num_s2_context_banks;
744 ias = smmu->va_size;
745 oas = smmu->ipa_size;
746 if (cfg->fmt == ARM_SMMU_CTX_FMT_AARCH64) {
747 fmt = ARM_64_LPAE_S1;
748 } else if (cfg->fmt == ARM_SMMU_CTX_FMT_AARCH32_L) {
749 fmt = ARM_32_LPAE_S1;
750 ias = min(ias, 32UL);
751 oas = min(oas, 40UL);
752 } else {
753 fmt = ARM_V7S;
754 ias = min(ias, 32UL);
755 oas = min(oas, 32UL);
756 }
757 smmu_domain->flush_ops = &arm_smmu_s1_tlb_ops;
758 break;
759 case ARM_SMMU_DOMAIN_NESTED:
760 /*
761 * We will likely want to change this if/when KVM gets
762 * involved.
763 */
764 case ARM_SMMU_DOMAIN_S2:
765 cfg->cbar = CBAR_TYPE_S2_TRANS;
766 start = 0;
767 ias = smmu->ipa_size;
768 oas = smmu->pa_size;
769 if (cfg->fmt == ARM_SMMU_CTX_FMT_AARCH64) {
770 fmt = ARM_64_LPAE_S2;
771 } else {
772 fmt = ARM_32_LPAE_S2;
773 ias = min(ias, 40UL);
774 oas = min(oas, 40UL);
775 }
776 if (smmu->version == ARM_SMMU_V2)
777 smmu_domain->flush_ops = &arm_smmu_s2_tlb_ops_v2;
778 else
779 smmu_domain->flush_ops = &arm_smmu_s2_tlb_ops_v1;
780 break;
781 default:
782 ret = -EINVAL;
783 goto out_unlock;
784 }
785 ret = __arm_smmu_alloc_bitmap(smmu->context_map, start,
786 smmu->num_context_banks);
787 if (ret < 0)
788 goto out_unlock;
789
790 cfg->cbndx = ret;
791 if (smmu->version < ARM_SMMU_V2) {
792 cfg->irptndx = atomic_inc_return(&smmu->irptndx);
793 cfg->irptndx %= smmu->num_context_irqs;
794 } else {
795 cfg->irptndx = cfg->cbndx;
796 }
797
798 if (smmu_domain->stage == ARM_SMMU_DOMAIN_S2)
799 cfg->vmid = cfg->cbndx + 1;
800 else
801 cfg->asid = cfg->cbndx;
802
803 smmu_domain->smmu = smmu;
> 804 smmu_domain->dev = dev;
805
806 pgtbl_cfg = (struct io_pgtable_cfg) {
807 .pgsize_bitmap = smmu->pgsize_bitmap,
808 .ias = ias,
809 .oas = oas,
810 .coherent_walk = smmu->features & ARM_SMMU_FEAT_COHERENT_WALK,
811 .tlb = smmu_domain->flush_ops,
812 .iommu_dev = smmu->dev,
813 };
814
815 if (smmu->impl && smmu->impl->init_context) {
816 ret = smmu->impl->init_context(smmu_domain, &pgtbl_cfg);
817 if (ret)
818 goto out_unlock;
819 }
820
821 if (smmu_domain->non_strict)
822 pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_NON_STRICT;
823
824 pgtbl_ops = alloc_io_pgtable_ops(fmt, &pgtbl_cfg, smmu_domain);
825 if (!pgtbl_ops) {
826 ret = -ENOMEM;
827 goto out_clear_smmu;
828 }
829
830 /* Update the domain's page sizes to reflect the page table format */
831 domain->pgsize_bitmap = pgtbl_cfg.pgsize_bitmap;
832
833 if (pgtbl_cfg.quirks & IO_PGTABLE_QUIRK_ARM_TTBR1) {
834 domain->geometry.aperture_start = ~0UL << ias;
835 domain->geometry.aperture_end = ~0UL;
836 } else {
837 domain->geometry.aperture_end = (1UL << ias) - 1;
838 }
839
840 domain->geometry.force_aperture = true;
841
842 /* Initialise the context bank with our page table cfg */
843 arm_smmu_init_context_bank(smmu_domain, &pgtbl_cfg);
844 arm_smmu_write_context_bank(smmu, cfg->cbndx);
845
846 /*
847 * Request context fault interrupt. Do this last to avoid the
848 * handler seeing a half-initialised domain state.
849 */
850 irq = smmu->irqs[smmu->num_global_irqs + cfg->irptndx];
851 ret = devm_request_irq(smmu->dev, irq, arm_smmu_context_fault,
852 IRQF_SHARED, "arm-smmu-context-fault", domain);
853 if (ret < 0) {
854 dev_err(smmu->dev, "failed to request context IRQ %d (%u)\n",
855 cfg->irptndx, irq);
856 cfg->irptndx = ARM_SMMU_INVALID_IRPTNDX;
857 }
858
859 mutex_unlock(&smmu_domain->init_mutex);
860
861 /* Publish page table ops for map/unmap */
862 smmu_domain->pgtbl_ops = pgtbl_ops;
863 return 0;
864
865 out_clear_smmu:
866 __arm_smmu_free_bitmap(smmu->context_map, cfg->cbndx);
867 smmu_domain->smmu = NULL;
868 out_unlock:
869 mutex_unlock(&smmu_domain->init_mutex);
870 return ret;
871 }
872
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months