Re: [PATCH V2 1/2] net: phylink: add a function to resume phy alone to fix resume issue with WoL enabled

From: kernel test robot
Date: Thu Feb 02 2023 - 07:27:50 EST


Hi Clark,

I love your patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]
[also build test WARNING on net/master linus/master v6.2-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Clark-Wang/net-stmmac-resume-phy-separately-before-calling-stmmac_hw_setup/20230201-184223
patch link: https://lore.kernel.org/r/20230201103837.3258752-1-xiaoning.wang%40nxp.com
patch subject: [PATCH V2 1/2] net: phylink: add a function to resume phy alone to fix resume issue with WoL enabled
config: x86_64-rhel-8.3-rust (https://download.01.org/0day-ci/archive/20230202/202302022040.NzeFwwSF-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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/intel-lab-lkp/linux/commit/6df0562fc6133175ff3932188af0d9126858c42c
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Clark-Wang/net-stmmac-resume-phy-separately-before-calling-stmmac_hw_setup/20230201-184223
git checkout 6df0562fc6133175ff3932188af0d9126858c42c
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/phy/ kernel/bpf/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/net/phy/phylink.c:1952:3: warning: add explicit braces to avoid dangling else [-Wdangling-else]
else
^
1 warning generated.


vim +1952 drivers/net/phy/phylink.c

1887
1888 /**
1889 * phylink_start() - start a phylink instance
1890 * @pl: a pointer to a &struct phylink returned from phylink_create()
1891 *
1892 * Start the phylink instance specified by @pl, configuring the MAC for the
1893 * desired link mode(s) and negotiation style. This should be called from the
1894 * network device driver's &struct net_device_ops ndo_open() method.
1895 */
1896 void phylink_start(struct phylink *pl)
1897 {
1898 bool poll = false;
1899
1900 ASSERT_RTNL();
1901
1902 phylink_info(pl, "configuring for %s/%s link mode\n",
1903 phylink_an_mode_str(pl->cur_link_an_mode),
1904 phy_modes(pl->link_config.interface));
1905
1906 /* Always set the carrier off */
1907 if (pl->netdev)
1908 netif_carrier_off(pl->netdev);
1909
1910 /* Apply the link configuration to the MAC when starting. This allows
1911 * a fixed-link to start with the correct parameters, and also
1912 * ensures that we set the appropriate advertisement for Serdes links.
1913 *
1914 * Restart autonegotiation if using 802.3z to ensure that the link
1915 * parameters are properly negotiated. This is necessary for DSA
1916 * switches using 802.3z negotiation to ensure they see our modes.
1917 */
1918 phylink_mac_initial_config(pl, true);
1919
1920 phylink_enable_and_run_resolve(pl, PHYLINK_DISABLE_STOPPED);
1921
1922 if (pl->cfg_link_an_mode == MLO_AN_FIXED && pl->link_gpio) {
1923 int irq = gpiod_to_irq(pl->link_gpio);
1924
1925 if (irq > 0) {
1926 if (!request_irq(irq, phylink_link_handler,
1927 IRQF_TRIGGER_RISING |
1928 IRQF_TRIGGER_FALLING,
1929 "netdev link", pl))
1930 pl->link_irq = irq;
1931 else
1932 irq = 0;
1933 }
1934 if (irq <= 0)
1935 poll = true;
1936 }
1937
1938 switch (pl->cfg_link_an_mode) {
1939 case MLO_AN_FIXED:
1940 poll |= pl->config->poll_fixed_state;
1941 break;
1942 case MLO_AN_INBAND:
1943 if (pl->pcs)
1944 poll |= pl->pcs->poll;
1945 break;
1946 }
1947 if (poll)
1948 mod_timer(&pl->link_poll, jiffies + HZ);
1949 if (pl->phydev)
1950 if (!pl->mac_resume_phy_separately)
1951 phy_start(pl->phydev);
> 1952 else
1953 pl->mac_resume_phy_separately = false;
1954 if (pl->sfp_bus)
1955 sfp_upstream_start(pl->sfp_bus);
1956 }
1957 EXPORT_SYMBOL_GPL(phylink_start);
1958

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests