From mboxrd@z Thu Jan 1 00:00:00 1970 From: XinHong Zhu Subject: [PATCH] [scsi] : pm80xx : fix problem of pm8001_work_fn reseting uncorrect phy device Date: Fri, 14 Feb 2014 16:01:28 +0800 Message-ID: <1392364888-6996-1-git-send-email-zxh3737@163.com> Return-path: Received: from m12-17.163.com ([220.181.12.17]:50233 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753056AbaBNIBv (ORCPT ); Fri, 14 Feb 2014 03:01:51 -0500 Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: linux-scsi@vger.kernel.org Cc: lindar_liu@usish.com, XinHong Zhu If a phy device is removed ,the device can get error of I/O and HBA maybe receieve IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS of event which causes pm8001_work_fn to reset the phy device ,but in pm8001_task_exec don't assign a value for field device of ccb and in other case a ccb used have device field set , when ccb is freeed the field device of the ccb don't be set NULL.So there is possibility of getting another devcie reset in fun of mpi_ssp_completion .Also there are another way to solve problem by adding following code in mpi_SSP_completion: pm8001_dev = t->dev->lldd_dev; Signed-off-by: zhuxh --- drivers/scsi/pm8001/pm8001_sas.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c index f50ac44..f0ea5db 100644 --- a/drivers/scsi/pm8001/pm8001_sas.c +++ b/drivers/scsi/pm8001/pm8001_sas.c @@ -434,6 +434,7 @@ static int pm8001_task_exec(struct sas_task *task, const int num, ccb->n_elem = n_elem; ccb->ccb_tag = tag; ccb->task = t; + ccb->device = pm8001_dev; switch (t->task_proto) { case SAS_PROTOCOL_SMP: rc = pm8001_task_prep_smp(pm8001_ha, ccb); -- 1.7.9