From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 309B130F93D for ; Mon, 6 Apr 2026 21:30:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775511047; cv=none; b=FHWSp8XkewBvt0oY3rPzPSAju9UIwpkI2kMR+Ib//f9rTgiPhX5ZG1p0nnbrhlML0o9FqYFIoklDLJGZobK4Q7YI4nOmubLICrKirIjbEj1b+v7Uv+yaHyrIrR/zKSuF6PXTC0kFa9InsZP+eSKPwLgfGvahN/zqJJ8yZXbKu5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775511047; c=relaxed/simple; bh=ONIPPa1gWPfIB0yzWOtd4JJ99xkN+0isVDzioBtNGk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FerbCfSa0b+X7y9FavHSyziQlC6dZNhVGFXlus+Bxq43oqQxeaoYe/f3eOdT6nnYzAsL8qTapfg3Je01vZCTiS0hauDivW6DOSv0UTl3KvhwsySNYzwvkbuQj1NUj7oq4LPXmr6Sqkg9GZtamc4XsES2rfxMbObXlUqX1Iu8W3U= 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=IU5Dzl41; arc=none smtp.client-ip=192.198.163.13 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="IU5Dzl41" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1775511045; x=1807047045; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ONIPPa1gWPfIB0yzWOtd4JJ99xkN+0isVDzioBtNGk4=; b=IU5Dzl41psymcGdiTwwSKyAORPa11fkz9+Vvy6ama+0ribOC+f8gTzFM 8oI024+pehrN9Zvqk4YHSC+M6Zo2reG+ulkfxIJyEv99DQu07JINHjma3 1SM09tTww0n/xoOcwa7BOo9+ukajxd9FX/ieNKj1L3g6uF4L5xgFFuMJU fnouGPXOEaOv3G5j6Ouh5ML8IfE/M15I/EbxmpQAeu6wrcinmRRoJz2Hi KZH/1YpWFJ5oOxHOzOCLnYyVDb0jGEoqrs+g2cCFeD6Hfx063gv3O2j29 ERn/XRVxn7wOF3CfvPrz3KgLhBbVjD9ny8AkCB9ZsQ27SeEn/iYT5OSGU A==; X-CSE-ConnectionGUID: P2DA1G/hR3SFB9H2IfNRsQ== X-CSE-MsgGUID: f9h//BOLRpqinTC5Zty6NA== X-IronPort-AV: E=McAfee;i="6800,10657,11751"; a="79057409" X-IronPort-AV: E=Sophos;i="6.23,164,1770624000"; d="scan'208";a="79057409" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Apr 2026 14:30:42 -0700 X-CSE-ConnectionGUID: LqpXF47GSZa40CK0TZPQZg== X-CSE-MsgGUID: 663OgorqSjq+NFBJbdNt0A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,164,1770624000"; d="scan'208";a="228248108" Received: from anguy11-upstream.jf.intel.com ([10.166.9.133]) by orviesa007.jf.intel.com with ESMTP; 06 Apr 2026 14:30:41 -0700 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, andrew+netdev@lunn.ch, netdev@vger.kernel.org Cc: Kohei Enju , anthony.l.nguyen@intel.com, sergey.temerkhanov@intel.com, przemyslaw.kitszel@intel.com, kohei.enju@gmail.com, horms@kernel.org, richardcochran@gmail.com, Aleksandr Loktionov Subject: [PATCH net 4/9] ice: ptp: don't WARN when controlling PF is unavailable Date: Mon, 6 Apr 2026 14:30:31 -0700 Message-ID: <20260406213038.444732-5-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20260406213038.444732-1-anthony.l.nguyen@intel.com> References: <20260406213038.444732-1-anthony.l.nguyen@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Kohei Enju In VFIO passthrough setups, it is possible to pass through only a PF which doesn't own the source timer. In that case the PTP controlling PF (adapter->ctrl_pf) is never initialized in the VM, so ice_get_ctrl_ptp() returns NULL and triggers WARN_ON() in ice_ptp_setup_pf(). Since this is an expected behavior in that configuration, replace WARN_ON() with an informational message and return -EOPNOTSUPP. Fixes: e800654e85b5 ("ice: Use ice_adapter for PTP shared data instead of auxdev") Signed-off-by: Kohei Enju Reviewed-by: Aleksandr Loktionov Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ice/ice_ptp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c index 094e96219f45..a3c5f0a5e09b 100644 --- a/drivers/net/ethernet/intel/ice/ice_ptp.c +++ b/drivers/net/ethernet/intel/ice/ice_ptp.c @@ -3080,7 +3080,13 @@ static int ice_ptp_setup_pf(struct ice_pf *pf) struct ice_ptp *ctrl_ptp = ice_get_ctrl_ptp(pf); struct ice_ptp *ptp = &pf->ptp; - if (WARN_ON(!ctrl_ptp) || pf->hw.mac_type == ICE_MAC_UNKNOWN) + if (!ctrl_ptp) { + dev_info(ice_pf_to_dev(pf), + "PTP unavailable: no controlling PF\n"); + return -EOPNOTSUPP; + } + + if (pf->hw.mac_type == ICE_MAC_UNKNOWN) return -ENODEV; INIT_LIST_HEAD(&ptp->port.list_node); -- 2.47.1