* Re: [PATCH] media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_probe
@ 2022-01-05 18:52 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-01-05 18:52 UTC (permalink / raw)
To: kbuild
[-- Attachment #1: Type: text/plain, Size: 17458 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20220105111056.4662-1-linmq006@gmail.com>
References: <20220105111056.4662-1-linmq006@gmail.com>
TO: Miaoqian Lin <linmq006@gmail.com>
CC: linmq006(a)gmail.com
CC: Eugen Hristev <eugen.hristev@microchip.com>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Nicolas Ferre <nicolas.ferre@microchip.com>
CC: Alexandre Belloni <alexandre.belloni@bootlin.com>
CC: Ludovic Desroches <ludovic.desroches@microchip.com>
CC: Hans Verkuil <hverkuil@xs4all.nl>
CC: linux-arm-kernel(a)lists.infradead.org
CC: linux-kernel(a)vger.kernel.org
Hi Miaoqian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on media-tree/master]
[also build test WARNING on v5.16-rc8 next-20220105]
[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/Miaoqian-Lin/media-atmel-atmel-isc-Fix-PM-disable-depth-imbalance-in-atmel_isc_probe/20220105-191228
base: git://linuxtv.org/media_tree.git master
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: alpha-randconfig-s031-20220105 (https://download.01.org/0day-ci/archive/20220106/202201060215.P1FTGS2p-lkp(a)intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/f116d8f81c642486900c9589a7c10d137d7eb0a2
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Miaoqian-Lin/media-atmel-atmel-isc-Fix-PM-disable-depth-imbalance-in-atmel_isc_probe/20220105-191228
git checkout f116d8f81c642486900c9589a7c10d137d7eb0a2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash drivers/media/platform/atmel/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/media/platform/atmel/atmel-sama5d2-isc.c:562:1: sparse: sparse: unused label 'disable_pm_runtime'
vim +/disable_pm_runtime +562 drivers/media/platform/atmel/atmel-sama5d2-isc.c
0a0e265515db76 Eugen Hristev 2019-06-12 380
0a0e265515db76 Eugen Hristev 2019-06-12 381 static int atmel_isc_probe(struct platform_device *pdev)
0a0e265515db76 Eugen Hristev 2019-06-12 382 {
0a0e265515db76 Eugen Hristev 2019-06-12 383 struct device *dev = &pdev->dev;
0a0e265515db76 Eugen Hristev 2019-06-12 384 struct isc_device *isc;
0a0e265515db76 Eugen Hristev 2019-06-12 385 struct resource *res;
0a0e265515db76 Eugen Hristev 2019-06-12 386 void __iomem *io_base;
0a0e265515db76 Eugen Hristev 2019-06-12 387 struct isc_subdev_entity *subdev_entity;
0a0e265515db76 Eugen Hristev 2019-06-12 388 int irq;
0a0e265515db76 Eugen Hristev 2019-06-12 389 int ret;
d51470069eb169 Eugen Hristev 2021-04-13 390 u32 ver;
0a0e265515db76 Eugen Hristev 2019-06-12 391
0a0e265515db76 Eugen Hristev 2019-06-12 392 isc = devm_kzalloc(dev, sizeof(*isc), GFP_KERNEL);
0a0e265515db76 Eugen Hristev 2019-06-12 393 if (!isc)
0a0e265515db76 Eugen Hristev 2019-06-12 394 return -ENOMEM;
0a0e265515db76 Eugen Hristev 2019-06-12 395
0a0e265515db76 Eugen Hristev 2019-06-12 396 platform_set_drvdata(pdev, isc);
0a0e265515db76 Eugen Hristev 2019-06-12 397 isc->dev = dev;
0a0e265515db76 Eugen Hristev 2019-06-12 398
0a0e265515db76 Eugen Hristev 2019-06-12 399 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
0a0e265515db76 Eugen Hristev 2019-06-12 400 io_base = devm_ioremap_resource(dev, res);
0a0e265515db76 Eugen Hristev 2019-06-12 401 if (IS_ERR(io_base))
0a0e265515db76 Eugen Hristev 2019-06-12 402 return PTR_ERR(io_base);
0a0e265515db76 Eugen Hristev 2019-06-12 403
0a0e265515db76 Eugen Hristev 2019-06-12 404 isc->regmap = devm_regmap_init_mmio(dev, io_base, &isc_regmap_config);
0a0e265515db76 Eugen Hristev 2019-06-12 405 if (IS_ERR(isc->regmap)) {
0a0e265515db76 Eugen Hristev 2019-06-12 406 ret = PTR_ERR(isc->regmap);
0a0e265515db76 Eugen Hristev 2019-06-12 407 dev_err(dev, "failed to init register map: %d\n", ret);
0a0e265515db76 Eugen Hristev 2019-06-12 408 return ret;
0a0e265515db76 Eugen Hristev 2019-06-12 409 }
0a0e265515db76 Eugen Hristev 2019-06-12 410
0a0e265515db76 Eugen Hristev 2019-06-12 411 irq = platform_get_irq(pdev, 0);
97299a3035328d Stephen Boyd 2019-07-30 412 if (irq < 0)
97299a3035328d Stephen Boyd 2019-07-30 413 return irq;
0a0e265515db76 Eugen Hristev 2019-06-12 414
0a0e265515db76 Eugen Hristev 2019-06-12 415 ret = devm_request_irq(dev, irq, isc_interrupt, 0,
d5475b3c901a00 Eugen Hristev 2021-04-13 416 "atmel-sama5d2-isc", isc);
0a0e265515db76 Eugen Hristev 2019-06-12 417 if (ret < 0) {
0a0e265515db76 Eugen Hristev 2019-06-12 418 dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
0a0e265515db76 Eugen Hristev 2019-06-12 419 irq, ret);
0a0e265515db76 Eugen Hristev 2019-06-12 420 return ret;
0a0e265515db76 Eugen Hristev 2019-06-12 421 }
0a0e265515db76 Eugen Hristev 2019-06-12 422
f84bc784fa614a Eugen Hristev 2021-04-13 423 isc->gamma_table = isc_sama5d2_gamma_table;
f84bc784fa614a Eugen Hristev 2021-04-13 424 isc->gamma_max = 2;
f84bc784fa614a Eugen Hristev 2021-04-13 425
f794bc16a52da7 Eugen Hristev 2021-04-13 426 isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH;
f794bc16a52da7 Eugen Hristev 2021-04-13 427 isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT;
f794bc16a52da7 Eugen Hristev 2021-04-13 428
883285556388af Eugen Hristev 2021-04-13 429 isc->config_dpc = isc_sama5d2_config_dpc;
2ede3975c0a853 Eugen Hristev 2021-04-13 430 isc->config_csc = isc_sama5d2_config_csc;
d3b2ee5478c856 Eugen Hristev 2021-04-13 431 isc->config_cbc = isc_sama5d2_config_cbc;
2873f85bd318bf Eugen Hristev 2021-04-13 432 isc->config_cc = isc_sama5d2_config_cc;
e48848a6af150e Eugen Hristev 2021-04-13 433 isc->config_gam = isc_sama5d2_config_gam;
ef9b7779688b2d Eugen Hristev 2021-04-13 434 isc->config_rlp = isc_sama5d2_config_rlp;
8f1b451c87ee05 Eugen Hristev 2021-04-13 435 isc->config_ctrls = isc_sama5d2_config_ctrls;
2ede3975c0a853 Eugen Hristev 2021-04-13 436
049a38fc9681b3 Eugen Hristev 2021-04-13 437 isc->adapt_pipeline = isc_sama5d2_adapt_pipeline;
049a38fc9681b3 Eugen Hristev 2021-04-13 438
ffeeb01d11397b Eugen Hristev 2021-04-13 439 isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;
4fc9e8a775d4b3 Eugen Hristev 2021-04-13 440 isc->offsets.cbc = ISC_SAMA5D2_CBC_OFFSET;
87b62b6d55dd78 Eugen Hristev 2021-04-13 441 isc->offsets.sub422 = ISC_SAMA5D2_SUB422_OFFSET;
87b62b6d55dd78 Eugen Hristev 2021-04-13 442 isc->offsets.sub420 = ISC_SAMA5D2_SUB420_OFFSET;
40ee17d1b41ccc Eugen Hristev 2021-04-13 443 isc->offsets.rlp = ISC_SAMA5D2_RLP_OFFSET;
1a3ac5d51541b6 Eugen Hristev 2021-04-13 444 isc->offsets.his = ISC_SAMA5D2_HIS_OFFSET;
e891009857716e Eugen Hristev 2021-04-13 445 isc->offsets.dma = ISC_SAMA5D2_DMA_OFFSET;
d51470069eb169 Eugen Hristev 2021-04-13 446 isc->offsets.version = ISC_SAMA5D2_VERSION_OFFSET;
629de518e6f3b8 Eugen Hristev 2021-04-13 447 isc->offsets.his_entry = ISC_SAMA5D2_HIS_ENTRY_OFFSET;
ffeeb01d11397b Eugen Hristev 2021-04-13 448
415dbe4efafa29 Eugen Hristev 2021-04-13 449 isc->controller_formats = sama5d2_controller_formats;
415dbe4efafa29 Eugen Hristev 2021-04-13 450 isc->controller_formats_size = ARRAY_SIZE(sama5d2_controller_formats);
415dbe4efafa29 Eugen Hristev 2021-04-13 451 isc->formats_list = sama5d2_formats_list;
415dbe4efafa29 Eugen Hristev 2021-04-13 452 isc->formats_list_size = ARRAY_SIZE(sama5d2_formats_list);
415dbe4efafa29 Eugen Hristev 2021-04-13 453
cd5af39467bdc7 Eugen Hristev 2021-04-13 454 /* sama5d2-isc - 8 bits per beat */
cd5af39467bdc7 Eugen Hristev 2021-04-13 455 isc->dcfg = ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8;
cd5af39467bdc7 Eugen Hristev 2021-04-13 456
d7f26849ed7cc8 Eugen Hristev 2021-09-13 457 /* sama5d2-isc : ISPCK is required and mandatory */
d7f26849ed7cc8 Eugen Hristev 2021-09-13 458 isc->ispck_required = true;
d7f26849ed7cc8 Eugen Hristev 2021-09-13 459
0a0e265515db76 Eugen Hristev 2019-06-12 460 ret = isc_pipeline_init(isc);
0a0e265515db76 Eugen Hristev 2019-06-12 461 if (ret)
0a0e265515db76 Eugen Hristev 2019-06-12 462 return ret;
0a0e265515db76 Eugen Hristev 2019-06-12 463
0a0e265515db76 Eugen Hristev 2019-06-12 464 isc->hclock = devm_clk_get(dev, "hclock");
0a0e265515db76 Eugen Hristev 2019-06-12 465 if (IS_ERR(isc->hclock)) {
0a0e265515db76 Eugen Hristev 2019-06-12 466 ret = PTR_ERR(isc->hclock);
0a0e265515db76 Eugen Hristev 2019-06-12 467 dev_err(dev, "failed to get hclock: %d\n", ret);
0a0e265515db76 Eugen Hristev 2019-06-12 468 return ret;
0a0e265515db76 Eugen Hristev 2019-06-12 469 }
0a0e265515db76 Eugen Hristev 2019-06-12 470
0a0e265515db76 Eugen Hristev 2019-06-12 471 ret = clk_prepare_enable(isc->hclock);
0a0e265515db76 Eugen Hristev 2019-06-12 472 if (ret) {
0a0e265515db76 Eugen Hristev 2019-06-12 473 dev_err(dev, "failed to enable hclock: %d\n", ret);
0a0e265515db76 Eugen Hristev 2019-06-12 474 return ret;
0a0e265515db76 Eugen Hristev 2019-06-12 475 }
0a0e265515db76 Eugen Hristev 2019-06-12 476
0a0e265515db76 Eugen Hristev 2019-06-12 477 ret = isc_clk_init(isc);
0a0e265515db76 Eugen Hristev 2019-06-12 478 if (ret) {
0a0e265515db76 Eugen Hristev 2019-06-12 479 dev_err(dev, "failed to init isc clock: %d\n", ret);
0a0e265515db76 Eugen Hristev 2019-06-12 480 goto unprepare_hclk;
0a0e265515db76 Eugen Hristev 2019-06-12 481 }
0a0e265515db76 Eugen Hristev 2019-06-12 482 ret = v4l2_device_register(dev, &isc->v4l2_dev);
0a0e265515db76 Eugen Hristev 2019-06-12 483 if (ret) {
0a0e265515db76 Eugen Hristev 2019-06-12 484 dev_err(dev, "unable to register v4l2 device.\n");
0a0e265515db76 Eugen Hristev 2019-06-12 485 goto unprepare_clk;
0a0e265515db76 Eugen Hristev 2019-06-12 486 }
0a0e265515db76 Eugen Hristev 2019-06-12 487
0a0e265515db76 Eugen Hristev 2019-06-12 488 ret = isc_parse_dt(dev, isc);
0a0e265515db76 Eugen Hristev 2019-06-12 489 if (ret) {
0a0e265515db76 Eugen Hristev 2019-06-12 490 dev_err(dev, "fail to parse device tree\n");
0a0e265515db76 Eugen Hristev 2019-06-12 491 goto unregister_v4l2_device;
0a0e265515db76 Eugen Hristev 2019-06-12 492 }
0a0e265515db76 Eugen Hristev 2019-06-12 493
0a0e265515db76 Eugen Hristev 2019-06-12 494 if (list_empty(&isc->subdev_entities)) {
0a0e265515db76 Eugen Hristev 2019-06-12 495 dev_err(dev, "no subdev found\n");
0a0e265515db76 Eugen Hristev 2019-06-12 496 ret = -ENODEV;
0a0e265515db76 Eugen Hristev 2019-06-12 497 goto unregister_v4l2_device;
0a0e265515db76 Eugen Hristev 2019-06-12 498 }
0a0e265515db76 Eugen Hristev 2019-06-12 499
0a0e265515db76 Eugen Hristev 2019-06-12 500 list_for_each_entry(subdev_entity, &isc->subdev_entities, list) {
d6701f13bd0747 Ezequiel Garcia 2021-01-18 501 struct v4l2_async_subdev *asd;
3c8c153914812a Sakari Ailus 2021-03-05 502 struct fwnode_handle *fwnode =
3c8c153914812a Sakari Ailus 2021-03-05 503 of_fwnode_handle(subdev_entity->epn);
d6701f13bd0747 Ezequiel Garcia 2021-01-18 504
3c8c153914812a Sakari Ailus 2021-03-05 505 v4l2_async_nf_init(&subdev_entity->notifier);
0a0e265515db76 Eugen Hristev 2019-06-12 506
3c8c153914812a Sakari Ailus 2021-03-05 507 asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
3c8c153914812a Sakari Ailus 2021-03-05 508 fwnode,
b01edcbd409cf7 Laurent Pinchart 2021-01-18 509 struct v4l2_async_subdev);
d6701f13bd0747 Ezequiel Garcia 2021-01-18 510
d6701f13bd0747 Ezequiel Garcia 2021-01-18 511 of_node_put(subdev_entity->epn);
d6701f13bd0747 Ezequiel Garcia 2021-01-18 512 subdev_entity->epn = NULL;
d6701f13bd0747 Ezequiel Garcia 2021-01-18 513
d6701f13bd0747 Ezequiel Garcia 2021-01-18 514 if (IS_ERR(asd)) {
d6701f13bd0747 Ezequiel Garcia 2021-01-18 515 ret = PTR_ERR(asd);
0a0e265515db76 Eugen Hristev 2019-06-12 516 goto cleanup_subdev;
0a0e265515db76 Eugen Hristev 2019-06-12 517 }
0a0e265515db76 Eugen Hristev 2019-06-12 518
0a0e265515db76 Eugen Hristev 2019-06-12 519 subdev_entity->notifier.ops = &isc_async_ops;
0a0e265515db76 Eugen Hristev 2019-06-12 520
3c8c153914812a Sakari Ailus 2021-03-05 521 ret = v4l2_async_nf_register(&isc->v4l2_dev,
0a0e265515db76 Eugen Hristev 2019-06-12 522 &subdev_entity->notifier);
0a0e265515db76 Eugen Hristev 2019-06-12 523 if (ret) {
0a0e265515db76 Eugen Hristev 2019-06-12 524 dev_err(dev, "fail to register async notifier\n");
0a0e265515db76 Eugen Hristev 2019-06-12 525 goto cleanup_subdev;
0a0e265515db76 Eugen Hristev 2019-06-12 526 }
0a0e265515db76 Eugen Hristev 2019-06-12 527
0a0e265515db76 Eugen Hristev 2019-06-12 528 if (video_is_registered(&isc->video_dev))
0a0e265515db76 Eugen Hristev 2019-06-12 529 break;
0a0e265515db76 Eugen Hristev 2019-06-12 530 }
0a0e265515db76 Eugen Hristev 2019-06-12 531
0a0e265515db76 Eugen Hristev 2019-06-12 532 pm_runtime_set_active(dev);
0a0e265515db76 Eugen Hristev 2019-06-12 533 pm_runtime_enable(dev);
0a0e265515db76 Eugen Hristev 2019-06-12 534 pm_request_idle(dev);
0a0e265515db76 Eugen Hristev 2019-06-12 535
d7f26849ed7cc8 Eugen Hristev 2021-09-13 536 isc->ispck = isc->isc_clks[ISC_ISPCK].clk;
d7f26849ed7cc8 Eugen Hristev 2021-09-13 537
d7f26849ed7cc8 Eugen Hristev 2021-09-13 538 ret = clk_prepare_enable(isc->ispck);
d7f26849ed7cc8 Eugen Hristev 2021-09-13 539 if (ret) {
d7f26849ed7cc8 Eugen Hristev 2021-09-13 540 dev_err(dev, "failed to enable ispck: %d\n", ret);
d7f26849ed7cc8 Eugen Hristev 2021-09-13 541 goto cleanup_subdev;
d7f26849ed7cc8 Eugen Hristev 2021-09-13 542 }
d7f26849ed7cc8 Eugen Hristev 2021-09-13 543
d7f26849ed7cc8 Eugen Hristev 2021-09-13 544 /* ispck should be greater or equal to hclock */
d7f26849ed7cc8 Eugen Hristev 2021-09-13 545 ret = clk_set_rate(isc->ispck, clk_get_rate(isc->hclock));
d7f26849ed7cc8 Eugen Hristev 2021-09-13 546 if (ret) {
d7f26849ed7cc8 Eugen Hristev 2021-09-13 547 dev_err(dev, "failed to set ispck rate: %d\n", ret);
d7f26849ed7cc8 Eugen Hristev 2021-09-13 548 goto unprepare_clk;
d7f26849ed7cc8 Eugen Hristev 2021-09-13 549 }
d7f26849ed7cc8 Eugen Hristev 2021-09-13 550
d51470069eb169 Eugen Hristev 2021-04-13 551 regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver);
d51470069eb169 Eugen Hristev 2021-04-13 552 dev_info(dev, "Microchip ISC version %x\n", ver);
d51470069eb169 Eugen Hristev 2021-04-13 553
0a0e265515db76 Eugen Hristev 2019-06-12 554 return 0;
0a0e265515db76 Eugen Hristev 2019-06-12 555
d7f26849ed7cc8 Eugen Hristev 2021-09-13 556 unprepare_clk:
d7f26849ed7cc8 Eugen Hristev 2021-09-13 557 clk_disable_unprepare(isc->ispck);
d7f26849ed7cc8 Eugen Hristev 2021-09-13 558
0a0e265515db76 Eugen Hristev 2019-06-12 559 cleanup_subdev:
0a0e265515db76 Eugen Hristev 2019-06-12 560 isc_subdev_cleanup(isc);
0a0e265515db76 Eugen Hristev 2019-06-12 561
f116d8f81c6424 Miaoqian Lin 2022-01-05 @562 disable_pm_runtime:
f116d8f81c6424 Miaoqian Lin 2022-01-05 563 pm_runtime_disable(dev);
f116d8f81c6424 Miaoqian Lin 2022-01-05 564
0a0e265515db76 Eugen Hristev 2019-06-12 565 unregister_v4l2_device:
0a0e265515db76 Eugen Hristev 2019-06-12 566 v4l2_device_unregister(&isc->v4l2_dev);
0a0e265515db76 Eugen Hristev 2019-06-12 567
0a0e265515db76 Eugen Hristev 2019-06-12 568 unprepare_hclk:
0a0e265515db76 Eugen Hristev 2019-06-12 569 clk_disable_unprepare(isc->hclock);
0a0e265515db76 Eugen Hristev 2019-06-12 570
0a0e265515db76 Eugen Hristev 2019-06-12 571 isc_clk_cleanup(isc);
0a0e265515db76 Eugen Hristev 2019-06-12 572
0a0e265515db76 Eugen Hristev 2019-06-12 573 return ret;
0a0e265515db76 Eugen Hristev 2019-06-12 574 }
0a0e265515db76 Eugen Hristev 2019-06-12 575
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_probe
2022-01-05 11:10 ` Miaoqian Lin
(?)
@ 2022-01-06 12:42 ` kernel test robot
-1 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-01-06 12:42 UTC (permalink / raw)
To: Miaoqian Lin
Cc: llvm, kbuild-all, linmq006, Eugen Hristev, Mauro Carvalho Chehab,
linux-media, Nicolas Ferre, Alexandre Belloni, Ludovic Desroches,
Hans Verkuil, linux-arm-kernel, linux-kernel
Hi Miaoqian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on media-tree/master]
[also build test WARNING on v5.16-rc8 next-20220105]
[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/Miaoqian-Lin/media-atmel-atmel-isc-Fix-PM-disable-depth-imbalance-in-atmel_isc_probe/20220105-191228
base: git://linuxtv.org/media_tree.git master
config: riscv-randconfig-r002-20220106 (https://download.01.org/0day-ci/archive/20220106/202201062034.BD2L4uCe-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project ca7ffe09dc6e525109e3cd570cc5182ce568be13)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/f116d8f81c642486900c9589a7c10d137d7eb0a2
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Miaoqian-Lin/media-atmel-atmel-isc-Fix-PM-disable-depth-imbalance-in-atmel_isc_probe/20220105-191228
git checkout f116d8f81c642486900c9589a7c10d137d7eb0a2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/media/platform/atmel/ net/xfrm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/media/platform/atmel/atmel-sama5d2-isc.c:30:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/media/platform/atmel/atmel-sama5d2-isc.c:30:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/media/platform/atmel/atmel-sama5d2-isc.c:30:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> drivers/media/platform/atmel/atmel-sama5d2-isc.c:562:1: warning: unused label 'disable_pm_runtime' [-Wunused-label]
disable_pm_runtime:
^~~~~~~~~~~~~~~~~~~
8 warnings generated.
vim +/disable_pm_runtime +562 drivers/media/platform/atmel/atmel-sama5d2-isc.c
380
381 static int atmel_isc_probe(struct platform_device *pdev)
382 {
383 struct device *dev = &pdev->dev;
384 struct isc_device *isc;
385 struct resource *res;
386 void __iomem *io_base;
387 struct isc_subdev_entity *subdev_entity;
388 int irq;
389 int ret;
390 u32 ver;
391
392 isc = devm_kzalloc(dev, sizeof(*isc), GFP_KERNEL);
393 if (!isc)
394 return -ENOMEM;
395
396 platform_set_drvdata(pdev, isc);
397 isc->dev = dev;
398
399 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
400 io_base = devm_ioremap_resource(dev, res);
401 if (IS_ERR(io_base))
402 return PTR_ERR(io_base);
403
404 isc->regmap = devm_regmap_init_mmio(dev, io_base, &isc_regmap_config);
405 if (IS_ERR(isc->regmap)) {
406 ret = PTR_ERR(isc->regmap);
407 dev_err(dev, "failed to init register map: %d\n", ret);
408 return ret;
409 }
410
411 irq = platform_get_irq(pdev, 0);
412 if (irq < 0)
413 return irq;
414
415 ret = devm_request_irq(dev, irq, isc_interrupt, 0,
416 "atmel-sama5d2-isc", isc);
417 if (ret < 0) {
418 dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
419 irq, ret);
420 return ret;
421 }
422
423 isc->gamma_table = isc_sama5d2_gamma_table;
424 isc->gamma_max = 2;
425
426 isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH;
427 isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT;
428
429 isc->config_dpc = isc_sama5d2_config_dpc;
430 isc->config_csc = isc_sama5d2_config_csc;
431 isc->config_cbc = isc_sama5d2_config_cbc;
432 isc->config_cc = isc_sama5d2_config_cc;
433 isc->config_gam = isc_sama5d2_config_gam;
434 isc->config_rlp = isc_sama5d2_config_rlp;
435 isc->config_ctrls = isc_sama5d2_config_ctrls;
436
437 isc->adapt_pipeline = isc_sama5d2_adapt_pipeline;
438
439 isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;
440 isc->offsets.cbc = ISC_SAMA5D2_CBC_OFFSET;
441 isc->offsets.sub422 = ISC_SAMA5D2_SUB422_OFFSET;
442 isc->offsets.sub420 = ISC_SAMA5D2_SUB420_OFFSET;
443 isc->offsets.rlp = ISC_SAMA5D2_RLP_OFFSET;
444 isc->offsets.his = ISC_SAMA5D2_HIS_OFFSET;
445 isc->offsets.dma = ISC_SAMA5D2_DMA_OFFSET;
446 isc->offsets.version = ISC_SAMA5D2_VERSION_OFFSET;
447 isc->offsets.his_entry = ISC_SAMA5D2_HIS_ENTRY_OFFSET;
448
449 isc->controller_formats = sama5d2_controller_formats;
450 isc->controller_formats_size = ARRAY_SIZE(sama5d2_controller_formats);
451 isc->formats_list = sama5d2_formats_list;
452 isc->formats_list_size = ARRAY_SIZE(sama5d2_formats_list);
453
454 /* sama5d2-isc - 8 bits per beat */
455 isc->dcfg = ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8;
456
457 /* sama5d2-isc : ISPCK is required and mandatory */
458 isc->ispck_required = true;
459
460 ret = isc_pipeline_init(isc);
461 if (ret)
462 return ret;
463
464 isc->hclock = devm_clk_get(dev, "hclock");
465 if (IS_ERR(isc->hclock)) {
466 ret = PTR_ERR(isc->hclock);
467 dev_err(dev, "failed to get hclock: %d\n", ret);
468 return ret;
469 }
470
471 ret = clk_prepare_enable(isc->hclock);
472 if (ret) {
473 dev_err(dev, "failed to enable hclock: %d\n", ret);
474 return ret;
475 }
476
477 ret = isc_clk_init(isc);
478 if (ret) {
479 dev_err(dev, "failed to init isc clock: %d\n", ret);
480 goto unprepare_hclk;
481 }
482 ret = v4l2_device_register(dev, &isc->v4l2_dev);
483 if (ret) {
484 dev_err(dev, "unable to register v4l2 device.\n");
485 goto unprepare_clk;
486 }
487
488 ret = isc_parse_dt(dev, isc);
489 if (ret) {
490 dev_err(dev, "fail to parse device tree\n");
491 goto unregister_v4l2_device;
492 }
493
494 if (list_empty(&isc->subdev_entities)) {
495 dev_err(dev, "no subdev found\n");
496 ret = -ENODEV;
497 goto unregister_v4l2_device;
498 }
499
500 list_for_each_entry(subdev_entity, &isc->subdev_entities, list) {
501 struct v4l2_async_subdev *asd;
502 struct fwnode_handle *fwnode =
503 of_fwnode_handle(subdev_entity->epn);
504
505 v4l2_async_nf_init(&subdev_entity->notifier);
506
507 asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
508 fwnode,
509 struct v4l2_async_subdev);
510
511 of_node_put(subdev_entity->epn);
512 subdev_entity->epn = NULL;
513
514 if (IS_ERR(asd)) {
515 ret = PTR_ERR(asd);
516 goto cleanup_subdev;
517 }
518
519 subdev_entity->notifier.ops = &isc_async_ops;
520
521 ret = v4l2_async_nf_register(&isc->v4l2_dev,
522 &subdev_entity->notifier);
523 if (ret) {
524 dev_err(dev, "fail to register async notifier\n");
525 goto cleanup_subdev;
526 }
527
528 if (video_is_registered(&isc->video_dev))
529 break;
530 }
531
532 pm_runtime_set_active(dev);
533 pm_runtime_enable(dev);
534 pm_request_idle(dev);
535
536 isc->ispck = isc->isc_clks[ISC_ISPCK].clk;
537
538 ret = clk_prepare_enable(isc->ispck);
539 if (ret) {
540 dev_err(dev, "failed to enable ispck: %d\n", ret);
541 goto cleanup_subdev;
542 }
543
544 /* ispck should be greater or equal to hclock */
545 ret = clk_set_rate(isc->ispck, clk_get_rate(isc->hclock));
546 if (ret) {
547 dev_err(dev, "failed to set ispck rate: %d\n", ret);
548 goto unprepare_clk;
549 }
550
551 regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver);
552 dev_info(dev, "Microchip ISC version %x\n", ver);
553
554 return 0;
555
556 unprepare_clk:
557 clk_disable_unprepare(isc->ispck);
558
559 cleanup_subdev:
560 isc_subdev_cleanup(isc);
561
> 562 disable_pm_runtime:
563 pm_runtime_disable(dev);
564
565 unregister_v4l2_device:
566 v4l2_device_unregister(&isc->v4l2_dev);
567
568 unprepare_hclk:
569 clk_disable_unprepare(isc->hclock);
570
571 isc_clk_cleanup(isc);
572
573 return ret;
574 }
575
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_probe
@ 2022-01-06 12:42 ` kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-01-06 12:42 UTC (permalink / raw)
To: Miaoqian Lin
Cc: linmq006, kbuild-all, Alexandre Belloni, llvm, linux-kernel,
Hans Verkuil, Ludovic Desroches, Eugen Hristev,
Mauro Carvalho Chehab, linux-arm-kernel, linux-media
Hi Miaoqian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on media-tree/master]
[also build test WARNING on v5.16-rc8 next-20220105]
[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/Miaoqian-Lin/media-atmel-atmel-isc-Fix-PM-disable-depth-imbalance-in-atmel_isc_probe/20220105-191228
base: git://linuxtv.org/media_tree.git master
config: riscv-randconfig-r002-20220106 (https://download.01.org/0day-ci/archive/20220106/202201062034.BD2L4uCe-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project ca7ffe09dc6e525109e3cd570cc5182ce568be13)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/f116d8f81c642486900c9589a7c10d137d7eb0a2
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Miaoqian-Lin/media-atmel-atmel-isc-Fix-PM-disable-depth-imbalance-in-atmel_isc_probe/20220105-191228
git checkout f116d8f81c642486900c9589a7c10d137d7eb0a2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/media/platform/atmel/ net/xfrm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/media/platform/atmel/atmel-sama5d2-isc.c:30:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/media/platform/atmel/atmel-sama5d2-isc.c:30:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/media/platform/atmel/atmel-sama5d2-isc.c:30:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> drivers/media/platform/atmel/atmel-sama5d2-isc.c:562:1: warning: unused label 'disable_pm_runtime' [-Wunused-label]
disable_pm_runtime:
^~~~~~~~~~~~~~~~~~~
8 warnings generated.
vim +/disable_pm_runtime +562 drivers/media/platform/atmel/atmel-sama5d2-isc.c
380
381 static int atmel_isc_probe(struct platform_device *pdev)
382 {
383 struct device *dev = &pdev->dev;
384 struct isc_device *isc;
385 struct resource *res;
386 void __iomem *io_base;
387 struct isc_subdev_entity *subdev_entity;
388 int irq;
389 int ret;
390 u32 ver;
391
392 isc = devm_kzalloc(dev, sizeof(*isc), GFP_KERNEL);
393 if (!isc)
394 return -ENOMEM;
395
396 platform_set_drvdata(pdev, isc);
397 isc->dev = dev;
398
399 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
400 io_base = devm_ioremap_resource(dev, res);
401 if (IS_ERR(io_base))
402 return PTR_ERR(io_base);
403
404 isc->regmap = devm_regmap_init_mmio(dev, io_base, &isc_regmap_config);
405 if (IS_ERR(isc->regmap)) {
406 ret = PTR_ERR(isc->regmap);
407 dev_err(dev, "failed to init register map: %d\n", ret);
408 return ret;
409 }
410
411 irq = platform_get_irq(pdev, 0);
412 if (irq < 0)
413 return irq;
414
415 ret = devm_request_irq(dev, irq, isc_interrupt, 0,
416 "atmel-sama5d2-isc", isc);
417 if (ret < 0) {
418 dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
419 irq, ret);
420 return ret;
421 }
422
423 isc->gamma_table = isc_sama5d2_gamma_table;
424 isc->gamma_max = 2;
425
426 isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH;
427 isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT;
428
429 isc->config_dpc = isc_sama5d2_config_dpc;
430 isc->config_csc = isc_sama5d2_config_csc;
431 isc->config_cbc = isc_sama5d2_config_cbc;
432 isc->config_cc = isc_sama5d2_config_cc;
433 isc->config_gam = isc_sama5d2_config_gam;
434 isc->config_rlp = isc_sama5d2_config_rlp;
435 isc->config_ctrls = isc_sama5d2_config_ctrls;
436
437 isc->adapt_pipeline = isc_sama5d2_adapt_pipeline;
438
439 isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;
440 isc->offsets.cbc = ISC_SAMA5D2_CBC_OFFSET;
441 isc->offsets.sub422 = ISC_SAMA5D2_SUB422_OFFSET;
442 isc->offsets.sub420 = ISC_SAMA5D2_SUB420_OFFSET;
443 isc->offsets.rlp = ISC_SAMA5D2_RLP_OFFSET;
444 isc->offsets.his = ISC_SAMA5D2_HIS_OFFSET;
445 isc->offsets.dma = ISC_SAMA5D2_DMA_OFFSET;
446 isc->offsets.version = ISC_SAMA5D2_VERSION_OFFSET;
447 isc->offsets.his_entry = ISC_SAMA5D2_HIS_ENTRY_OFFSET;
448
449 isc->controller_formats = sama5d2_controller_formats;
450 isc->controller_formats_size = ARRAY_SIZE(sama5d2_controller_formats);
451 isc->formats_list = sama5d2_formats_list;
452 isc->formats_list_size = ARRAY_SIZE(sama5d2_formats_list);
453
454 /* sama5d2-isc - 8 bits per beat */
455 isc->dcfg = ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8;
456
457 /* sama5d2-isc : ISPCK is required and mandatory */
458 isc->ispck_required = true;
459
460 ret = isc_pipeline_init(isc);
461 if (ret)
462 return ret;
463
464 isc->hclock = devm_clk_get(dev, "hclock");
465 if (IS_ERR(isc->hclock)) {
466 ret = PTR_ERR(isc->hclock);
467 dev_err(dev, "failed to get hclock: %d\n", ret);
468 return ret;
469 }
470
471 ret = clk_prepare_enable(isc->hclock);
472 if (ret) {
473 dev_err(dev, "failed to enable hclock: %d\n", ret);
474 return ret;
475 }
476
477 ret = isc_clk_init(isc);
478 if (ret) {
479 dev_err(dev, "failed to init isc clock: %d\n", ret);
480 goto unprepare_hclk;
481 }
482 ret = v4l2_device_register(dev, &isc->v4l2_dev);
483 if (ret) {
484 dev_err(dev, "unable to register v4l2 device.\n");
485 goto unprepare_clk;
486 }
487
488 ret = isc_parse_dt(dev, isc);
489 if (ret) {
490 dev_err(dev, "fail to parse device tree\n");
491 goto unregister_v4l2_device;
492 }
493
494 if (list_empty(&isc->subdev_entities)) {
495 dev_err(dev, "no subdev found\n");
496 ret = -ENODEV;
497 goto unregister_v4l2_device;
498 }
499
500 list_for_each_entry(subdev_entity, &isc->subdev_entities, list) {
501 struct v4l2_async_subdev *asd;
502 struct fwnode_handle *fwnode =
503 of_fwnode_handle(subdev_entity->epn);
504
505 v4l2_async_nf_init(&subdev_entity->notifier);
506
507 asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
508 fwnode,
509 struct v4l2_async_subdev);
510
511 of_node_put(subdev_entity->epn);
512 subdev_entity->epn = NULL;
513
514 if (IS_ERR(asd)) {
515 ret = PTR_ERR(asd);
516 goto cleanup_subdev;
517 }
518
519 subdev_entity->notifier.ops = &isc_async_ops;
520
521 ret = v4l2_async_nf_register(&isc->v4l2_dev,
522 &subdev_entity->notifier);
523 if (ret) {
524 dev_err(dev, "fail to register async notifier\n");
525 goto cleanup_subdev;
526 }
527
528 if (video_is_registered(&isc->video_dev))
529 break;
530 }
531
532 pm_runtime_set_active(dev);
533 pm_runtime_enable(dev);
534 pm_request_idle(dev);
535
536 isc->ispck = isc->isc_clks[ISC_ISPCK].clk;
537
538 ret = clk_prepare_enable(isc->ispck);
539 if (ret) {
540 dev_err(dev, "failed to enable ispck: %d\n", ret);
541 goto cleanup_subdev;
542 }
543
544 /* ispck should be greater or equal to hclock */
545 ret = clk_set_rate(isc->ispck, clk_get_rate(isc->hclock));
546 if (ret) {
547 dev_err(dev, "failed to set ispck rate: %d\n", ret);
548 goto unprepare_clk;
549 }
550
551 regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver);
552 dev_info(dev, "Microchip ISC version %x\n", ver);
553
554 return 0;
555
556 unprepare_clk:
557 clk_disable_unprepare(isc->ispck);
558
559 cleanup_subdev:
560 isc_subdev_cleanup(isc);
561
> 562 disable_pm_runtime:
563 pm_runtime_disable(dev);
564
565 unregister_v4l2_device:
566 v4l2_device_unregister(&isc->v4l2_dev);
567
568 unprepare_hclk:
569 clk_disable_unprepare(isc->hclock);
570
571 isc_clk_cleanup(isc);
572
573 return ret;
574 }
575
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_probe
@ 2022-01-06 12:42 ` kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-01-06 12:42 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 12536 bytes --]
Hi Miaoqian,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on media-tree/master]
[also build test WARNING on v5.16-rc8 next-20220105]
[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/Miaoqian-Lin/media-atmel-atmel-isc-Fix-PM-disable-depth-imbalance-in-atmel_isc_probe/20220105-191228
base: git://linuxtv.org/media_tree.git master
config: riscv-randconfig-r002-20220106 (https://download.01.org/0day-ci/archive/20220106/202201062034.BD2L4uCe-lkp(a)intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project ca7ffe09dc6e525109e3cd570cc5182ce568be13)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/f116d8f81c642486900c9589a7c10d137d7eb0a2
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Miaoqian-Lin/media-atmel-atmel-isc-Fix-PM-disable-depth-imbalance-in-atmel_isc_probe/20220105-191228
git checkout f116d8f81c642486900c9589a7c10d137d7eb0a2
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash drivers/media/platform/atmel/ net/xfrm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from drivers/media/platform/atmel/atmel-sama5d2-isc.c:30:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:464:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __raw_readb(PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:477:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/media/platform/atmel/atmel-sama5d2-isc.c:30:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:490:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/media/platform/atmel/atmel-sama5d2-isc.c:30:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from ./arch/riscv/include/generated/asm/hardirq.h:1:
In file included from include/asm-generic/hardirq.h:17:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:136:
include/asm-generic/io.h:501:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writeb(value, PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:511:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:521:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
__raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
~~~~~~~~~~ ^
include/asm-generic/io.h:1024:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> drivers/media/platform/atmel/atmel-sama5d2-isc.c:562:1: warning: unused label 'disable_pm_runtime' [-Wunused-label]
disable_pm_runtime:
^~~~~~~~~~~~~~~~~~~
8 warnings generated.
vim +/disable_pm_runtime +562 drivers/media/platform/atmel/atmel-sama5d2-isc.c
380
381 static int atmel_isc_probe(struct platform_device *pdev)
382 {
383 struct device *dev = &pdev->dev;
384 struct isc_device *isc;
385 struct resource *res;
386 void __iomem *io_base;
387 struct isc_subdev_entity *subdev_entity;
388 int irq;
389 int ret;
390 u32 ver;
391
392 isc = devm_kzalloc(dev, sizeof(*isc), GFP_KERNEL);
393 if (!isc)
394 return -ENOMEM;
395
396 platform_set_drvdata(pdev, isc);
397 isc->dev = dev;
398
399 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
400 io_base = devm_ioremap_resource(dev, res);
401 if (IS_ERR(io_base))
402 return PTR_ERR(io_base);
403
404 isc->regmap = devm_regmap_init_mmio(dev, io_base, &isc_regmap_config);
405 if (IS_ERR(isc->regmap)) {
406 ret = PTR_ERR(isc->regmap);
407 dev_err(dev, "failed to init register map: %d\n", ret);
408 return ret;
409 }
410
411 irq = platform_get_irq(pdev, 0);
412 if (irq < 0)
413 return irq;
414
415 ret = devm_request_irq(dev, irq, isc_interrupt, 0,
416 "atmel-sama5d2-isc", isc);
417 if (ret < 0) {
418 dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
419 irq, ret);
420 return ret;
421 }
422
423 isc->gamma_table = isc_sama5d2_gamma_table;
424 isc->gamma_max = 2;
425
426 isc->max_width = ISC_SAMA5D2_MAX_SUPPORT_WIDTH;
427 isc->max_height = ISC_SAMA5D2_MAX_SUPPORT_HEIGHT;
428
429 isc->config_dpc = isc_sama5d2_config_dpc;
430 isc->config_csc = isc_sama5d2_config_csc;
431 isc->config_cbc = isc_sama5d2_config_cbc;
432 isc->config_cc = isc_sama5d2_config_cc;
433 isc->config_gam = isc_sama5d2_config_gam;
434 isc->config_rlp = isc_sama5d2_config_rlp;
435 isc->config_ctrls = isc_sama5d2_config_ctrls;
436
437 isc->adapt_pipeline = isc_sama5d2_adapt_pipeline;
438
439 isc->offsets.csc = ISC_SAMA5D2_CSC_OFFSET;
440 isc->offsets.cbc = ISC_SAMA5D2_CBC_OFFSET;
441 isc->offsets.sub422 = ISC_SAMA5D2_SUB422_OFFSET;
442 isc->offsets.sub420 = ISC_SAMA5D2_SUB420_OFFSET;
443 isc->offsets.rlp = ISC_SAMA5D2_RLP_OFFSET;
444 isc->offsets.his = ISC_SAMA5D2_HIS_OFFSET;
445 isc->offsets.dma = ISC_SAMA5D2_DMA_OFFSET;
446 isc->offsets.version = ISC_SAMA5D2_VERSION_OFFSET;
447 isc->offsets.his_entry = ISC_SAMA5D2_HIS_ENTRY_OFFSET;
448
449 isc->controller_formats = sama5d2_controller_formats;
450 isc->controller_formats_size = ARRAY_SIZE(sama5d2_controller_formats);
451 isc->formats_list = sama5d2_formats_list;
452 isc->formats_list_size = ARRAY_SIZE(sama5d2_formats_list);
453
454 /* sama5d2-isc - 8 bits per beat */
455 isc->dcfg = ISC_DCFG_YMBSIZE_BEATS8 | ISC_DCFG_CMBSIZE_BEATS8;
456
457 /* sama5d2-isc : ISPCK is required and mandatory */
458 isc->ispck_required = true;
459
460 ret = isc_pipeline_init(isc);
461 if (ret)
462 return ret;
463
464 isc->hclock = devm_clk_get(dev, "hclock");
465 if (IS_ERR(isc->hclock)) {
466 ret = PTR_ERR(isc->hclock);
467 dev_err(dev, "failed to get hclock: %d\n", ret);
468 return ret;
469 }
470
471 ret = clk_prepare_enable(isc->hclock);
472 if (ret) {
473 dev_err(dev, "failed to enable hclock: %d\n", ret);
474 return ret;
475 }
476
477 ret = isc_clk_init(isc);
478 if (ret) {
479 dev_err(dev, "failed to init isc clock: %d\n", ret);
480 goto unprepare_hclk;
481 }
482 ret = v4l2_device_register(dev, &isc->v4l2_dev);
483 if (ret) {
484 dev_err(dev, "unable to register v4l2 device.\n");
485 goto unprepare_clk;
486 }
487
488 ret = isc_parse_dt(dev, isc);
489 if (ret) {
490 dev_err(dev, "fail to parse device tree\n");
491 goto unregister_v4l2_device;
492 }
493
494 if (list_empty(&isc->subdev_entities)) {
495 dev_err(dev, "no subdev found\n");
496 ret = -ENODEV;
497 goto unregister_v4l2_device;
498 }
499
500 list_for_each_entry(subdev_entity, &isc->subdev_entities, list) {
501 struct v4l2_async_subdev *asd;
502 struct fwnode_handle *fwnode =
503 of_fwnode_handle(subdev_entity->epn);
504
505 v4l2_async_nf_init(&subdev_entity->notifier);
506
507 asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier,
508 fwnode,
509 struct v4l2_async_subdev);
510
511 of_node_put(subdev_entity->epn);
512 subdev_entity->epn = NULL;
513
514 if (IS_ERR(asd)) {
515 ret = PTR_ERR(asd);
516 goto cleanup_subdev;
517 }
518
519 subdev_entity->notifier.ops = &isc_async_ops;
520
521 ret = v4l2_async_nf_register(&isc->v4l2_dev,
522 &subdev_entity->notifier);
523 if (ret) {
524 dev_err(dev, "fail to register async notifier\n");
525 goto cleanup_subdev;
526 }
527
528 if (video_is_registered(&isc->video_dev))
529 break;
530 }
531
532 pm_runtime_set_active(dev);
533 pm_runtime_enable(dev);
534 pm_request_idle(dev);
535
536 isc->ispck = isc->isc_clks[ISC_ISPCK].clk;
537
538 ret = clk_prepare_enable(isc->ispck);
539 if (ret) {
540 dev_err(dev, "failed to enable ispck: %d\n", ret);
541 goto cleanup_subdev;
542 }
543
544 /* ispck should be greater or equal to hclock */
545 ret = clk_set_rate(isc->ispck, clk_get_rate(isc->hclock));
546 if (ret) {
547 dev_err(dev, "failed to set ispck rate: %d\n", ret);
548 goto unprepare_clk;
549 }
550
551 regmap_read(isc->regmap, ISC_VERSION + isc->offsets.version, &ver);
552 dev_info(dev, "Microchip ISC version %x\n", ver);
553
554 return 0;
555
556 unprepare_clk:
557 clk_disable_unprepare(isc->ispck);
558
559 cleanup_subdev:
560 isc_subdev_cleanup(isc);
561
> 562 disable_pm_runtime:
563 pm_runtime_disable(dev);
564
565 unregister_v4l2_device:
566 v4l2_device_unregister(&isc->v4l2_dev);
567
568 unprepare_hclk:
569 clk_disable_unprepare(isc->hclock);
570
571 isc_clk_cleanup(isc);
572
573 return ret;
574 }
575
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_probe
@ 2022-01-05 11:10 ` Miaoqian Lin
0 siblings, 0 replies; 6+ messages in thread
From: Miaoqian Lin @ 2022-01-05 11:10 UTC (permalink / raw)
Cc: linmq006, Eugen Hristev, Mauro Carvalho Chehab, Nicolas Ferre,
Alexandre Belloni, Ludovic Desroches, Hans Verkuil, linux-media,
linux-arm-kernel, linux-kernel
The pm_runtime_enable will increase power disable depth.
If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().
Fixes: 0a0e265 ("media: atmel: atmel-isc: split driver into driver base and isc")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
drivers/media/platform/atmel/atmel-sama5d2-isc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
index 1b2063cce0f7..88a81c3ada90 100644
--- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
+++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
@@ -559,6 +559,9 @@ static int atmel_isc_probe(struct platform_device *pdev)
cleanup_subdev:
isc_subdev_cleanup(isc);
+disable_pm_runtime:
+ pm_runtime_disable(dev);
+
unregister_v4l2_device:
v4l2_device_unregister(&isc->v4l2_dev);
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_probe
@ 2022-01-05 11:10 ` Miaoqian Lin
0 siblings, 0 replies; 6+ messages in thread
From: Miaoqian Lin @ 2022-01-05 11:10 UTC (permalink / raw)
Cc: linmq006, Alexandre Belloni, linux-kernel, Ludovic Desroches,
Hans Verkuil, Eugen Hristev, Mauro Carvalho Chehab,
linux-arm-kernel, linux-media
The pm_runtime_enable will increase power disable depth.
If the probe fails, we should use pm_runtime_disable() to balance
pm_runtime_enable().
Fixes: 0a0e265 ("media: atmel: atmel-isc: split driver into driver base and isc")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
drivers/media/platform/atmel/atmel-sama5d2-isc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
index 1b2063cce0f7..88a81c3ada90 100644
--- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
+++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
@@ -559,6 +559,9 @@ static int atmel_isc_probe(struct platform_device *pdev)
cleanup_subdev:
isc_subdev_cleanup(isc);
+disable_pm_runtime:
+ pm_runtime_disable(dev);
+
unregister_v4l2_device:
v4l2_device_unregister(&isc->v4l2_dev);
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-01-06 12:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-05 18:52 [PATCH] media: atmel: atmel-isc: Fix PM disable depth imbalance in atmel_isc_probe kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-01-05 11:10 Miaoqian Lin
2022-01-05 11:10 ` Miaoqian Lin
2022-01-06 12:42 ` kernel test robot
2022-01-06 12:42 ` kernel test robot
2022-01-06 12:42 ` kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.