All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [xlnx:xlnx_rebase_v5.4 1296/1699] drivers/soc/xilinx/xlnx_vcu_core.c:120 xvcu_core_probe() warn: 'xvcu->aclk' not released on lines: 88.
Date: Wed, 03 Mar 2021 00:05:42 +0800	[thread overview]
Message-ID: <202103030041.hmgXFX45-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 8573 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-arm-kernel(a)lists.infradead.org
TO: Vishal Sagar <vishal.sagar@xilinx.com>
CC: Michal Simek <monstr@monstr.eu>
CC: Hyun Kwon <hyun.kwon@xilinx.com>

Hi Vishal,

First bad commit (maybe != root cause):

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head:   700725af75ecddb674ccadf3f6d06b9bd5df79a5
commit: 0b197959bbbdb68e1da974bd013339f08704b178 [1296/1699] staging: xlnxsync: Fix the uapi header license
:::::: branch date: 4 hours ago
:::::: commit date: 10 months ago
config: x86_64-randconfig-m001-20210302 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/soc/xilinx/xlnx_vcu_core.c:120 xvcu_core_probe() warn: 'xvcu->aclk' not released on lines: 88.
drivers/usb/dwc3/gadget.c:2140 dwc3_gadget_start() warn: 'irq' not released on lines: 2140.
drivers/usb/dwc3/gadget_hibernation.c:368 gadget_hibernation_interrupt() warn: inconsistent indenting
drivers/gpio/gpio-xilinx.c:698 xgpio_of_probe() warn: missing error code 'status'

vim +120 drivers/soc/xilinx/xlnx_vcu_core.c

