From nobody Mon Feb 19 04:50:02 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 4TdVT71K60z592tw; Mon, 19 Feb 2024 04:50:03 +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 4TdVT70bTbz51gB; Mon, 19 Feb 2024 04:50:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318203; 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=Y25yIVRSQbt3dpGHXW2y5zRwIXHU8owIpRbRSFY3YWc=; b=uPpLRuGkFBo82dBgBTCUA+oRZvJBI/VMzYeCge47iqNPovs7tTT6UnGXj2Im4eoy4+n8dw 7LxOfUT5UbgPGafJ9WTPbZUd9PAxhWa4Gt8/Z6aMF3k4Sn75sC4wTr77GlTyFqu7ZpG+QJ ZxgiyTK42W0XOLFgAX/2rp2MUxjfuOSWmnLbdf07Ha0LrL0ythzbIZ1ywGrjNjjuBpge/+ f8qXDEZZPu3tTiRNzmQj726ShPoT1ai+w3+9VeaAPFlHSl0xLXNK0Z2z3WZd/bG4bGC3h7 nzTpCGc4aIfwc5dcDutU6KMmAqLJf8YzNWQmtRxl9ZNnMOybpe3Hi8isMDBuYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708318203; 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=Y25yIVRSQbt3dpGHXW2y5zRwIXHU8owIpRbRSFY3YWc=; b=nlpUTlzonlonroXKb3i6BEt+8YGvjYr7QGudX1KUQ1TmsP4b9w+pQthWKFisSceDUkTe+5 yrDK5nLHg8EbA+hnhgsDru6ITBXR0MUCPUOFYh2grNapRFJKqW0p/THd6kL/yT4MHsxO30 FF8gSbFFZBUbpTD7mv4Ydg4IPgXm+SLiYNBLQCFyZANOTQ2uchwzmmQbgA9grpscz5U4ue cE2AEka6Y3vxJWr+rB79mHpJcAsnsq2onyIN+TIEqN51zzr5uZDQZBJbILrgkMZmF28wM6 uiz/JZn0E2LxIZtYvOBAUVniALtsgMgDJjUnXZW4nmo0JLL1EQZuJsgPge3VUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708318203; a=rsa-sha256; cv=none; b=SoNIIpnbhuxDKKOrRN8zWphWf4QAcjpeT+FvCYfM+aNu9zirdcD/5j0Iv0ysotR738oGgF EsKWslX9oanm2lb+TVdtlEA2JJvLgngYbVpNxt5tjyU4CRsYyHhS3ZNBIEHtQPtdjKgf/K yZ3ptekZMJYM7b7+Yoo5eT+ygaZ7h6GVado5XGhTeZ6QTlO8BrFNyQZNo7am8gKBZ81QF4 btI1uTcm/uaLTeNHrikAISD1JoC1xF+1lvpXzQhRs2PO30ro8Wr4N3cJyLr0u7p/GKuRun Pq7lINuLv7qQc8cCb05dhYpZe69dXlJ2a2+t7eQy85pzAOHsVTkSpSgAtf4BmA== 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 4TdVT66mXlzKgn; Mon, 19 Feb 2024 04:50:02 +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 41J4o2k4079435; Mon, 19 Feb 2024 04:50:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J4o2Qi079431; Mon, 19 Feb 2024 04:50:02 GMT (envelope-from git) Date: Mon, 19 Feb 2024 04:50:02 GMT Message-Id: <202402190450.41J4o2Qi079431@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 898e02d74074 - stable/13 - smartpqi: Drop spinlock before freeing memory 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 898e02d740741d13a8948cbad4e0d969a768fd30 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=898e02d740741d13a8948cbad4e0d969a768fd30 commit 898e02d740741d13a8948cbad4e0d969a768fd30 Author: John F. Carr AuthorDate: 2023-10-19 03:02:42 +0000 Commit: Warner Losh CommitDate: 2024-02-19 04:07:04 +0000 smartpqi: Drop spinlock before freeing memory pqisrc_free_device frees the device softc with the os spinlock held. This causes crashes when devices are removed because the memory free might sleep (which is prohibited with spin locks held). Drop the spinlock before releasing the memory. MFC After: 2 days PR: 273289 Reviewed by: imp This is the alternate fix from the box. (this is not a cherry pick of b064a4c9eed5b1dd2a40fc4fd2cb7e738b681547) --- sys/dev/smartpqi/smartpqi_discovery.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/smartpqi/smartpqi_discovery.c b/sys/dev/smartpqi/smartpqi_discovery.c index 48243d8fc882..08722a35b707 100644 --- a/sys/dev/smartpqi/smartpqi_discovery.c +++ b/sys/dev/smartpqi/smartpqi_discovery.c @@ -1460,10 +1460,9 @@ pqisrc_free_device(pqisrc_softstate_t * softs,pqi_scsi_dev_t *device) softs->device_list[device->target][device->lun] = NULL; - pqisrc_device_mem_free(softs, device); - OS_RELEASE_SPINLOCK(&softs->devlist_lock); + pqisrc_device_mem_free(softs, device); } /* Update the newly added devices to the device list */