mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>,
	Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	netdev@vger.kernel.org, Oleksij Rempel <o.rempel@pengutronix.de>,
	kernel@pengutronix.de, linux-kernel@vger.kernel.org,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH net-next v2 1/1] phy: micrel: add Signal Quality Indicator (SQI) support for KSZ9477 switch PHYs
Date: Thu, 26 Jun 2025 08:07:02 +0800	[thread overview]
Message-ID: <202506260756.KhOdmLCy-lkp@intel.com> (raw)
In-Reply-To: <20250625124127.4176960-1-o.rempel@pengutronix.de>

Hi Oleksij,

kernel test robot noticed the following build warnings:

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

url:    https://github.com/intel-lab-lkp/linux/commits/Oleksij-Rempel/phy-micrel-add-Signal-Quality-Indicator-SQI-support-for-KSZ9477-switch-PHYs/20250625-204330
base:   net-next/main
patch link:    https://lore.kernel.org/r/20250625124127.4176960-1-o.rempel%40pengutronix.de
patch subject: [PATCH net-next v2 1/1] phy: micrel: add Signal Quality Indicator (SQI) support for KSZ9477 switch PHYs
config: i386-buildonly-randconfig-004-20250626 (https://download.01.org/0day-ci/archive/20250626/202506260756.KhOdmLCy-lkp@intel.com/config)
compiler: clang version 20.1.7 (https://github.com/llvm/llvm-project 6146a88f60492b520a36f8f8f3231e15f3cc6082)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250626/202506260756.KhOdmLCy-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506260756.KhOdmLCy-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/phy/micrel.c:2247:5: warning: variable 'channels' set but not used [-Wunused-but-set-variable]
    2247 |         u8 channels;
         |            ^
   1 warning generated.


vim +/channels +2247 drivers/net/phy/micrel.c

  2231	
  2232	/**
  2233	 * kszphy_get_sqi - Read, average, and map Signal Quality Index (SQI)
  2234	 * @phydev: the PHY device
  2235	 *
  2236	 * This function reads and processes the raw Signal Quality Index from the
  2237	 * PHY. Based on empirical testing, a raw value of 8 or higher indicates a
  2238	 * pre-failure state and is mapped to SQI 0. Raw values from 0-7 are
  2239	 * mapped to the standard 0-7 SQI scale via a lookup table.
  2240	 *
  2241	 * Return: SQI value (0–7), or a negative errno on failure.
  2242	 */
  2243	static int kszphy_get_sqi(struct phy_device *phydev)
  2244	{
  2245		int sum = 0;
  2246		int i, val, raw_sqi, avg_raw_sqi;
> 2247		u8 channels;
  2248	
  2249		/* Determine applicable channels based on link speed */
  2250		if (phydev->speed == SPEED_1000)
  2251			/* TODO: current SQI API only supports 1 channel. */
  2252			channels = 1;
  2253		else if (phydev->speed == SPEED_100)
  2254			channels = 1;
  2255		else
  2256			return -EOPNOTSUPP;
  2257	
  2258		/*
  2259		 * Sample and accumulate SQI readings for each pair (currently only one).
  2260		 *
  2261		 * Reference: KSZ9477S Datasheet DS00002392C, Section 4.1.11 (page 26)
  2262		 * - The SQI register is updated every 2 µs.
  2263		 * - Values may fluctuate significantly, even in low-noise environments.
  2264		 * - For reliable estimation, average a minimum of 30–50 samples
  2265		 *   (recommended for noisy environments)
  2266		 * - In noisy environments, individual readings are highly unreliable.
  2267		 *
  2268		 * We use 40 samples per pair with a delay of 3 µs between each
  2269		 * read to ensure new values are captured (2 µs update interval).
  2270		 */
  2271		for (i = 0; i < KSZ9477_SQI_SAMPLE_COUNT; i++) {
  2272			val = phy_read_mmd(phydev, MDIO_MMD_PMAPMD,
  2273					   KSZ9477_MMD_SIGNAL_QUALITY_CHAN_A);
  2274			if (val < 0)
  2275				return val;
  2276	
  2277			raw_sqi = FIELD_GET(KSZ9477_MMD_SQI_MASK, val);
  2278			sum += raw_sqi;
  2279	
  2280			udelay(KSZ9477_MMD_SQI_READ_DELAY_US);
  2281		}
  2282	
  2283		avg_raw_sqi = sum / KSZ9477_SQI_SAMPLE_COUNT;
  2284	
  2285		/* Handle the pre-fail/failed state first. */
  2286		if (avg_raw_sqi >= ARRAY_SIZE(ksz_sqi_mapping))
  2287			return 0;
  2288	
  2289		/* Use the lookup table for the good signal range. */
  2290		return ksz_sqi_mapping[avg_raw_sqi];
  2291	}
  2292	

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

      parent reply	other threads:[~2025-06-26  0:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 12:41 Oleksij Rempel
2025-06-25 15:33 ` Maxime Chevallier
2025-06-25 16:36   ` Oleksij Rempel
2025-06-25 18:06 ` Lucas Stach
2025-06-26  5:11   ` Oleksij Rempel
2025-06-26 12:20     ` Oleksij Rempel
2025-06-26  0:07 ` kernel test robot [this message]

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=202506260756.KhOdmLCy-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=llvm@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®