From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev,
Yang Xiwen via B4 Relay
<devnull+forbidden405.outlook.com@kernel.org>,
Yisen Zhuang <yisen.zhuang@huawei.com>,
Salil Mehta <salil.mehta@huawei.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Yang Xiwen <forbidden405@foxmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH 1/6] net: hisilicon: add support for hisi_femac core on Hi3798MV200
Date: Mon, 26 Feb 2024 12:13:22 +0300 [thread overview]
Message-ID: <8af83663-e7d9-4a18-833f-a32df97b96e7@moroto.mountain> (raw)
In-Reply-To: <20240216-net-v1-1-e0ad972cda99@outlook.com>
Hi Yang,
kernel test robot noticed the following build warnings:
url: https://github.com/intel-lab-lkp/linux/commits/Yang-Xiwen-via-B4-Relay/net-hisilicon-add-support-for-hisi_femac-core-on-Hi3798MV200/20240216-075015
base: 8d3dea210042f54b952b481838c1e7dfc4ec751d
patch link: https://lore.kernel.org/r/20240216-net-v1-1-e0ad972cda99%40outlook.com
patch subject: [PATCH 1/6] net: hisilicon: add support for hisi_femac core on Hi3798MV200
config: arm-randconfig-r081-20240223 (https://download.01.org/0day-ci/archive/20240224/202402242354.leEII4M9-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project edd4aee4dd9b5b98b2576a6f783e4086173d902a)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202402242354.leEII4M9-lkp@intel.com/
smatch warnings:
drivers/net/ethernet/hisilicon/hisi_femac.c:931 hisi_femac_drv_probe() error: uninitialized symbol 'ret'.
vim +/ret +931 drivers/net/ethernet/hisilicon/hisi_femac.c
542ae60af24f02 Dongpo Li 2016-07-15 786 static int hisi_femac_drv_probe(struct platform_device *pdev)
542ae60af24f02 Dongpo Li 2016-07-15 787 {
542ae60af24f02 Dongpo Li 2016-07-15 788 struct device *dev = &pdev->dev;
3c2c758a1607ea Yang Xiwen 2024-02-16 789 struct device_node *node = dev->of_node, *mdio_np;
542ae60af24f02 Dongpo Li 2016-07-15 790 struct net_device *ndev;
542ae60af24f02 Dongpo Li 2016-07-15 791 struct hisi_femac_priv *priv;
542ae60af24f02 Dongpo Li 2016-07-15 792 struct phy_device *phy;
3c2c758a1607ea Yang Xiwen 2024-02-16 793 int ret, i;
3c2c758a1607ea Yang Xiwen 2024-02-16 794 bool mdio_registered = false;
3c2c758a1607ea Yang Xiwen 2024-02-16 795 static const char * const clk_strs[] = {
3c2c758a1607ea Yang Xiwen 2024-02-16 796 [CLK_MAC] = "mac",
3c2c758a1607ea Yang Xiwen 2024-02-16 797 [CLK_BUS] = "bus",
3c2c758a1607ea Yang Xiwen 2024-02-16 798 [CLK_PHY] = "phy",
3c2c758a1607ea Yang Xiwen 2024-02-16 799 };
542ae60af24f02 Dongpo Li 2016-07-15 800
542ae60af24f02 Dongpo Li 2016-07-15 801 ndev = alloc_etherdev(sizeof(*priv));
542ae60af24f02 Dongpo Li 2016-07-15 802 if (!ndev)
542ae60af24f02 Dongpo Li 2016-07-15 803 return -ENOMEM;
542ae60af24f02 Dongpo Li 2016-07-15 804
542ae60af24f02 Dongpo Li 2016-07-15 805 platform_set_drvdata(pdev, ndev);
2087d421a5a1af Dongpo Li 2016-12-12 806 SET_NETDEV_DEV(ndev, &pdev->dev);
542ae60af24f02 Dongpo Li 2016-07-15 807
542ae60af24f02 Dongpo Li 2016-07-15 808 priv = netdev_priv(ndev);
542ae60af24f02 Dongpo Li 2016-07-15 809 priv->dev = dev;
542ae60af24f02 Dongpo Li 2016-07-15 810 priv->ndev = ndev;
542ae60af24f02 Dongpo Li 2016-07-15 811
56170ba3bd9098 Jiangfeng Xiao 2019-07-12 812 priv->port_base = devm_platform_ioremap_resource(pdev, 0);
542ae60af24f02 Dongpo Li 2016-07-15 813 if (IS_ERR(priv->port_base)) {
542ae60af24f02 Dongpo Li 2016-07-15 814 ret = PTR_ERR(priv->port_base);
542ae60af24f02 Dongpo Li 2016-07-15 815 goto out_free_netdev;
542ae60af24f02 Dongpo Li 2016-07-15 816 }
542ae60af24f02 Dongpo Li 2016-07-15 817
56170ba3bd9098 Jiangfeng Xiao 2019-07-12 818 priv->glb_base = devm_platform_ioremap_resource(pdev, 1);
542ae60af24f02 Dongpo Li 2016-07-15 819 if (IS_ERR(priv->glb_base)) {
542ae60af24f02 Dongpo Li 2016-07-15 820 ret = PTR_ERR(priv->glb_base);
542ae60af24f02 Dongpo Li 2016-07-15 821 goto out_free_netdev;
542ae60af24f02 Dongpo Li 2016-07-15 822 }
542ae60af24f02 Dongpo Li 2016-07-15 823
3c2c758a1607ea Yang Xiwen 2024-02-16 824 for (i = 0; i < CLK_NUM; i++) {
3c2c758a1607ea Yang Xiwen 2024-02-16 825 priv->clks[i] = devm_clk_get_enabled(&pdev->dev, clk_strs[i]);
3c2c758a1607ea Yang Xiwen 2024-02-16 826 if (IS_ERR(priv->clks[i])) {
3c2c758a1607ea Yang Xiwen 2024-02-16 827 dev_err(dev, "failed to get enabled clk %s: %ld\n", clk_strs[i],
3c2c758a1607ea Yang Xiwen 2024-02-16 828 PTR_ERR(priv->clks[i]));
542ae60af24f02 Dongpo Li 2016-07-15 829 ret = -ENODEV;
542ae60af24f02 Dongpo Li 2016-07-15 830 goto out_free_netdev;
542ae60af24f02 Dongpo Li 2016-07-15 831 }
542ae60af24f02 Dongpo Li 2016-07-15 832 }
542ae60af24f02 Dongpo Li 2016-07-15 833
542ae60af24f02 Dongpo Li 2016-07-15 834 priv->mac_rst = devm_reset_control_get(dev, "mac");
542ae60af24f02 Dongpo Li 2016-07-15 835 if (IS_ERR(priv->mac_rst)) {
542ae60af24f02 Dongpo Li 2016-07-15 836 ret = PTR_ERR(priv->mac_rst);
3c2c758a1607ea Yang Xiwen 2024-02-16 837 goto out_free_netdev;
542ae60af24f02 Dongpo Li 2016-07-15 838 }
542ae60af24f02 Dongpo Li 2016-07-15 839 hisi_femac_core_reset(priv);
542ae60af24f02 Dongpo Li 2016-07-15 840
542ae60af24f02 Dongpo Li 2016-07-15 841 priv->phy_rst = devm_reset_control_get(dev, "phy");
542ae60af24f02 Dongpo Li 2016-07-15 842 if (IS_ERR(priv->phy_rst)) {
542ae60af24f02 Dongpo Li 2016-07-15 843 priv->phy_rst = NULL;
542ae60af24f02 Dongpo Li 2016-07-15 844 } else {
542ae60af24f02 Dongpo Li 2016-07-15 845 ret = of_property_read_u32_array(node,
542ae60af24f02 Dongpo Li 2016-07-15 846 PHY_RESET_DELAYS_PROPERTY,
542ae60af24f02 Dongpo Li 2016-07-15 847 priv->phy_reset_delays,
542ae60af24f02 Dongpo Li 2016-07-15 848 DELAYS_NUM);
542ae60af24f02 Dongpo Li 2016-07-15 849 if (ret)
3c2c758a1607ea Yang Xiwen 2024-02-16 850 goto out_free_netdev;
542ae60af24f02 Dongpo Li 2016-07-15 851 hisi_femac_phy_reset(priv);
542ae60af24f02 Dongpo Li 2016-07-15 852 }
542ae60af24f02 Dongpo Li 2016-07-15 853
3c2c758a1607ea Yang Xiwen 2024-02-16 854 // Register the optional MDIO bus
3c2c758a1607ea Yang Xiwen 2024-02-16 855 for_each_available_child_of_node(node, mdio_np) {
3c2c758a1607ea Yang Xiwen 2024-02-16 856 if (of_node_name_prefix(mdio_np, "mdio")) {
3c2c758a1607ea Yang Xiwen 2024-02-16 857 priv->mdio_pdev = of_platform_device_create(mdio_np, NULL, dev);
3c2c758a1607ea Yang Xiwen 2024-02-16 858 of_node_put(mdio_np);
3c2c758a1607ea Yang Xiwen 2024-02-16 859 if (!priv->mdio_pdev) {
3c2c758a1607ea Yang Xiwen 2024-02-16 860 dev_err(dev, "failed to register MDIO bus device\n");
ret = -ENOMEM;
3c2c758a1607ea Yang Xiwen 2024-02-16 861 goto out_free_netdev;
3c2c758a1607ea Yang Xiwen 2024-02-16 862 }
3c2c758a1607ea Yang Xiwen 2024-02-16 863 mdio_registered = true;
3c2c758a1607ea Yang Xiwen 2024-02-16 864 break;
3c2c758a1607ea Yang Xiwen 2024-02-16 865 }
3c2c758a1607ea Yang Xiwen 2024-02-16 866 }
3c2c758a1607ea Yang Xiwen 2024-02-16 867
3c2c758a1607ea Yang Xiwen 2024-02-16 868 if (!mdio_registered)
3c2c758a1607ea Yang Xiwen 2024-02-16 869 dev_warn(dev, "MDIO subnode notfound. This is usually a bug.\n");
3c2c758a1607ea Yang Xiwen 2024-02-16 870
542ae60af24f02 Dongpo Li 2016-07-15 871 phy = of_phy_get_and_connect(ndev, node, hisi_femac_adjust_link);
542ae60af24f02 Dongpo Li 2016-07-15 872 if (!phy) {
542ae60af24f02 Dongpo Li 2016-07-15 873 dev_err(dev, "connect to PHY failed!\n");
542ae60af24f02 Dongpo Li 2016-07-15 874 ret = -ENODEV;
3c2c758a1607ea Yang Xiwen 2024-02-16 875 goto out_unregister_mdio_bus;
542ae60af24f02 Dongpo Li 2016-07-15 876 }
542ae60af24f02 Dongpo Li 2016-07-15 877
542ae60af24f02 Dongpo Li 2016-07-15 878 phy_attached_print(phy, "phy_id=0x%.8lx, phy_mode=%s\n",
542ae60af24f02 Dongpo Li 2016-07-15 879 (unsigned long)phy->phy_id,
542ae60af24f02 Dongpo Li 2016-07-15 880 phy_modes(phy->interface));
542ae60af24f02 Dongpo Li 2016-07-15 881
9ca01b25dffffe Jakub Kicinski 2021-10-06 882 ret = of_get_ethdev_address(node, ndev);
83216e3988cd19 Michael Walle 2021-04-12 883 if (ret) {
542ae60af24f02 Dongpo Li 2016-07-15 884 eth_hw_addr_random(ndev);
542ae60af24f02 Dongpo Li 2016-07-15 885 dev_warn(dev, "using random MAC address %pM\n",
542ae60af24f02 Dongpo Li 2016-07-15 886 ndev->dev_addr);
542ae60af24f02 Dongpo Li 2016-07-15 887 }
542ae60af24f02 Dongpo Li 2016-07-15 888
542ae60af24f02 Dongpo Li 2016-07-15 889 ndev->watchdog_timeo = 6 * HZ;
542ae60af24f02 Dongpo Li 2016-07-15 890 ndev->priv_flags |= IFF_UNICAST_FLT;
542ae60af24f02 Dongpo Li 2016-07-15 891 ndev->netdev_ops = &hisi_femac_netdev_ops;
542ae60af24f02 Dongpo Li 2016-07-15 892 ndev->ethtool_ops = &hisi_femac_ethtools_ops;
b707b89f7be361 Jakub Kicinski 2022-05-06 893 netif_napi_add_weight(ndev, &priv->napi, hisi_femac_poll,
b707b89f7be361 Jakub Kicinski 2022-05-06 894 FEMAC_POLL_WEIGHT);
542ae60af24f02 Dongpo Li 2016-07-15 895
542ae60af24f02 Dongpo Li 2016-07-15 896 hisi_femac_port_init(priv);
542ae60af24f02 Dongpo Li 2016-07-15 897
542ae60af24f02 Dongpo Li 2016-07-15 898 ret = hisi_femac_init_tx_and_rx_queues(priv);
542ae60af24f02 Dongpo Li 2016-07-15 899 if (ret)
542ae60af24f02 Dongpo Li 2016-07-15 900 goto out_disconnect_phy;
542ae60af24f02 Dongpo Li 2016-07-15 901
542ae60af24f02 Dongpo Li 2016-07-15 902 ndev->irq = platform_get_irq(pdev, 0);
ae1d60c41e581b Ruan Jinjie 2023-07-31 903 if (ndev->irq < 0) {
ae1d60c41e581b Ruan Jinjie 2023-07-31 904 ret = ndev->irq;
542ae60af24f02 Dongpo Li 2016-07-15 905 goto out_disconnect_phy;
542ae60af24f02 Dongpo Li 2016-07-15 906 }
542ae60af24f02 Dongpo Li 2016-07-15 907
542ae60af24f02 Dongpo Li 2016-07-15 908 ret = devm_request_irq(dev, ndev->irq, hisi_femac_interrupt,
542ae60af24f02 Dongpo Li 2016-07-15 909 IRQF_SHARED, pdev->name, ndev);
542ae60af24f02 Dongpo Li 2016-07-15 910 if (ret) {
542ae60af24f02 Dongpo Li 2016-07-15 911 dev_err(dev, "devm_request_irq %d failed!\n", ndev->irq);
542ae60af24f02 Dongpo Li 2016-07-15 912 goto out_disconnect_phy;
542ae60af24f02 Dongpo Li 2016-07-15 913 }
542ae60af24f02 Dongpo Li 2016-07-15 914
542ae60af24f02 Dongpo Li 2016-07-15 915 ret = register_netdev(ndev);
542ae60af24f02 Dongpo Li 2016-07-15 916 if (ret) {
542ae60af24f02 Dongpo Li 2016-07-15 917 dev_err(dev, "register_netdev failed!\n");
542ae60af24f02 Dongpo Li 2016-07-15 918 goto out_disconnect_phy;
542ae60af24f02 Dongpo Li 2016-07-15 919 }
542ae60af24f02 Dongpo Li 2016-07-15 920
542ae60af24f02 Dongpo Li 2016-07-15 921 return ret;
542ae60af24f02 Dongpo Li 2016-07-15 922
542ae60af24f02 Dongpo Li 2016-07-15 923 out_disconnect_phy:
542ae60af24f02 Dongpo Li 2016-07-15 924 netif_napi_del(&priv->napi);
542ae60af24f02 Dongpo Li 2016-07-15 925 phy_disconnect(phy);
3c2c758a1607ea Yang Xiwen 2024-02-16 926 out_unregister_mdio_bus:
3c2c758a1607ea Yang Xiwen 2024-02-16 927 platform_device_unregister(priv->mdio_pdev);
542ae60af24f02 Dongpo Li 2016-07-15 928 out_free_netdev:
542ae60af24f02 Dongpo Li 2016-07-15 929 free_netdev(ndev);
542ae60af24f02 Dongpo Li 2016-07-15 930
542ae60af24f02 Dongpo Li 2016-07-15 @931 return ret;
542ae60af24f02 Dongpo Li 2016-07-15 932 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-02-26 9:13 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-15 23:48 [PATCH 0/6] net: hisi-femac: add support for Hi3798MV200, remove unmaintained compatibles Yang Xiwen via B4 Relay
2024-02-15 23:48 ` [PATCH 1/6] net: hisilicon: add support for hisi_femac core on Hi3798MV200 Yang Xiwen via B4 Relay
2024-02-15 23:57 ` Andrew Lunn
2024-02-15 23:59 ` Yang Xiwen
2024-02-16 13:49 ` Andrew Lunn
2024-02-16 13:58 ` Yang Xiwen
2024-02-16 13:23 ` Andrew Lunn
2024-02-16 13:41 ` Yang Xiwen
2024-02-16 13:58 ` Andrew Lunn
2024-02-16 14:08 ` Yang Xiwen
2024-02-26 9:13 ` Dan Carpenter [this message]
2024-02-15 23:48 ` [PATCH 2/6] net: hisi_femac: remove unused compatible strings Yang Xiwen via B4 Relay
2024-02-16 7:20 ` Krzysztof Kozlowski
2024-02-16 8:21 ` Yang Xiwen
2024-02-16 8:26 ` Krzysztof Kozlowski
2024-02-16 8:39 ` Yang Xiwen
2024-02-16 13:01 ` Andrew Lunn
2024-02-16 20:05 ` Conor Dooley
2024-02-16 20:09 ` Yang Xiwen
2024-02-15 23:48 ` [PATCH 3/6] dt-bindings: net: remove outdated hisilicon-femac Yang Xiwen via B4 Relay
2024-02-16 7:21 ` Krzysztof Kozlowski
2024-02-16 8:03 ` Yang Xiwen
2024-02-16 8:23 ` Krzysztof Kozlowski
2024-02-15 23:48 ` [PATCH 4/6] dt-bindings: net: add hisilicon-femac Yang Xiwen via B4 Relay
2024-02-16 0:06 ` Andrew Lunn
2024-02-16 0:20 ` Yang Xiwen
2024-02-16 2:09 ` Rob Herring
2024-02-16 6:30 ` Yang Xiwen
2024-02-16 7:20 ` Krzysztof Kozlowski
2024-02-16 7:24 ` Krzysztof Kozlowski
2024-02-16 9:36 ` Yang Xiwen
2024-02-16 9:41 ` Krzysztof Kozlowski
2024-02-16 9:48 ` Yang Xiwen
2024-02-16 13:11 ` Andrew Lunn
2024-02-16 13:33 ` Yang Xiwen
2024-02-16 14:10 ` Andrew Lunn
2024-02-16 14:29 ` Yang Xiwen
2024-02-15 23:48 ` [PATCH 5/6] net: mdio: hisi-femac: make clock optional Yang Xiwen via B4 Relay
2024-02-15 23:48 ` [PATCH 6/6] dt-bindings: net: hisilicon-femac-mdio: " Yang Xiwen via B4 Relay
2024-02-16 7:25 ` Krzysztof Kozlowski
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=8af83663-e7d9-4a18-833f-a32df97b96e7@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=devnull+forbidden405.outlook.com@kernel.org \
--cc=edumazet@google.com \
--cc=forbidden405@foxmail.com \
--cc=hkallweit1@gmail.com \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lkp@intel.com \
--cc=netdev@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=robh+dt@kernel.org \
--cc=salil.mehta@huawei.com \
--cc=yisen.zhuang@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox