From patchwork Thu Dec 26 16:52:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13921359 X-Patchwork-Delegate: kuba@kernel.org Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (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 9F3D283CC1; Thu, 26 Dec 2024 16:52:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735231964; cv=none; b=SiQsdx1oeh2TuEV7sseosOHvC8FD9z9q/tCr/60El5qqPd9lfAs80zPMSMtJFXbgQ6hwu63eKhlYnh+BmKf/SG0uco0iliQ62JrYebmAo2jkvuCST3+P7Y9DTibPy0jLW5Fp20PY2R34/OkG08/tY5SNEINthH4qZ8gI1wtESho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735231964; c=relaxed/simple; bh=cMpSLK+TqXGI5ylHvyziqrIhBXLV15jFcdexa8T6me8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QsTWcnLIAQqdOhfk2j1ZJbmES3FNwnwldmWX0xdOfjIJdaNBaIjrlQuxOM8AVU4ARtl3ZasUYF3tLCszH9pexRGBPAEZbeJj0/rXyjiNXct+iNKs8NqGiSL/Qe5A2myjGrC3jUbFcyCtl4k9grTcxEkQCHnJruQRrxklvET13t8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=SzKyHP6r; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="SzKyHP6r" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=pdsFoyjvN7jwIB/z6Mz4XwBi+s2/8ncP7Z2rx9wjM1I=; b=SzKyHP6r9yFoZfQj GObburqqgBg5LtQqlBjJefLXBMgrh3rtBd0IWjZUFyljWso6JxyCPa897IOZoIexayjLo7arfhKyF zozh/jPxxNnES6GvMrJfR5WbHz8W8e8KfSaUNnYBtaJGcUtOzYdtgWvTPUyxcQlQP+ky1xkDX2UIe R6Qy9LTwvjf96k8k1ldkBs8ZlPd8DEZo4a7pynVUA0iNmVPGRfDN74yEo0dtyPuqG0s2V5g2OsV54 b5dst4qS/St0WdU9GjJq/PrcBrrJkla+lgVZnRCAV817Q7W77/ZJl8kEKdo4czM5VpmieQXMxT4vQ nY4MdThk8Bhc1urWtA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1tQr5s-007IaP-37; Thu, 26 Dec 2024 16:52:17 +0000 From: linux@treblig.org To: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [RFC net-next 1/3] igc: Remove unused igc_acquire/release_nvm Date: Thu, 26 Dec 2024 16:52:13 +0000 Message-ID: <20241226165215.105092-2-linux@treblig.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241226165215.105092-1-linux@treblig.org> References: <20241226165215.105092-1-linux@treblig.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC From: "Dr. David Alan Gilbert" igc_acquire_nvm() and igc_release_nvm() were added in 2018 as part of commit ab4056126813 ("igc: Add NVM support") but never used. Remove them. The igc_1225.c has it's own specific implementations. Signed-off-by: Dr. David Alan Gilbert --- drivers/net/ethernet/intel/igc/igc_nvm.c | 50 ------------------------ drivers/net/ethernet/intel/igc/igc_nvm.h | 2 - 2 files changed, 52 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.c b/drivers/net/ethernet/intel/igc/igc_nvm.c index 58f81aba0144..efd121c03967 100644 --- a/drivers/net/ethernet/intel/igc/igc_nvm.c +++ b/drivers/net/ethernet/intel/igc/igc_nvm.c @@ -35,56 +35,6 @@ static s32 igc_poll_eerd_eewr_done(struct igc_hw *hw, int ee_reg) return ret_val; } -/** - * igc_acquire_nvm - Generic request for access to EEPROM - * @hw: pointer to the HW structure - * - * Set the EEPROM access request bit and wait for EEPROM access grant bit. - * Return successful if access grant bit set, else clear the request for - * EEPROM access and return -IGC_ERR_NVM (-1). - */ -s32 igc_acquire_nvm(struct igc_hw *hw) -{ - s32 timeout = IGC_NVM_GRANT_ATTEMPTS; - u32 eecd = rd32(IGC_EECD); - s32 ret_val = 0; - - wr32(IGC_EECD, eecd | IGC_EECD_REQ); - eecd = rd32(IGC_EECD); - - while (timeout) { - if (eecd & IGC_EECD_GNT) - break; - udelay(5); - eecd = rd32(IGC_EECD); - timeout--; - } - - if (!timeout) { - eecd &= ~IGC_EECD_REQ; - wr32(IGC_EECD, eecd); - hw_dbg("Could not acquire NVM grant\n"); - ret_val = -IGC_ERR_NVM; - } - - return ret_val; -} - -/** - * igc_release_nvm - Release exclusive access to EEPROM - * @hw: pointer to the HW structure - * - * Stop any current commands to the EEPROM and clear the EEPROM request bit. - */ -void igc_release_nvm(struct igc_hw *hw) -{ - u32 eecd; - - eecd = rd32(IGC_EECD); - eecd &= ~IGC_EECD_REQ; - wr32(IGC_EECD, eecd); -} - /** * igc_read_nvm_eerd - Reads EEPROM using EERD register * @hw: pointer to the HW structure diff --git a/drivers/net/ethernet/intel/igc/igc_nvm.h b/drivers/net/ethernet/intel/igc/igc_nvm.h index f9fc2e9cfb03..ab78d0c64547 100644 --- a/drivers/net/ethernet/intel/igc/igc_nvm.h +++ b/drivers/net/ethernet/intel/igc/igc_nvm.h @@ -4,8 +4,6 @@ #ifndef _IGC_NVM_H_ #define _IGC_NVM_H_ -s32 igc_acquire_nvm(struct igc_hw *hw); -void igc_release_nvm(struct igc_hw *hw); s32 igc_read_mac_addr(struct igc_hw *hw); s32 igc_read_nvm_eerd(struct igc_hw *hw, u16 offset, u16 words, u16 *data); s32 igc_validate_nvm_checksum(struct igc_hw *hw); From patchwork Thu Dec 26 16:52:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13921358 X-Patchwork-Delegate: kuba@kernel.org Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (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 51B54EC5; Thu, 26 Dec 2024 16:52:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735231957; cv=none; b=YZKvJa9l8hfYvh0aqqGqmgVaY7m1fJWG198DmkL30B0Ai6q6+2lJMVbAmH5PJ4We1y8w7kk5iawBsut5lUG9nvGwYzamXw0HvJyrsVc8g9PQhw9vew/FzwrU+pIwlvjjel+dXg9nSmer9KN5XOrrHXSeIrTFLcPcdry/I16+rxo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735231957; c=relaxed/simple; bh=FfHMfV3m6N+lxueI9KsD0EdOdSpmT3d1lucrwtc/0bI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sLRP1DRmxx1OnYK5PNM1fYjXqdGgyI9BFlV+ZuRo/VS5JIc2IEkb5Et6zn3YmPi9RGf7fqBefTm1BNAj7Mo7MIUXAFoPzh6cVa9fEVOkUO3CT4BI34tXV54hy0ufX2QKa8d4y9Kxl1W1knY4qATGWxLasNDdVyeumUyLV/11AYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=VKUFBX6e; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="VKUFBX6e" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=zewCXryLBAmS6GupELoPnKwlpgE7Rk2QDzMgSD+MVFI=; b=VKUFBX6eoigWH2fU UaSvitHog9H9Hgo/eFU/GROMJPIk7yTVpAJZ6VT9ugngCqffiqtzxbJ1Dd3c29n5sehqyNeDPjdyL zt90AgJvEL8JnoOpGYj8iQuoBwxPC6LZovwizBp1zY+NKwoGErtkXKf0eV1B8AyG9XYBrLgcRdqy7 AjMXaOT24qh/YgqTs6VJh8yCXPXJrXsaziCS7Iosz/N0335sfTIXxXU2AhzwbhpROKHOXTWdpur0P 4X1Bc0Jkbl7314fJjLLE4bVQH3T9Yi73ajhLaZYHOjHkh0fHWGU++29NUDu5vO1J+2IIdDmIcRjE3 FnN1CqyH5Gj8T83oOg==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1tQr5t-007IaP-2F; Thu, 26 Dec 2024 16:52:17 +0000 From: linux@treblig.org To: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [RFC net-next 2/3] igc: Remove unused igc_read/write_pci_cfg wrappers Date: Thu, 26 Dec 2024 16:52:14 +0000 Message-ID: <20241226165215.105092-3-linux@treblig.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241226165215.105092-1-linux@treblig.org> References: <20241226165215.105092-1-linux@treblig.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC From: "Dr. David Alan Gilbert" igc_read_pci_cfg() and igc_write_pci_cfg were added in 2018 as part of commit 146740f9abc4 ("igc: Add support for PF") but have remained unused. Remove them. Signed-off-by: Dr. David Alan Gilbert --- drivers/net/ethernet/intel/igc/igc_hw.h | 2 -- drivers/net/ethernet/intel/igc/igc_main.c | 14 -------------- 2 files changed, 16 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h index d9d1a1a11daf..7ec7e395020b 100644 --- a/drivers/net/ethernet/intel/igc/igc_hw.h +++ b/drivers/net/ethernet/intel/igc/igc_hw.h @@ -281,7 +281,5 @@ struct net_device *igc_get_hw_dev(struct igc_hw *hw); s32 igc_read_pcie_cap_reg(struct igc_hw *hw, u32 reg, u16 *value); s32 igc_write_pcie_cap_reg(struct igc_hw *hw, u32 reg, u16 *value); -void igc_read_pci_cfg(struct igc_hw *hw, u32 reg, u16 *value); -void igc_write_pci_cfg(struct igc_hw *hw, u32 reg, u16 *value); #endif /* _IGC_HW_H_ */ diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 27872bdea9bd..9c92673a7240 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -6780,20 +6780,6 @@ static const struct net_device_ops igc_netdev_ops = { }; /* PCIe configuration access */ -void igc_read_pci_cfg(struct igc_hw *hw, u32 reg, u16 *value) -{ - struct igc_adapter *adapter = hw->back; - - pci_read_config_word(adapter->pdev, reg, value); -} - -void igc_write_pci_cfg(struct igc_hw *hw, u32 reg, u16 *value) -{ - struct igc_adapter *adapter = hw->back; - - pci_write_config_word(adapter->pdev, reg, *value); -} - s32 igc_read_pcie_cap_reg(struct igc_hw *hw, u32 reg, u16 *value) { struct igc_adapter *adapter = hw->back; From patchwork Thu Dec 26 16:52:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13921360 X-Patchwork-Delegate: kuba@kernel.org Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (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 C6E4113B7A1; Thu, 26 Dec 2024 16:52:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735231971; cv=none; b=Zy8m8xQRWsdmstfmP2uxE+DXToVLJlPz/eAHwumg3zGZRgbHXuM2/bBIrjglXBNMtTIsmxWsZi5OI3j9JlGw28hjs5F7db+qXOf/9FA8gVF7DQYR6vvPd5HQaDOQUkSseswsBQaIWz6pIqb1xg4/rVtctQ2WxPrWzIUP6rzKJsM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735231971; c=relaxed/simple; bh=Fi0bn4ckJEgIGDpgKWy3yhL85HYvSuIMnanl4g6FpyM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jieOnMl0lcfdTAC4zTMBEJU6MGW3RutTUa4A1j3at5BB3HFgeB+3xhAu8VpqfUXLM0k2bzv6IFY50rlzBaprJrfmyKNev3d17s0Dr7WDREKd0Q3dnnSvTfGnenR3E/cKjCNfM39F9cWxgWbBlXBDbCRE8e+FOz/Pml11p4kdo10= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=WXEOyl0f; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="WXEOyl0f" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=7AmYte8oTBIV4rhftXrsFRb4h3cQ6cpdyY2nNfyPAUo=; b=WXEOyl0fxXdhgbXP SlSEZIGhcqhU98vojNJqoUO2SX68Jgx6zyaCNiCGarFacJysuHxtXRooWGDfvzGmrCn4h7P1QefC4 z1USatp7VaiZkVchLulP0KoGlLzO0u62j2kbHmiJGUt2PEbiaDwWnHg0P2b5fA0QqpajbP2wIFnes xEq6AOCtC8BnF4pivVd+j6ch/0Jx2Ih5TLUTKPt54eNrqJIeeP+m27fMqURqwypwB6IZrHUxYA7Fb n3DOibfxxFo92xKNuxW+mUrQRFg4NQXL9alBvsFIHiE/oxaLkjUC7buQB0XbOmc0nW5XBlbZch+o3 plsTbZlXiQPoR8rTWQ==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1tQr5u-007IaP-1M; Thu, 26 Dec 2024 16:52:18 +0000 From: linux@treblig.org To: anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [RFC net-next 3/3] igc: Remove unused igc_read/write_pcie_cap_reg Date: Thu, 26 Dec 2024 16:52:15 +0000 Message-ID: <20241226165215.105092-4-linux@treblig.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241226165215.105092-1-linux@treblig.org> References: <20241226165215.105092-1-linux@treblig.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC From: "Dr. David Alan Gilbert" The last uses of igc_read_pcie_cap_reg() and igc_write_pcie_cap_reg() were removed in 2019 by commit 16ecd8d9af26 ("igc: Remove the obsolete workaround") Remove them. Signed-off-by: Dr. David Alan Gilbert --- drivers/net/ethernet/intel/igc/igc_hw.h | 3 --- drivers/net/ethernet/intel/igc/igc_main.c | 25 ----------------------- 2 files changed, 28 deletions(-) diff --git a/drivers/net/ethernet/intel/igc/igc_hw.h b/drivers/net/ethernet/intel/igc/igc_hw.h index 7ec7e395020b..be8a49a86d09 100644 --- a/drivers/net/ethernet/intel/igc/igc_hw.h +++ b/drivers/net/ethernet/intel/igc/igc_hw.h @@ -279,7 +279,4 @@ struct net_device *igc_get_hw_dev(struct igc_hw *hw); #define hw_dbg(format, arg...) \ netdev_dbg(igc_get_hw_dev(hw), format, ##arg) -s32 igc_read_pcie_cap_reg(struct igc_hw *hw, u32 reg, u16 *value); -s32 igc_write_pcie_cap_reg(struct igc_hw *hw, u32 reg, u16 *value); - #endif /* _IGC_HW_H_ */ diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index 9c92673a7240..f58cd6940434 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -6779,31 +6779,6 @@ static const struct net_device_ops igc_netdev_ops = { .ndo_get_tstamp = igc_get_tstamp, }; -/* PCIe configuration access */ -s32 igc_read_pcie_cap_reg(struct igc_hw *hw, u32 reg, u16 *value) -{ - struct igc_adapter *adapter = hw->back; - - if (!pci_is_pcie(adapter->pdev)) - return -IGC_ERR_CONFIG; - - pcie_capability_read_word(adapter->pdev, reg, value); - - return IGC_SUCCESS; -} - -s32 igc_write_pcie_cap_reg(struct igc_hw *hw, u32 reg, u16 *value) -{ - struct igc_adapter *adapter = hw->back; - - if (!pci_is_pcie(adapter->pdev)) - return -IGC_ERR_CONFIG; - - pcie_capability_write_word(adapter->pdev, reg, *value); - - return IGC_SUCCESS; -} - u32 igc_rd32(struct igc_hw *hw, u32 reg) { struct igc_adapter *igc = container_of(hw, struct igc_adapter, hw);