[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 dan.carpenter at oracle.com
Wed Mar 3 05:31:47 GMT 2021


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
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 at intel.com>
Reported-by: Dan Carpenter <dan.carpenter at 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   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");

disable unprepare the clock?

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  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 34551 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210303/23033919/attachment-0001.gz>


More information about the linux-arm-kernel mailing list