[intel-lts:5.10/KMB-yocto 49/62] drivers/gpu/drm/kmb/kmb_drv.c:39:5: warning: no previous prototype for function 'kmb_display_clk_enable'
by kernel test robot
tree: https://github.com/intel/linux-intel-lts.git 5.10/KMB-yocto
head: afd0620ed0e5ce91d03f51deb2e551721ba97640
commit: 01c1338e9611c7c8a65c84e0102298bd9f0732d0 [49/62] drm/kmb: Enable support for fbcon (framebuffer console)
config: riscv-randconfig-r042-20211209 (https://download.01.org/0day-ci/archive/20211210/202112100556.kUVV7RMR-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
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/intel/linux-intel-lts/commit/01c1338e9611c7c8a65c84e01...
git remote add intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-lts 5.10/KMB-yocto
git checkout 01c1338e9611c7c8a65c84e0102298bd9f0732d0
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/gpu/drm/kmb/ drivers/spi/
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 >>):
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:87:48: note: expanded from macro 'readb_cpu'
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
^
In file included from drivers/gpu/drm/kmb/kmb_drv.c:18:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:564:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inw(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:88:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/gpu/drm/kmb/kmb_drv.c:18:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:57:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:89:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/gpu/drm/kmb/kmb_drv.c:18:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:91:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from drivers/gpu/drm/kmb/kmb_drv.c:18:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from drivers/gpu/drm/kmb/kmb_drv.c:18:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:61:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from drivers/gpu/drm/kmb/kmb_drv.c:18:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:1005:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
In file included from drivers/gpu/drm/kmb/kmb_drv.c:22:
In file included from include/drm/drm_fb_helper.h:39:
In file included from include/linux/vgaarb.h:34:
include/video/vga.h:215:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(VGA_OUT16VAL (val, reg), port);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
>> drivers/gpu/drm/kmb/kmb_drv.c:39:5: warning: no previous prototype for function 'kmb_display_clk_enable' [-Wmissing-prototypes]
int kmb_display_clk_enable(struct kmb_drm_private *kmb)
^
drivers/gpu/drm/kmb/kmb_drv.c:39:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int kmb_display_clk_enable(struct kmb_drm_private *kmb)
^
static
9 warnings generated.
vim +/kmb_display_clk_enable +39 drivers/gpu/drm/kmb/kmb_drv.c
32
33 /* Module Parameters */
34 static bool console;
35 module_param(console, bool, 0400);
36 MODULE_PARM_DESC(console,
37 "Enable framebuffer console support (0=disable [default], 1=on)");
38
> 39 int kmb_display_clk_enable(struct kmb_drm_private *kmb)
40 {
41 int ret = 0;
42
43 ret = clk_prepare_enable(kmb->kmb_clk.clk_lcd);
44 if (ret) {
45 drm_err(&kmb->drm, "Failed to enable LCD clock: %d\n", ret);
46 return ret;
47 }
48 DRM_INFO("SUCCESS : enabled LCD clocks\n");
49 return 0;
50 }
51
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
[melver:review/uaccess-logging 4/6] kernel/uaccess-buffer.c:62:31: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git review/uaccess-logging
head: b0aa74824d0cd2fca9a45f5328b355949217f721
commit: 8ebb2cf0597b5485d0e3aa745fb79d9495ac9b97 [4/6] uaccess-buffer: add CONFIG_GENERIC_ENTRY support
config: i386-randconfig-s031-20211207 (https://download.01.org/0day-ci/archive/20211210/202112100515.6IGZbs7H-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git/commit/?...
git remote add melver https://git.kernel.org/pub/scm/linux/kernel/git/melver/linux.git
git fetch --no-tags melver review/uaccess-logging
git checkout 8ebb2cf0597b5485d0e3aa745fb79d9495ac9b97
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash
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 >>)
>> kernel/uaccess-buffer.c:62:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/uaccess-buffer.c:62:31: sparse: expected struct spinlock [usertype] *lock
kernel/uaccess-buffer.c:62:31: sparse: got struct spinlock [noderef] __rcu *
kernel/uaccess-buffer.c:65:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/uaccess-buffer.c:65:33: sparse: expected struct spinlock [usertype] *lock
kernel/uaccess-buffer.c:65:33: sparse: got struct spinlock [noderef] __rcu *
>> kernel/uaccess-buffer.c:83:13: sparse: sparse: Using plain integer as NULL pointer
vim +62 kernel/uaccess-buffer.c
b3442207580a7a Peter Collingbourne 2021-12-07 59
b3442207580a7a Peter Collingbourne 2021-12-07 60 void __uaccess_buffer_post_exit_loop(void)
b3442207580a7a Peter Collingbourne 2021-12-07 61 {
b3442207580a7a Peter Collingbourne 2021-12-07 @62 spin_lock_irq(¤t->sighand->siglock);
b3442207580a7a Peter Collingbourne 2021-12-07 63 current->blocked = current->real_blocked;
b3442207580a7a Peter Collingbourne 2021-12-07 64 recalc_sigpending();
b3442207580a7a Peter Collingbourne 2021-12-07 65 spin_unlock_irq(¤t->sighand->siglock);
b3442207580a7a Peter Collingbourne 2021-12-07 66 }
b3442207580a7a Peter Collingbourne 2021-12-07 67
b3442207580a7a Peter Collingbourne 2021-12-07 68 void uaccess_buffer_free(struct task_struct *tsk)
b3442207580a7a Peter Collingbourne 2021-12-07 69 {
b3442207580a7a Peter Collingbourne 2021-12-07 70 struct uaccess_buffer_info *buf = &tsk->uaccess_buffer;
b3442207580a7a Peter Collingbourne 2021-12-07 71
b3442207580a7a Peter Collingbourne 2021-12-07 72 kfree(buf->kbegin);
b3442207580a7a Peter Collingbourne 2021-12-07 73 clear_syscall_work(UACCESS_BUFFER_EXIT);
b3442207580a7a Peter Collingbourne 2021-12-07 74 buf->kbegin = buf->kcur = buf->kend = NULL;
b3442207580a7a Peter Collingbourne 2021-12-07 75 }
b3442207580a7a Peter Collingbourne 2021-12-07 76
b3442207580a7a Peter Collingbourne 2021-12-07 77 void __uaccess_buffer_syscall_entry(void)
b3442207580a7a Peter Collingbourne 2021-12-07 78 {
b3442207580a7a Peter Collingbourne 2021-12-07 79 struct uaccess_buffer_info *buf = ¤t->uaccess_buffer;
b3442207580a7a Peter Collingbourne 2021-12-07 80 struct uaccess_descriptor desc;
b3442207580a7a Peter Collingbourne 2021-12-07 81
b3442207580a7a Peter Collingbourne 2021-12-07 82 if (get_user(buf->desc_ptr, buf->desc_ptr_ptr) || !buf->desc_ptr ||
b3442207580a7a Peter Collingbourne 2021-12-07 @83 put_user(0, buf->desc_ptr_ptr) ||
b3442207580a7a Peter Collingbourne 2021-12-07 84 copy_from_user(&desc, buf->desc_ptr, sizeof(desc)))
b3442207580a7a Peter Collingbourne 2021-12-07 85 return;
b3442207580a7a Peter Collingbourne 2021-12-07 86
b3442207580a7a Peter Collingbourne 2021-12-07 87 if (desc.size > 1024)
b3442207580a7a Peter Collingbourne 2021-12-07 88 desc.size = 1024;
b3442207580a7a Peter Collingbourne 2021-12-07 89
b3442207580a7a Peter Collingbourne 2021-12-07 90 if (buf->kend - buf->kbegin != desc.size)
b3442207580a7a Peter Collingbourne 2021-12-07 91 buf->kbegin =
b3442207580a7a Peter Collingbourne 2021-12-07 92 krealloc_array(buf->kbegin, desc.size,
b3442207580a7a Peter Collingbourne 2021-12-07 93 sizeof(struct uaccess_buffer_entry),
b3442207580a7a Peter Collingbourne 2021-12-07 94 GFP_KERNEL);
b3442207580a7a Peter Collingbourne 2021-12-07 95 if (!buf->kbegin)
b3442207580a7a Peter Collingbourne 2021-12-07 96 return;
b3442207580a7a Peter Collingbourne 2021-12-07 97
b3442207580a7a Peter Collingbourne 2021-12-07 98 set_syscall_work(UACCESS_BUFFER_EXIT);
b3442207580a7a Peter Collingbourne 2021-12-07 99 buf->kcur = buf->kbegin;
b3442207580a7a Peter Collingbourne 2021-12-07 100 buf->kend = buf->kbegin + desc.size;
b3442207580a7a Peter Collingbourne 2021-12-07 101 buf->ubegin =
b3442207580a7a Peter Collingbourne 2021-12-07 102 (struct uaccess_buffer_entry __user *)(unsigned long)desc.addr;
b3442207580a7a Peter Collingbourne 2021-12-07 103 }
b3442207580a7a Peter Collingbourne 2021-12-07 104
:::::: The code at line 62 was first introduced by commit
:::::: b3442207580a7ad112ed80ebff4f516282979c3b uaccess-buffer: add core code
:::::: TO: Peter Collingbourne <pcc(a)google.com>
:::::: CC: Marco Elver <elver(a)google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
arch/mips/kvm/vz.c:1552: warning: expecting prototype for kvm_trap_vz_handle_cop_unusuable(). Prototype was for kvm_trap_vz_handle_cop_unusable() instead
by kernel test robot
Hi Thomas,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2a987e65025e2b79c6d453b78cb5985ac6e5eb26
commit: 45c7e8af4a5e3f0bea4ac209eea34118dd57ac64 MIPS: Remove KVM_TE support
date: 9 months ago
config: mips-randconfig-r005-20211209 (https://download.01.org/0day-ci/archive/20211210/202112100504.EqkymVXu-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 45c7e8af4a5e3f0bea4ac209eea34118dd57ac64
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash arch/mips/crypto/ arch/mips/kvm/
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 >>):
arch/mips/kvm/vz.c:471: warning: Function parameter or member 'out_compare' not described in '_kvm_vz_save_htimer'
arch/mips/kvm/vz.c:471: warning: Function parameter or member 'out_cause' not described in '_kvm_vz_save_htimer'
arch/mips/kvm/vz.c:471: warning: Excess function parameter 'compare' description in '_kvm_vz_save_htimer'
arch/mips/kvm/vz.c:471: warning: Excess function parameter 'cause' description in '_kvm_vz_save_htimer'
>> arch/mips/kvm/vz.c:1552: warning: expecting prototype for kvm_trap_vz_handle_cop_unusuable(). Prototype was for kvm_trap_vz_handle_cop_unusable() instead
vim +1552 arch/mips/kvm/vz.c
c992a4f6a9b0a37 James Hogan 2017-03-14 1543
c992a4f6a9b0a37 James Hogan 2017-03-14 1544 /**
c992a4f6a9b0a37 James Hogan 2017-03-14 1545 * kvm_trap_vz_handle_cop_unusuable() - Guest used unusable coprocessor.
c992a4f6a9b0a37 James Hogan 2017-03-14 1546 * @vcpu: Virtual CPU context.
c992a4f6a9b0a37 James Hogan 2017-03-14 1547 *
c992a4f6a9b0a37 James Hogan 2017-03-14 1548 * Handle when the guest attempts to use a coprocessor which hasn't been allowed
c992a4f6a9b0a37 James Hogan 2017-03-14 1549 * by the root context.
c992a4f6a9b0a37 James Hogan 2017-03-14 1550 */
c992a4f6a9b0a37 James Hogan 2017-03-14 1551 static int kvm_trap_vz_handle_cop_unusable(struct kvm_vcpu *vcpu)
c992a4f6a9b0a37 James Hogan 2017-03-14 @1552 {
c992a4f6a9b0a37 James Hogan 2017-03-14 1553 u32 cause = vcpu->arch.host_cp0_cause;
c992a4f6a9b0a37 James Hogan 2017-03-14 1554 enum emulation_result er = EMULATE_FAIL;
c992a4f6a9b0a37 James Hogan 2017-03-14 1555 int ret = RESUME_GUEST;
c992a4f6a9b0a37 James Hogan 2017-03-14 1556
c992a4f6a9b0a37 James Hogan 2017-03-14 1557 if (((cause & CAUSEF_CE) >> CAUSEB_CE) == 1) {
c992a4f6a9b0a37 James Hogan 2017-03-14 1558 /*
c992a4f6a9b0a37 James Hogan 2017-03-14 1559 * If guest FPU not present, the FPU operation should have been
c992a4f6a9b0a37 James Hogan 2017-03-14 1560 * treated as a reserved instruction!
c992a4f6a9b0a37 James Hogan 2017-03-14 1561 * If FPU already in use, we shouldn't get this at all.
c992a4f6a9b0a37 James Hogan 2017-03-14 1562 */
c992a4f6a9b0a37 James Hogan 2017-03-14 1563 if (WARN_ON(!kvm_mips_guest_has_fpu(&vcpu->arch) ||
c992a4f6a9b0a37 James Hogan 2017-03-14 1564 vcpu->arch.aux_inuse & KVM_MIPS_AUX_FPU)) {
c992a4f6a9b0a37 James Hogan 2017-03-14 1565 preempt_enable();
c992a4f6a9b0a37 James Hogan 2017-03-14 1566 return EMULATE_FAIL;
c992a4f6a9b0a37 James Hogan 2017-03-14 1567 }
c992a4f6a9b0a37 James Hogan 2017-03-14 1568
c992a4f6a9b0a37 James Hogan 2017-03-14 1569 kvm_own_fpu(vcpu);
c992a4f6a9b0a37 James Hogan 2017-03-14 1570 er = EMULATE_DONE;
c992a4f6a9b0a37 James Hogan 2017-03-14 1571 }
c992a4f6a9b0a37 James Hogan 2017-03-14 1572 /* other coprocessors not handled */
c992a4f6a9b0a37 James Hogan 2017-03-14 1573
c992a4f6a9b0a37 James Hogan 2017-03-14 1574 switch (er) {
c992a4f6a9b0a37 James Hogan 2017-03-14 1575 case EMULATE_DONE:
c992a4f6a9b0a37 James Hogan 2017-03-14 1576 ret = RESUME_GUEST;
c992a4f6a9b0a37 James Hogan 2017-03-14 1577 break;
c992a4f6a9b0a37 James Hogan 2017-03-14 1578
c992a4f6a9b0a37 James Hogan 2017-03-14 1579 case EMULATE_FAIL:
c34b26b98caca48 Tianjia Zhang 2020-06-23 1580 vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR;
c992a4f6a9b0a37 James Hogan 2017-03-14 1581 ret = RESUME_HOST;
c992a4f6a9b0a37 James Hogan 2017-03-14 1582 break;
c992a4f6a9b0a37 James Hogan 2017-03-14 1583
c992a4f6a9b0a37 James Hogan 2017-03-14 1584 default:
c992a4f6a9b0a37 James Hogan 2017-03-14 1585 BUG();
c992a4f6a9b0a37 James Hogan 2017-03-14 1586 }
c992a4f6a9b0a37 James Hogan 2017-03-14 1587 return ret;
c992a4f6a9b0a37 James Hogan 2017-03-14 1588 }
c992a4f6a9b0a37 James Hogan 2017-03-14 1589
:::::: The code at line 1552 was first introduced by commit
:::::: c992a4f6a9b0a37c8bd7dfc727ecc3fed125c16b KVM: MIPS: Implement VZ support
:::::: TO: James Hogan <james.hogan(a)imgtec.com>
:::::: CC: James Hogan <james.hogan(a)imgtec.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
Re: [net-next RFC PATCH v2 7/8] net: dsa: qca8k: Add support for mdio read/write in Ethernet packet
by kernel test robot
Hi Ansuel,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Ansuel-Smith/Add-support-for-qca...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 59d58d93af94d7b546f12438b4a3d781b7190095
config: arm-randconfig-s031-20211209 (https://download.01.org/0day-ci/archive/20211210/202112100354.XoEu9gUo-lk...)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/1283a493fbd646756be33415ab9d3830d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ansuel-Smith/Add-support-for-qca8k-mdio-rw-in-Ethernet-packet/20211208-114220
git checkout 1283a493fbd646756be33415ab9d3830d6ffb0af
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm SHELL=/bin/bash drivers/net/bonding/ drivers/net/dsa/
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 >>)
>> drivers/net/dsa/qca8k.c:205:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] hdr @@ got restricted __be16 [usertype] @@
drivers/net/dsa/qca8k.c:205:26: sparse: expected unsigned short [usertype] hdr
drivers/net/dsa/qca8k.c:205:26: sparse: got restricted __be16 [usertype]
>> drivers/net/dsa/qca8k.c:220:63: sparse: sparse: Using plain integer as NULL pointer
vim +205 drivers/net/dsa/qca8k.c
173
174 static struct sk_buff *qca8k_alloc_mdio_header(struct qca8k_port_tag *header, enum mdio_cmd cmd,
175 u32 reg, u32 *val)
176 {
177 struct mdio_ethhdr *mdio_ethhdr;
178 struct sk_buff *skb;
179 u16 hdr;
180
181 skb = dev_alloc_skb(QCA_HDR_MDIO_PKG_LEN);
182
183 prefetchw(skb->data);
184
185 skb_reset_mac_header(skb);
186 skb_set_network_header(skb, skb->len);
187
188 mdio_ethhdr = skb_push(skb, QCA_HDR_MDIO_HEADER_LEN + QCA_HDR_LEN);
189
190 hdr = FIELD_PREP(QCA_HDR_XMIT_VERSION, QCA_HDR_VERSION);
191 hdr |= QCA_HDR_XMIT_FROM_CPU;
192 hdr |= FIELD_PREP(QCA_HDR_XMIT_DP_BIT, BIT(0));
193 hdr |= FIELD_PREP(QCA_HDR_XMIT_CONTROL, QCA_HDR_XMIT_TYPE_RW_REG);
194
195 mdio_ethhdr->seq = FIELD_PREP(QCA_HDR_MDIO_SEQ_NUM, 200);
196
197 mdio_ethhdr->command = FIELD_PREP(QCA_HDR_MDIO_ADDR, reg);
198 mdio_ethhdr->command |= FIELD_PREP(QCA_HDR_MDIO_LENGTH, 4);
199 mdio_ethhdr->command |= FIELD_PREP(QCA_HDR_MDIO_CMD, cmd);
200 mdio_ethhdr->command |= FIELD_PREP(QCA_HDR_MDIO_CHECK_CODE, MDIO_CHECK_CODE_VAL);
201
202 if (cmd == MDIO_WRITE)
203 mdio_ethhdr->mdio_data = *val;
204
> 205 mdio_ethhdr->hdr = htons(hdr);
206
207 skb_put_zero(skb, QCA_HDR_MDIO_DATA2_LEN);
208 skb_put_zero(skb, QCA_HDR_MDIO_PADDING_LEN);
209
210 return skb;
211 }
212
213 static int qca8k_read_eth(struct qca8k_priv *priv, u32 reg, u32 *val)
214 {
215 struct qca8k_port_tag *header = priv->header_mdio;
216 struct sk_buff *skb;
217 bool ack;
218 int ret;
219
> 220 skb = qca8k_alloc_mdio_header(header, MDIO_READ, reg, 0);
221 skb->dev = dsa_to_port(priv->ds, 0)->master;
222
223 mutex_lock(&header->mdio_mutex);
224
225 reinit_completion(&header->rw_done);
226 header->seq = 200;
227 header->ack = false;
228
229 dev_queue_xmit(skb);
230
231 ret = wait_for_completion_timeout(&header->rw_done, QCA8K_MDIO_RW_ETHERNET);
232
233 *val = header->data[0];
234 ack = header->ack;
235
236 mutex_unlock(&header->mdio_mutex);
237
238 if (ret <= 0)
239 return -ETIMEDOUT;
240
241 if (!ack)
242 return -EINVAL;
243
244 return 0;
245 }
246
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
Re: [PATCH 13/73] sata_dwc_460ex: use generic tracepoints
by kernel test robot
Hi Hannes,
I love your patch! Yet something to improve:
[auto build test ERROR on rostedt-trace/for-next]
[also build test ERROR on axboe-block/for-next linus/master v5.16-rc4 next-20211208]
[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/Hannes-Reinecke/libata-rework-lo...
base: https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git for-next
config: i386-randconfig-a012-20211209 (https://download.01.org/0day-ci/archive/20211210/202112100319.zR4w9NfW-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 097a1cb1d5ebb3a0ec4bcaed8ba3ff6a8e33c00a)
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/b3bb5eac4170da8a3e9c477ad4c1c8f97...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Hannes-Reinecke/libata-rework-logging-take-II/20211209-003634
git checkout b3bb5eac4170da8a3e9c477ad4c1c8f97164abc5
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
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 >>):
>> drivers/ata/sata_dwc_460ex.c:744:5: error: implicit declaration of function 'get_dma_dir_descript' [-Werror,-Wimplicit-function-declaration]
get_dma_dir_descript(qc->dma_dir),
^
drivers/ata/sata_dwc_460ex.c:744:5: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat]
get_dma_dir_descript(qc->dma_dir),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info'
dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
_p_func(dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
1 warning and 1 error generated.
vim +/get_dma_dir_descript +744 drivers/ata/sata_dwc_460ex.c
62936009f35a665 Rupjyoti Sarmah 2010-07-06 724
62936009f35a665 Rupjyoti Sarmah 2010-07-06 725 static void sata_dwc_dma_xfer_complete(struct ata_port *ap, u32 check_status)
62936009f35a665 Rupjyoti Sarmah 2010-07-06 726 {
62936009f35a665 Rupjyoti Sarmah 2010-07-06 727 struct ata_queued_cmd *qc;
62936009f35a665 Rupjyoti Sarmah 2010-07-06 728 struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap);
62936009f35a665 Rupjyoti Sarmah 2010-07-06 729 struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap);
62936009f35a665 Rupjyoti Sarmah 2010-07-06 730 u8 tag = 0;
62936009f35a665 Rupjyoti Sarmah 2010-07-06 731
62936009f35a665 Rupjyoti Sarmah 2010-07-06 732 tag = ap->link.active_tag;
62936009f35a665 Rupjyoti Sarmah 2010-07-06 733 qc = ata_qc_from_tag(ap, tag);
62936009f35a665 Rupjyoti Sarmah 2010-07-06 734 if (!qc) {
62936009f35a665 Rupjyoti Sarmah 2010-07-06 735 dev_err(ap->dev, "failed to get qc");
62936009f35a665 Rupjyoti Sarmah 2010-07-06 736 return;
62936009f35a665 Rupjyoti Sarmah 2010-07-06 737 }
62936009f35a665 Rupjyoti Sarmah 2010-07-06 738
62936009f35a665 Rupjyoti Sarmah 2010-07-06 739 #ifdef DEBUG_NCQ
62936009f35a665 Rupjyoti Sarmah 2010-07-06 740 if (tag > 0) {
d578514b271e7c8 Andy Shevchenko 2015-03-03 741 dev_info(ap->dev,
d578514b271e7c8 Andy Shevchenko 2015-03-03 742 "%s tag=%u cmd=0x%02x dma dir=%s proto=%s dmacr=0x%08x\n",
4e5b6260cc9ba84 Jens Axboe 2018-05-11 743 __func__, qc->hw_tag, qc->tf.command,
84b47e3b16f8a5b Sergei Shtylyov 2011-01-28 @744 get_dma_dir_descript(qc->dma_dir),
84b47e3b16f8a5b Sergei Shtylyov 2011-01-28 745 get_prot_descript(qc->tf.protocol),
ee81d6cc8e8aa66 Mans Rullgard 2016-04-26 746 sata_dwc_readl(&hsdev->sata_dwc_regs->dmacr));
62936009f35a665 Rupjyoti Sarmah 2010-07-06 747 }
62936009f35a665 Rupjyoti Sarmah 2010-07-06 748 #endif
62936009f35a665 Rupjyoti Sarmah 2010-07-06 749
62936009f35a665 Rupjyoti Sarmah 2010-07-06 750 if (ata_is_dma(qc->tf.protocol)) {
62936009f35a665 Rupjyoti Sarmah 2010-07-06 751 if (hsdevp->dma_pending[tag] == SATA_DWC_DMA_PENDING_NONE) {
d578514b271e7c8 Andy Shevchenko 2015-03-03 752 dev_err(ap->dev,
d578514b271e7c8 Andy Shevchenko 2015-03-03 753 "%s DMA protocol RX and TX DMA not pending dmacr: 0x%08x\n",
d578514b271e7c8 Andy Shevchenko 2015-03-03 754 __func__,
ee81d6cc8e8aa66 Mans Rullgard 2016-04-26 755 sata_dwc_readl(&hsdev->sata_dwc_regs->dmacr));
62936009f35a665 Rupjyoti Sarmah 2010-07-06 756 }
62936009f35a665 Rupjyoti Sarmah 2010-07-06 757
62936009f35a665 Rupjyoti Sarmah 2010-07-06 758 hsdevp->dma_pending[tag] = SATA_DWC_DMA_PENDING_NONE;
62936009f35a665 Rupjyoti Sarmah 2010-07-06 759 sata_dwc_qc_complete(ap, qc, check_status);
62936009f35a665 Rupjyoti Sarmah 2010-07-06 760 ap->link.active_tag = ATA_TAG_POISON;
62936009f35a665 Rupjyoti Sarmah 2010-07-06 761 } else {
62936009f35a665 Rupjyoti Sarmah 2010-07-06 762 sata_dwc_qc_complete(ap, qc, check_status);
62936009f35a665 Rupjyoti Sarmah 2010-07-06 763 }
62936009f35a665 Rupjyoti Sarmah 2010-07-06 764 }
62936009f35a665 Rupjyoti Sarmah 2010-07-06 765
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
[leon-rdma:rdma-next 24/31] drivers/infiniband/core/cache.c:968:17: error: expected ';' before 'goto'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git rdma-next
head: 3851deadf6de976fe0d2f72ca1084b47a044c2c7
commit: 1f2b65dfb4d995e74b621e3e21e7c7445d187956 [24/31] RDMA/core: Modify rdma_query_gid() to return accurate error codes
config: nios2-allyesconfig (https://download.01.org/0day-ci/archive/20211210/202112100326.X7X2uSiO-lk...)
compiler: nios2-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git/commi...
git remote add leon-rdma https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git
git fetch --no-tags leon-rdma rdma-next
git checkout 1f2b65dfb4d995e74b621e3e21e7c7445d187956
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash
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 >>):
drivers/infiniband/core/cache.c: In function 'rdma_query_gid':
>> drivers/infiniband/core/cache.c:968:17: error: expected ';' before 'goto'
968 | goto done;
| ^~~~
vim +968 drivers/infiniband/core/cache.c
03db3a2d81e6e8 Matan Barak 2015-07-30 938
6612b4983f7e8d Parav Pandit 2018-03-13 939 /**
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 940 * rdma_query_gid - Read the GID content from the GID software cache
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 941 * @device: Device to query the GID
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 942 * @port_num: Port number of the device
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 943 * @index: Index of the GID table entry to read
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 944 * @gid: Pointer to GID where to store the entry's GID
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 945 *
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 946 * rdma_query_gid() only reads the GID entry content for requested device,
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 947 * port and index. It reads for IB, RoCE and iWarp link layers. It doesn't
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 948 * hold any reference to the GID table entry in the HCA or software cache.
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 949 *
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 950 * Returns 0 on success or appropriate error code.
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 951 *
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 952 */
1fb7f8973f51ca Mark Bloch 2021-03-01 953 int rdma_query_gid(struct ib_device *device, u32 port_num,
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 954 int index, union ib_gid *gid)
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 955 {
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 956 struct ib_gid_table *table;
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 957 unsigned long flags;
1f2b65dfb4d995 Avihai Horon 2021-10-25 958 int res;
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 959
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 960 if (!rdma_is_port_valid(device, port_num))
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 961 return -EINVAL;
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 962
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 963 table = rdma_gid_table(device, port_num);
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 964 read_lock_irqsave(&table->rwlock, flags);
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 965
1f2b65dfb4d995 Avihai Horon 2021-10-25 966 if (index < 0 || index >= table->sz) {
1f2b65dfb4d995 Avihai Horon 2021-10-25 967 res = -EINVAL
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 @968 goto done;
1f2b65dfb4d995 Avihai Horon 2021-10-25 969 }
1f2b65dfb4d995 Avihai Horon 2021-10-25 970
1f2b65dfb4d995 Avihai Horon 2021-10-25 971 if (!is_gid_entry_valid(table->data_vec[index])) {
1f2b65dfb4d995 Avihai Horon 2021-10-25 972 res = -ENOENT;
1f2b65dfb4d995 Avihai Horon 2021-10-25 973 goto done;
1f2b65dfb4d995 Avihai Horon 2021-10-25 974 }
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 975
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 976 memcpy(gid, &table->data_vec[index]->attr.gid, sizeof(*gid));
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 977 res = 0;
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 978
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 979 done:
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 980 read_unlock_irqrestore(&table->rwlock, flags);
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 981 return res;
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 982 }
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 983 EXPORT_SYMBOL(rdma_query_gid);
c3d71b69a75cbb Jason Gunthorpe 2018-06-05 984
:::::: The code at line 968 was first introduced by commit
:::::: c3d71b69a75cbbc03c8f43571b003ddadd40d056 IB/core: Provide rdma_ versions of the gid cache API
:::::: TO: Jason Gunthorpe <jgg(a)mellanox.com>
:::::: CC: Jason Gunthorpe <jgg(a)mellanox.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
fs/buffer.c:2342:1: warning: the frame size of 2072 bytes is larger than 1024 bytes
by kernel test robot
Hi Christophe,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 2a987e65025e2b79c6d453b78cb5985ac6e5eb26
commit: 4eeef098b43242ed145c83fba9989d586d707589 powerpc/44x: Remove STDBINUTILS kconfig option
date: 10 months ago
config: powerpc-randconfig-r036-20211209 (https://download.01.org/0day-ci/archive/20211210/202112100307.ewo3JMUl-lk...)
compiler: powerpc-linux-gcc (GCC) 11.2.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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 4eeef098b43242ed145c83fba9989d586d707589
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=powerpc SHELL=/bin/bash
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 >>):
fs/buffer.c: In function 'block_read_full_page':
>> fs/buffer.c:2342:1: warning: the frame size of 2072 bytes is larger than 1024 bytes [-Wframe-larger-than=]
2342 | }
| ^
--
fs/ext4/move_extent.c: In function 'mext_page_mkuptodate':
>> fs/ext4/move_extent.c:227:1: warning: the frame size of 2072 bytes is larger than 1024 bytes [-Wframe-larger-than=]
227 | }
| ^
--
fs/fat/dir.c: In function 'fat_add_new_entries':
>> fs/fat/dir.c:1279:1: warning: the frame size of 2088 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1279 | }
| ^
fs/fat/dir.c: In function 'fat_alloc_new_dir':
fs/fat/dir.c:1195:1: warning: the frame size of 2064 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1195 | }
| ^
--
fs/fat/fatent.c: In function 'fat_free_clusters':
>> fs/fat/fatent.c:632:1: warning: the frame size of 2096 bytes is larger than 1024 bytes [-Wframe-larger-than=]
632 | }
| ^
fs/fat/fatent.c: In function 'fat_alloc_clusters':
fs/fat/fatent.c:550:1: warning: the frame size of 2128 bytes is larger than 1024 bytes [-Wframe-larger-than=]
550 | }
| ^
vim +2342 fs/buffer.c
8ab22b9abb5c55 Hisashi Hifumi 2008-07-28 2251
^1da177e4c3f41 Linus Torvalds 2005-04-16 2252 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 2253 * Generic "read page" function for block devices that have the normal
^1da177e4c3f41 Linus Torvalds 2005-04-16 2254 * get_block functionality. This is most of the block device filesystems.
^1da177e4c3f41 Linus Torvalds 2005-04-16 2255 * Reads the page asynchronously --- the unlock_buffer() and
^1da177e4c3f41 Linus Torvalds 2005-04-16 2256 * set/clear_buffer_uptodate() functions propagate buffer state into the
^1da177e4c3f41 Linus Torvalds 2005-04-16 2257 * page struct once IO has completed.
^1da177e4c3f41 Linus Torvalds 2005-04-16 2258 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 2259 int block_read_full_page(struct page *page, get_block_t *get_block)
^1da177e4c3f41 Linus Torvalds 2005-04-16 2260 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 2261 struct inode *inode = page->mapping->host;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2262 sector_t iblock, lblock;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2263 struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE];
45bce8f3e3436b Linus Torvalds 2012-11-29 2264 unsigned int blocksize, bbits;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2265 int nr, i;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2266 int fully_mapped = 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2267
45bce8f3e3436b Linus Torvalds 2012-11-29 2268 head = create_page_buffers(page, inode, 0);
45bce8f3e3436b Linus Torvalds 2012-11-29 2269 blocksize = head->b_size;
45bce8f3e3436b Linus Torvalds 2012-11-29 2270 bbits = block_size_bits(blocksize);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2271
09cbfeaf1a5a67 Kirill A. Shutemov 2016-04-01 2272 iblock = (sector_t)page->index << (PAGE_SHIFT - bbits);
45bce8f3e3436b Linus Torvalds 2012-11-29 2273 lblock = (i_size_read(inode)+blocksize-1) >> bbits;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2274 bh = head;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2275 nr = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2276 i = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2277
^1da177e4c3f41 Linus Torvalds 2005-04-16 2278 do {
^1da177e4c3f41 Linus Torvalds 2005-04-16 2279 if (buffer_uptodate(bh))
^1da177e4c3f41 Linus Torvalds 2005-04-16 2280 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2281
^1da177e4c3f41 Linus Torvalds 2005-04-16 2282 if (!buffer_mapped(bh)) {
c64610ba585fab Andrew Morton 2005-05-16 2283 int err = 0;
c64610ba585fab Andrew Morton 2005-05-16 2284
^1da177e4c3f41 Linus Torvalds 2005-04-16 2285 fully_mapped = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2286 if (iblock < lblock) {
b0cf2321c65991 Badari Pulavarty 2006-03-26 2287 WARN_ON(bh->b_size != blocksize);
c64610ba585fab Andrew Morton 2005-05-16 2288 err = get_block(inode, iblock, bh, 0);
c64610ba585fab Andrew Morton 2005-05-16 2289 if (err)
^1da177e4c3f41 Linus Torvalds 2005-04-16 2290 SetPageError(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2291 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 2292 if (!buffer_mapped(bh)) {
eebd2aa355692a Christoph Lameter 2008-02-04 2293 zero_user(page, i * blocksize, blocksize);
c64610ba585fab Andrew Morton 2005-05-16 2294 if (!err)
^1da177e4c3f41 Linus Torvalds 2005-04-16 2295 set_buffer_uptodate(bh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2296 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2297 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 2298 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 2299 * get_block() might have updated the buffer
^1da177e4c3f41 Linus Torvalds 2005-04-16 2300 * synchronously
^1da177e4c3f41 Linus Torvalds 2005-04-16 2301 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 2302 if (buffer_uptodate(bh))
^1da177e4c3f41 Linus Torvalds 2005-04-16 2303 continue;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2304 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 2305 arr[nr++] = bh;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2306 } while (i++, iblock++, (bh = bh->b_this_page) != head);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2307
^1da177e4c3f41 Linus Torvalds 2005-04-16 2308 if (fully_mapped)
^1da177e4c3f41 Linus Torvalds 2005-04-16 2309 SetPageMappedToDisk(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2310
^1da177e4c3f41 Linus Torvalds 2005-04-16 2311 if (!nr) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 2312 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 2313 * All buffers are uptodate - we can set the page uptodate
^1da177e4c3f41 Linus Torvalds 2005-04-16 2314 * as well. But not if get_block() returned an error.
^1da177e4c3f41 Linus Torvalds 2005-04-16 2315 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 2316 if (!PageError(page))
^1da177e4c3f41 Linus Torvalds 2005-04-16 2317 SetPageUptodate(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2318 unlock_page(page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2319 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 2320 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 2321
^1da177e4c3f41 Linus Torvalds 2005-04-16 2322 /* Stage two: lock the buffers */
^1da177e4c3f41 Linus Torvalds 2005-04-16 2323 for (i = 0; i < nr; i++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 2324 bh = arr[i];
^1da177e4c3f41 Linus Torvalds 2005-04-16 2325 lock_buffer(bh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2326 mark_buffer_async_read(bh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2327 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 2328
^1da177e4c3f41 Linus Torvalds 2005-04-16 2329 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 2330 * Stage 3: start the IO. Check for uptodateness
^1da177e4c3f41 Linus Torvalds 2005-04-16 2331 * inside the buffer lock in case another process reading
^1da177e4c3f41 Linus Torvalds 2005-04-16 2332 * the underlying blockdev brought it uptodate (the sct fix).
^1da177e4c3f41 Linus Torvalds 2005-04-16 2333 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 2334 for (i = 0; i < nr; i++) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 2335 bh = arr[i];
^1da177e4c3f41 Linus Torvalds 2005-04-16 2336 if (buffer_uptodate(bh))
^1da177e4c3f41 Linus Torvalds 2005-04-16 2337 end_buffer_async_read(bh, 1);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2338 else
2a222ca992c35a Mike Christie 2016-06-05 2339 submit_bh(REQ_OP_READ, 0, bh);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2340 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 2341 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 @2342 }
1fe72eaa0f46a0 H Hartley Sweeten 2009-09-22 2343 EXPORT_SYMBOL(block_read_full_page);
^1da177e4c3f41 Linus Torvalds 2005-04-16 2344
:::::: The code at line 2342 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks
[asahilinux:asahi 54/56] drivers/spi/spi-apple.c:148:19: error: implicit declaration of function 'FIELD_PREP'
by kernel test robot
tree: https://github.com/AsahiLinux/linux asahi
head: 139e005bda0da795d21b4afeae8b184b1792b2c6
commit: 0058b3377882b80df30d9490c4653bca12423ff2 [54/56] spi: apple: Add driver for Apple SPI controller
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20211210/202112100204.LNhZJUFo-lk...)
compiler: sh4-linux-gcc (GCC) 11.2.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/AsahiLinux/linux/commit/0058b3377882b80df30d9490c4653b...
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux asahi
git checkout 0058b3377882b80df30d9490c4653bca12423ff2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sh SHELL=/bin/bash drivers/spi/
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 >>):
drivers/spi/spi-apple.c: In function 'apple_spi_init':
>> drivers/spi/spi-apple.c:148:19: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
148 | FIELD_PREP(APPLE_SPI_CFG_FIFO_THRESH, APPLE_SPI_CFG_FIFO_THRESH_8B) |
| ^~~~~~~~~~
drivers/spi/spi-apple.c: In function 'apple_spi_tx':
>> drivers/spi/spi-apple.c:250:17: error: implicit declaration of function 'FIELD_GET'; did you mean 'FOLL_GET'? [-Werror=implicit-function-declaration]
250 | inuse = FIELD_GET(APPLE_SPI_FIFOSTAT_LEVEL_TX, reg_read(spi, APPLE_SPI_FIFOSTAT));
| ^~~~~~~~~
| FOLL_GET
cc1: some warnings being treated as errors
vim +/FIELD_PREP +148 drivers/spi/spi-apple.c
135
136 static void apple_spi_init(struct apple_spi *spi)
137 {
138 /* Set CS high (inactive) and disable override and auto-CS */
139 reg_write(spi, APPLE_SPI_PIN, APPLE_SPI_PIN_CS);
140 reg_mask(spi, APPLE_SPI_SHIFTCFG, APPLE_SPI_SHIFTCFG_OVERRIDE_CS, 0);
141 reg_mask(spi, APPLE_SPI_PINCFG, APPLE_SPI_PINCFG_CS_IDLE_VAL, APPLE_SPI_PINCFG_KEEP_CS);
142
143 /* Reset FIFOs */
144 reg_write(spi, APPLE_SPI_CTRL, APPLE_SPI_CTRL_RX_RESET | APPLE_SPI_CTRL_TX_RESET);
145
146 /* Configure defaults */
147 reg_write(spi, APPLE_SPI_CFG,
> 148 FIELD_PREP(APPLE_SPI_CFG_FIFO_THRESH, APPLE_SPI_CFG_FIFO_THRESH_8B) |
149 FIELD_PREP(APPLE_SPI_CFG_MODE, APPLE_SPI_CFG_MODE_IRQ) |
150 FIELD_PREP(APPLE_SPI_CFG_WORD_SIZE, APPLE_SPI_CFG_WORD_SIZE_8B));
151
152 /* Disable IRQs */
153 reg_write(spi, APPLE_SPI_IE_FIFO, 0);
154 reg_write(spi, APPLE_SPI_IE_XFER, 0);
155
156 /* Disable delays */
157 reg_write(spi, APPLE_SPI_DELAY_PRE, 0);
158 reg_write(spi, APPLE_SPI_DELAY_POST, 0);
159 }
160
161 static int apple_spi_prepare_message(struct spi_controller *ctlr, struct spi_message *msg)
162 {
163 struct apple_spi *spi = spi_controller_get_devdata(ctlr);
164 struct spi_device *device = msg->spi;
165
166 u32 cfg = ((device->mode & SPI_CPHA ? APPLE_SPI_CFG_CPHA : 0) |
167 (device->mode & SPI_CPOL ? APPLE_SPI_CFG_CPOL : 0) |
168 (device->mode & SPI_LSB_FIRST ? APPLE_SPI_CFG_LSB_FIRST : 0));
169
170 /* Update core config */
171 reg_mask(spi, APPLE_SPI_CFG,
172 APPLE_SPI_CFG_CPHA | APPLE_SPI_CFG_CPOL | APPLE_SPI_CFG_LSB_FIRST, cfg);
173
174 return 0;
175 }
176
177 static void apple_spi_set_cs(struct spi_device *device, bool is_high)
178 {
179 struct apple_spi *spi = spi_controller_get_devdata(device->controller);
180
181 reg_mask(spi, APPLE_SPI_PIN, APPLE_SPI_PIN_CS, is_high ? APPLE_SPI_PIN_CS : 0);
182 }
183
184 static bool apple_spi_prep_transfer(struct apple_spi *spi, struct spi_device *device,
185 struct spi_transfer *t)
186 {
187 u32 cr;
188
189 /* Calculate and program the clock rate */
190 cr = DIV_ROUND_UP(clk_get_rate(spi->clk), t->speed_hz) - 1;
191 reg_write(spi, APPLE_SPI_CLKDIV, min_t(u32, cr, APPLE_SPI_CLKDIV_MAX));
192
193 /* Update bits per word */
194 reg_mask(spi, APPLE_SPI_SHIFTCFG, APPLE_SPI_SHIFTCFG_BITS,
195 FIELD_PREP(APPLE_SPI_SHIFTCFG_BITS, t->bits_per_word));
196
197 /* We will want to poll if the time we need to wait is
198 * less than the context switching time.
199 * Let's call that threshold 5us. The operation will take:
200 * bits_per_word * fifo_threshold / hz <= 5 * 10^-6
201 * 200000 * bits_per_word * fifo_threshold <= hz
202 */
203 return 200000 * t->bits_per_word * APPLE_SPI_FIFO_DEPTH / 2 <= t->speed_hz;
204 }
205
206 static irqreturn_t apple_spi_irq(int irq, void *dev_id)
207 {
208 struct apple_spi *spi = dev_id;
209 u32 fifo = reg_read(spi, APPLE_SPI_IF_FIFO) & reg_read(spi, APPLE_SPI_IE_FIFO);
210 u32 xfer = reg_read(spi, APPLE_SPI_IF_XFER) & reg_read(spi, APPLE_SPI_IE_XFER);
211
212 if (fifo || xfer) {
213 /* Disable interrupts until next transfer */
214 reg_write(spi, APPLE_SPI_IE_XFER, 0);
215 reg_write(spi, APPLE_SPI_IE_FIFO, 0);
216 complete(&spi->done);
217 return IRQ_HANDLED;
218 }
219
220 return IRQ_NONE;
221 }
222
223 static void apple_spi_wait(struct apple_spi *spi, u32 fifo_bit, u32 xfer_bit, int poll)
224 {
225 if (poll) {
226 u32 fifo, xfer;
227
228 do {
229 fifo = reg_read(spi, APPLE_SPI_IF_FIFO);
230 xfer = reg_read(spi, APPLE_SPI_IF_XFER);
231 } while (!((fifo & fifo_bit) || (xfer & xfer_bit)));
232 } else {
233 reinit_completion(&spi->done);
234 reg_write(spi, APPLE_SPI_IE_XFER, xfer_bit);
235 reg_write(spi, APPLE_SPI_IE_FIFO, fifo_bit);
236 wait_for_completion(&spi->done);
237 reg_write(spi, APPLE_SPI_IE_XFER, 0);
238 reg_write(spi, APPLE_SPI_IE_FIFO, 0);
239 }
240 }
241
242 static void apple_spi_tx(struct apple_spi *spi, const void **tx_ptr, u32 *left,
243 unsigned int bpw)
244 {
245 u32 inuse, words, wrote;
246
247 if (!*tx_ptr)
248 return;
249
> 250 inuse = FIELD_GET(APPLE_SPI_FIFOSTAT_LEVEL_TX, reg_read(spi, APPLE_SPI_FIFOSTAT));
251 words = wrote = min_t(u32, *left, APPLE_SPI_FIFOSTAT_LEVEL_TX - inuse);
252
253 if (!words)
254 return;
255
256 *left -= words;
257
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 2 weeks