From nobody Tue May 28 06:43:10 2024 X-Original-To: dev-commits-src-all@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 4VpNHy4hgDz5LnTB; Tue, 28 May 2024 06:43:10 +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 4VpNHy2Vcjz51DK; Tue, 28 May 2024 06:43:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716878590; 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=ucMVJi2pe4Tg+re5wHyf4NWRbJCl/2hC0oRme3fzL+8=; b=mYbl+/p6Si7FwvyxrfIB96QMJWdCwSfZUHdqehPh7Gxgk05GhsS4oTHlkaNlaNmlh3TGYq QgmkcSdTwHeZv4TR481BKOIcUuH7XlMrfbbo0/KY2nt1MieMYkFt3/V8DX2FWHxR4/4pTQ krtk7bra/T7t1NCYmuBUKrWteR1xQKJXJTND9oJS5G28hpbAh/R/7iqsxhAQ3UpnJmpCwP PI6Ohyzxcyahnj6GrfsSHjgwh4ze1g7SzBfgyWB9TLfa2GvU2pcpm3t7vh4ZPCB3Y4LCd5 Eqw9HpQNANFVgpQGtJ3pr2PsuehWjzsaBP/dpnPgS13cTMus89ey9MdQWGr3Sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716878590; a=rsa-sha256; cv=none; b=gZz86xc8vr6at+0+0yi0f4n3SvShw35fk6DRuDM03H+ERHiYSADXLU297yxSVU4Hsx26oe ZgaTNjkSEdGECXMP3Qd/BnVWMvqgvdcUkc2bhizXGfHsK3KgTuuopm26Q/4nLV+kdp2pP9 wKIj+8b5BIPIk54EYr9Q2BJmXRoUJF9cmTgloH9yWmK5rqmJQgigj8PsSwm5DYrDLAHBg6 SC2yoD8K6U0aowzvgruJer8cK3THYwbU/I63TFPPi0hBF95QDtmDsdlOZ7ibSyNVlH/UF+ Ircu+OjT2IflTBVRZS1klqsuRrr8dyotztqFnMbgi4pkeXewnvuAp2f2fXtdTg== 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=1716878590; 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=ucMVJi2pe4Tg+re5wHyf4NWRbJCl/2hC0oRme3fzL+8=; b=Hgdqhm+wmjl0TmrTw1etuJ0OoJRDz2DbrUy3V2XFjkqEvK2kQx4ymuOx1bAbw/ziRrEO3T hvukCWryeNYS/zIUe7gdeFvSek+qIs3ZvapuZaHPC7te2XLwUaoKMDIirYhY2njzGiUepj aXo6urxd3g5Em5lKY5fjpveQRx1e+ueygz1LIF46c/OgaaBKWRjnNaDHFRIijwzQpGOFYe etmaXIObZ35cCYI0mCVk99DRb4e3z9E5bgZhuRS9vtVRoo5fQoPJGkVmkkF0NRhXOVUCM7 xxJgKwZbEW1jyWXKBL9c3mhOrUuL7iGo7ZX2gL5meoBvoOaV4/LLSeJmxL57WQ== 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 4VpNHy25xqz1GTP; Tue, 28 May 2024 06:43:10 +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 44S6hAP8054443; Tue, 28 May 2024 06:43:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44S6hAuL054440; Tue, 28 May 2024 06:43:10 GMT (envelope-from git) Date: Tue, 28 May 2024 06:43:10 GMT Message-Id: <202405280643.44S6hAuL054440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: fb78e20b4e59 - main - Revert "qlnxe: Fix multiple locking issues" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fb78e20b4e5989a8d5f81d5765e77b4eb883a448 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=fb78e20b4e5989a8d5f81d5765e77b4eb883a448 commit fb78e20b4e5989a8d5f81d5765e77b4eb883a448 Author: Kevin Bowling AuthorDate: 2024-05-28 06:39:06 +0000 Commit: Kevin Bowling CommitDate: 2024-05-28 06:39:23 +0000 Revert "qlnxe: Fix multiple locking issues" This commit is missing a file, revert so I can do it correctly, atomically. This reverts commit 29684d08fa3010c2035b4eb1ce0b39091ad07723. --- sys/dev/qlnx/qlnxe/bcm_osal.h | 8 ++++---- sys/dev/qlnx/qlnxe/ecore.h | 1 - sys/dev/qlnx/qlnxe/ecore_mcp.h | 6 +++--- sys/dev/qlnx/qlnxe/qlnx_def.h | 2 +- sys/dev/qlnx/qlnxe/qlnx_os.c | 9 ++++----- sys/dev/qlnx/qlnxe/qlnx_os.h | 4 ++-- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/sys/dev/qlnx/qlnxe/bcm_osal.h b/sys/dev/qlnx/qlnxe/bcm_osal.h index c820532c9e0a..5d940d3272d6 100644 --- a/sys/dev/qlnx/qlnxe/bcm_osal.h +++ b/sys/dev/qlnx/qlnxe/bcm_osal.h @@ -72,7 +72,7 @@ extern void qlnx_dma_free_coherent(void *ecore_dev, void *v_addr, bus_addr_t phys, uint32_t size); extern void qlnx_link_update(void *p_hwfn); -extern void qlnx_barrier(void *p_dev); +extern void qlnx_barrier(void *p_hwfn); extern void *qlnx_zalloc(uint32_t size); @@ -213,14 +213,14 @@ typedef struct osal_list_t #define OSAL_SPIN_LOCK_ALLOC(p_hwfn, mutex) #define OSAL_SPIN_LOCK_DEALLOC(mutex) mtx_destroy(mutex) #define OSAL_SPIN_LOCK_INIT(lock) {\ - mtx_init(lock, __func__, "OSAL spin lock", MTX_SPIN); \ + mtx_init(lock, __func__, MTX_NETWORK_LOCK, MTX_SPIN); \ } #define OSAL_SPIN_UNLOCK(lock) {\ - mtx_unlock_spin(lock); \ + mtx_unlock(lock); \ } #define OSAL_SPIN_LOCK(lock) {\ - mtx_lock_spin(lock); \ + mtx_lock(lock); \ } #define OSAL_MUTEX_ALLOC(p_hwfn, mutex) diff --git a/sys/dev/qlnx/qlnxe/ecore.h b/sys/dev/qlnx/qlnxe/ecore.h index eda7c260ba99..8fcbc1f8d8a0 100644 --- a/sys/dev/qlnx/qlnxe/ecore.h +++ b/sys/dev/qlnx/qlnxe/ecore.h @@ -790,7 +790,6 @@ struct ecore_dev { u8 dp_level; char name[NAME_SIZE]; void *dp_ctx; - void *ha; enum ecore_dev_type type; /* Translate type/revision combo into the proper conditions */ diff --git a/sys/dev/qlnx/qlnxe/ecore_mcp.h b/sys/dev/qlnx/qlnxe/ecore_mcp.h index edb1f9083467..c94583cdfba3 100644 --- a/sys/dev/qlnx/qlnxe/ecore_mcp.h +++ b/sys/dev/qlnx/qlnxe/ecore_mcp.h @@ -51,10 +51,10 @@ struct ecore_mcp_info { /* List for mailbox commands which were sent and wait for a response */ osal_list_t cmd_list; - /* Lock used for protecting the access to the mailbox commands list + /* Spinlock used for protecting the access to the mailbox commands list * and the sending of the commands. */ - osal_mutex_t cmd_lock; + osal_spinlock_t cmd_lock; /* Flag to indicate whether sending a MFW mailbox command is blocked */ bool b_block_cmd; @@ -62,7 +62,7 @@ struct ecore_mcp_info { /* Spinlock used for syncing SW link-changes and link-changes * originating from attention context. */ - osal_mutex_t link_lock; + osal_spinlock_t link_lock; /* Address of the MCP public area */ u32 public_base; diff --git a/sys/dev/qlnx/qlnxe/qlnx_def.h b/sys/dev/qlnx/qlnxe/qlnx_def.h index 4342bba89587..8ac403ab49dc 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_def.h +++ b/sys/dev/qlnx/qlnxe/qlnx_def.h @@ -391,7 +391,7 @@ struct qlnx_host { int msix_count; - struct sx hw_lock; + struct mtx hw_lock; /* debug */ diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 2b3732e748fd..de64aaef1b4c 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -763,7 +763,7 @@ qlnx_pci_attach(device_t dev) ha->pci_dev = dev; - sx_init(&ha->hw_lock, "qlnx_hw_lock"); + mtx_init(&ha->hw_lock, "qlnx_hw_lock", MTX_NETWORK_LOCK, MTX_DEF); ha->flags.lock_init = 1; @@ -1207,7 +1207,6 @@ qlnx_init_hw(qlnx_host_t *ha) int rval = 0; struct ecore_hw_prepare_params params; - ha->cdev.ha = ha; ecore_init_struct(&ha->cdev); /* ha->dp_module = ECORE_MSG_PROBE | @@ -1352,7 +1351,7 @@ qlnx_release(qlnx_host_t *ha) pci_release_msi(dev); if (ha->flags.lock_init) { - sx_destroy(&ha->hw_lock); + mtx_destroy(&ha->hw_lock); } if (ha->pci_reg) @@ -5397,11 +5396,11 @@ qlnx_zalloc(uint32_t size) } void -qlnx_barrier(void *p_dev) +qlnx_barrier(void *p_hwfn) { qlnx_host_t *ha; - ha = ((struct ecore_dev *) p_dev)->ha; + ha = (qlnx_host_t *)((struct ecore_hwfn *)p_hwfn)->p_dev; bus_barrier(ha->pci_reg, 0, 0, BUS_SPACE_BARRIER_WRITE); } diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.h b/sys/dev/qlnx/qlnxe/qlnx_os.h index 6d717d0e70bf..261283fb6eaf 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.h +++ b/sys/dev/qlnx/qlnxe/qlnx_os.h @@ -130,8 +130,8 @@ MALLOC_DECLARE(M_QLNXBUF); /* * Locks */ -#define QLNX_LOCK(ha) sx_xlock(&ha->hw_lock) -#define QLNX_UNLOCK(ha) sx_xunlock(&ha->hw_lock) +#define QLNX_LOCK(ha) mtx_lock(&ha->hw_lock) +#define QLNX_UNLOCK(ha) mtx_unlock(&ha->hw_lock) /* * structure encapsulating a DMA buffer