Re: [PATCH v2] pinctrl: samsung: Use bank name as irqchip name
by kernel test robot
Hi Marek,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pinctrl-samsung/for-next]
[also build test WARNING on pinctrl/devel next-20200610]
[cannot apply to v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Marek-Szyprowski/pinctrl-samsung...
base: https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git for-next
config: x86_64-randconfig-s021-20200607 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-247-gcadbd124-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=x86_64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/pinctrl/samsung/pinctrl-exynos.c:374:30: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected unsigned int val @@ got unsigned int [usertype] *eint_wake_mask_value @@
>> drivers/pinctrl/samsung/pinctrl-exynos.c:374:30: sparse: expected unsigned int val
>> drivers/pinctrl/samsung/pinctrl-exynos.c:374:30: sparse: got unsigned int [usertype] *eint_wake_mask_value
drivers/pinctrl/samsung/pinctrl-exynos.c:393:30: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int val @@ got unsigned int [usertype] *eint_wake_mask_value @@
drivers/pinctrl/samsung/pinctrl-exynos.c:393:30: sparse: expected unsigned int val
drivers/pinctrl/samsung/pinctrl-exynos.c:393:30: sparse: got unsigned int [usertype] *eint_wake_mask_value
>> drivers/pinctrl/samsung/pinctrl-exynos.c:374:22: sparse: sparse: non size-preserving pointer to integer cast
drivers/pinctrl/samsung/pinctrl-exynos.c:393:22: sparse: sparse: non size-preserving pointer to integer cast
vim +374 drivers/pinctrl/samsung/pinctrl-exynos.c
ad350cd9d54113 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-17 355
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 356 static void
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 357 exynos_pinctrl_set_eint_wakeup_mask(struct samsung_pinctrl_drv_data *drvdata,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 358 struct exynos_irq_chip *irq_chip)
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 359 {
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 360 struct regmap *pmu_regs;
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 361
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 362 if (!drvdata->retention_ctrl || !drvdata->retention_ctrl->priv) {
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 363 dev_warn(drvdata->dev,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 364 "No retention data configured bank with external wakeup interrupt. Wake-up mask will not be set.\n");
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 365 return;
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 366 }
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 367
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 368 pmu_regs = drvdata->retention_ctrl->priv;
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 369 dev_info(drvdata->dev,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 370 "Setting external wakeup interrupt mask: 0x%x\n",
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 371 irq_chip->eint_wake_mask_value);
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 372
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 373 regmap_write(pmu_regs, irq_chip->eint_wake_mask_reg,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 @374 irq_chip->eint_wake_mask_value);
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 375 }
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 376
:::::: The code at line 374 was first introduced by commit
:::::: b577a279914085c6b657c33e9f39ef56d96a3302 pinctrl: samsung: Correct setting of eint wakeup mask on s5pv210
:::::: TO: Jonathan Bakker <xc-racer2(a)live.ca>
:::::: CC: Krzysztof Kozlowski <krzk(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH v2] pinctrl: samsung: Use bank name as irqchip name
by kernel test robot
Hi Marek,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pinctrl-samsung/for-next]
[also build test WARNING on pinctrl/devel next-20200610]
[cannot apply to v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Marek-Szyprowski/pinctrl-samsung...
base: https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git for-next
config: s390-allyesconfig (attached as .config)
compiler: s390-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=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/device.h:15,
from drivers/pinctrl/samsung/pinctrl-exynos.c:16:
drivers/pinctrl/samsung/pinctrl-exynos.c: In function 'exynos_pinctrl_set_eint_wakeup_mask':
drivers/pinctrl/samsung/pinctrl-exynos.c:370:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32 *' {aka 'unsigned int *'} [-Wformat=]
370 | "Setting external wakeup interrupt mask: 0x%xn",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/pinctrl/samsung/pinctrl-exynos.c:369:2: note: in expansion of macro 'dev_info'
369 | dev_info(drvdata->dev,
| ^~~~~~~~
drivers/pinctrl/samsung/pinctrl-exynos.c:370:48: note: format string is defined here
370 | "Setting external wakeup interrupt mask: 0x%xn",
| ~^
| |
| unsigned int
| %n
drivers/pinctrl/samsung/pinctrl-exynos.c:374:16: warning: passing argument 3 of 'regmap_write' makes integer from pointer without a cast [-Wint-conversion]
374 | irq_chip->eint_wake_mask_value);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
| |
| u32 * {aka unsigned int *}
In file included from drivers/pinctrl/samsung/pinctrl-exynos.c:25:
include/linux/regmap.h:1054:69: note: expected 'unsigned int' but argument is of type 'u32 *' {aka 'unsigned int *'}
1054 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
| ~~~~~~~~~~~~~^~~
drivers/pinctrl/samsung/pinctrl-exynos.c: In function 's5pv210_pinctrl_set_eint_wakeup_mask':
>> drivers/pinctrl/samsung/pinctrl-exynos.c:393:23: warning: passing argument 1 of 'zpci_write_u32' makes integer from pointer without a cast [-Wint-conversion]
393 | __raw_writel(irq_chip->eint_wake_mask_value,
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
| |
| u32 * {aka unsigned int *}
In file included from arch/s390/include/asm/io.h:15,
from include/linux/io.h:13,
from include/linux/irq.h:20,
from drivers/pinctrl/samsung/pinctrl-exynos.c:19:
arch/s390/include/asm/pci_io.h:50:49: note: expected 'u32' {aka 'unsigned int'} but argument is of type 'u32 *' {aka 'unsigned int *'}
50 | static inline void zpci_write_##VALTYPE(VALTYPE val, | ^
>> arch/s390/include/asm/pci_io.h:63:1: note: in expansion of macro 'zpci_write'
63 | zpci_write(4, u32)
| ^~~~~~~~~~
vim +/zpci_write_u32 +393 drivers/pinctrl/samsung/pinctrl-exynos.c
b577a279914085 Jonathan Bakker 2020-04-04 376
b577a279914085 Jonathan Bakker 2020-04-04 377 static void
b577a279914085 Jonathan Bakker 2020-04-04 378 s5pv210_pinctrl_set_eint_wakeup_mask(struct samsung_pinctrl_drv_data *drvdata,
b577a279914085 Jonathan Bakker 2020-04-04 379 struct exynos_irq_chip *irq_chip)
b577a279914085 Jonathan Bakker 2020-04-04 380
b577a279914085 Jonathan Bakker 2020-04-04 381 {
b577a279914085 Jonathan Bakker 2020-04-04 382 void __iomem *clk_base;
b577a279914085 Jonathan Bakker 2020-04-04 383
b577a279914085 Jonathan Bakker 2020-04-04 384 if (!drvdata->retention_ctrl || !drvdata->retention_ctrl->priv) {
b577a279914085 Jonathan Bakker 2020-04-04 385 dev_warn(drvdata->dev,
b577a279914085 Jonathan Bakker 2020-04-04 386 "No retention data configured bank with external wakeup interrupt. Wake-up mask will not be set.\n");
b577a279914085 Jonathan Bakker 2020-04-04 387 return;
b577a279914085 Jonathan Bakker 2020-04-04 388 }
b577a279914085 Jonathan Bakker 2020-04-04 389
b577a279914085 Jonathan Bakker 2020-04-04 390
b577a279914085 Jonathan Bakker 2020-04-04 391 clk_base = (void __iomem *) drvdata->retention_ctrl->priv;
b577a279914085 Jonathan Bakker 2020-04-04 392
b577a279914085 Jonathan Bakker 2020-04-04 @393 __raw_writel(irq_chip->eint_wake_mask_value,
b577a279914085 Jonathan Bakker 2020-04-04 394 clk_base + irq_chip->eint_wake_mask_reg);
b577a279914085 Jonathan Bakker 2020-04-04 395 }
b577a279914085 Jonathan Bakker 2020-04-04 396
:::::: The code at line 393 was first introduced by commit
:::::: b577a279914085c6b657c33e9f39ef56d96a3302 pinctrl: samsung: Correct setting of eint wakeup mask on s5pv210
:::::: TO: Jonathan Bakker <xc-racer2(a)live.ca>
:::::: CC: Krzysztof Kozlowski <krzk(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[rcar:gmsl/dev 35/38] drivers/regulator/gpio-regulator.c:245:17: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git gmsl/dev
head: 406241b95becdda74baddd9c8eedbc2c376d9e23
commit: 6d19b4c1bce26c0057892422ad990598c85af4e5 [35/38] DNI: Regulator: Debug
config: s390-allyesconfig (attached as .config)
compiler: s390-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 6d19b4c1bce26c0057892422ad990598c85af4e5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/device.h:15,
from include/linux/platform_device.h:13,
from drivers/regulator/gpio-regulator.c:24:
drivers/regulator/gpio-regulator.c: In function 'gpio_regulator_probe':
>> drivers/regulator/gpio-regulator.c:245:17: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=]
245 | dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %dn", PTR_ERR(config));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
>> drivers/regulator/gpio-regulator.c:245:4: note: in expansion of macro 'dev_err'
245 | dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %dn", PTR_ERR(config));
| ^~~~~~~
drivers/regulator/gpio-regulator.c:245:48: note: format string is defined here
245 | dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %dn", PTR_ERR(config));
| ~^
| |
| int
| %ld
vim +245 drivers/regulator/gpio-regulator.c
223
224 static int gpio_regulator_probe(struct platform_device *pdev)
225 {
226 struct device *dev = &pdev->dev;
227 struct gpio_regulator_config *config = dev_get_platdata(dev);
228 struct device_node *np = dev->of_node;
229 struct gpio_regulator_data *drvdata;
230 struct regulator_config cfg = { };
231 struct regulator_dev *rdev;
232 enum gpiod_flags gflags;
233 int ptr, ret, state, i;
234
235 drvdata = devm_kzalloc(dev, sizeof(struct gpio_regulator_data),
236 GFP_KERNEL);
237 if (drvdata == NULL)
238 return -ENOMEM;
239
240 if (np) {
241 config = of_get_gpio_regulator_config(dev, np,
242 &drvdata->desc);
243
244 if (IS_ERR(config)) {
> 245 dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %d\n", PTR_ERR(config));
246 return PTR_ERR(config);
247 }
248 }
249
250 dev_err(dev, "Probing GPIO Regulator\n");
251
252 drvdata->desc.name = devm_kstrdup(dev, config->supply_name, GFP_KERNEL);
253 if (drvdata->desc.name == NULL) {
254 dev_err(dev, "Failed to allocate supply name\n");
255 return -ENOMEM;
256 }
257
258 drvdata->gpiods = devm_kzalloc(dev, sizeof(struct gpio_desc *),
259 GFP_KERNEL);
260 if (!drvdata->gpiods)
261 return -ENOMEM;
262
263 for (i = 0; i < config->ngpios; i++) {
264 drvdata->gpiods[i] = devm_gpiod_get_index(dev,
265 NULL,
266 i,
267 config->gflags[i]);
268 if (IS_ERR(drvdata->gpiods[i]))
269 return PTR_ERR(drvdata->gpiods[i]);
270 /* This is good to know */
271 gpiod_set_consumer_name(drvdata->gpiods[i], drvdata->desc.name);
272 }
273 drvdata->nr_gpios = config->ngpios;
274
275 drvdata->states = devm_kmemdup(dev,
276 config->states,
277 config->nr_states *
278 sizeof(struct gpio_regulator_state),
279 GFP_KERNEL);
280 if (drvdata->states == NULL) {
281 dev_err(dev, "Failed to allocate state data\n");
282 return -ENOMEM;
283 }
284 drvdata->nr_states = config->nr_states;
285
286 drvdata->desc.owner = THIS_MODULE;
287 drvdata->desc.enable_time = config->startup_delay;
288
289 /* handle regulator type*/
290 switch (config->type) {
291 case REGULATOR_VOLTAGE:
292 drvdata->desc.type = REGULATOR_VOLTAGE;
293 drvdata->desc.ops = &gpio_regulator_voltage_ops;
294 drvdata->desc.n_voltages = config->nr_states;
295 break;
296 case REGULATOR_CURRENT:
297 drvdata->desc.type = REGULATOR_CURRENT;
298 drvdata->desc.ops = &gpio_regulator_current_ops;
299 break;
300 default:
301 dev_err(dev, "No regulator type set\n");
302 return -EINVAL;
303 }
304
305 /* build initial state from gpio init data. */
306 state = 0;
307 for (ptr = 0; ptr < drvdata->nr_gpios; ptr++) {
308 if (config->gflags[ptr] == GPIOD_OUT_HIGH)
309 state |= (1 << ptr);
310 }
311 drvdata->state = state;
312
313 cfg.dev = dev;
314 cfg.init_data = config->init_data;
315 cfg.driver_data = drvdata;
316 cfg.of_node = np;
317
318 /*
319 * The signal will be inverted by the GPIO core if flagged so in the
320 * decriptor.
321 */
322 if (config->enabled_at_boot)
323 gflags = GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
324 else
325 gflags = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
326
327 cfg.ena_gpiod = gpiod_get_optional(dev, "enable", gflags);
328 if (IS_ERR(cfg.ena_gpiod))
329 return PTR_ERR(cfg.ena_gpiod);
330
331 rdev = devm_regulator_register(dev, &drvdata->desc, &cfg);
332 if (IS_ERR(rdev)) {
333 ret = PTR_ERR(rdev);
334 dev_err(dev, "Failed to register regulator: %d\n", ret);
335 return ret;
336 }
337
338 platform_set_drvdata(pdev, drvdata);
339
340 return 0;
341 }
342
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
sound/soc/meson/t9015.c:315:34: warning: unused variable 't9015_ids'
by kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ffeb595d84811dde16a28b33d8a7cf26d51d51b3
commit: 33901f5b9b16d212ee58865e9e8e80fc813f12da ASoC: meson: add t9015 internal DAC driver
date: 3 months ago
config: x86_64-randconfig-r033-20200531 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2388a096e7865c043e83ece4e26654bd3d1a20d5)
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 33901f5b9b16d212ee58865e9e8e80fc813f12da
# 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: kbuild test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> sound/soc/meson/t9015.c:315:34: warning: unused variable 't9015_ids' [-Wunused-const-variable]
static const struct of_device_id t9015_ids[] = {
^
1 warning generated.
vim +/t9015_ids +315 sound/soc/meson/t9015.c
314
> 315 static const struct of_device_id t9015_ids[] = {
316 { .compatible = "amlogic,t9015", },
317 { }
318 };
319 MODULE_DEVICE_TABLE(of, t9015_ids);
320
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[hch-block:blk_mq_complete 15/17] drivers/s390/block/dasd.c:2809:1: error: expected identifier or '(' before '}' token
by kernel test robot
tree: git://git.infradead.org/users/hch/block.git blk_mq_complete
head: a0ad6ee43045c2abd0f6cc9a91be06e5ff551a8f
commit: c9b28e546368fc34fb641f41d7fcd18307b125b3 [15/17] blk-mq: move failure injection out of blk_mq_complete_request
config: s390-defconfig (attached as .config)
compiler: s390-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 c9b28e546368fc34fb641f41d7fcd18307b125b3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/s390/block/dasd.c:2809:1: error: expected identifier or '(' before '}' token
2809 | }
| ^
vim +2809 drivers/s390/block/dasd.c
8e09f21574ea30 Stefan Weinhuber 2008-01-26 2754
8e09f21574ea30 Stefan Weinhuber 2008-01-26 2755 static void __dasd_cleanup_cqr(struct dasd_ccw_req *cqr)
8e09f21574ea30 Stefan Weinhuber 2008-01-26 2756 {
8e09f21574ea30 Stefan Weinhuber 2008-01-26 2757 struct request *req;
2a842acab109f4 Christoph Hellwig 2017-06-03 2758 blk_status_t error = BLK_STS_OK;
5e6bdd37c5526e Stefan Haberland 2020-03-12 2759 unsigned int proc_bytes;
e443343e509aac Stefan Haberland 2017-05-22 2760 int status;
8e09f21574ea30 Stefan Weinhuber 2008-01-26 2761
8e09f21574ea30 Stefan Weinhuber 2008-01-26 2762 req = (struct request *) cqr->callback_data;
8e09f21574ea30 Stefan Weinhuber 2008-01-26 2763 dasd_profile_end(cqr->block, cqr, req);
2a842acab109f4 Christoph Hellwig 2017-06-03 2764
5e6bdd37c5526e Stefan Haberland 2020-03-12 2765 proc_bytes = cqr->proc_bytes;
fe6b8e76d920b9 Stefan Weinhuber 2008-02-05 2766 status = cqr->block->base->discipline->free_cp(cqr, req);
d1ffc1f8660e74 Hannes Reinecke 2013-01-30 2767 if (status < 0)
2a842acab109f4 Christoph Hellwig 2017-06-03 2768 error = errno_to_blk_status(status);
d1ffc1f8660e74 Hannes Reinecke 2013-01-30 2769 else if (status == 0) {
2a842acab109f4 Christoph Hellwig 2017-06-03 2770 switch (cqr->intrc) {
2a842acab109f4 Christoph Hellwig 2017-06-03 2771 case -EPERM:
2a842acab109f4 Christoph Hellwig 2017-06-03 2772 error = BLK_STS_NEXUS;
2a842acab109f4 Christoph Hellwig 2017-06-03 2773 break;
2a842acab109f4 Christoph Hellwig 2017-06-03 2774 case -ENOLINK:
2a842acab109f4 Christoph Hellwig 2017-06-03 2775 error = BLK_STS_TRANSPORT;
2a842acab109f4 Christoph Hellwig 2017-06-03 2776 break;
2a842acab109f4 Christoph Hellwig 2017-06-03 2777 case -ETIMEDOUT:
2a842acab109f4 Christoph Hellwig 2017-06-03 2778 error = BLK_STS_TIMEOUT;
2a842acab109f4 Christoph Hellwig 2017-06-03 2779 break;
2a842acab109f4 Christoph Hellwig 2017-06-03 2780 default:
2a842acab109f4 Christoph Hellwig 2017-06-03 2781 error = BLK_STS_IOERR;
2a842acab109f4 Christoph Hellwig 2017-06-03 2782 break;
2a842acab109f4 Christoph Hellwig 2017-06-03 2783 }
d1ffc1f8660e74 Hannes Reinecke 2013-01-30 2784 }
e443343e509aac Stefan Haberland 2017-05-22 2785
e443343e509aac Stefan Haberland 2017-05-22 2786 /*
e443343e509aac Stefan Haberland 2017-05-22 2787 * We need to take care for ETIMEDOUT errors here since the
e443343e509aac Stefan Haberland 2017-05-22 2788 * complete callback does not get called in this case.
e443343e509aac Stefan Haberland 2017-05-22 2789 * Take care of all errors here and avoid additional code to
e443343e509aac Stefan Haberland 2017-05-22 2790 * transfer the error value to the complete callback.
e443343e509aac Stefan Haberland 2017-05-22 2791 */
e443343e509aac Stefan Haberland 2017-05-22 2792 if (error) {
e443343e509aac Stefan Haberland 2017-05-22 2793 blk_mq_end_request(req, error);
e443343e509aac Stefan Haberland 2017-05-22 2794 blk_mq_run_hw_queues(req->q, true);
5e6bdd37c5526e Stefan Haberland 2020-03-12 2795 } else {
5e6bdd37c5526e Stefan Haberland 2020-03-12 2796 /*
5e6bdd37c5526e Stefan Haberland 2020-03-12 2797 * Partial completed requests can happen with ESE devices.
5e6bdd37c5526e Stefan Haberland 2020-03-12 2798 * During read we might have gotten a NRF error and have to
5e6bdd37c5526e Stefan Haberland 2020-03-12 2799 * complete a request partially.
5e6bdd37c5526e Stefan Haberland 2020-03-12 2800 */
5e6bdd37c5526e Stefan Haberland 2020-03-12 2801 if (proc_bytes) {
5e6bdd37c5526e Stefan Haberland 2020-03-12 2802 blk_update_request(req, BLK_STS_OK,
5e6bdd37c5526e Stefan Haberland 2020-03-12 2803 blk_rq_bytes(req) - proc_bytes);
5e6bdd37c5526e Stefan Haberland 2020-03-12 2804 blk_mq_requeue_request(req, true);
c9b28e546368fc Christoph Hellwig 2020-06-10 2805 } else if (likely(!blk_should_fake_timeout(req->q)))
e443343e509aac Stefan Haberland 2017-05-22 2806 blk_mq_complete_request(req);
e443343e509aac Stefan Haberland 2017-05-22 2807 }
8e09f21574ea30 Stefan Weinhuber 2008-01-26 2808 }
5e6bdd37c5526e Stefan Haberland 2020-03-12 @2809 }
8e09f21574ea30 Stefan Weinhuber 2008-01-26 2810
:::::: The code at line 2809 was first introduced by commit
:::::: 5e6bdd37c5526ef01326df5dabb93011ee89237e s390/dasd: fix data corruption for thin provisioned devices
:::::: TO: Stefan Haberland <sth(a)linux.ibm.com>
:::::: CC: Jens Axboe <axboe(a)kernel.dk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[rcar:gmsl/dev 35/38] drivers/regulator/gpio-regulator.c:245:17: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git gmsl/dev
head: 406241b95becdda74baddd9c8eedbc2c376d9e23
commit: 6d19b4c1bce26c0057892422ad990598c85af4e5 [35/38] DNI: Regulator: Debug
config: ia64-randconfig-r034-20200608 (attached as .config)
compiler: ia64-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 6d19b4c1bce26c0057892422ad990598c85af4e5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/device.h:15,
from include/linux/platform_device.h:13,
from drivers/regulator/gpio-regulator.c:24:
drivers/regulator/gpio-regulator.c: In function 'gpio_regulator_probe':
>> drivers/regulator/gpio-regulator.c:245:17: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=]
245 | dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %dn", PTR_ERR(config));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
>> drivers/regulator/gpio-regulator.c:245:4: note: in expansion of macro 'dev_err'
245 | dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %dn", PTR_ERR(config));
| ^~~~~~~
drivers/regulator/gpio-regulator.c:245:48: note: format string is defined here
245 | dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %dn", PTR_ERR(config));
| ~^
| |
| int
| %ld
vim +245 drivers/regulator/gpio-regulator.c
223
224 static int gpio_regulator_probe(struct platform_device *pdev)
225 {
226 struct device *dev = &pdev->dev;
227 struct gpio_regulator_config *config = dev_get_platdata(dev);
228 struct device_node *np = dev->of_node;
229 struct gpio_regulator_data *drvdata;
230 struct regulator_config cfg = { };
231 struct regulator_dev *rdev;
232 enum gpiod_flags gflags;
233 int ptr, ret, state, i;
234
235 drvdata = devm_kzalloc(dev, sizeof(struct gpio_regulator_data),
236 GFP_KERNEL);
237 if (drvdata == NULL)
238 return -ENOMEM;
239
240 if (np) {
241 config = of_get_gpio_regulator_config(dev, np,
242 &drvdata->desc);
243
244 if (IS_ERR(config)) {
> 245 dev_err(dev, "OF_GET_GPIO_REGULATOR_CONFIG %d\n", PTR_ERR(config));
246 return PTR_ERR(config);
247 }
248 }
249
250 dev_err(dev, "Probing GPIO Regulator\n");
251
252 drvdata->desc.name = devm_kstrdup(dev, config->supply_name, GFP_KERNEL);
253 if (drvdata->desc.name == NULL) {
254 dev_err(dev, "Failed to allocate supply name\n");
255 return -ENOMEM;
256 }
257
258 drvdata->gpiods = devm_kzalloc(dev, sizeof(struct gpio_desc *),
259 GFP_KERNEL);
260 if (!drvdata->gpiods)
261 return -ENOMEM;
262
263 for (i = 0; i < config->ngpios; i++) {
264 drvdata->gpiods[i] = devm_gpiod_get_index(dev,
265 NULL,
266 i,
267 config->gflags[i]);
268 if (IS_ERR(drvdata->gpiods[i]))
269 return PTR_ERR(drvdata->gpiods[i]);
270 /* This is good to know */
271 gpiod_set_consumer_name(drvdata->gpiods[i], drvdata->desc.name);
272 }
273 drvdata->nr_gpios = config->ngpios;
274
275 drvdata->states = devm_kmemdup(dev,
276 config->states,
277 config->nr_states *
278 sizeof(struct gpio_regulator_state),
279 GFP_KERNEL);
280 if (drvdata->states == NULL) {
281 dev_err(dev, "Failed to allocate state data\n");
282 return -ENOMEM;
283 }
284 drvdata->nr_states = config->nr_states;
285
286 drvdata->desc.owner = THIS_MODULE;
287 drvdata->desc.enable_time = config->startup_delay;
288
289 /* handle regulator type*/
290 switch (config->type) {
291 case REGULATOR_VOLTAGE:
292 drvdata->desc.type = REGULATOR_VOLTAGE;
293 drvdata->desc.ops = &gpio_regulator_voltage_ops;
294 drvdata->desc.n_voltages = config->nr_states;
295 break;
296 case REGULATOR_CURRENT:
297 drvdata->desc.type = REGULATOR_CURRENT;
298 drvdata->desc.ops = &gpio_regulator_current_ops;
299 break;
300 default:
301 dev_err(dev, "No regulator type set\n");
302 return -EINVAL;
303 }
304
305 /* build initial state from gpio init data. */
306 state = 0;
307 for (ptr = 0; ptr < drvdata->nr_gpios; ptr++) {
308 if (config->gflags[ptr] == GPIOD_OUT_HIGH)
309 state |= (1 << ptr);
310 }
311 drvdata->state = state;
312
313 cfg.dev = dev;
314 cfg.init_data = config->init_data;
315 cfg.driver_data = drvdata;
316 cfg.of_node = np;
317
318 /*
319 * The signal will be inverted by the GPIO core if flagged so in the
320 * decriptor.
321 */
322 if (config->enabled_at_boot)
323 gflags = GPIOD_OUT_HIGH | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
324 else
325 gflags = GPIOD_OUT_LOW | GPIOD_FLAGS_BIT_NONEXCLUSIVE;
326
327 cfg.ena_gpiod = gpiod_get_optional(dev, "enable", gflags);
328 if (IS_ERR(cfg.ena_gpiod))
329 return PTR_ERR(cfg.ena_gpiod);
330
331 rdev = devm_regulator_register(dev, &drvdata->desc, &cfg);
332 if (IS_ERR(rdev)) {
333 ret = PTR_ERR(rdev);
334 dev_err(dev, "Failed to register regulator: %d\n", ret);
335 return ret;
336 }
337
338 platform_set_drvdata(pdev, drvdata);
339
340 return 0;
341 }
342
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH v2] pinctrl: samsung: Use bank name as irqchip name
by kernel test robot
Hi Marek,
I love your patch! Perhaps something to improve:
[auto build test WARNING on pinctrl-samsung/for-next]
[also build test WARNING on pinctrl/devel next-20200610]
[cannot apply to v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Marek-Szyprowski/pinctrl-samsung...
base: https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung.git for-next
config: arm-defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/device.h:15,
from drivers/pinctrl/samsung/pinctrl-exynos.c:16:
drivers/pinctrl/samsung/pinctrl-exynos.c: In function 'exynos_pinctrl_set_eint_wakeup_mask':
>> drivers/pinctrl/samsung/pinctrl-exynos.c:370:4: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u32 *' {aka 'unsigned int *'} [-Wformat=]
370 | "Setting external wakeup interrupt mask: 0x%xn",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
>> drivers/pinctrl/samsung/pinctrl-exynos.c:369:2: note: in expansion of macro 'dev_info'
369 | dev_info(drvdata->dev,
| ^~~~~~~~
drivers/pinctrl/samsung/pinctrl-exynos.c:370:48: note: format string is defined here
370 | "Setting external wakeup interrupt mask: 0x%xn",
| ~^
| |
| unsigned int
| %n
>> drivers/pinctrl/samsung/pinctrl-exynos.c:374:16: warning: passing argument 3 of 'regmap_write' makes integer from pointer without a cast [-Wint-conversion]
374 | irq_chip->eint_wake_mask_value);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
| |
| u32 * {aka unsigned int *}
In file included from drivers/pinctrl/samsung/pinctrl-exynos.c:25:
include/linux/regmap.h:1054:69: note: expected 'unsigned int' but argument is of type 'u32 *' {aka 'unsigned int *'}
1054 | int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
| ~~~~~~~~~~~~~^~~
drivers/pinctrl/samsung/pinctrl-exynos.c: In function 's5pv210_pinctrl_set_eint_wakeup_mask':
>> drivers/pinctrl/samsung/pinctrl-exynos.c:393:23: warning: passing argument 1 of '__raw_writel' makes integer from pointer without a cast [-Wint-conversion]
393 | __raw_writel(irq_chip->eint_wake_mask_value,
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
| |
| u32 * {aka unsigned int *}
In file included from include/linux/io.h:13,
from include/linux/irq.h:20,
from drivers/pinctrl/samsung/pinctrl-exynos.c:19:
arch/arm/include/asm/io.h:93:37: note: expected 'u32' {aka 'unsigned int'} but argument is of type 'u32 *' {aka 'unsigned int *'}
93 | static inline void __raw_writel(u32 val, volatile void __iomem *addr)
| ~~~~^~~
vim +370 drivers/pinctrl/samsung/pinctrl-exynos.c
ad350cd9d54113 drivers/pinctrl/pinctrl-exynos.c Tomasz Figa 2013-05-17 355
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 356 static void
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 357 exynos_pinctrl_set_eint_wakeup_mask(struct samsung_pinctrl_drv_data *drvdata,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 358 struct exynos_irq_chip *irq_chip)
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 359 {
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 360 struct regmap *pmu_regs;
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 361
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 362 if (!drvdata->retention_ctrl || !drvdata->retention_ctrl->priv) {
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 363 dev_warn(drvdata->dev,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 364 "No retention data configured bank with external wakeup interrupt. Wake-up mask will not be set.\n");
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 365 return;
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 366 }
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 367
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 368 pmu_regs = drvdata->retention_ctrl->priv;
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 @369 dev_info(drvdata->dev,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 @370 "Setting external wakeup interrupt mask: 0x%x\n",
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 371 irq_chip->eint_wake_mask_value);
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 372
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 373 regmap_write(pmu_regs, irq_chip->eint_wake_mask_reg,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 @374 irq_chip->eint_wake_mask_value);
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 375 }
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 376
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 377 static void
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 378 s5pv210_pinctrl_set_eint_wakeup_mask(struct samsung_pinctrl_drv_data *drvdata,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 379 struct exynos_irq_chip *irq_chip)
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 380
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 381 {
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 382 void __iomem *clk_base;
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 383
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 384 if (!drvdata->retention_ctrl || !drvdata->retention_ctrl->priv) {
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 385 dev_warn(drvdata->dev,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 386 "No retention data configured bank with external wakeup interrupt. Wake-up mask will not be set.\n");
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 387 return;
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 388 }
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 389
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 390
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 391 clk_base = (void __iomem *) drvdata->retention_ctrl->priv;
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 392
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 @393 __raw_writel(irq_chip->eint_wake_mask_value,
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 394 clk_base + irq_chip->eint_wake_mask_reg);
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 395 }
b577a279914085 drivers/pinctrl/samsung/pinctrl-exynos.c Jonathan Bakker 2020-04-04 396
:::::: The code at line 370 was first introduced by commit
:::::: b577a279914085c6b657c33e9f39ef56d96a3302 pinctrl: samsung: Correct setting of eint wakeup mask on s5pv210
:::::: TO: Jonathan Bakker <xc-racer2(a)live.ca>
:::::: CC: Krzysztof Kozlowski <krzk(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
Re: [PATCH v11 5/6] ndctl/papr_scm,uapi: Add support for PAPR nvdimm specific methods
by Dan Williams
On Wed, Jun 10, 2020 at 5:10 AM Vaibhav Jain <vaibhav(a)linux.ibm.com> wrote:
>
> Dan Williams <dan.j.williams(a)intel.com> writes:
>
> > On Tue, Jun 9, 2020 at 10:54 AM Vaibhav Jain <vaibhav(a)linux.ibm.com> wrote:
> >>
> >> Thanks Dan for the consideration and taking time to look into this.
> >>
> >> My responses below:
> >>
> >> Dan Williams <dan.j.williams(a)intel.com> writes:
> >>
> >> > On Mon, Jun 8, 2020 at 5:16 PM kernel test robot <lkp(a)intel.com> wrote:
> >> >>
> >> >> Hi Vaibhav,
> >> >>
> >> >> Thank you for the patch! Perhaps something to improve:
> >> >>
> >> >> [auto build test WARNING on powerpc/next]
> >> >> [also build test WARNING on linus/master v5.7 next-20200605]
> >> >> [cannot apply to linux-nvdimm/libnvdimm-for-next scottwood/next]
> >> >> [if your patch is applied to the wrong git tree, please drop us a note to help
> >> >> improve the system. BTW, we also suggest to use '--base' option to specify the
> >> >> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
> >> >>
> >> >> url: https://github.com/0day-ci/linux/commits/Vaibhav-Jain/powerpc-papr_scm-Ad...
> >> >> base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
> >> >> config: powerpc-randconfig-r016-20200607 (attached as .config)
> >> >> compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project e429cffd4f228f70c1d9df0e5d77c08590dd9766)
> >> >> 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 powerpc cross compiling tool for clang build
> >> >> # apt-get install binutils-powerpc-linux-gnu
> >> >> # save the attached .config to linux build tree
> >> >> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
> >> >>
> >> >> If you fix the issue, kindly add following tag as appropriate
> >> >> Reported-by: kernel test robot <lkp(a)intel.com>
> >> >>
> >> >> All warnings (new ones prefixed by >>, old ones prefixed by <<):
> >> >>
> >> >> In file included from <built-in>:1:
> >> >> >> ./usr/include/asm/papr_pdsm.h:69:20: warning: field 'hdr' with variable sized type 'struct nd_cmd_pkg' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> >> >> struct nd_cmd_pkg hdr; /* Package header containing sub-cmd */
> >> >
> >> > Hi Vaibhav,
> >> >
> >> [.]
> >> > This looks like it's going to need another round to get this fixed. I
> >> > don't think 'struct nd_pdsm_cmd_pkg' should embed a definition of
> >> > 'struct nd_cmd_pkg'. An instance of 'struct nd_cmd_pkg' carries a
> >> > payload that is the 'pdsm' specifics. As the code has it now it's
> >> > defined as a superset of 'struct nd_cmd_pkg' and the compiler warning
> >> > is pointing out a real 'struct' organization problem.
> >> >
> >> > Given the soak time needed in -next after the code is finalized this
> >> > there's no time to do another round of updates and still make the v5.8
> >> > merge window.
> >>
> >> Agreed that this looks bad, a solution will probably need some more
> >> review cycles resulting in this series missing the merge window.
> >>
> >> I am investigating into the possible solutions for this reported issue
> >> and made few observations:
> >>
> >> I see command pkg for Intel, Hpe, Msft and Hyperv families using a
> >> similar layout of embedding nd_cmd_pkg at the head of the
> >> command-pkg. struct nd_pdsm_cmd_pkg is following the same pattern.
> >>
> >> struct nd_pdsm_cmd_pkg {
> >> struct nd_cmd_pkg hdr;
> >> /* other members */
> >> };
> >>
> >> struct ndn_pkg_msft {
> >> struct nd_cmd_pkg gen;
> >> /* other members */
> >> };
> >> struct nd_pkg_intel {
> >> struct nd_cmd_pkg gen;
> >> /* other members */
> >> };
> >> struct ndn_pkg_hpe1 {
> >> struct nd_cmd_pkg gen;
> >> /* other members */
> [.]
> >
> > In those cases the other members are a union and there is no second
> > variable length array. Perhaps that is why those definitions are not
> > getting flagged? I'm not seeing anything in ndctl build options that
> > would explicitly disable this warning, but I'm not sure if the ndctl
> > build environment is missing this build warning by accident.
>
> I tried building ndctl master with clang-10 with CC=clang and
> CFLAGS="". Seeing the same warning messages reported for all command
> package struct for existing command families.
>
> ./hpe1.h:334:20: warning: field 'gen' with variable sized type 'struct nd_cmd_pkg' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct nd_cmd_pkg gen;
> ^
> ./msft.h:59:20: warning: field 'gen' with variable sized type 'struct nd_cmd_pkg' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct nd_cmd_pkg gen;
> ^
> ./hyperv.h:34:20: warning: field 'gen' with variable sized type 'struct nd_cmd_pkg' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> struct nd_cmd_pkg gen;
> ^
Good to know, but ugh now I'm just realizing this warning is only
coming from clang and not gcc. Frankly I'm not as concerned about
clang warnings and I should have been more careful looking at the
source of this warning.
> >
> > Those variable size payloads are also not being used in any code paths
> > that would look at the size of the command payload, like the kernel
> > ioctl() path. The payload validation code needs static sizes and the
> > payload parsing code wants to cast the payload to a known type. I
> > don't think you can use the same struct definition for both those
> > cases which is why the ndctl parsing code uses the union layout, but
> > the kernel command marshaling code does strict layering.
> Even if I switch to union layout and replacing the flexible array 'payload'
> at end to a fixed size array something like below, I still see
> '-Wgnu-variable-sized-type-not-at-end' warning reported by clang:
>
> union nd_pdsm_cmd_payload {
> struct nd_papr_pdsm_health health;
> __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
> };
>
> struct nd_pdsm_cmd_pkg {
> struct nd_cmd_pkg hdr; /* Package header containing sub-cmd */
> __s32 cmd_status; /* Out: Sub-cmd status returned back */
> __u16 reserved[2]; /* Ignored and to be used in future */
> union nd_pdsm_cmd_payload payload;
> } __attribute__((packed));
Even though this is a clang warning, I'm still not sure it's a good
idea to copy the ndctl approach into the kernel. Could you perhaps
handle this the way that drivers/acpi/nfit/intel.c handles submitting
commands through the ND_CMD_CALL interface, i.e. by just defining the
command locally like this (from intel_security_flags()):
struct {
struct nd_cmd_pkg pkg;
struct nd_intel_get_security_state cmd;
} nd_cmd = {
.pkg = {
.nd_command = NVDIMM_INTEL_GET_SECURITY_STATE,
.nd_family = NVDIMM_FAMILY_INTEL,
.nd_size_out =
sizeof(struct nd_intel_get_security_state),
.nd_fw_size =
sizeof(struct nd_intel_get_security_state),
},
};
That way it's clear that the payload is 'struct
nd_intel_get_security_state' without needing to have a pre-existing
definition. For parsing in the ioctl path I think it's clearer to cast
the payload to the local pdsm structure for the command.
>
>
> >
> >> };
> >>
> >> Even though other command families implement similar command-package
> >> layout they were not flagged (yet) as they are (I am guessing) serviced
> >> in vendor acpi drivers rather than in kernel like in case of papr-scm
> >> command family.
> >
> > I sincerely hope there are no vendor acpi kernel drivers outside of
> > the upstream one.
> Apologies if I was not clear. Was referring to nvdimm vendor uefi
> drivers which ultimately service the DSM commands. Since CMD_CALL serves
> as a conduit to send the command payload to these vendor drivers,
> libnvdimm never needs to peek into the nd_cmd_pkg.payload
> field. Consequently nfit module never hit this warning in kernel before.
Ah, understood, and no, that's not the root reason this problem is not
present in the kernel. The expectation is that any payload that the
kernel would need to consider should probably have a kernel specific
translation defined. For example,
ND_CMD_GET_CONFIG_SIZE
ND_CMD_GET_CONFIG_DATA
ND_CMD_SET_CONFIG_DATA
...are payloads that the kernel needs to understand. However instead
of supporting each way to read / write the label area the expectation
is that all drivers just parse this common kernel payload and
translate it if necessary. For example ND_CMD_{GET,SET}_CONFIG_DATA is
optionally translated to the Intel DSMs, generic ACPI _LSR/_LSW, or
papr_scm_meta_{get,set}.
Outside of validating command numbers the expectation is that the
kernel does not validate/consume the contents of the ND_CMD_CALL
payload, it passes it to the backend where ACPI DSM or pdsm protocol
takes over.
>
> >
> >>
> >> So, I think this issue is not just specific to papr-scm command family
> >> introduced in this patch series but rather across all other command
> >> families. Every other command family assumes 'struct nd_cmd_pkg_hdr' to
> >> be embeddable and puts it at the beginning of their corresponding
> >> command-packages. And its only a matter of time when someone tries
> >> filtering/handling of vendor specific commands in nfit module when they
> >> hit similar issue.
> >>
> >> Possible Solutions:
> >>
> >> * One way would be to redefine 'struct nd_cmd_pkg' to mark field
> >> 'nd_payload[]' from a flexible array to zero sized array as
> >> 'nd_payload[0]'.
> >
> > I just went through a round of removing the usage of buf[0] in ndctl
> > since gcc10 now warns about that too.
> >
> >> This should make 'struct nd_cmd_pkg' embeddable and
> >> clang shouldn't report 'gnu-variable-sized-type-not-at-end'
> >> warning. Also I think this change shouldn't introduce any ABI change.
> >>
> >> * Another way to solve this issue might be to redefine 'struct
> >> nd_pdsm_cmd_pkg' to below removing the 'struct nd_cmd_pkg' member. This
> >> struct should immediately follow the 'struct nd_cmd_pkg' command package
> >> when sent to libnvdimm:
> >>
> >> struct nd_pdsm_cmd_pkg {
> >> __s32 cmd_status; /* Out: Sub-cmd status returned back */
> >> __u16 reserved[2]; /* Ignored and to be used in future */
> >> __u8 payload[];
> >> };
> >>
> >> This should remove the flexible member nc_cmd_pkg.nd_payload from the
> >> struct with just one remaining at the end. However this would make
> >> accessing the [in|out|fw]_size members of 'struct nd_cmd_pkg'
> >> difficult for the pdsm servicing functions.
> >>
> >>
> >> Any other solution that you think, may solve this issue ?
> >
> > The union might help, but per the above I think only for parsing the
> > command at which point I don't think the kernel needs a unified
> > structure defining both the generic envelope and the end-point
> > specific payload at once.
>
> As I tested above, switching to union too will not solve the clang
> warning.
>
> Having a unified structure for a command family defining both
> generic envelop and end-point specific payload, is what I see all the
> existing command families doing.
>
> However if I split 'struct nd_pdsm_cmd_pkg' to not have an embedded
> 'struct nd_cmd_pkg' then it goes opposite to what existing command family
> implementations.
>
> So to me it looks like no clear way to address this :-(
>
> Another non-conventional way to fix this might be to suppress this clang
> warning messages by adding "CFLAGS_papr_scm.o +=
> -Wno-gnu-variable-sized-type-not-at-end" to papr_scm Makefile.
No, I don't think it's appropriate to customize clang warnings. Have a
look at splitting parsing vs local command submission following the
approach taken in drivers/acpi/nfit/intel.c.
> Current implementation 'struct nd_cmd_pkg' clearly depends on gcc
> extension of having a flexible payload array which is allowed to be not
> necessarily placed at the end of a containing struct. So the problem can be
> attributed to difference in compiler implementations between GCC and
> Clang rather than how 'struct nd_pdsm_cmd_pkg' and 'struct nd_cmd_pkg'
> are laid out.
>
> --
> Cheers
> ~ Vaibhav
2 years, 3 months
Re: [RESEND PATCH 2/6] can: mcp25xxfd: Add Microchip MCP25XXFD CAN-FD driver infrastructure
by kernel test robot
Hi Manivannan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v5.7 next-20200610]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Manivannan-Sadhasivam/Add-Microc...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project bc2b70982be8f5250cd0082a7190f8b417bd4dfe)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/net/can/spi/mcp25xxfd/mcp25xxfd_base.c:69:11: warning: cast to smaller integer type 'enum mcp25xxfd_model' from 'const void *' [-Wvoid-pointer-to-enum-cast]
model = (enum mcp25xxfd_model)of_id->data;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
vim +69 drivers/net/can/spi/mcp25xxfd/mcp25xxfd_base.c
38
39 static int mcp25xxfd_base_probe(struct spi_device *spi)
40 {
41 const struct of_device_id *of_id =
42 of_match_device(mcp25xxfd_of_match, &spi->dev);
43 struct mcp25xxfd_priv *priv;
44 struct clk *clk;
45 enum mcp25xxfd_model model;
46 u32 freq;
47 int ret;
48
49 /* Check whether valid IRQ line is defined or not */
50 if (spi->irq <= 0) {
51 dev_err(&spi->dev, "no valid irq line defined: irq = %i\n",
52 spi->irq);
53 return -EINVAL;
54 }
55
56 priv = devm_kzalloc(&spi->dev, sizeof(*priv), GFP_KERNEL);
57 if (!priv)
58 return -ENOMEM;
59
60 spi_set_drvdata(spi, priv);
61 priv->spi = spi;
62
63 /* Assign device name */
64 snprintf(priv->device_name, sizeof(priv->device_name),
65 DEVICE_NAME "-%s", dev_name(&priv->spi->dev));
66
67 /* assign model from of or driver_data */
68 if (of_id)
> 69 model = (enum mcp25xxfd_model)of_id->data;
70 else
71 model = spi_get_device_id(spi)->driver_data;
72
73 clk = devm_clk_get(&spi->dev, NULL);
74 if (IS_ERR(clk)) {
75 ret = PTR_ERR(clk);
76 goto out_free;
77 }
78
79 freq = clk_get_rate(clk);
80 if (!(freq == CLOCK_4_MHZ || freq == CLOCK_10_MHZ ||
81 freq == CLOCK_40_MHZ)) {
82 ret = -ERANGE;
83 goto out_free;
84 }
85
86 ret = clk_prepare_enable(clk);
87 if (ret)
88 goto out_free;
89
90 priv->clk = clk;
91 priv->clock_freq = freq;
92
93 /* Configure the SPI bus */
94 spi->bits_per_word = 8;
95
96 /* The frequency of SCK has to be less than or equal to half the
97 * frequency of SYSCLK.
98 */
99 spi->max_speed_hz = freq / 2;
100 ret = spi_setup(spi);
101 if (ret)
102 goto out_clk;
103
104 priv->power = devm_regulator_get(&spi->dev, "vdd");
105 if (IS_ERR(priv->power)) {
106 if (PTR_ERR(priv->power) != -EPROBE_DEFER)
107 dev_err(&spi->dev, "failed to get vdd\n");
108 ret = PTR_ERR(priv->power);
109 goto out_clk;
110 }
111
112 ret = mcp25xxfd_base_power_enable(priv->power, 1);
113 if (ret)
114 goto out_clk;
115
116 /* disable interrupts */
117 ret = mcp25xxfd_int_enable(priv, false);
118 if (ret)
119 goto out_power;
120
121 /* setup ECC for SRAM */
122 ret = mcp25xxfd_ecc_enable(priv);
123 if (ret)
124 goto out_power;
125
126 dev_info(&spi->dev,
127 "MCP%04x successfully initialized.\n", model);
128 return 0;
129
130 out_power:
131 mcp25xxfd_base_power_enable(priv->power, 0);
132 out_clk:
133 clk_disable_unprepare(clk);
134 out_free:
135 dev_err(&spi->dev, "Probe failed, err=%d\n", -ret);
136 return ret;
137 }
138
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months
[rcar:gmsl/dev 33/38] drivers/media/i2c/max9286.c:1481:24: warning: too many arguments for format
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git gmsl/dev
head: 406241b95becdda74baddd9c8eedbc2c376d9e23
commit: f693866098882afde9574a6fd1055acd062269f5 [33/38] DNI: max9286 of_ref_read debug
config: s390-allyesconfig (attached as .config)
compiler: s390-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 f693866098882afde9574a6fd1055acd062269f5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
In file included from include/linux/device.h:15,
from drivers/media/i2c/max9286.c:15:
drivers/media/i2c/max9286.c: In function 'max9286_probe':
>> drivers/media/i2c/max9286.c:1481:24: warning: too many arguments for format [-Wformat-extra-args]
1481 | dev_err(&client->dev, "A) of_node pre parse_dt %d.n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
>> drivers/media/i2c/max9286.c:1481:2: note: in expansion of macro 'dev_err'
1481 | dev_err(&client->dev, "A) of_node pre parse_dt %d.n",
| ^~~~~~~
drivers/media/i2c/max9286.c:1488:24: warning: too many arguments for format [-Wformat-extra-args]
1488 | dev_err(&client->dev, "B) of_node post parse_dt %d.n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/media/i2c/max9286.c:1488:2: note: in expansion of macro 'dev_err'
1488 | dev_err(&client->dev, "B) of_node post parse_dt %d.n",
| ^~~~~~~
drivers/media/i2c/max9286.c:1519:24: warning: too many arguments for format [-Wformat-extra-args]
1519 | dev_err(&client->dev, "C) of_node post parse_dt %d.n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/dev_printk.h:19:22: note: in definition of macro 'dev_fmt'
19 | #define dev_fmt(fmt) fmt
| ^~~
drivers/media/i2c/max9286.c:1519:2: note: in expansion of macro 'dev_err'
1519 | dev_err(&client->dev, "C) of_node post parse_dt %d.n",
| ^~~~~~~
vim +1481 drivers/media/i2c/max9286.c
1413
1414 static int max9286_probe(struct i2c_client *client)
1415 {
1416 struct max9286_priv *priv;
1417 int ret;
1418
1419 priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL);
1420 if (!priv)
1421 return -ENOMEM;
1422
1423 mutex_init(&priv->mutex);
1424
1425 priv->client = client;
1426 i2c_set_clientdata(client, priv);
1427
1428 priv->gpiod_pwdn = devm_gpiod_get_optional(&client->dev, "enable",
1429 GPIOD_OUT_HIGH);
1430 if (IS_ERR(priv->gpiod_pwdn))
1431 return PTR_ERR(priv->gpiod_pwdn);
1432
1433 gpiod_set_consumer_name(priv->gpiod_pwdn, "max9286-pwdn");
1434 gpiod_set_value_cansleep(priv->gpiod_pwdn, 1);
1435
1436 /* Wait at least 4ms before the I2C lines latch to the address */
1437 if (priv->gpiod_pwdn)
1438 usleep_range(4000, 5000);
1439
1440 /*
1441 * We can have multiple MAX9286 instances on the same physical I2C
1442 * bus, and I2C children behind ports of separate MAX9286 instances
1443 * having the same I2C address. As the MAX9286 starts by default with
1444 * all ports enabled, we need to disable all ports on all MAX9286
1445 * instances before proceeding to further initialize the devices and
1446 * instantiate children.
1447 *
1448 * Start by just disabling all channels on the current device. Then,
1449 * if all other MAX9286 on the parent bus have been probed, proceed
1450 * to initialize them all, including the current one.
1451 */
1452 max9286_i2c_mux_close(priv);
1453
1454 /*
1455 * The MAX9286 initialises with auto-acknowledge enabled by default.
1456 * This means that if multiple MAX9286 devices are connected to an I2C
1457 * bus, another MAX9286 could ack I2C transfers meant for a device on
1458 * the other side of the GMSL links for this MAX9286 (such as a
1459 * MAX9271). To prevent that disable auto-acknowledge early on; it
1460 * will be enabled later as needed.
1461 */
1462 max9286_configure_i2c(priv, false);
1463
1464 ret = max9286_register_gpio(priv);
1465 if (ret)
1466 goto err_powerdown;
1467
1468 priv->regulator = devm_regulator_get(&client->dev, "poc");
1469 if (IS_ERR(priv->regulator)) {
1470 if (PTR_ERR(priv->regulator) != -EPROBE_DEFER)
1471 dev_err(&client->dev,
1472 "Unable to get PoC regulator (%ld)\n",
1473 PTR_ERR(priv->regulator));
1474 else
1475 dev_err(&client->dev, "Regulator not yet available -EPROBE_DEFER...\n");
1476
1477 ret = PTR_ERR(priv->regulator);
1478 goto err_powerdown;
1479 }
1480
> 1481 dev_err(&client->dev, "A) of_node pre parse_dt %d.\n",
1482 __LINE__, of_ref_read(client->dev.of_node));
1483
1484 ret = max9286_parse_dt(priv);
1485 if (ret)
1486 goto err_powerdown;
1487
1488 dev_err(&client->dev, "B) of_node post parse_dt %d.\n",
1489 __LINE__, of_ref_read(client->dev.of_node));
1490
1491 /* Add any userspace support before we return early. */
1492 max9286_debugfs_init(priv);
1493
1494 dev_err(&client->dev, "Pre-init");
1495
1496 ret = device_for_each_child(client->dev.parent, &client->dev,
1497 max9286_is_bound);
1498 if (ret)
1499 return 0;
1500
1501 dev_dbg(&client->dev,
1502 "All max9286 probed: start initialization sequence\n");
1503 ret = device_for_each_child(client->dev.parent, NULL,
1504 max9286_init);
1505 if (ret < 0)
1506 goto err_cleanup_dt;
1507
1508 /* Leave the mux channels disabled until they are selected. */
1509 max9286_i2c_mux_close(priv);
1510
1511 return 0;
1512
1513 err_cleanup_dt:
1514 max9286_cleanup_dt(priv);
1515 max9286_debugfs_remove(priv);
1516 err_powerdown:
1517 gpiod_set_value_cansleep(priv->gpiod_pwdn, 0);
1518
1519 dev_err(&client->dev, "C) of_node post parse_dt %d.\n",
1520 __LINE__, of_ref_read(client->dev.of_node));
1521
1522 return ret;
1523 }
1524
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 3 months