[balbi-usb:testing/next 32/38] drivers/usb/dwc2/drd.c:71: undefined reference to `usb_role_switch_get_drvdata'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git testing/next
head: 3c9722514c3fb74bbe0af87c20bc6b4c47121287
commit: a0f0bc95705446b8b1476338056bf869271ba36a [32/38] usb: dwc2: override PHY input signals with usb role switch support
config: i386-randconfig-a014-20200914 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git checkout a0f0bc95705446b8b1476338056bf869271ba36a
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
ld: drivers/usb/dwc2/drd.o: in function `dwc2_drd_role_sw_set':
>> drivers/usb/dwc2/drd.c:71: undefined reference to `usb_role_switch_get_drvdata'
ld: drivers/usb/dwc2/drd.o: in function `dwc2_drd_init':
>> drivers/usb/dwc2/drd.c:134: undefined reference to `usb_role_switch_register'
ld: drivers/usb/dwc2/drd.o: in function `dwc2_drd_exit':
>> drivers/usb/dwc2/drd.c:179: undefined reference to `usb_role_switch_unregister'
# https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git/commit/?id=...
git remote add balbi-usb https://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git
git fetch --no-tags balbi-usb testing/next
git checkout a0f0bc95705446b8b1476338056bf869271ba36a
vim +71 drivers/usb/dwc2/drd.c
68
69 static int dwc2_drd_role_sw_set(struct usb_role_switch *sw, enum usb_role role)
70 {
> 71 struct dwc2_hsotg *hsotg = usb_role_switch_get_drvdata(sw);
72 unsigned long flags;
73 int already = 0;
74
75 /* Skip session not in line with dr_mode */
76 if ((role == USB_ROLE_DEVICE && hsotg->dr_mode == USB_DR_MODE_HOST) ||
77 (role == USB_ROLE_HOST && hsotg->dr_mode == USB_DR_MODE_PERIPHERAL))
78 return -EINVAL;
79
80 #if IS_ENABLED(CONFIG_USB_DWC2_PERIPHERAL) || \
81 IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
82 /* Skip session if core is in test mode */
83 if (role == USB_ROLE_NONE && hsotg->test_mode) {
84 dev_dbg(hsotg->dev, "Core is in test mode\n");
85 return -EBUSY;
86 }
87 #endif
88
89 spin_lock_irqsave(&hsotg->lock, flags);
90
91 if (role == USB_ROLE_HOST) {
92 already = dwc2_ovr_avalid(hsotg, true);
93 } else if (role == USB_ROLE_DEVICE) {
94 already = dwc2_ovr_bvalid(hsotg, true);
95 /* This clear DCTL.SFTDISCON bit */
96 dwc2_hsotg_core_connect(hsotg);
97 } else {
98 if (dwc2_is_device_mode(hsotg)) {
99 if (!dwc2_ovr_bvalid(hsotg, false))
100 /* This set DCTL.SFTDISCON bit */
101 dwc2_hsotg_core_disconnect(hsotg);
102 } else {
103 dwc2_ovr_avalid(hsotg, false);
104 }
105 }
106
107 spin_unlock_irqrestore(&hsotg->lock, flags);
108
109 if (!already && hsotg->dr_mode == USB_DR_MODE_OTG)
110 /* This will raise a Connector ID Status Change Interrupt */
111 dwc2_force_mode(hsotg, role == USB_ROLE_HOST);
112
113 dev_dbg(hsotg->dev, "%s-session valid\n",
114 role == USB_ROLE_NONE ? "No" :
115 role == USB_ROLE_HOST ? "A" : "B");
116
117 return 0;
118 }
119
120 int dwc2_drd_init(struct dwc2_hsotg *hsotg)
121 {
122 struct usb_role_switch_desc role_sw_desc = {0};
123 struct usb_role_switch *role_sw;
124 int ret;
125
126 if (!device_property_read_bool(hsotg->dev, "usb-role-switch"))
127 return 0;
128
129 role_sw_desc.driver_data = hsotg;
130 role_sw_desc.fwnode = dev_fwnode(hsotg->dev);
131 role_sw_desc.set = dwc2_drd_role_sw_set;
132 role_sw_desc.allow_userspace_control = true;
133
> 134 role_sw = usb_role_switch_register(hsotg->dev, &role_sw_desc);
135 if (IS_ERR(role_sw)) {
136 ret = PTR_ERR(role_sw);
137 dev_err(hsotg->dev,
138 "failed to register role switch: %d\n", ret);
139 return ret;
140 }
141
142 hsotg->role_sw = role_sw;
143
144 /* Enable override and initialize values */
145 dwc2_ovr_init(hsotg);
146
147 return 0;
148 }
149
150 void dwc2_drd_suspend(struct dwc2_hsotg *hsotg)
151 {
152 u32 gintsts, gintmsk;
153
154 if (hsotg->role_sw && !hsotg->params.external_id_pin_ctl) {
155 gintmsk = dwc2_readl(hsotg, GINTMSK);
156 gintmsk &= ~GINTSTS_CONIDSTSCHNG;
157 dwc2_writel(hsotg, gintmsk, GINTMSK);
158 gintsts = dwc2_readl(hsotg, GINTSTS);
159 dwc2_writel(hsotg, gintsts | GINTSTS_CONIDSTSCHNG, GINTSTS);
160 }
161 }
162
163 void dwc2_drd_resume(struct dwc2_hsotg *hsotg)
164 {
165 u32 gintsts, gintmsk;
166
167 if (hsotg->role_sw && !hsotg->params.external_id_pin_ctl) {
168 gintsts = dwc2_readl(hsotg, GINTSTS);
169 dwc2_writel(hsotg, gintsts | GINTSTS_CONIDSTSCHNG, GINTSTS);
170 gintmsk = dwc2_readl(hsotg, GINTMSK);
171 gintmsk |= GINTSTS_CONIDSTSCHNG;
172 dwc2_writel(hsotg, gintmsk, GINTMSK);
173 }
174 }
175
176 void dwc2_drd_exit(struct dwc2_hsotg *hsotg)
177 {
178 if (hsotg->role_sw)
> 179 usb_role_switch_unregister(hsotg->role_sw);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
Re: [PATCH rdma-next v1 4/4] RDMA/uverbs: Expose the new GID query API to user space
by kernel test robot
Hi Leon,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on rdma/for-next]
[also build test ERROR on v5.9-rc5 next-20200914]
[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/Leon-Romanovsky/Query-GID-table-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git for-next
config: microblaze-randconfig-r033-20200913 (attached as .config)
compiler: microblaze-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=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from drivers/infiniband/core/uverbs_std_types_device.c:6:
include/linux/overflow.h: In function 'array_size':
>> include/linux/overflow.h:258:10: error: 'SIZE_MAX' undeclared (first use in this function)
258 | return SIZE_MAX;
| ^~~~~~~~
include/linux/overflow.h:6:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
5 | #include <linux/compiler.h>
+++ |+#include <stdint.h>
6 |
include/linux/overflow.h:258:10: note: each undeclared identifier is reported only once for each function it appears in
258 | return SIZE_MAX;
| ^~~~~~~~
include/linux/overflow.h: In function 'array3_size':
include/linux/overflow.h:280:10: error: 'SIZE_MAX' undeclared (first use in this function)
280 | return SIZE_MAX;
| ^~~~~~~~
include/linux/overflow.h:280:10: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
include/linux/overflow.h: In function '__ab_c_size':
include/linux/overflow.h:296:10: error: 'SIZE_MAX' undeclared (first use in this function)
296 | return SIZE_MAX;
| ^~~~~~~~
include/linux/overflow.h:296:10: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
# https://github.com/0day-ci/linux/commit/97341ae6bc1e5075caa16ee753a3e4f9d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Leon-Romanovsky/Query-GID-table-API/20200914-191347
git checkout 97341ae6bc1e5075caa16ee753a3e4f9d1ed522b
vim +/SIZE_MAX +258 include/linux/overflow.h
0c66847793d198 Jason Gunthorpe 2018-08-01 241
610b15c50e86eb Kees Cook 2018-05-07 242 /**
610b15c50e86eb Kees Cook 2018-05-07 243 * array_size() - Calculate size of 2-dimensional array.
610b15c50e86eb Kees Cook 2018-05-07 244 *
610b15c50e86eb Kees Cook 2018-05-07 245 * @a: dimension one
610b15c50e86eb Kees Cook 2018-05-07 246 * @b: dimension two
610b15c50e86eb Kees Cook 2018-05-07 247 *
610b15c50e86eb Kees Cook 2018-05-07 248 * Calculates size of 2-dimensional array: @a * @b.
610b15c50e86eb Kees Cook 2018-05-07 249 *
610b15c50e86eb Kees Cook 2018-05-07 250 * Returns: number of bytes needed to represent the array or SIZE_MAX on
610b15c50e86eb Kees Cook 2018-05-07 251 * overflow.
610b15c50e86eb Kees Cook 2018-05-07 252 */
610b15c50e86eb Kees Cook 2018-05-07 253 static inline __must_check size_t array_size(size_t a, size_t b)
610b15c50e86eb Kees Cook 2018-05-07 254 {
610b15c50e86eb Kees Cook 2018-05-07 255 size_t bytes;
610b15c50e86eb Kees Cook 2018-05-07 256
610b15c50e86eb Kees Cook 2018-05-07 257 if (check_mul_overflow(a, b, &bytes))
610b15c50e86eb Kees Cook 2018-05-07 @258 return SIZE_MAX;
610b15c50e86eb Kees Cook 2018-05-07 259
610b15c50e86eb Kees Cook 2018-05-07 260 return bytes;
610b15c50e86eb Kees Cook 2018-05-07 261 }
610b15c50e86eb Kees Cook 2018-05-07 262
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
drivers/tty/vt/vt_ioctl.c:1004:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fc4f28bb3daf3265d6bc5f73b497306985bb23ab
commit: e5fc436f06eef54ef512ea55a9db8eb9f2e76959 sparse: use static inline for __chk_{user,io}_ptr()
date: 2 weeks ago
config: sh-randconfig-s031-20200913 (attached as .config)
compiler: sh4-linux-gcc (GCC) 9.3.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.2-191-g10164920-dirty
git checkout e5fc436f06eef54ef512ea55a9db8eb9f2e76959
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=sh
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/tty/vt/vt_ioctl.c:1004:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned short const *__gu_addr @@ got unsigned short [noderef] __user * @@
drivers/tty/vt/vt_ioctl.c:1004:21: sparse: expected unsigned short const *__gu_addr
drivers/tty/vt/vt_ioctl.c:1004:21: sparse: got unsigned short [noderef] __user *
>> drivers/tty/vt/vt_ioctl.c:1004:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned short const *__gu_addr @@
>> drivers/tty/vt/vt_ioctl.c:1004:21: sparse: expected void const volatile [noderef] __user *ptr
drivers/tty/vt/vt_ioctl.c:1004:21: sparse: got unsigned short const *__gu_addr
drivers/tty/vt/vt_ioctl.c:1005:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned short const *__gu_addr @@ got unsigned short [noderef] __user * @@
drivers/tty/vt/vt_ioctl.c:1005:21: sparse: expected unsigned short const *__gu_addr
drivers/tty/vt/vt_ioctl.c:1005:21: sparse: got unsigned short [noderef] __user *
drivers/tty/vt/vt_ioctl.c:1005:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned short const *__gu_addr @@
drivers/tty/vt/vt_ioctl.c:1005:21: sparse: expected void const volatile [noderef] __user *ptr
drivers/tty/vt/vt_ioctl.c:1005:21: sparse: got unsigned short const *__gu_addr
--
drivers/tty/vt/vt.c:4301:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const *__gu_addr @@ got char [noderef] __user * @@
drivers/tty/vt/vt.c:4301:13: sparse: expected char const *__gu_addr
drivers/tty/vt/vt.c:4301:13: sparse: got char [noderef] __user *
>> drivers/tty/vt/vt.c:4301:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got char const *__gu_addr @@
>> drivers/tty/vt/vt.c:4301:13: sparse: expected void const volatile [noderef] __user *ptr
drivers/tty/vt/vt.c:4301:13: sparse: got char const *__gu_addr
drivers/tty/vt/vt.c:225:5: sparse: sparse: symbol 'console_blank_hook' was not declared. Should it be static?
drivers/tty/vt/vt.c:2991:19: sparse: sparse: symbol 'console_driver' was not declared. Should it be static?
drivers/tty/vt/vt.c:3147:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const *__gu_addr @@ got char [noderef] __user *p @@
drivers/tty/vt/vt.c:3147:13: sparse: expected char const *__gu_addr
drivers/tty/vt/vt.c:3147:13: sparse: got char [noderef] __user *p
drivers/tty/vt/vt.c:3147:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got char const *__gu_addr @@
drivers/tty/vt/vt.c:3147:13: sparse: expected void const volatile [noderef] __user *ptr
drivers/tty/vt/vt.c:3147:13: sparse: got char const *__gu_addr
drivers/tty/vt/vt.c:3200:37: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const *__gu_addr @@ got char [noderef] __user * @@
drivers/tty/vt/vt.c:3200:37: sparse: expected char const *__gu_addr
drivers/tty/vt/vt.c:3200:37: sparse: got char [noderef] __user *
drivers/tty/vt/vt.c:3200:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got char const *__gu_addr @@
drivers/tty/vt/vt.c:3200:37: sparse: expected void const volatile [noderef] __user *ptr
drivers/tty/vt/vt.c:3200:37: sparse: got char const *__gu_addr
drivers/tty/vt/vt.c:3213:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected signed int const *__gu_addr @@ got signed int [noderef] [usertype] __user * @@
drivers/tty/vt/vt.c:3213:29: sparse: expected signed int const *__gu_addr
drivers/tty/vt/vt.c:3213:29: sparse: got signed int [noderef] [usertype] __user *
>> drivers/tty/vt/vt.c:3213:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got signed int const *__gu_addr @@
drivers/tty/vt/vt.c:3213:29: sparse: expected void const volatile [noderef] __user *ptr
drivers/tty/vt/vt.c:3213:29: sparse: got signed int const *__gu_addr
drivers/tty/vt/vt.c:3032:13: sparse: sparse: context imbalance in 'vt_console_print' - wrong count at exit
--
drivers/tty/vt/keyboard.c:1730:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] __user * @@
drivers/tty/vt/keyboard.c:1730:21: sparse: expected unsigned int const *__gu_addr
drivers/tty/vt/keyboard.c:1730:21: sparse: got unsigned int [noderef] __user *
>> drivers/tty/vt/keyboard.c:1730:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned int const *__gu_addr @@
>> drivers/tty/vt/keyboard.c:1730:21: sparse: expected void const volatile [noderef] __user *ptr
drivers/tty/vt/keyboard.c:1730:21: sparse: got unsigned int const *__gu_addr
drivers/tty/vt/keyboard.c:1768:21: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected unsigned int const *__gu_addr @@ got unsigned int [noderef] __user * @@
drivers/tty/vt/keyboard.c:1768:21: sparse: expected unsigned int const *__gu_addr
drivers/tty/vt/keyboard.c:1768:21: sparse: got unsigned int [noderef] __user *
drivers/tty/vt/keyboard.c:1768:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got unsigned int const *__gu_addr @@
drivers/tty/vt/keyboard.c:1768:21: sparse: expected void const volatile [noderef] __user *ptr
drivers/tty/vt/keyboard.c:1768:21: sparse: got unsigned int const *__gu_addr
# 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 e5fc436f06eef54ef512ea55a9db8eb9f2e76959
vim +1004 drivers/tty/vt/vt_ioctl.c
5422337d569ead drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 821
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 822 /*
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 823 * We handle the console-specific ioctl's here. We allow the
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 824 * capability to modify any console, not just the fg_console.
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 825 */
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 826 int vt_ioctl(struct tty_struct *tty,
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 827 unsigned int cmd, unsigned long arg)
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 828 {
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 829 struct vc_data *vc = tty->driver_data;
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 830 void __user *up = (void __user *)arg;
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 831 int i, perm;
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 832 int ret;
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 833
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 834 /*
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 835 * To have permissions to do most of the vt ioctls, we either have
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 836 * to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 837 */
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 838 perm = 0;
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 839 if (current->signal->tty == tty || capable(CAP_SYS_TTY_CONFIG))
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 840 perm = 1;
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 841
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 842 ret = vt_k_ioctl(tty, cmd, arg, perm);
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 843 if (ret != -ENOIOCTLCMD)
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 844 return ret;
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 845
bfbbdfa4de133e drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 846 ret = vt_io_ioctl(vc, cmd, up, perm);
bfbbdfa4de133e drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 847 if (ret != -ENOIOCTLCMD)
bfbbdfa4de133e drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 848 return ret;
bfbbdfa4de133e drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 849
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 850 switch (cmd) {
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 851 case TIOCLINUX:
832a62ab6b7d32 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 852 return tioclinux(tty, arg);
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 853 case VT_SETMODE:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 854 {
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 855 struct vt_mode tmp;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 856
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 857 if (!perm)
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 858 return -EPERM;
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 859 if (copy_from_user(&tmp, up, sizeof(struct vt_mode)))
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 860 return -EFAULT;
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 861 if (tmp.mode != VT_AUTO && tmp.mode != VT_PROCESS)
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 862 return -EINVAL;
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 863
ac751efa6a0d70 drivers/tty/vt/vt_ioctl.c Torben Hohn 2011-01-25 864 console_lock();
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 865 vc->vt_mode = tmp;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 866 /* the frsig is ignored, so we set it to 0 */
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 867 vc->vt_mode.frsig = 0;
8b6312f4dcc1ef drivers/char/vt_ioctl.c Eric W. Biederman 2007-02-10 868 put_pid(vc->vt_pid);
8b6312f4dcc1ef drivers/char/vt_ioctl.c Eric W. Biederman 2007-02-10 869 vc->vt_pid = get_pid(task_pid(current));
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 870 /* no switch is required -- saw(a)shade.msu.ru */
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 871 vc->vt_newvt = -1;
ac751efa6a0d70 drivers/tty/vt/vt_ioctl.c Torben Hohn 2011-01-25 872 console_unlock();
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 873 break;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 874 }
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 875
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 876 case VT_GETMODE:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 877 {
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 878 struct vt_mode tmp;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 879 int rc;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 880
ac751efa6a0d70 drivers/tty/vt/vt_ioctl.c Torben Hohn 2011-01-25 881 console_lock();
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 882 memcpy(&tmp, &vc->vt_mode, sizeof(struct vt_mode));
ac751efa6a0d70 drivers/tty/vt/vt_ioctl.c Torben Hohn 2011-01-25 883 console_unlock();
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 884
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 885 rc = copy_to_user(up, &tmp, sizeof(struct vt_mode));
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 886 if (rc)
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 887 return -EFAULT;
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 888 break;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 889 }
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 890
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 891 /*
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 892 * Returns global vt state. Note that VT 0 is always open, since
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 893 * it's an alias for the current VT, and people can't use it here.
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 894 * We cannot return state for more than 16 VTs, since v_state is short.
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 895 */
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 896 case VT_GETSTATE:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 897 {
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 898 struct vt_stat __user *vtstat = up;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 899 unsigned short state, mask;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 900
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 901 if (put_user(fg_console + 1, &vtstat->v_active))
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 902 return -EFAULT;
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 903
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 904 state = 1; /* /dev/tty0 is always open */
7cf64b18b0b96e drivers/tty/vt/vt_ioctl.c Eric Biggers 2020-03-21 905 console_lock(); /* required by vt_in_use() */
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 906 for (i = 0, mask = 2; i < MAX_NR_CONSOLES && mask;
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 907 ++i, mask <<= 1)
e587e8f17433dd drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-02-19 908 if (vt_in_use(i))
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 909 state |= mask;
7cf64b18b0b96e drivers/tty/vt/vt_ioctl.c Eric Biggers 2020-03-21 910 console_unlock();
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 911 return put_user(state, &vtstat->v_state);
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 912 }
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 913
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 914 /*
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 915 * Returns the first available (non-opened) console.
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 916 */
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 917 case VT_OPENQRY:
7cf64b18b0b96e drivers/tty/vt/vt_ioctl.c Eric Biggers 2020-03-21 918 console_lock(); /* required by vt_in_use() */
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 919 for (i = 0; i < MAX_NR_CONSOLES; ++i)
e587e8f17433dd drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-02-19 920 if (!vt_in_use(i))
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 921 break;
7cf64b18b0b96e drivers/tty/vt/vt_ioctl.c Eric Biggers 2020-03-21 922 console_unlock();
eca734d8f0043e drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 923 i = i < MAX_NR_CONSOLES ? (i+1) : -1;
eca734d8f0043e drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 924 return put_user(i, (int __user *)arg);
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 925
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 926 /*
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 927 * ioctl(fd, VT_ACTIVATE, num) will cause us to switch to vt # num,
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 928 * with num >= 1 (switches to vt 0, our console, are not allowed, just
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 929 * to preserve sanity).
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 930 */
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 931 case VT_ACTIVATE:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 932 if (!perm)
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 933 return -EPERM;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 934 if (arg == 0 || arg > MAX_NR_CONSOLES)
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 935 return -ENXIO;
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 936
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 937 arg--;
ac751efa6a0d70 drivers/tty/vt/vt_ioctl.c Torben Hohn 2011-01-25 938 console_lock();
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 939 ret = vc_allocate(arg);
ac751efa6a0d70 drivers/tty/vt/vt_ioctl.c Torben Hohn 2011-01-25 940 console_unlock();
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 941 if (ret)
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 942 return ret;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 943 set_console(arg);
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 944 break;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 945
d3b5cffcf84a8b drivers/char/vt_ioctl.c Alan Cox 2009-09-19 946 case VT_SETACTIVATE:
d3b5cffcf84a8b drivers/char/vt_ioctl.c Alan Cox 2009-09-19 947 if (!perm)
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 948 return -EPERM;
d3b5cffcf84a8b drivers/char/vt_ioctl.c Alan Cox 2009-09-19 949
ebf1efbb1a7f79 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 950 return vt_setactivate(up);
d3b5cffcf84a8b drivers/char/vt_ioctl.c Alan Cox 2009-09-19 951
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 952 /*
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 953 * wait until the specified VT has been activated
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 954 */
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 955 case VT_WAITACTIVE:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 956 if (!perm)
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 957 return -EPERM;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 958 if (arg == 0 || arg > MAX_NR_CONSOLES)
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 959 return -ENXIO;
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 960 return vt_waitactive(arg);
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 961
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 962 /*
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 963 * If a vt is under process control, the kernel will not switch to it
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 964 * immediately, but postpone the operation until the process calls this
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 965 * ioctl, allowing the switch to complete.
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 966 *
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 967 * According to the X sources this is the behavior:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 968 * 0: pending switch-from not OK
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 969 * 1: pending switch-from OK
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 970 * 2: completed switch-to OK
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 971 */
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 972 case VT_RELDISP:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 973 if (!perm)
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 974 return -EPERM;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 975
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 976 console_lock();
535082d9078d0b drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 977 ret = vt_reldisp(vc, arg);
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 978 console_unlock();
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 979
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 980 return ret;
535082d9078d0b drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 981
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 982
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 983 /*
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 984 * Disallocate memory associated to VT (but leave VT1)
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 985 */
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 986 case VT_DISALLOCATE:
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 987 if (arg > MAX_NR_CONSOLES)
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 988 return -ENXIO;
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 989
421b40a6286ee3 drivers/tty/vt/vt_ioctl.c Peter Hurley 2013-05-17 990 if (arg == 0)
421b40a6286ee3 drivers/tty/vt/vt_ioctl.c Peter Hurley 2013-05-17 991 vt_disallocate_all();
421b40a6286ee3 drivers/tty/vt/vt_ioctl.c Peter Hurley 2013-05-17 992 else
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 993 return vt_disallocate(--arg);
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 994 break;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 995
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 996 case VT_RESIZE:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 997 {
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 998 struct vt_sizes __user *vtsizes = up;
e400b6ec4ede4d drivers/char/vt_ioctl.c Antonino A. Daplas 2007-10-16 999 struct vc_data *vc;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1000 ushort ll,cc;
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 1001
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1002 if (!perm)
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 1003 return -EPERM;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 @1004 if (get_user(ll, &vtsizes->v_rows) ||
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1005 get_user(cc, &vtsizes->v_cols))
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 1006 return -EFAULT;
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 1007
ac751efa6a0d70 drivers/tty/vt/vt_ioctl.c Torben Hohn 2011-01-25 1008 console_lock();
e400b6ec4ede4d drivers/char/vt_ioctl.c Antonino A. Daplas 2007-10-16 1009 for (i = 0; i < MAX_NR_CONSOLES; i++) {
e400b6ec4ede4d drivers/char/vt_ioctl.c Antonino A. Daplas 2007-10-16 1010 vc = vc_cons[i].d;
e400b6ec4ede4d drivers/char/vt_ioctl.c Antonino A. Daplas 2007-10-16 1011
e400b6ec4ede4d drivers/char/vt_ioctl.c Antonino A. Daplas 2007-10-16 1012 if (vc) {
e400b6ec4ede4d drivers/char/vt_ioctl.c Antonino A. Daplas 2007-10-16 1013 vc->vc_resize_user = 1;
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 1014 /* FIXME: review v tty lock */
8c9a9dd0fa3a26 drivers/char/vt_ioctl.c Alan Cox 2008-08-15 1015 vc_resize(vc_cons[i].d, cc, ll);
e400b6ec4ede4d drivers/char/vt_ioctl.c Antonino A. Daplas 2007-10-16 1016 }
e400b6ec4ede4d drivers/char/vt_ioctl.c Antonino A. Daplas 2007-10-16 1017 }
ac751efa6a0d70 drivers/tty/vt/vt_ioctl.c Torben Hohn 2011-01-25 1018 console_unlock();
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 1019 break;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1020 }
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1021
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1022 case VT_RESIZEX:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1023 if (!perm)
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 1024 return -EPERM;
6cd1ed50efd882 drivers/tty/vt/vt_ioctl.c Eric Dumazet 2020-02-10 1025
5422337d569ead drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 1026 return vt_resizex(vc, up);
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1027
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1028 case VT_LOCKSWITCH:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1029 if (!capable(CAP_SYS_TTY_CONFIG))
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 1030 return -EPERM;
f400991bf872de drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-02-19 1031 vt_dont_switch = true;
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 1032 break;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1033 case VT_UNLOCKSWITCH:
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1034 if (!capable(CAP_SYS_TTY_CONFIG))
4001d7b7fc2710 drivers/tty/vt/vt_ioctl.c Alan Cox 2012-03-02 1035 return -EPERM;
f400991bf872de drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-02-19 1036 vt_dont_switch = false;
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 1037 break;
533475d3d48eb8 drivers/char/vt_ioctl.c Samuel Thibault 2006-08-27 1038 case VT_GETHIFONTMASK:
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 1039 return put_user(vc->vc_hi_font_mask,
9cc3c22bf017f3 drivers/char/vt_ioctl.c Alan Cox 2008-04-30 1040 (unsigned short __user *)arg);
8b92e87d39bfd0 drivers/char/vt_ioctl.c Alan Cox 2009-09-19 1041 case VT_WAITEVENT:
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 1042 return vt_event_wait_ioctl((struct vt_event __user *)arg);
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1043 default:
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 1044 return -ENOIOCTLCMD;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1045 }
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 1046
0ce8179e248023 drivers/tty/vt/vt_ioctl.c Jiri Slaby 2020-06-15 1047 return 0;
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1048 }
^1da177e4c3f41 drivers/char/vt_ioctl.c Linus Torvalds 2005-04-16 1049
:::::: The code at line 1004 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
2 years
Re: [patch 05/13] mm/pagemap: Clenaup PREEMPT_COUNT leftovers
by kernel test robot
Hi Thomas,
I love your patch! Yet something to improve:
[auto build test ERROR on drm-intel/for-linux-next]
[also build test ERROR on linus/master v5.9-rc5 next-20200914]
[cannot apply to rcu/dev arm/for-next tip/sched/core linux/master]
[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/Thomas-Gleixner/preempt-Make-pre...
base: git://anongit.freedesktop.org/drm-intel for-linux-next
config: microblaze-randconfig-r033-20200913 (attached as .config)
compiler: microblaze-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=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/interrupt.h:6,
from drivers/net/can/m_can/m_can.c:12:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/timer.h:5,
from drivers/target/target_core_pscsi.c:15:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
drivers/target/target_core_pscsi.c: In function 'pscsi_complete_cmd':
drivers/target/target_core_pscsi.c:624:5: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
624 | ; /* XXX: TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE */
| ^
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/nvme/target/core.c:7:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
In file included from drivers/nvme/target/trace.h:169,
from drivers/nvme/target/core.c:14:
include/trace/define_trace.h: At top level:
include/trace/define_trace.h:95:42: fatal error: ./trace.h: No such file or directory
95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
| ^
compilation terminated.
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/uio.h:8,
from include/linux/socket.h:8,
from include/rdma/rdma_cm.h:10,
from drivers/infiniband/core/cma_trace.c:12:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
In file included from drivers/infiniband/core/cma_trace.h:401,
from drivers/infiniband/core/cma_trace.c:16:
include/trace/define_trace.h: At top level:
include/trace/define_trace.h:95:42: fatal error: ./cma_trace.h: No such file or directory
95 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
| ^
compilation terminated.
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from drivers/ata/ahci_platform.c:11:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
In file included from drivers/ata/ahci_platform.c:21:
drivers/ata/ahci_platform.c: At top level:
drivers/ata/ahci.h:385:16: warning: initialized field overwritten [-Woverride-init]
385 | .can_queue = AHCI_MAX_CMDS, \
| ^~~~~~~~~~~~~
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro 'AHCI_SHT'
40 | AHCI_SHT(DRV_NAME),
| ^~~~~~~~
drivers/ata/ahci.h:385:16: note: (near initialization for 'ahci_platform_sht.can_queue')
385 | .can_queue = AHCI_MAX_CMDS, \
| ^~~~~~~~~~~~~
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro 'AHCI_SHT'
40 | AHCI_SHT(DRV_NAME),
| ^~~~~~~~
drivers/ata/ahci.h:389:17: warning: initialized field overwritten [-Woverride-init]
389 | .sdev_attrs = ahci_sdev_attrs
| ^~~~~~~~~~~~~~~
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro 'AHCI_SHT'
40 | AHCI_SHT(DRV_NAME),
| ^~~~~~~~
drivers/ata/ahci.h:389:17: note: (near initialization for 'ahci_platform_sht.sdev_attrs')
389 | .sdev_attrs = ahci_sdev_attrs
| ^~~~~~~~~~~~~~~
drivers/ata/ahci_platform.c:40:2: note: in expansion of macro 'AHCI_SHT'
40 | AHCI_SHT(DRV_NAME),
| ^~~~~~~~
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from drivers/ata/ahci_ceva.c:10:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
In file included from drivers/ata/ahci_ceva.c:15:
drivers/ata/ahci_ceva.c: At top level:
drivers/ata/ahci.h:385:16: warning: initialized field overwritten [-Woverride-init]
385 | .can_queue = AHCI_MAX_CMDS, \
| ^~~~~~~~~~~~~
drivers/ata/ahci_ceva.c:187:2: note: in expansion of macro 'AHCI_SHT'
187 | AHCI_SHT(DRV_NAME),
| ^~~~~~~~
drivers/ata/ahci.h:385:16: note: (near initialization for 'ahci_platform_sht.can_queue')
385 | .can_queue = AHCI_MAX_CMDS, \
| ^~~~~~~~~~~~~
drivers/ata/ahci_ceva.c:187:2: note: in expansion of macro 'AHCI_SHT'
187 | AHCI_SHT(DRV_NAME),
| ^~~~~~~~
drivers/ata/ahci.h:389:17: warning: initialized field overwritten [-Woverride-init]
389 | .sdev_attrs = ahci_sdev_attrs
| ^~~~~~~~~~~~~~~
drivers/ata/ahci_ceva.c:187:2: note: in expansion of macro 'AHCI_SHT'
187 | AHCI_SHT(DRV_NAME),
| ^~~~~~~~
drivers/ata/ahci.h:389:17: note: (near initialization for 'ahci_platform_sht.sdev_attrs')
389 | .sdev_attrs = ahci_sdev_attrs
| ^~~~~~~~~~~~~~~
drivers/ata/ahci_ceva.c:187:2: note: in expansion of macro 'AHCI_SHT'
187 | AHCI_SHT(DRV_NAME),
| ^~~~~~~~
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/net/ethernet/intel/e1000/e1000.h:10,
from drivers/net/ethernet/intel/e1000/e1000_hw.c:8:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
drivers/net/ethernet/intel/e1000/e1000_hw.c: In function 'e1000_phy_init_script':
drivers/net/ethernet/intel/e1000/e1000_hw.c:132:6: warning: variable 'ret_val' set but not used [-Wunused-but-set-variable]
132 | u32 ret_val;
| ^~~~~~~
drivers/net/ethernet/intel/e1000/e1000_hw.c: In function 'e1000_reset_hw':
drivers/net/ethernet/intel/e1000/e1000_hw.c:380:6: warning: variable 'icr' set but not used [-Wunused-but-set-variable]
380 | u32 icr;
| ^~~
drivers/net/ethernet/intel/e1000/e1000_hw.c: In function 'e1000_check_for_link':
drivers/net/ethernet/intel/e1000/e1000_hw.c:2378:6: warning: variable 'signal' set but not used [-Wunused-but-set-variable]
2378 | u32 signal = 0;
| ^~~~~~
drivers/net/ethernet/intel/e1000/e1000_hw.c:2374:6: warning: variable 'ctrl' set but not used [-Wunused-but-set-variable]
2374 | u32 ctrl;
| ^~~~
drivers/net/ethernet/intel/e1000/e1000_hw.c:2373:6: warning: variable 'rxcw' set but not used [-Wunused-but-set-variable]
2373 | u32 rxcw = 0;
| ^~~~
drivers/net/ethernet/intel/e1000/e1000_hw.c: In function 'e1000_clear_hw_cntrs':
drivers/net/ethernet/intel/e1000/e1000_hw.c:4678:15: warning: variable 'temp' set but not used [-Wunused-but-set-variable]
4678 | volatile u32 temp;
| ^~~~
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/video/fbdev/uvesafb.c:13:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
drivers/video/fbdev/uvesafb.c: In function 'uvesafb_vbe_getinfo':
drivers/video/fbdev/uvesafb.c:426:2: warning: 'strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Wstringop-truncation]
426 | strncpy(par->vbe_ib.vbe_signature, "VBE2", 4);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/rculist.h:10,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/utsname.h:6,
from drivers/char/random.c:312:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
drivers/char/random.c: At top level:
drivers/char/random.c:2297:6: warning: no previous prototype for 'add_hwgenerator_randomness' [-Wmissing-prototypes]
2297 | void add_hwgenerator_randomness(const char *buffer, size_t count,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/asm-generic/bug.h:20,
from ./arch/microblaze/include/generated/asm/bug.h:1,
from include/linux/bug.h:5,
from include/linux/mmdebug.h:5,
from include/linux/mm.h:9,
from include/linux/pagemap.h:8,
from drivers/dax/super.c:5:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
drivers/dax/super.c: At top level:
drivers/dax/super.c:447:6: warning: no previous prototype for 'run_dax' [-Wmissing-prototypes]
447 | void run_dax(struct dax_device *dax_dev)
| ^~~~~~~
--
In file included from include/linux/bits.h:22,
from include/linux/bitops.h:5,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/block/drbd/drbd_main.c:19:
include/linux/pagemap.h: In function '__page_cache_add_speculative':
>> include/linux/build_bug.h:30:34: error: called object is not a function or function pointer
30 | #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mmdebug.h:45:25: note: in expansion of macro 'BUILD_BUG_ON_INVALID'
45 | #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
| ^~~~~~~~~~~~~~~~~~~~
include/linux/pagemap.h:171:2: note: in expansion of macro 'VM_BUG_ON'
171 | VM_BUG_ON(preemptible())
| ^~~~~~~~~
drivers/block/drbd/drbd_main.c: In function 'cmdname':
drivers/block/drbd/drbd_main.c:3683:22: warning: initialized field overwritten [-Woverride-init]
3683 | [P_RETRY_WRITE] = "retry_write",
| ^~~~~~~~~~~~~
drivers/block/drbd/drbd_main.c:3683:22: note: (near initialization for 'cmdnames[44]')
..
# https://github.com/0day-ci/linux/commit/a4a0f54fdd08d95dfe20d684b405db8a4...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thomas-Gleixner/preempt-Make-preempt-count-unconditional/20200915-044640
git checkout a4a0f54fdd08d95dfe20d684b405db8a47fb61d8
vim +30 include/linux/build_bug.h
527edbc18a70e7 Masahiro Yamada 2019-01-03 18
527edbc18a70e7 Masahiro Yamada 2019-01-03 19 /* Force a compilation error if a constant expression is not a power of 2 */
527edbc18a70e7 Masahiro Yamada 2019-01-03 20 #define __BUILD_BUG_ON_NOT_POWER_OF_2(n) \
527edbc18a70e7 Masahiro Yamada 2019-01-03 21 BUILD_BUG_ON(((n) & ((n) - 1)) != 0)
527edbc18a70e7 Masahiro Yamada 2019-01-03 22 #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \
527edbc18a70e7 Masahiro Yamada 2019-01-03 23 BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0))
bc6245e5efd70c Ian Abbott 2017-07-10 24
bc6245e5efd70c Ian Abbott 2017-07-10 25 /*
bc6245e5efd70c Ian Abbott 2017-07-10 26 * BUILD_BUG_ON_INVALID() permits the compiler to check the validity of the
bc6245e5efd70c Ian Abbott 2017-07-10 27 * expression but avoids the generation of any code, even if that expression
bc6245e5efd70c Ian Abbott 2017-07-10 28 * has side-effects.
bc6245e5efd70c Ian Abbott 2017-07-10 29 */
bc6245e5efd70c Ian Abbott 2017-07-10 @30 #define BUILD_BUG_ON_INVALID(e) ((void)(sizeof((__force long)(e))))
bc6245e5efd70c Ian Abbott 2017-07-10 31
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[sashal-linux-stable:queue-4.4 7/10] /tmp/lowcomms-373448.s:137: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.4
head: 468d91b8a8759ba935302dc08716f4d3242a73a7
commit: 414ad9babd329c871dcf804bb9b828bd4b59f28e [7/10] xfs: initialize the shortform attr header padding entry
config: x86_64-randconfig-a002-20200913 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project b2c32c90bab09a6e2c1f370429db26017a182143)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout 414ad9babd329c871dcf804bb9b828bd4b59f28e
# 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 >>):
In file included from fs/dlm/lowcomms.c:48:
In file included from include/net/sock.h:62:
In file included from include/linux/filter.h:16:
In file included from include/net/sch_generic.h:12:
In file included from include/net/rtnetlink.h:5:
include/net/netlink.h:337:18: warning: comparison of integers of different signs: 'const __u32' (aka 'const unsigned int') and 'int' [-Wsign-compare]
nlh->nlmsg_len <= remaining);
~~~~~~~~~~~~~~ ^ ~~~~~~~~~
include/net/netlink.h:372:21: warning: comparison of integers of different signs: 'const __u32' (aka 'const unsigned int') and 'int' [-Wsign-compare]
if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
include/net/netlink.h:405:21: warning: comparison of integers of different signs: 'const __u32' (aka 'const unsigned int') and 'int' [-Wsign-compare]
if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/dlm/lowcomms.c:48:
In file included from include/net/sock.h:62:
In file included from include/linux/filter.h:16:
In file included from include/net/sch_generic.h:12:
include/net/rtnetlink.h:20:21: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg))
~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/dlm/lowcomms.c:48:
In file included from include/net/sock.h:62:
In file included from include/linux/filter.h:16:
include/net/sch_generic.h:267:33: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
BUILD_BUG_ON(sizeof(qcb->data) < sz);
~~~~~~~~~~~~~~~~~ ^ ~~
include/linux/bug.h:74:19: note: expanded from macro 'BUILD_BUG_ON'
BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
^~~~~~~~~
include/linux/bug.h:50:58: note: expanded from macro 'BUILD_BUG_ON_MSG'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~
include/linux/compiler.h:505:22: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler.h:493:23: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler.h:485:19: note: expanded from macro '__compiletime_assert'
bool __cond = !(condition); \
^~~~~~~~~
In file included from fs/dlm/lowcomms.c:48:
In file included from include/net/sock.h:62:
include/linux/filter.h:517:16: warning: comparison of integers of different signs: 'const __u32' (aka 'const unsigned int') and 'int' [-Wsign-compare]
if (first->k == SKF_AD_OFF + SKF_AD_ALU_XOR_X)
~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/dlm/lowcomms.c:48:
include/net/sock.h:1838:54: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
if (csum_and_copy_from_iter(to, copy, &csum, from) != copy)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
include/net/sock.h:1842:46: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
if (copy_from_iter_nocache(to, copy, from) != copy)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
include/net/sock.h:1844:44: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
} else if (copy_from_iter(to, copy, from) != copy)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
In file included from fs/dlm/lowcomms.c:49:
In file included from include/net/tcp.h:24:
In file included from include/linux/tcp.h:23:
include/net/inet_connection_sock.h:294:38: warning: comparison of integers of different signs: 'int' and 'const u32' (aka 'const unsigned int') [-Wsign-compare]
return inet_csk_reqsk_queue_len(sk) >= sk->sk_max_ack_backlog;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/dlm/lowcomms.c:49:
include/net/tcp.h:321:25: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
include/net/tcp.h:1201:12: warning: comparison of integers of different signs: 's32' (aka 'int') and '__u32' (aka 'unsigned int') [-Wsign-compare]
if (delta > inet_csk(sk)->icsk_rto)
~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
include/net/tcp.h:1276:29: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
if (unlikely(get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_24DAYS))
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:182:42: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^
In file included from fs/dlm/lowcomms.c:49:
include/net/tcp.h:1306:27: warning: comparison of integers of different signs: 'unsigned long' and 'long' [-Wsign-compare]
if (rst && get_seconds() >= rx_opt->ts_recent_stamp + TCP_PAWS_MSL)
~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from fs/dlm/lowcomms.c:55:
In file included from include/net/sctp/sctp.h:76:
In file included from include/net/sctp/structs.h:88:
include/net/sctp/ulpevent.h:147:13: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
if (offset >= sizeof(struct sctp_event_subscribe))
~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/dlm/lowcomms.c:185:19: warning: comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Wsign-compare]
if (con->nodeid == nodeid)
~~~~~~~~~~~ ^ ~~~~~~
fs/dlm/lowcomms.c:614:26: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
if (cbuf_data(&con->cb) >= con->cb.base) {
~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
fs/dlm/lowcomms.c:626:15: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
else if (ret == len)
~~~ ^ ~~~
fs/dlm/lowcomms.c:1369:32: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
(PAGE_CACHE_SIZE - e->end < len)) {
~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~
35 warnings generated.
/tmp/lowcomms-373448.s: Assembler messages:
>> /tmp/lowcomms-373448.s:137: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:453: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
>> /tmp/lowcomms-373448.s:1267: Warning: no instruction mnemonic suffix given and no register operands; using default for `btr'
/tmp/lowcomms-373448.s:1273: Warning: no instruction mnemonic suffix given and no register operands; using default for `btr'
/tmp/lowcomms-373448.s:1288: Warning: no instruction mnemonic suffix given and no register operands; using default for `btr'
/tmp/lowcomms-373448.s:1429: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:1454: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:1473: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:1778: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:2039: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:2282: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:2421: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:2452: Warning: no instruction mnemonic suffix given and no register operands; using default for `btr'
/tmp/lowcomms-373448.s:2458: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:2481: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:2845: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
/tmp/lowcomms-373448.s:3061: Warning: no instruction mnemonic suffix given and no register operands; using default for `bts'
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[boqun:arm64-64k 14/22] drivers/uio/uio_hv_generic.c:39: warning: "HV_RING_SIZE" redefined
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git arm64-64k
head: 77ab5d483f012ac5cfd6017e4d11b1b601ebb497
commit: 4fc7c26337e297884de34cefc7ca3c07704125a5 [14/22] Drivers: hv: vmbus: Introduce types of GPADL
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git checkout 4fc7c26337e297884de34cefc7ca3c07704125a5
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/uio/uio_hv_generic.c:39: warning: "HV_RING_SIZE" redefined
39 | #define HV_RING_SIZE 512 /* pages */
|
In file included from drivers/uio/uio_hv_generic.c:29:
include/linux/hyperv.h:166: note: this is the location of the previous definition
166 | #define HV_RING_SIZE(payload_sz) PAGE_ALIGN(sizeof(struct hv_ring_buffer) + \
|
# https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git/commit/?i...
git remote add boqun https://git.kernel.org/pub/scm/linux/kernel/git/boqun/linux.git
git fetch --no-tags boqun arm64-64k
git checkout 4fc7c26337e297884de34cefc7ca3c07704125a5
vim +/HV_RING_SIZE +39 drivers/uio/uio_hv_generic.c
95096f2fbd1018 Stephen Hemminger 2016-12-03 38
e7d214642a19b8 Stephen Hemminger 2018-01-09 @39 #define HV_RING_SIZE 512 /* pages */
108ddb8fa1fc31 Stephen Hemminger 2018-08-10 40 #define SEND_BUFFER_SIZE (16 * 1024 * 1024)
108ddb8fa1fc31 Stephen Hemminger 2018-08-10 41 #define RECV_BUFFER_SIZE (31 * 1024 * 1024)
e7d214642a19b8 Stephen Hemminger 2018-01-09 42
:::::: The code at line 39 was first introduced by commit
:::::: e7d214642a19b8e0e7ecda39184c2ab98ba4801f uio_hv_generic: create send and receive buffers
:::::: TO: Stephen Hemminger <stephen(a)networkplumber.org>
:::::: CC: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[kdave-btrfs-devel:ext/aota/zoned-7 132/162] fs/btrfs/zoned.c:42: undefined reference to `__udivdi3'
by kernel test robot
tree: https://github.com/kdave/btrfs-devel.git ext/aota/zoned-7
head: 17046312f8c0a16a96b4b3a145f4b30be84e6ede
commit: d7a064645672c0cb922ca0bc60c687d22f0c1fa4 [132/162] btrfs: implement log-structured superblock for ZONED mode
config: i386-randconfig-s002-20200914 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-191-g10164920-dirty
git checkout d7a064645672c0cb922ca0bc60c687d22f0c1fa4
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
ld: fs/btrfs/zoned.o: in function `sb_zone_number':
>> fs/btrfs/zoned.c:42: undefined reference to `__udivdi3'
>> ld: fs/btrfs/zoned.c:42: undefined reference to `__udivdi3'
>> ld: fs/btrfs/zoned.c:42: undefined reference to `__udivdi3'
>> ld: fs/btrfs/zoned.c:42: undefined reference to `__udivdi3'
>> ld: fs/btrfs/zoned.c:42: undefined reference to `__udivdi3'
sparse warnings: (new ones prefixed by >>)
>> fs/btrfs/zoned.c:429:29: sparse: sparse: restricted __le64 degrades to integer
fs/btrfs/zoned.c:429:52: sparse: sparse: restricted __le64 degrades to integer
fs/btrfs/zoned.c:61:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
fs/btrfs/zoned.c:61:17: sparse: struct rcu_string [noderef] __rcu *
fs/btrfs/zoned.c:61:17: sparse: struct rcu_string *
fs/btrfs/zoned.c:142:17: sparse: sparse: incompatible types in comparison expression (different address spaces):
fs/btrfs/zoned.c:142:17: sparse: struct rcu_string [noderef] __rcu *
fs/btrfs/zoned.c:142:17: sparse: struct rcu_string *
fs/btrfs/zoned.c:165:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
fs/btrfs/zoned.c:165:25: sparse: struct rcu_string [noderef] __rcu *
fs/btrfs/zoned.c:165:25: sparse: struct rcu_string *
fs/btrfs/zoned.c:175:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
fs/btrfs/zoned.c:175:25: sparse: struct rcu_string [noderef] __rcu *
fs/btrfs/zoned.c:175:25: sparse: struct rcu_string *
fs/btrfs/zoned.c:194:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
fs/btrfs/zoned.c:194:9: sparse: struct rcu_string [noderef] __rcu *
fs/btrfs/zoned.c:194:9: sparse: struct rcu_string *
# https://github.com/kdave/btrfs-devel/commit/d7a064645672c0cb922ca0bc60c68...
git remote add kdave-btrfs-devel https://github.com/kdave/btrfs-devel.git
git fetch --no-tags kdave-btrfs-devel ext/aota/zoned-7
git checkout d7a064645672c0cb922ca0bc60c687d22f0c1fa4
vim +42 fs/btrfs/zoned.c
28
29 static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zone,
30 u64 *wp_ret);
31
32 static inline u32 sb_zone_number(u64 zone_size, int mirror)
33 {
34 ASSERT(mirror < BTRFS_SUPER_MIRROR_MAX);
35
36 switch (mirror) {
37 case 0:
38 return 0;
39 case 1:
40 return 16;
41 case 2:
> 42 return min(btrfs_sb_offset(mirror) / zone_size, 1024ULL);
43 default:
44 BUG();
45 }
46
47 return 0;
48 }
49
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[drm-msm:msm-next-dp 49/50] drivers/gpu/drm/msm/dp/dp_panel.c:248:27: warning: variable 'panel' set but not used
by kernel test robot
tree: https://gitlab.freedesktop.org/drm/msm.git msm-next-dp
head: 15562c2537a3dcedcf92fb942d7fec853ab0428a
commit: 8d58c622f51c1f03c4b48483704ca5fbc7d670a6 [49/50] drm/msm/dp: remove mode hard-coding in case of DP CTS
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
git checkout 8d58c622f51c1f03c4b48483704ca5fbc7d670a6
# 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 >>):
drivers/gpu/drm/msm/dp/dp_panel.c: In function 'dp_panel_get_modes':
>> drivers/gpu/drm/msm/dp/dp_panel.c:248:27: warning: variable 'panel' set but not used [-Wunused-but-set-variable]
248 | struct dp_panel_private *panel;
| ^~~~~
git remote add drm-msm https://gitlab.freedesktop.org/drm/msm.git
git fetch --no-tags drm-msm msm-next-dp
git checkout 8d58c622f51c1f03c4b48483704ca5fbc7d670a6
vim +/panel +248 drivers/gpu/drm/msm/dp/dp_panel.c
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 244
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 245 int dp_panel_get_modes(struct dp_panel *dp_panel,
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 246 struct drm_connector *connector, struct dp_display_mode *mode)
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 247 {
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 @248 struct dp_panel_private *panel;
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 249
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 250 if (!dp_panel) {
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 251 DRM_ERROR("invalid input\n");
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 252 return -EINVAL;
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 253 }
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 254
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 255 panel = container_of(dp_panel, struct dp_panel_private, dp_panel);
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 256
8d58c622f51c1f Abhinav Kumar 2020-09-12 257 if (dp_panel->edid)
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 258 return dp_panel_update_modes(connector, dp_panel->edid);
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 259
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 260 return 0;
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 261 }
15f1a5a04a1551 Chandan Uddaraju 2020-08-27 262
:::::: The code at line 248 was first introduced by commit
:::::: 15f1a5a04a1551f9801569e81ddbef412252652f drm/msm/dp: add displayPort driver support
:::::: TO: Chandan Uddaraju <chandanu(a)codeaurora.org>
:::::: CC: Rob Clark <robdclark(a)chromium.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[dm:dm-5.10 3/6] drivers/md/dm-table.c:1507:28: error: implicit declaration of function 'lcm_not_zero'; did you mean
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git dm-5.10
head: 86958eac97c2edd72a4a36ac2c7c257aee639711
commit: 7a888ac0a16dbdff2889066f35580575c56ebf0c [3/6] dm table: stack 'chunk_sectors' limit to account for target-specific splitting
config: microblaze-randconfig-r033-20200913 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 7a888ac0a16dbdff2889066f35580575c56ebf0c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
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/md/dm-table.c: In function 'dm_calculate_queue_limits':
>> drivers/md/dm-table.c:1507:28: error: implicit declaration of function 'lcm_not_zero'; did you mean 'min_not_zero'? [-Werror=implicit-function-declaration]
1507 | limits->chunk_sectors = lcm_not_zero(ti->max_io_len,
| ^~~~~~~~~~~~
| min_not_zero
cc1: some warnings being treated as errors
# https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.gi...
git remote add dm https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git
git fetch --no-tags dm dm-5.10
git checkout 7a888ac0a16dbdff2889066f35580575c56ebf0c
vim +1507 drivers/md/dm-table.c
1467
1468 /*
1469 * Establish the new table's queue_limits and validate them.
1470 */
1471 int dm_calculate_queue_limits(struct dm_table *table,
1472 struct queue_limits *limits)
1473 {
1474 struct dm_target *ti;
1475 struct queue_limits ti_limits;
1476 unsigned i;
1477 enum blk_zoned_model zoned_model = BLK_ZONED_NONE;
1478 unsigned int zone_sectors = 0;
1479
1480 blk_set_stacking_limits(limits);
1481
1482 for (i = 0; i < dm_table_get_num_targets(table); i++) {
1483 blk_set_stacking_limits(&ti_limits);
1484
1485 ti = dm_table_get_target(table, i);
1486
1487 if (!ti->type->iterate_devices)
1488 goto combine_limits;
1489
1490 /*
1491 * Combine queue limits of all the devices this target uses.
1492 */
1493 ti->type->iterate_devices(ti, dm_set_device_limits,
1494 &ti_limits);
1495
1496 if (zoned_model == BLK_ZONED_NONE && ti_limits.zoned != BLK_ZONED_NONE) {
1497 /*
1498 * After stacking all limits, validate all devices
1499 * in table support this zoned model and zone sectors.
1500 */
1501 zoned_model = ti_limits.zoned;
1502 zone_sectors = ti_limits.chunk_sectors;
1503 }
1504
1505 /* Stack chunk_sectors if target-specific splitting is required */
1506 if (ti->max_io_len)
> 1507 limits->chunk_sectors = lcm_not_zero(ti->max_io_len,
1508 ti_limits.chunk_sectors);
1509 /* Set I/O hints portion of queue limits */
1510 if (ti->type->io_hints)
1511 ti->type->io_hints(ti, &ti_limits);
1512
1513 /*
1514 * Check each device area is consistent with the target's
1515 * overall queue limits.
1516 */
1517 if (ti->type->iterate_devices(ti, device_area_is_invalid,
1518 &ti_limits))
1519 return -EINVAL;
1520
1521 combine_limits:
1522 /*
1523 * Merge this target's queue limits into the overall limits
1524 * for the table.
1525 */
1526 if (blk_stack_limits(limits, &ti_limits, 0) < 0)
1527 DMWARN("%s: adding target device "
1528 "(start sect %llu len %llu) "
1529 "caused an alignment inconsistency",
1530 dm_device_name(table->md),
1531 (unsigned long long) ti->begin,
1532 (unsigned long long) ti->len);
1533 }
1534
1535 /*
1536 * Verify that the zoned model and zone sectors, as determined before
1537 * any .io_hints override, are the same across all devices in the table.
1538 * - this is especially relevant if .io_hints is emulating a disk-managed
1539 * zoned model (aka BLK_ZONED_NONE) on host-managed zoned block devices.
1540 * BUT...
1541 */
1542 if (limits->zoned != BLK_ZONED_NONE) {
1543 /*
1544 * ...IF the above limits stacking determined a zoned model
1545 * validate that all of the table's devices conform to it.
1546 */
1547 zoned_model = limits->zoned;
1548 zone_sectors = limits->chunk_sectors;
1549 }
1550 if (validate_hardware_zoned_model(table, zoned_model, zone_sectors))
1551 return -EINVAL;
1552
1553 return validate_hardware_logical_block_alignment(table, limits);
1554 }
1555
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years