lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 16 Oct 2021 12:29:21 +0800
From:   kernel test robot <lkp@...el.com>
To:     Alvin Šipraga <alvin@...s.dk>,
        Linus Walleij <linus.walleij@...aro.org>,
        Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Heiner Kallweit <hkallweit1@...il.com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        netdev@...r.kernel.org
Subject: Re: [PATCH v3 net-next 6/7] net: dsa: realtek-smi: add rtl8365mb
 subdriver for RTL8365MB-VC

Hi "Alvin,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Alvin-ipraga/net-dsa-add-support-for-RTL8365MB-VC/20211016-011352
base:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 295711fa8fec42a55623bf6997d05a21d7855132
config: i386-randconfig-a005-20211015 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a49f5386ce6b091da66ea7c3a1d9a588d53becf7)
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
        # https://github.com/0day-ci/linux/commit/94c375779207a23a0a8731a4cc3b29338f91cb32
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alvin-ipraga/net-dsa-add-support-for-RTL8365MB-VC/20211016-011352
        git checkout 94c375779207a23a0a8731a4cc3b29338f91cb32
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/net/dsa/rtl8365mb.c:1597:24: warning: variable 'irq' is uninitialized when used here [-Wuninitialized]
                   irq_set_parent(virq, irq);
                                        ^~~
   drivers/net/dsa/rtl8365mb.c:1569:9: note: initialize the variable 'irq' to silence this warning
           int irq;
                  ^
                   = 0
   1 warning generated.


vim +/irq +1597 drivers/net/dsa/rtl8365mb.c

  1562	
  1563	static int rtl8365mb_irq_setup(struct realtek_smi *smi)
  1564	{
  1565		struct rtl8365mb *mb = smi->chip_data;
  1566		struct device_node *intc;
  1567		u32 irq_trig;
  1568		int virq;
  1569		int irq;
  1570		u32 val;
  1571		int ret;
  1572		int i;
  1573	
  1574		intc = of_get_child_by_name(smi->dev->of_node, "interrupt-controller");
  1575		if (!intc) {
  1576			dev_err(smi->dev, "missing child interrupt-controller node\n");
  1577			return -EINVAL;
  1578		}
  1579	
  1580		smi->irqdomain = irq_domain_add_linear(intc, smi->num_ports,
  1581						       &rtl8365mb_irqdomain_ops, smi);
  1582		if (!smi->irqdomain) {
  1583			dev_err(smi->dev, "failed to add irq domain\n");
  1584			ret = -ENOMEM;
  1585			goto out_put_node;
  1586		}
  1587	
  1588		for (i = 0; i < smi->num_ports; i++) {
  1589			virq = irq_create_mapping(smi->irqdomain, i);
  1590			if (!virq) {
  1591				dev_err(smi->dev,
  1592					"failed to create irq domain mapping\n");
  1593				ret = -EINVAL;
  1594				goto out_remove_irqdomain;
  1595			}
  1596	
> 1597			irq_set_parent(virq, irq);
  1598		}
  1599	
  1600		/* rtl8365mb IRQs cascade off this one */
  1601		irq = of_irq_get(intc, 0);
  1602		if (irq <= 0) {
  1603			if (irq != -EPROBE_DEFER)
  1604				dev_err(smi->dev, "failed to get parent irq: %d\n",
  1605					irq);
  1606			ret = irq ? irq : -EINVAL;
  1607			goto out_remove_irqdomain;
  1608		}
  1609	
  1610		/* Configure chip interrupt signal polarity */
  1611		irq_trig = irqd_get_trigger_type(irq_get_irq_data(irq));
  1612		switch (irq_trig) {
  1613		case IRQF_TRIGGER_RISING:
  1614		case IRQF_TRIGGER_HIGH:
  1615			val = RTL8365MB_INTR_POLARITY_HIGH;
  1616			break;
  1617		case IRQF_TRIGGER_FALLING:
  1618		case IRQF_TRIGGER_LOW:
  1619			val = RTL8365MB_INTR_POLARITY_LOW;
  1620			break;
  1621		default:
  1622			dev_err(smi->dev, "unsupported irq trigger type %u\n",
  1623				irq_trig);
  1624			ret = -EINVAL;
  1625			goto out_remove_irqdomain;
  1626		}
  1627	
  1628		ret = regmap_update_bits(smi->map, RTL8365MB_INTR_POLARITY_REG,
  1629					 RTL8365MB_INTR_POLARITY_MASK,
  1630					 FIELD_PREP(RTL8365MB_INTR_POLARITY_MASK, val));
  1631		if (ret)
  1632			goto out_remove_irqdomain;
  1633	
  1634		/* Disable the interrupt in case the chip has it enabled on reset */
  1635		ret = rtl8365mb_irq_disable(smi);
  1636		if (ret)
  1637			goto out_remove_irqdomain;
  1638	
  1639		/* Clear the interrupt status register */
  1640		ret = regmap_write(smi->map, RTL8365MB_INTR_STATUS_REG,
  1641				   RTL8365MB_INTR_ALL_MASK);
  1642		if (ret)
  1643			goto out_remove_irqdomain;
  1644	
  1645		ret = request_threaded_irq(irq, NULL, rtl8365mb_irq, IRQF_ONESHOT,
  1646					   "rtl8365mb", smi);
  1647		if (ret) {
  1648			dev_err(smi->dev, "failed to request irq: %d\n", ret);
  1649			goto out_remove_irqdomain;
  1650		}
  1651	
  1652		/* Store the irq so that we know to free it during teardown */
  1653		mb->irq = irq;
  1654	
  1655		ret = rtl8365mb_irq_enable(smi);
  1656		if (ret)
  1657			goto out_free_irq;
  1658	
  1659		of_node_put(intc);
  1660	
  1661		return 0;
  1662	
  1663	out_free_irq:
  1664		free_irq(mb->irq, smi);
  1665		mb->irq = 0;
  1666	
  1667	out_remove_irqdomain:
  1668		for (i = 0; i < smi->num_ports; i++) {
  1669			virq = irq_find_mapping(smi->irqdomain, i);
  1670			irq_dispose_mapping(virq);
  1671		}
  1672	
  1673		irq_domain_remove(smi->irqdomain);
  1674		smi->irqdomain = NULL;
  1675	
  1676	out_put_node:
  1677		of_node_put(intc);
  1678	
  1679		return ret;
  1680	}
  1681	

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

Download attachment ".config.gz" of type "application/gzip" (35235 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