From nobody Mon Apr 29 19:45:48 2024 X-Original-To: dev-commits-src-main@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 4VSy1d6yLHz5Jvwf; Mon, 29 Apr 2024 22:00:21 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSy1d1MrSz4p96; Mon, 29 Apr 2024 22:00:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714428021; 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=Fl4c/LiCosVWawtK+6PHEwJ0yR0E3IL7hmXw2u4YIlk=; b=ywwVbiqaElKCaQJRCNaCttIn2WXJPBuxzi2xcBQwPjyh3BaYZ1KWfNmV6EIlj6UA0JxWH+ F2irAGFH3E93lJxgDoDAHimHOUjknFdrzNW6REVyHbXYTF/wA7+Jvdd5ZuGqR6Nr71FzTY yrJVGDdt2W5ov9T3MwpuEBFMdMDPBlg3MF+kgYdgo+vW6Mxqf34wjlT7BjyzjS5sT+q7VV qWh+0KfFV2BJj+9Na3CxYQTI36Vh1hVWeBtPYGOHor+3IplpRvoYKGl5S3+IktITlS2ol8 AoWleQKQt6xTYOXZHAbGINeo3Z3dtj/6gd/6Y1fsRlrsi1luGBEay9N1MPRqbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714428021; a=rsa-sha256; cv=none; b=xouLKYeegSwVaWUB3u+8gfDPfCJWdRilR5HrsUubmTTwgnQWLHmfefeOIdRURDQe6bEV5L RHmWNem1jXEPNByHNPiFmw8kCoNvUkYQCkVp1UJ0rlrvIQpLDV10x6FJ29LuH3TqeHuog8 hJwW+SMpiaRJFNN4Nnj7UlcAf3v3FJM8ooVjRrWZZgXWNVm0HMGxh0HbHSLRbA6Graucwl TYRyrCUm0r0JVcG6p+ODuP/M7RABu45D7bEMHhCraX6PmTNJBnbCc1q32NOm28XOFpTwcd LePv3AYepZS9mVX2E3R+uF7rHFVBhNFzgzmoI6gMJUSBAhw/z1B4HX9iecVlIQ== 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=1714428021; 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=Fl4c/LiCosVWawtK+6PHEwJ0yR0E3IL7hmXw2u4YIlk=; b=o5W/2GFtdGvmofZ2A2vlfPk/+s+t9rnQPe7QsAAv+1B9OYZDx5BIClNjbfMK9K9YCnIBT0 IY/8VsIjQLSBGjwliSiqrfnUcyUg174xM1cuJAMfDU2VZzsoC+pYP1NxKQd6rVLm8YeYAe 3xDDsMorfE03AyprNoHW35D5uZeuUAHPwPfbtktkVSofBwQEvvae7/UPFWhRkcQ3pybRFD KYJH0BFrgHGwF1h4OBSwKeCeAZP3fqTxBt7gy1MQ6NOoj1SB7jI8SsmkiVERc23w9kKhPE oOC1kgRVX0ysHdy0cByLrM2IVGScxs08Xahy/I6BUjaL8d2dXL0qCQIO+lSUrA== Received: from gitrepo.freebsd.org (unknown [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 4VSxgf1rdsz1KJX; Mon, 29 Apr 2024 21:44:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43TJjmSF004495; Mon, 29 Apr 2024 19:45:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43TJjm88004492; Mon, 29 Apr 2024 19:45:48 GMT (envelope-from git) Date: Mon, 29 Apr 2024 19:45:48 GMT Message-Id: <202404291945.43TJjm88004492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 1c7f9c8b4673 - main - cxgbe(4): Retire t4_intr_clear. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 1c7f9c8b4673abf3723be09afed4443261e0d186 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=1c7f9c8b4673abf3723be09afed4443261e0d186 commit 1c7f9c8b4673abf3723be09afed4443261e0d186 Author: Navdeep Parhar AuthorDate: 2024-04-26 00:39:55 +0000 Commit: Navdeep Parhar CommitDate: 2024-04-29 19:34:51 +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. MFC after: 1 week Sponsored by: Chelsio Communications --- 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 79bb6276f4c7..f91d4ebf7334 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 4ca87727ca59..e3d5cf814e4d 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 5c2e1fd232c2..7bdce5faf7af 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1333,7 +1333,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); @@ -2289,7 +2288,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);