From patchwork Fri Feb 21 09:39:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nitka, Grzegorz" X-Patchwork-Id: 2050158 X-Patchwork-Delegate: anthony.l.nguyen@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=L3rUFCMM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4YzlYy5DKdz1yJw for ; Fri, 21 Feb 2025 20:43:34 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 45A968114C; Fri, 21 Feb 2025 09:43:34 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ysZjlo5pQ_0o; Fri, 21 Feb 2025 09:43:33 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9C0EF837D2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1740131013; bh=BaGzCCZJqrTm5b+bqODxCVMQSwkDPtN73zbv0oYAAnM=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=L3rUFCMMw8IDz6GAKKxa42PHoQ9MPrukVSnBceVK/xAdvilcw61XalIgbUYo56bgN 21qTkBpS9efQPXk6ZO4FOiOaen+fhiTXoVWJ7P/i8/UcBQMqmoTIlY9AIdfF8fkdOJ PzOD4xRX6p5XjEentDyuKVSavBRv0oMcaa8p+MtL7wryE0WpYeYAa6OsoSvD3cF4O8 Kz3/qgv/CoSmv9eFGAoI2rI6uzeFPwhjZHwnE3yagNsGf6quBRDM0vKQ5Chj08Mke/ N1wNIk9ZuTRS/u+3fqfB919o7fqbhZDcv3+3WqAS9MLVG74sOZd+jOPyamLONE5DDj JVbsj+curGHjw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 9C0EF837D2; Fri, 21 Feb 2025 09:43:33 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists1.osuosl.org (Postfix) with ESMTP id B8A44D92 for ; Fri, 21 Feb 2025 09:43:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A898C8386F for ; Fri, 21 Feb 2025 09:43:31 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id yhr9xdFedYaZ for ; Fri, 21 Feb 2025 09:43:31 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.9; helo=mgamail.intel.com; envelope-from=grzegorz.nitka@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org ECA988114C DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org ECA988114C Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by smtp1.osuosl.org (Postfix) with ESMTPS id ECA988114C for ; Fri, 21 Feb 2025 09:43:29 +0000 (UTC) X-CSE-ConnectionGUID: H9obJ30aR0+DEGiT+QzNmQ== X-CSE-MsgGUID: lDqqlvqSS8OJmm03z6q8dQ== X-IronPort-AV: E=McAfee;i="6700,10204,11351"; a="51588303" X-IronPort-AV: E=Sophos;i="6.13,304,1732608000"; d="scan'208";a="51588303" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2025 01:43:30 -0800 X-CSE-ConnectionGUID: UZ8654HgQxyk8hBCbgBuUg== X-CSE-MsgGUID: gWQjtqNiRPG6ZbGjteWRzA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="146214739" Received: from gklab-003-001.igk.intel.com ([10.211.3.1]) by fmviesa001.fm.intel.com with ESMTP; 21 Feb 2025 01:43:28 -0800 From: Grzegorz Nitka To: intel-wired-lan@lists.osuosl.org Date: Fri, 21 Feb 2025 10:39:49 +0100 Message-Id: <20250221093949.2436728-1-grzegorz.nitka@intel.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1740131011; x=1771667011; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=522MooTYpYrtzHnLXBjlkvV0sFdSBCEqCsgZPGxH6BI=; b=ep9BfnbFI5sPX85jftMpn/TwXUe0MpPNh0Ba+8kcP9/0dRmrUYeA1kBX 3JD6KLUQAhvG5wlveksGSfg51nWjvPUwIGckV1Z5E8Zjlv/h9VSQqiYVK mi4e4DF9TuKXOqjTeej/Sa9k2Umj0pxbvRTEioDxgD+eEOOId2nK3XMhO fsgBtp8MTNX0HyCC2MZwyM64NOolT1tITXmNcuYOwd9EZrUP5RHmuS5+2 XB21aE0MY1/VNBRDEySLT5Z08f4M2hiP+xcGFlpNoAjZItQdfjukB0RfZ F5/Q8M0SpaJhrM1Eg8x6/W7llb8YLPf1woAhitaBeN8Bp+2ja2I6Ek/AC A==; X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ep9BfnbF Subject: [Intel-wired-lan] [PATCH iwl-net v1] ice: fix lane number calculation X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Karol Kolacinski , Milena Olech , Przemek Kitszel Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" E82X adapters do not have sequential IDs, lane number is PF ID. Add check for ICE_MAC_GENERIC and skip checking port options. Also, adjust logical port number for specific E825 device with external PHY support (PCI device id 0x579F). For this particular device, with 2x25G (PHY0) and 2x10G (PHY1) port configuration, modification of pf_id -> lane_number mapping is required. PF IDs on the 2nd PHY start from 4 in such scenario. Otherwise, the lane number cannot be determined correctly, leading to PTP init errors during PF initialization. Fixes: 258f5f9058159 ("ice: Add correct PHY lane assignment") Co-developed-by: Karol Kolacinski Signed-off-by: Karol Kolacinski Signed-off-by: Grzegorz Nitka Reviewed-by: Przemek Kitszel Reviewed-by: Milena Olech Reviewed-by: Simon Horman Tested-by: Rinitha S (A Contingent worker at Intel) --- drivers/net/ethernet/intel/ice/ice_common.c | 9 +++++++++ 1 file changed, 9 insertions(+) base-commit: c4813820042d447c687cf4f1d5e240740638e586 diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 7a2a2e8da8fa..83b72414760a 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -4171,6 +4171,15 @@ int ice_get_phy_lane_number(struct ice_hw *hw) unsigned int lane; int err; + /* E82X does not have sequential IDs, lane number is PF ID. + * For E825 device, the exception is the variant with external + * PHY (0x579F), in which there is also 1:1 pf_id -> lane_number + * mapping. + */ + if (hw->mac_type == ICE_MAC_GENERIC || + hw->device_id == ICE_DEV_ID_E825C_SGMII) + return hw->pf_id; + options = kcalloc(ICE_AQC_PORT_OPT_MAX, sizeof(*options), GFP_KERNEL); if (!options) return -ENOMEM;