From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 25AB73BFE33; Sat, 17 Oct 2026 17:15:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792257304; cv=none; b=Avfz6kvkAJrqabGOiG/BT+DeN1QE9V34QMcSXPIoPlRa+8/g/OGjPw3obPQkj9yfD0La87kNuc/yee3CXhnXa1rS93Ho5ApiX1c7fhUFetd2lz/wiJlXs6iF3ve2qLsM4MOLKUvhgfyQBIQutH02uvSW3OfPyp8li7b1CLG/Gqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792257304; c=relaxed/simple; bh=7LOBI2SpuKxw4qkOwocpTzzu93M9+feuO+3E3NlyGJw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W82ZPfTO8wVzRkG+OJebGkMpJ942oGvQf6oWtFO7Wf0AmWvWMSbxJrZj896lH3+11fCgI2BqsFFWe+oDqKWCNVXCAbsIKcPqpge39ttbvf2BKU4fSq/cQPQcDXnksmhdfEzXiA5KVu66ESubSG0wrs26s9rfAAms1D1ieXmNaEI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NkaIBmMV; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NkaIBmMV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 854FC1F000CA; Sat, 17 Oct 2026 17:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792257302; bh=E0sz8lwq+tz1jUg23BooD2QdZ5kzrqYfgzuW5MBGrTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NkaIBmMVEdgwIsIa4WKOcrixOVScO0FUnS8ybNcuy+qp/bnNcsqt/aslmdLR8rEO2 gJZQI3Aye9qe9JGwjdATI4aLo063WB4ethxZbxRm4x6oLxZ1f9d72oBLn3/LlMzmC5 CyQXcHEczgYKF4aRv4s9oqbb73mfGs5y3nn54Iqs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Runyu Xiao , "Martin K. Petersen (Oracle)" Subject: [PATCH 6.6 0515/1674] scsi: qedi: Initialize callback state before registration Date: Sat, 17 Oct 2026 17:46:27 +0200 Message-ID: <20261017160444.323848384@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160431.119607952@linuxfoundation.org> References: <20261017160431.119607952@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev 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: Runyu Xiao commit 85de8b3a5eaa23d153aff4c7c83dddbc949064c9 upstream. qedi_get_protocol_tlv_data() can be called asynchronously by QED after qedi_ops->register_ops(). It takes stats_lock and reads ll2_mtu, but __qedi_probe() currently registers the callback before initializing the mutex and assigning the default MTU on the normal probe path. Initialize the callback-visible state before registering qedi_cb_ops. Keep the recovery path from reinitializing state because it reuses the existing qedi context. Fixes: 3cc5746e5ad7 ("scsi: qedi: Initialize the stats mutex lock") Cc: stable@vger.kernel.org Assisted-by: LLM Codex Signed-off-by: Runyu Xiao Link: https://patch.msgid.link/20260910092405.1300129-1-runyu.xiao@seu.edu.cn Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/qedi/qedi_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -2664,8 +2664,6 @@ retry_probe: snprintf(host_buf, sizeof(host_buf), "host_%d", qedi->shost->host_no); qedi_ops->common->set_name(qedi->cdev, host_buf); - qedi_ops->register_ops(qedi->cdev, &qedi_cb_ops, qedi); - memset(¶ms, 0, sizeof(params)); params.mtu = DEF_PATH_MTU + IPV6_HDR_LEN + TCP_HDR_LEN; qedi->ll2_mtu = DEF_PATH_MTU; @@ -2682,6 +2680,7 @@ retry_probe: spin_lock_init(&qedi->task_idx_lock); mutex_init(&qedi->stats_lock); } + qedi_ops->register_ops(qedi->cdev, &qedi_cb_ops, qedi); qedi_ops->ll2->register_cb_ops(qedi->cdev, &qedi_ll2_cb_ops, qedi); qedi_ops->ll2->start(qedi->cdev, ¶ms);