tree:
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.4.y
head: 1770371bdb34438b6bb83c2a1c90f939c8f9d6ab
commit: c1a632fc83e364aa8fd82e949b47b36db64523c5 [2283/9316] remoteproc: add
infrastructure support to allow pre-loaded remoteprocs
config: x86_64-randconfig-m001-20200816 (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(a)intel.com>
New smatch warnings:
drivers/remoteproc/remoteproc_core.c:1879 rproc_boot() error: uninitialized symbol
'firmware_p'.
Old smatch warnings:
drivers/remoteproc/remoteproc_core.c:1671 rproc_coredump() warn: is 'data' large
enough for 'struct elf32_hdr'? 1
git remote add ti
git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-rt-linux-5.4.y
git checkout c1a632fc83e364aa8fd82e949b47b36db64523c5
vim +/firmware_p +1879 drivers/remoteproc/remoteproc_core.c
87775487f5e8475 Suman Anna 2018-01-15 1825
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1826 /**
1b0ef9068f053d8 Suman Anna 2017-07-20 1827 * rproc_boot() - boot a remote
processor
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1828 * @rproc: handle of a remote
processor
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1829 *
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1830 * Boot a remote processor (i.e. load
its firmware, power it on, ...).
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1831 *
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1832 * If the remote processor is already
powered on, this function immediately
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1833 * returns (successfully).
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1834 *
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1835 * Returns 0 on success, and an
appropriate error value otherwise.
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1836 */
1b0ef9068f053d8 Suman Anna 2017-07-20 1837 int rproc_boot(struct rproc *rproc)
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1838 {
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1839 const struct firmware *firmware_p;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1840 struct device *dev;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1841 int ret;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1842
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1843 if (!rproc) {
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1844 pr_err("invalid rproc
handle\n");
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1845 return -EINVAL;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1846 }
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1847
b5ab5e24e960b9f Ohad Ben-Cohen 2012-05-30 1848 dev = &rproc->dev;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1849
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1850 ret =
mutex_lock_interruptible(&rproc->lock);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1851 if (ret) {
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1852 dev_err(dev, "can't lock
rproc %s: %d\n", rproc->name, ret);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1853 return ret;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1854 }
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1855
2099c77d4af7d15 Sarangdhar Joshi 2017-01-23 1856 if (rproc->state == RPROC_DELETED)
{
2099c77d4af7d15 Sarangdhar Joshi 2017-01-23 1857 ret = -ENODEV;
2099c77d4af7d15 Sarangdhar Joshi 2017-01-23 1858 dev_err(dev, "can't boot
deleted rproc %s\n", rproc->name);
2099c77d4af7d15 Sarangdhar Joshi 2017-01-23 1859 goto unlock_mutex;
2099c77d4af7d15 Sarangdhar Joshi 2017-01-23 1860 }
2099c77d4af7d15 Sarangdhar Joshi 2017-01-23 1861
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1862 /* skip the boot process if rproc is
already powered up */
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1863 if
(atomic_inc_return(&rproc->power) > 1) {
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1864 ret = 0;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1865 goto unlock_mutex;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1866 }
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1867
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1868 dev_info(dev, "powering up
%s\n", rproc->name);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1869
c1a632fc83e364a Suman Anna 2018-10-08 1870 if (!rproc->skip_firmware_request)
{
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1871 /* load firmware */
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1872 ret =
request_firmware(&firmware_p, rproc->firmware, dev);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1873 if (ret < 0) {
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1874 dev_err(dev, "request_firmware
failed: %d\n", ret);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1875 goto downref_rproc;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1876 }
c1a632fc83e364a Suman Anna 2018-10-08 1877 }
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1878
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 @1879 ret = rproc_fw_boot(rproc,
firmware_p);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1880
c1a632fc83e364a Suman Anna 2018-10-08 1881 if (!rproc->skip_firmware_request)
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1882 release_firmware(firmware_p);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1883
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1884 downref_rproc:
fbb6aacb078285f Bjorn Andersson 2016-10-02 1885 if (ret)
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1886 atomic_dec(&rproc->power);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1887 unlock_mutex:
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1888 mutex_unlock(&rproc->lock);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1889 return ret;
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1890 }
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1891 EXPORT_SYMBOL(rproc_boot);
400e64df6b237eb Ohad Ben-Cohen 2011-10-20 1892
:::::: The code at line 1879 was first introduced by commit
:::::: 400e64df6b237eb36b127efd72000a2794f9eec1 remoteproc: add framework for controlling
remote processors
:::::: TO: Ohad Ben-Cohen <ohad(a)wizery.com>
:::::: CC: Ohad Ben-Cohen <ohad(a)wizery.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org