From nobody Wed Jul 17 14:24:33 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WPJ9G0psJz5RPr7; Wed, 17 Jul 2024 14:24:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WPJ9F5Mtwz40lf; Wed, 17 Jul 2024 14:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721226273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sOjo/cbUnFo548wXensA+goDSXeumfaUnLs/vC1ca5g=; b=MNKzTFJSFVUxQ+S27w59EzFKpSsssPW/sMaTMynHvZHsAEhFyy+zop5PF+9R9bW0NzB50C uF9IdNdczU7ffKxqWq9nVE3TjasyeVDYnlLCc0QxRvHvE8Ov8HWJGO9T1ic02BAjIKyzMo NQXq9SS8HX+zKjAOPr05GIX+NWIDLFNgr5Nmphj4MKHNZxBiHA0Lc30KiHxG9m78+Zty5p yvpO+hOSqHw30gpqvJQbXKJcbSgvuSH/sHstZdtSYZ7mKvAQWYiel8RS5gCrzOFqLna35r NSgSUNXXW02qYaQ8LE2e9kzSIAO0rd0Il4kzf1y8Bem5bQSMqVuVCNvPYqA7wA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721226273; a=rsa-sha256; cv=none; b=XlVQIXnJmT6LUSvEdhXC9VfPKNalB0xw4fWWEvYR79sIIRMlXbz70jwc3B9FYlhrgqyFxi dbfLiCrRvjxK7D6jPt1fY81hHDWXSjS5gQzpyxqRn1wmvb5RSfZjC/mzLkM+dwMfBS5mjv t3synF5eFPiExAovQXzYe1f8056aoWc1Y4NY1y1rWuzket4vr+JYWGlB3EWYTsb99RvPIy TR7zfD7HFnBZNtX9Lo6nO4ZWBNPJnklq0OO6hTxwHabEYdPDsaWP+k1cIrHrJHuE8O5cN4 ic7SR1kTX1CwhZ7ljpFhNiwvRaaplLpM9QVs6KofsnKRPHQ3NpRwzuqudoxFiA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721226273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sOjo/cbUnFo548wXensA+goDSXeumfaUnLs/vC1ca5g=; b=wE2bToiWjQ53/vHfkpGJiT+2OMI/5Ue8lncFmfR64Esp5wqfUen0mN4lAmbR0Tv5095XDR IydZA+LxEfSFA8G8U118WFAZhP8jYO702uRhRqh0QGdcJQxCtSnHGbr8EMM3WDFaffg6t9 UBElmuyb7/fp+TvyapGc7cjPc68HAE0hOyG0ym5gwsoxolPkGmwVlysAeJ73WuqWk/+M+8 MXIfV6KfZhqOZK9jXenthsIko662MgX9p0NSRDSaAq4aUppHd6RGgS65o5a3vBdeDVxvfm x5VR5Zricfh8Azs1wEAis6/bJQbjowI3SrUlAyehl3//q5DrOLrNzUNSyq3hgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WPJ9F50FCz1MnH; Wed, 17 Jul 2024 14:24:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46HEOXnE032894; Wed, 17 Jul 2024 14:24:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46HEOXvf032891; Wed, 17 Jul 2024 14:24:33 GMT (envelope-from git) Date: Wed, 17 Jul 2024 14:24:33 GMT Message-Id: <202407171424.46HEOXvf032891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: fd90e164109f - stable/13 - cxgbe(4): Retire t4_intr_clear. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fd90e164109f9ccd7e0d94e38226403880526034 Auto-Submitted: auto-generated The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=fd90e164109f9ccd7e0d94e38226403880526034 commit fd90e164109f9ccd7e0d94e38226403880526034 Author: Navdeep Parhar AuthorDate: 2024-04-26 00:39:55 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-17 07:13:19 +0000 cxgbe(4): Retire t4_intr_clear. The firmware clears the interrupts already and it has a better idea of exactly what to clear for which generation of the ASIC. There is no need for the driver to get involved. Sponsored by: Chelsio Communications (cherry picked from commit 1c7f9c8b4673abf3723be09afed4443261e0d186) --- sys/dev/cxgbe/common/common.h | 1 - sys/dev/cxgbe/common/t4_hw.c | 93 ------------------------------------------- sys/dev/cxgbe/t4_main.c | 2 - 3 files changed, 96 deletions(-) diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 3d546c2f976f..f43ffc83dff1 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -618,7 +618,6 @@ struct fw_filter_wr; void t4_intr_enable(struct adapter *adapter); void t4_intr_disable(struct adapter *adapter); -void t4_intr_clear(struct adapter *adapter); bool t4_slow_intr_handler(struct adapter *adapter, bool verbose); int t4_hash_mac_addr(const u8 *addr); diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index cf4f5a65c3e5..b58d9f5df0d9 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -5454,99 +5454,6 @@ void t4_intr_disable(struct adapter *adap) t4_set_reg_field(adap, A_PL_INT_MAP0, 1 << adap->pf, 0); } -/** - * t4_intr_clear - clear all interrupts - * @adap: the adapter whose interrupts should be cleared - * - * Clears all interrupts. The caller must be a PCI function managing - * global interrupts. - */ -void t4_intr_clear(struct adapter *adap) -{ - static const u32 cause_reg[] = { - A_CIM_HOST_INT_CAUSE, - A_CIM_HOST_UPACC_INT_CAUSE, - MYPF_REG(A_CIM_PF_HOST_INT_CAUSE), - A_CPL_INTR_CAUSE, - EDC_REG(A_EDC_INT_CAUSE, 0), EDC_REG(A_EDC_INT_CAUSE, 1), - A_LE_DB_INT_CAUSE, - A_MA_INT_WRAP_STATUS, - A_MA_PARITY_ERROR_STATUS1, - A_MA_INT_CAUSE, - A_MPS_CLS_INT_CAUSE, - A_MPS_RX_PERR_INT_CAUSE, - A_MPS_STAT_PERR_INT_CAUSE_RX_FIFO, - A_MPS_STAT_PERR_INT_CAUSE_SRAM, - A_MPS_TRC_INT_CAUSE, - A_MPS_TX_INT_CAUSE, - A_MPS_STAT_PERR_INT_CAUSE_TX_FIFO, - A_NCSI_INT_CAUSE, - A_PCIE_INT_CAUSE, - A_PCIE_NONFAT_ERR, - A_PL_PL_INT_CAUSE, - A_PM_RX_INT_CAUSE, - A_PM_TX_INT_CAUSE, - A_SGE_INT_CAUSE1, - A_SGE_INT_CAUSE2, - A_SGE_INT_CAUSE3, - A_SGE_INT_CAUSE4, - A_SMB_INT_CAUSE, - A_TP_INT_CAUSE, - A_ULP_RX_INT_CAUSE, - A_ULP_RX_INT_CAUSE_2, - A_ULP_TX_INT_CAUSE, - A_ULP_TX_INT_CAUSE_2, - - MYPF_REG(A_PL_PF_INT_CAUSE), - }; - int i; - const int nchan = adap->chip_params->nchan; - - for (i = 0; i < ARRAY_SIZE(cause_reg); i++) - t4_write_reg(adap, cause_reg[i], 0xffffffff); - - if (is_t4(adap)) { - t4_write_reg(adap, A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, - 0xffffffff); - t4_write_reg(adap, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, - 0xffffffff); - t4_write_reg(adap, A_MC_INT_CAUSE, 0xffffffff); - for (i = 0; i < nchan; i++) { - t4_write_reg(adap, PORT_REG(i, A_XGMAC_PORT_INT_CAUSE), - 0xffffffff); - } - } - if (chip_id(adap) >= CHELSIO_T5) { - t4_write_reg(adap, A_MA_PARITY_ERROR_STATUS2, 0xffffffff); - t4_write_reg(adap, A_MPS_STAT_PERR_INT_CAUSE_SRAM1, 0xffffffff); - t4_write_reg(adap, A_SGE_INT_CAUSE5, 0xffffffff); - t4_write_reg(adap, A_MC_P_INT_CAUSE, 0xffffffff); - if (is_t5(adap)) { - t4_write_reg(adap, MC_REG(A_MC_P_INT_CAUSE, 1), - 0xffffffff); - } - for (i = 0; i < nchan; i++) { - t4_write_reg(adap, T5_PORT_REG(i, - A_MAC_PORT_PERR_INT_CAUSE), 0xffffffff); - if (chip_id(adap) > CHELSIO_T5) { - t4_write_reg(adap, T5_PORT_REG(i, - A_MAC_PORT_PERR_INT_CAUSE_100G), - 0xffffffff); - } - t4_write_reg(adap, T5_PORT_REG(i, A_MAC_PORT_INT_CAUSE), - 0xffffffff); - } - } - if (chip_id(adap) >= CHELSIO_T6) { - t4_write_reg(adap, A_SGE_INT_CAUSE6, 0xffffffff); - } - - t4_write_reg(adap, A_MPS_INT_CAUSE, is_t4(adap) ? 0 : 0xffffffff); - t4_write_reg(adap, A_PL_PERR_CAUSE, 0xffffffff); - t4_write_reg(adap, A_PL_INT_CAUSE, 0xffffffff); - (void) t4_read_reg(adap, A_PL_INT_CAUSE); /* flush */ -} - /** * hash_mac_addr - return the hash value of a MAC address * @addr: the 48-bit Ethernet MAC address diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 9a637767c9a6..b9b9b3150caf 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1341,7 +1341,6 @@ t4_attach(device_t dev) rc = partition_resources(sc); if (rc != 0) goto done; /* error message displayed already */ - t4_intr_clear(sc); } rc = get_params__post_init(sc); @@ -2303,7 +2302,6 @@ t4_resume(device_t dev) rc = partition_resources(sc); if (rc != 0) goto done; /* error message displayed already */ - t4_intr_clear(sc); } rc = get_params__post_init(sc);