From nobody Sat Oct 4 14:13:10 2025 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (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 051D5270540; Sat, 16 Aug 2025 10:53:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755341593; cv=none; b=qUZpdmP2nLe37NEB5nu89A59Olwfjutzne0Rp7fVYzvwwgo8DV2NR9yH16gUVp2Y48xz4FZbTwmnFmIn1prkZqzfXsXe6qFyDgudcieBMQa5Y43LZmD4gmxB6thsjbj3ireMHuZafyQyFpzbz8rlc/jiEW9cj/YE50cjjBwSW6g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755341593; c=relaxed/simple; bh=34tW2e3C5M3cp3ogF+1sE3TiPvSLtG2Dj12a0Ql5z0o=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lgoxLUWx1/exVpyoKd7EBghTADPO2ymfBA33UuwJeu58rIP+bSiNQzrziZDPQ+WTqYSGe9lrTIQ4x5jxQ6aO40MpSPgKQhO+4kzGvvC8fyv2NysJ/N1uUMzFW/9yBJ9vs5aR4QbIJCkYnpYwNdvyUM4HGoNte9V0vVI4Ukyl0XY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=h-partners.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=h-partners.com Received: from mail.maildlp.com (unknown [172.19.88.214]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4c3wjh68VDz2gKxD; Sat, 16 Aug 2025 18:50:16 +0800 (CST) Received: from kwepemk500001.china.huawei.com (unknown [7.202.194.86]) by mail.maildlp.com (Postfix) with ESMTPS id 2C08A1A016C; Sat, 16 Aug 2025 18:53:08 +0800 (CST) Received: from localhost.localdomain (10.175.104.170) by kwepemk500001.china.huawei.com (7.202.194.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Sat, 16 Aug 2025 18:53:07 +0800 From: JiangJianJun To: , , CC: , , , , , , , , , , , Subject: [PATCH 02/14] scsi: scsi_error: Move complete variable eh_action from shost to sdevice Date: Sat, 16 Aug 2025 19:24:05 +0800 Message-ID: <20250816112417.3581253-3-jiangjianjun3@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20250816112417.3581253-1-jiangjianjun3@huawei.com> References: <20250816112417.3581253-1-jiangjianjun3@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: kwepems100002.china.huawei.com (7.221.188.206) To kwepemk500001.china.huawei.com (7.202.194.86) Content-Type: text/plain; charset="utf-8" From: Wenchao Hao eh_action is used to wait for error handle command's completion if scsi command is send in error handle. Now the error handler might based on scsi_device, so move it to scsi_device. This is preparation for a genernal LUN/target based error handle strategy. Signed-off-by: Wenchao Hao Co-developed-by: JiangJianJun Signed-off-by: JiangJianJun --- drivers/scsi/scsi_error.c | 6 +++--- include/scsi/scsi_device.h | 2 ++ include/scsi/scsi_host.h | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 135b63d89d72..6020f20c7f07 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -954,7 +954,7 @@ void scsi_eh_done(struct scsi_cmnd *scmd) SCSI_LOG_ERROR_RECOVERY(3, scmd_printk(KERN_INFO, scmd, "%s result: %x\n", __func__, scmd->result)); =20 - eh_action =3D scmd->device->host->eh_action; + eh_action =3D scmd->device->eh_action; if (eh_action) complete(eh_action); } @@ -1243,7 +1243,7 @@ static enum scsi_disposition scsi_send_eh_cmnd(struct= scsi_cmnd *scmd, =20 retry: scsi_eh_prep_cmnd(scmd, &ses, cmnd, cmnd_size, sense_bytes); - shost->eh_action =3D &done; + sdev->eh_action =3D &done; =20 scsi_log_send(scmd); scmd->submitter =3D SUBMITTED_BY_SCSI_ERROR_HANDLER; @@ -1287,7 +1287,7 @@ static enum scsi_disposition scsi_send_eh_cmnd(struct= scsi_cmnd *scmd, rtn =3D SUCCESS; } =20 - shost->eh_action =3D NULL; + sdev->eh_action =3D NULL; =20 scsi_log_completion(scmd, rtn); =20 diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 6a58b297e74c..6f47a7a74cd1 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -345,6 +345,8 @@ struct scsi_device { enum scsi_device_state sdev_state; struct task_struct *quiesced_by; struct scsi_device_eh *eh; + struct completion *eh_action; /* Wait for specific actions */ + /* on the device. */ unsigned long sdev_data[]; } __attribute__((aligned(sizeof(unsigned long)))); =20 diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index c53812b9026f..46f57fe78505 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -558,8 +558,6 @@ struct Scsi_Host { struct list_head eh_abort_list; struct list_head eh_cmd_q; struct task_struct * ehandler; /* Error recovery thread. */ - struct completion * eh_action; /* Wait for specific actions on the - host. */ wait_queue_head_t host_wait; const struct scsi_host_template *hostt; struct scsi_transport_template *transportt; --=20 2.33.0