461f3f52ff70cf Rajan Vaja  2020-01-13   27  
461f3f52ff70cf Rajan Vaja  2020-01-13   28  static int xvcu_core_probe(struct platform_device *pdev)
461f3f52ff70cf Rajan Vaja  2020-01-13   29  {
461f3f52ff70cf Rajan Vaja  2020-01-13   30  	struct xvcu_device *xvcu;
461f3f52ff70cf Rajan Vaja  2020-01-13   31  	struct resource *res;
461f3f52ff70cf Rajan Vaja  2020-01-13   32  	int ret;
461f3f52ff70cf Rajan Vaja  2020-01-13   33  
461f3f52ff70cf Rajan Vaja  2020-01-13   34  	xvcu = devm_kzalloc(&pdev->dev, sizeof(*xvcu), GFP_KERNEL);
461f3f52ff70cf Rajan Vaja  2020-01-13   35  	if (!xvcu)
461f3f52ff70cf Rajan Vaja  2020-01-13   36  		return -ENOMEM;
461f3f52ff70cf Rajan Vaja  2020-01-13   37  
461f3f52ff70cf Rajan Vaja  2020-01-13   38  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vcu_slcr");
461f3f52ff70cf Rajan Vaja  2020-01-13   39  	if (!res) {
461f3f52ff70cf Rajan Vaja  2020-01-13   40  		dev_err(&pdev->dev, "get vcu_slcr memory resource failed.\n");
461f3f52ff70cf Rajan Vaja  2020-01-13   41  		return -ENODEV;
461f3f52ff70cf Rajan Vaja  2020-01-13   42  	}
461f3f52ff70cf Rajan Vaja  2020-01-13   43  
461f3f52ff70cf Rajan Vaja  2020-01-13   44  	xvcu->vcu_slcr_ba = devm_ioremap_nocache(&pdev->dev, res->start,
461f3f52ff70cf Rajan Vaja  2020-01-13   45  						 resource_size(res));
461f3f52ff70cf Rajan Vaja  2020-01-13   46  	if (!xvcu->vcu_slcr_ba) {
461f3f52ff70cf Rajan Vaja  2020-01-13   47  		dev_err(&pdev->dev, "vcu_slcr register mapping failed.\n");
461f3f52ff70cf Rajan Vaja  2020-01-13   48  		return -ENOMEM;
461f3f52ff70cf Rajan Vaja  2020-01-13   49  	}
461f3f52ff70cf Rajan Vaja  2020-01-13   50  
461f3f52ff70cf Rajan Vaja  2020-01-13   51  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "logicore");
461f3f52ff70cf Rajan Vaja  2020-01-13   52  	if (!res) {
461f3f52ff70cf Rajan Vaja  2020-01-13   53  		dev_err(&pdev->dev, "get logicore memory resource failed.\n");
461f3f52ff70cf Rajan Vaja  2020-01-13   54  		return -ENODEV;
461f3f52ff70cf Rajan Vaja  2020-01-13   55  	}
461f3f52ff70cf Rajan Vaja  2020-01-13   56  
461f3f52ff70cf Rajan Vaja  2020-01-13   57  	xvcu->logicore_reg_ba = devm_ioremap_nocache(&pdev->dev, res->start,
461f3f52ff70cf Rajan Vaja  2020-01-13   58  						     resource_size(res));
461f3f52ff70cf Rajan Vaja  2020-01-13   59  	if (!xvcu->logicore_reg_ba) {
461f3f52ff70cf Rajan Vaja  2020-01-13   60  		dev_err(&pdev->dev, "logicore register mapping failed.\n");
461f3f52ff70cf Rajan Vaja  2020-01-13   61  		return -ENOMEM;
461f3f52ff70cf Rajan Vaja  2020-01-13   62  	}
461f3f52ff70cf Rajan Vaja  2020-01-13   63  
461f3f52ff70cf Rajan Vaja  2020-01-13   64  	dev_set_drvdata(&pdev->dev, xvcu);
461f3f52ff70cf Rajan Vaja  2020-01-13   65  
461f3f52ff70cf Rajan Vaja  2020-01-13   66  	xvcu->aclk = devm_clk_get(&pdev->dev, "aclk");
461f3f52ff70cf Rajan Vaja  2020-01-13   67  	if (IS_ERR(xvcu->aclk)) {
461f3f52ff70cf Rajan Vaja  2020-01-13   68  		dev_err(&pdev->dev, "Could not get aclk clock\n");
461f3f52ff70cf Rajan Vaja  2020-01-13   69  		return PTR_ERR(xvcu->aclk);
461f3f52ff70cf Rajan Vaja  2020-01-13   70  	}
461f3f52ff70cf Rajan Vaja  2020-01-13   71  
461f3f52ff70cf Rajan Vaja  2020-01-13   72  	ret = clk_prepare_enable(xvcu->aclk);
461f3f52ff70cf Rajan Vaja  2020-01-13   73  	if (ret) {
461f3f52ff70cf Rajan Vaja  2020-01-13   74  		dev_err(&pdev->dev, "aclk clock enable failed\n");
461f3f52ff70cf Rajan Vaja  2020-01-13   75  		return ret;
461f3f52ff70cf Rajan Vaja  2020-01-13   76  	}
461f3f52ff70cf Rajan Vaja  2020-01-13   77  
461f3f52ff70cf Rajan Vaja  2020-01-13   78  	/*
461f3f52ff70cf Rajan Vaja  2020-01-13   79  	 * Do the Gasket isolation and put the VCU out of reset
461f3f52ff70cf Rajan Vaja  2020-01-13   80  	 * Bit 0 : Gasket isolation
461f3f52ff70cf Rajan Vaja  2020-01-13   81  	 * Bit 1 : put VCU out of reset
461f3f52ff70cf Rajan Vaja  2020-01-13   82  	 */
09ffb01764320a Dhaval Shah 2020-01-13   83  	xvcu->reset_gpio = devm_gpiod_get_optional(&pdev->dev, "reset",
09ffb01764320a Dhaval Shah 2020-01-13   84  						   GPIOD_OUT_LOW);
09ffb01764320a Dhaval Shah 2020-01-13   85  	if (IS_ERR(xvcu->reset_gpio)) {
09ffb01764320a Dhaval Shah 2020-01-13   86  		ret = PTR_ERR(xvcu->reset_gpio);
09ffb01764320a Dhaval Shah 2020-01-13   87  		dev_err(&pdev->dev, "failed to get reset gpio for vcu.\n");
09ffb01764320a Dhaval Shah 2020-01-13   88  		return ret;
09ffb01764320a Dhaval Shah 2020-01-13   89  	}
09ffb01764320a Dhaval Shah 2020-01-13   90  
09ffb01764320a Dhaval Shah 2020-01-13   91  	if (xvcu->reset_gpio) {
09ffb01764320a Dhaval Shah 2020-01-13   92  		gpiod_set_value(xvcu->reset_gpio, 0);
09ffb01764320a Dhaval Shah 2020-01-13   93  		/* min 2 clock cycle of vcu pll_ref, slowest freq is 33.33KHz */
09ffb01764320a Dhaval Shah 2020-01-13   94  		usleep_range(60, 120);
09ffb01764320a Dhaval Shah 2020-01-13   95  		gpiod_set_value(xvcu->reset_gpio, 1);
09ffb01764320a Dhaval Shah 2020-01-13   96  		usleep_range(60, 120);
09ffb01764320a Dhaval Shah 2020-01-13   97  	} else {
09ffb01764320a Dhaval Shah 2020-01-13   98  		dev_warn(&pdev->dev, "No reset gpio info from dts for vcu. This may lead to incorrect functionality if VCU isolation is removed post initialization.\n");
09ffb01764320a Dhaval Shah 2020-01-13   99  	}
09ffb01764320a Dhaval Shah 2020-01-13  100  
461f3f52ff70cf Rajan Vaja  2020-01-13  101  	iowrite32(VCU_GASKET_VALUE, xvcu->logicore_reg_ba + VCU_GASKET_INIT);
461f3f52ff70cf Rajan Vaja  2020-01-13  102  
461f3f52ff70cf Rajan Vaja  2020-01-13  103  	ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, xvcu_devs,
461f3f52ff70cf Rajan Vaja  2020-01-13  104  			      ARRAY_SIZE(xvcu_devs), NULL, 0, NULL);
461f3f52ff70cf Rajan Vaja  2020-01-13  105  	if (ret) {
461f3f52ff70cf Rajan Vaja  2020-01-13  106  		dev_err(&pdev->dev, "failed to add MFD devices %d\n", ret);
461f3f52ff70cf Rajan Vaja  2020-01-13  107  		goto err_mfd_add_devices;
461f3f52ff70cf Rajan Vaja  2020-01-13  108  	}
461f3f52ff70cf Rajan Vaja  2020-01-13  109  
461f3f52ff70cf Rajan Vaja  2020-01-13  110  	dev_dbg(&pdev->dev, "Successfully added MFD devices\n");
461f3f52ff70cf Rajan Vaja  2020-01-13  111  
461f3f52ff70cf Rajan Vaja  2020-01-13  112  	return 0;
461f3f52ff70cf Rajan Vaja  2020-01-13  113  
461f3f52ff70cf Rajan Vaja  2020-01-13  114  err_mfd_add_devices:
461f3f52ff70cf Rajan Vaja  2020-01-13  115  	/* Add the the Gasket isolation and put the VCU in reset. */
461f3f52ff70cf Rajan Vaja  2020-01-13  116  	iowrite32(0, xvcu->logicore_reg_ba + VCU_GASKET_INIT);
461f3f52ff70cf Rajan Vaja  2020-01-13  117  
461f3f52ff70cf Rajan Vaja  2020-01-13  118  	clk_disable_unprepare(xvcu->aclk);
461f3f52ff70cf Rajan Vaja  2020-01-13  119  
461f3f52ff70cf Rajan Vaja  2020-01-13 @120  	return ret;
461f3f52ff70cf Rajan Vaja  2020-01-13  121  }
461f3f52ff70cf Rajan Vaja  2020-01-13  122  

:::::: The code at line 120 was first introduced by commit
:::::: 461f3f52ff70cfdf0f6c8595d327989015b47770 soc: xilinx: vcu: Add VCU MFD core driver

:::::: TO: Rajan Vaja <rajan.vaja@xilinx.com>
:::::: CC: Michal Simek <michal.simek@xilinx.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 34551 bytes --]

             reply	other threads:[~2021-03-02 16:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 16:05 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-03-03  5:31 [xlnx:xlnx_rebase_v5.4 1296/1699] drivers/soc/xilinx/xlnx_vcu_core.c:120 xvcu_core_probe() warn: 'xvcu->aclk' not released on lines: 88 Dan Carpenter
2021-03-03  5:31 ` Dan Carpenter
2021-03-03  5:31 ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202103030041.hmgXFX45-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.