From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D71BA15E8B; Mon, 30 Dec 2024 15:51:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735573894; cv=none; b=Bn7y21KcZx9NMHDE3CNUeWo6MbwltWEC7uZwWzlDjXHFsiN40CGtU7TFlsHp271J8sagkdLBrddBV6yL04Q8zGmEW4QQiKNWGOO2/xCyy+jVKC8GgjljsrCQsNFeto3tNk+YUfBVkv/vLp0iWP827OsPDvgifD0zBqifrT6GIVM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735573894; c=relaxed/simple; bh=WpbHiFsaYGpFbC3NAg1s5PEEJkfBrKDnolW4jftFoiU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s8vw1Ykl2hnK0tltpC2EbAdahqKqdA2w2KnbTsn1SiiDL9YwNXNI+NPZHFI1Bg+4ylylrKEfMBRZ76U4tN0wpRsoEOswXGJCR++XjxOwzbvv4LcQi39HpZXZ0nqGWmgKa2NRmbzixnEmTfnGdOVL3NHunJqlBccUilf+eUSoNJ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BuO9j2xE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BuO9j2xE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43A73C4CED0; Mon, 30 Dec 2024 15:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735573894; bh=WpbHiFsaYGpFbC3NAg1s5PEEJkfBrKDnolW4jftFoiU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BuO9j2xEWi6Ne1vsj7bXYzkmCfui2v676ZMQzoegA1DkszAWcgYFu7s7MfISP4xkp 4DzN7o8FXK+VEURWUepIRz0S8lGy7qQPB3n91wyhQLouRETnZZKyoC45vKeDJIrCaW OWaAv+Fv89+tpexZwQ7dsv02vDqh5AuC4mprQsyE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tomas Henzl , Chandrakanth Patil , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 6.6 35/86] scsi: megaraid_sas: Fix for a potential deadlock Date: Mon, 30 Dec 2024 16:42:43 +0100 Message-ID: <20241230154213.057016918@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241230154211.711515682@linuxfoundation.org> References: <20241230154211.711515682@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tomas Henzl [ Upstream commit 50740f4dc78b41dec7c8e39772619d5ba841ddd7 ] This fixes a 'possible circular locking dependency detected' warning CPU0 CPU1 ---- ---- lock(&instance->reset_mutex); lock(&shost->scan_mutex); lock(&instance->reset_mutex); lock(&shost->scan_mutex); Fix this by temporarily releasing the reset_mutex. Signed-off-by: Tomas Henzl Link: https://lore.kernel.org/r/20240923174833.45345-1-thenzl@redhat.com Acked-by: Chandrakanth Patil Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/megaraid/megaraid_sas_base.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 3d4f13da1ae8..4cc93cb79b8b 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -8904,8 +8904,11 @@ megasas_aen_polling(struct work_struct *work) (ld_target_id / MEGASAS_MAX_DEV_PER_CHANNEL), (ld_target_id % MEGASAS_MAX_DEV_PER_CHANNEL), 0); - if (sdev1) + if (sdev1) { + mutex_unlock(&instance->reset_mutex); megasas_remove_scsi_device(sdev1); + mutex_lock(&instance->reset_mutex); + } event_type = SCAN_VD_CHANNEL; break; -- 2.39.5