From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DCCE1A6802; Tue, 17 Mar 2026 17:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773769566; cv=none; b=olTHGdmLOtc62fP/5U8GWemGWusCO4eha8607/Rhms5WEnsdJh5XABv8RjEiRIOeV5hFSIyMfc73qZCn8oDzyshRFOb0S+x/PGb58lpKJA/qElwaZJvB+qGFTBZ/l719Sw4mH7t3jkeyUqVCapXX3GwwzvsHK1l7HRJURSOUIeg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773769566; c=relaxed/simple; bh=meDOgFZsp9t8qHxBQVBAJcgZFytRkiMISoWsVNRBdkw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MgaPaY5c1mqm3TYdZU5PIJ0l2NraAJ+behqMGaDj2BizF1Lt42Wtq/TSM4uZBpzlTWVNwNxJY1K0L7UqLdzferym9f8EcaD4S+g+OEcZQATEZGPZ8OnNcD81//2q5TwWopLiFlaww6qsenHxtiLUzKyZxqE4oNiMpMogNIP7Rqg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Ef2eap+F; arc=none smtp.client-ip=192.198.163.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ef2eap+F" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1773769564; x=1805305564; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=meDOgFZsp9t8qHxBQVBAJcgZFytRkiMISoWsVNRBdkw=; b=Ef2eap+Fv8EwbLyCRlQawjfsTEOFYyRQzwkxR+FdV1eVGwrLrEoIoAz7 KKZRnpvqLpZ34tyL5FVh9q5g6og9NsdR4ZQduormoJ9yN9P92HLQlHR83 JeXOdRKeYyNiFToVPHQOl+CPZY8n+bZPw7Ej6skNsZjkl5mqVBpGbmWEt iEgjLrmwzR9c7ZrY3y2rfWlVFPvxGWFLv8l296RclJDClIcOluAOplOEJ oujy4XCa8/9Voj3r/KtuntLX5aNGbo0VUiqemEGm2Ane2PtGl+ModvFdy FE8hRBMdC2fGn1AXqGpfelOAjDQPqrXQzD+rcQLTpBFYT3vg783QhdLsM Q==; X-CSE-ConnectionGUID: enwiFh5FQ/KPk3LVY6aBjg== X-CSE-MsgGUID: lSogaHaHR+uHOECjKNMkvg== X-IronPort-AV: E=McAfee;i="6800,10657,11732"; a="85508071" X-IronPort-AV: E=Sophos;i="6.23,126,1770624000"; d="scan'208";a="85508071" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2026 10:46:03 -0700 X-CSE-ConnectionGUID: iqhCGTDgRcug5ssz+7tWTg== X-CSE-MsgGUID: nPwSKXBMSCutlgLu2VIUqQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,126,1770624000"; d="scan'208";a="221408834" Received: from igk-lkp-server01.igk.intel.com (HELO 9958d990ccf2) ([10.211.93.152]) by orviesa006.jf.intel.com with ESMTP; 17 Mar 2026 10:46:00 -0700 Received: from kbuild by 9958d990ccf2 with local (Exim 4.98.2) (envelope-from ) id 1w2YUO-000000004TV-3Qvi; Tue, 17 Mar 2026 17:45:56 +0000 Date: Tue, 17 Mar 2026 18:45:25 +0100 From: kernel test robot To: Anand Moon , Heiner Kallweit , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Manivannan Sadhasivam , Shawn Lin , Hans Zhang <18255117159@163.com>, Niklas Cassel , linux-kernel@vger.kernel.org Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, netdev@vger.kernel.org, Anand Moon , Robin Murphy , Danilo Krummrich Subject: Re: [PATCH next v1] r8169: Fix PHY lookup for mdiobus_get_phy() and improve error reporting during probe Message-ID: <202603171855.OtM7sS7W-lkp@intel.com> References: <20260317061700.7734-1-linux.amoon@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260317061700.7734-1-linux.amoon@gmail.com> Hi Anand, kernel test robot noticed the following build warnings: [auto build test WARNING on 95c541ddfb0815a0ea8477af778bb13bb075079a] url: https://github.com/intel-lab-lkp/linux/commits/Anand-Moon/r8169-Fix-PHY-lookup-for-mdiobus_get_phy-and-improve-error-reporting-during-probe/20260317-183327 base: 95c541ddfb0815a0ea8477af778bb13bb075079a patch link: https://lore.kernel.org/r/20260317061700.7734-1-linux.amoon%40gmail.com patch subject: [PATCH next v1] r8169: Fix PHY lookup for mdiobus_get_phy() and improve error reporting during probe config: x86_64-kexec (https://download.01.org/0day-ci/archive/20260317/202603171855.OtM7sS7W-lkp@intel.com/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260317/202603171855.OtM7sS7W-lkp@intel.com/reproduce) 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 | Closes: https://lore.kernel.org/oe-kbuild-all/202603171855.OtM7sS7W-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/net/ethernet/realtek/r8169_main.c:5467:17: warning: variable 'phydev' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized] 5467 | for (addr = 0; addr < PHY_MAX_ADDR; addr++) { | ^~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/realtek/r8169_main.c:5476:7: note: uninitialized use occurs here 5476 | if (!phydev) { | ^~~~~~ drivers/net/ethernet/realtek/r8169_main.c:5467:17: note: remove the condition if it is always true 5467 | for (addr = 0; addr < PHY_MAX_ADDR; addr++) { | ^~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/realtek/r8169_main.c:5430:27: note: initialize the variable 'phydev' to silence this warning 5430 | struct phy_device *phydev; | ^ | = NULL 1 warning generated. vim +5467 drivers/net/ethernet/realtek/r8169_main.c 5425 5426 static int r8169_mdio_register(struct rtl8169_private *tp) 5427 { 5428 struct pci_dev *pdev = tp->pci_dev; 5429 struct mii_bus *new_bus; 5430 struct phy_device *phydev; 5431 int ret, addr; 5432 5433 /* On some boards with this chip version the BIOS is buggy and misses 5434 * to reset the PHY page selector. This results in the PHY ID read 5435 * accessing registers on a different page, returning a more or 5436 * less random value. Fix this by resetting the page selector first. 5437 */ 5438 if (tp->mac_version == RTL_GIGA_MAC_VER_25 || 5439 tp->mac_version == RTL_GIGA_MAC_VER_26) 5440 r8169_mdio_write(tp, 0x1f, 0); 5441 5442 new_bus = devm_mdiobus_alloc(&pdev->dev); 5443 if (!new_bus) 5444 return -ENOMEM; 5445 5446 new_bus->name = "r8169"; 5447 new_bus->priv = tp; 5448 new_bus->parent = &pdev->dev; 5449 new_bus->irq[0] = PHY_MAC_INTERRUPT; 5450 new_bus->phy_mask = GENMASK(31, 1); 5451 snprintf(new_bus->id, MII_BUS_ID_SIZE, "r8169-%x-%x", 5452 pci_domain_nr(pdev->bus), pci_dev_id(pdev)); 5453 5454 new_bus->read = r8169_mdio_read_reg; 5455 new_bus->write = r8169_mdio_write_reg; 5456 5457 if (tp->mac_version >= RTL_GIGA_MAC_VER_40) { 5458 new_bus->read_c45 = r8169_mdio_read_reg_c45; 5459 new_bus->write_c45 = r8169_mdio_write_reg_c45; 5460 } 5461 5462 ret = devm_mdiobus_register(&pdev->dev, new_bus); 5463 if (ret) 5464 return ret; 5465 5466 /* find the first (lowest address) PHY on the current MAC's MII bus */ > 5467 for (addr = 0; addr < PHY_MAX_ADDR; addr++) { 5468 struct phy_device *tmp = mdiobus_get_phy(new_bus, addr); 5469 5470 if (tmp) { 5471 phydev = tmp; 5472 break; 5473 } 5474 } 5475 5476 if (!phydev) { 5477 dev_err(&pdev->dev, "no PHY found on bus\n"); 5478 return -ENODEV; 5479 } 5480 5481 /* Most chip versions fail with the genphy driver. 5482 * Therefore ensure that the dedicated PHY driver is loaded. 5483 */ 5484 if (!phydev->drv) { 5485 dev_err(&pdev->dev, "no dedicated PHY driver found for PHY ID 0x%08x, maybe realtek.ko needs to be added to initramfs?\n", 5486 phydev->phy_id); 5487 return -EUNATCH; 5488 } 5489 5490 tp->phydev = phydev; 5491 tp->phydev->mac_managed_pm = true; 5492 if (rtl_supports_eee(tp)) 5493 phy_support_eee(tp->phydev); 5494 phy_support_asym_pause(tp->phydev); 5495 5496 /* mimic behavior of r8125/r8126 vendor drivers */ 5497 if (tp->mac_version == RTL_GIGA_MAC_VER_61) 5498 phy_disable_eee_mode(tp->phydev, 5499 ETHTOOL_LINK_MODE_2500baseT_Full_BIT); 5500 5501 /* PHY will be woken up in rtl_open() */ 5502 phy_suspend(tp->phydev); 5503 5504 return 0; 5505 } 5506 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki