From nobody Mon Feb 19 07:00:26 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 4TdYMZ3gqqz59qR3; Mon, 19 Feb 2024 07:00:26 +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 4TdYMZ2sjhz43Pv; Mon, 19 Feb 2024 07:00:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326026; 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=Ws6iuvVlZAChpusuXfhIfTkJ4YQt4kHGOv06FG9CWeY=; b=kLrlhZAiWyKtNcqT13H9nyO4EID3s0jtSBnQ6NjVIte6h8DTbIYy5MioaCVhx1dEuoiw/B 5rUM9Makfun5TMDF8QJV4j/lDtasy+puhwT6GRF9a4P1rY8YJ+NfBxXaHenvBdrazxlnsP uj/uy5KuC/H5Ud2JTYLsDUtvAlKaaRmumxET1k2fRJHyYYexgmhR/wPSv39HyKVq0Ukf9b B1uPyqI//6uwbcqzcwczwWyhp6IDoH47SXqQ3iM+p3ZxoF7wFJnou87HpPzkTArU1nxx0v vCIrAh1rgNXGSdPRX4wjzLNTvbh2CqJ3p+N8/ndMIvvXi336YA1NxVMi9LNaUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708326026; 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=Ws6iuvVlZAChpusuXfhIfTkJ4YQt4kHGOv06FG9CWeY=; b=FdHmE269khtOVGlC//V4Ffuo20+hiEJFy5Bc+KH3u9lpAf9HrI81Wxrl9rAkA8+CsrH+b2 ofbeAKqpznXG+wntdo5tErRnuvb2E/wv5CV/n1rZtI1YeelFy3iEtRiZAF3I7yXt21oxEe UxYF/xFIzglUTA88JByHU7VJ9lVBQJ4V+TiR5QYlosQ1c2EF08p2TsUK5BaX4sLGX+GGG6 qIaOCZkebZ6V8itwpznao+Wqm3jOhR/1gDq+evot7o9vGacpJmVVQZnZeoJkujI61iztnv Af+OCHAaDdWSgqwOSrb2bB5dChn86moGVE9u1eWIjLYGBFdoiO+GQGnajEEQKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708326026; a=rsa-sha256; cv=none; b=U+J6PzvFxePnXCmkRCaAmjOOhl48jcwGcsRs8o1V/MK9uB9lIQAoHhPOz6zddHk7vyCAut EANy2InW9cVikzjsTTHlUpA0cQeJq/4CtBkT/9sLoEq+FmQwDZZf2c44VIk82n6g28FvgX jS7y8VUEpiPIHLe21IhiZNOK+sSfdmDyGV5zB21ut3BLaEh0AZLu96TnCe5xxHYGRRSTiA D8CMjg42JhQhrviH6WiP+2MACrnlZZN6QYa+Qa9ZQKETOffM9MXMDuQN7Jj1SAcR3qsIdY lvDS8XgQDwldCGqY2uMa8j3amotXd4oKGrwlMEMP85+qTemYWV7rNS5lWTYs+Q== 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 4TdYMZ1wSmzPQl; Mon, 19 Feb 2024 07:00:26 +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 41J70Q0t006512; Mon, 19 Feb 2024 07:00:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41J70QaH006509; Mon, 19 Feb 2024 07:00:26 GMT (envelope-from git) Date: Mon, 19 Feb 2024 07:00:26 GMT Message-Id: <202402190700.41J70QaH006509@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: da2e35b0ec99 - releng/13.3 - 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/releng/13.3 X-Git-Reftype: branch X-Git-Commit: da2e35b0ec99e979963923ed6392b3e883f40eb2 Auto-Submitted: auto-generated The branch releng/13.3 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=da2e35b0ec99e979963923ed6392b3e883f40eb2 commit da2e35b0ec99e979963923ed6392b3e883f40eb2 Author: John F. Carr AuthorDate: 2023-10-19 03:02:42 +0000 Commit: Warner Losh CommitDate: 2024-02-19 06:59:36 +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) (cherry picked from commit 898e02d740741d13a8948cbad4e0d969a768fd30) Approved-by: re (cperciva) --- 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 */