Re: [libsas PATCH v10 6/9] libsas: use ->lldd_I_T_nexus_reset for ->eh_bus_reset_handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks OK to me.
Thanks.
Acked-by: Jack Wang <jack_wang@xxxxxxxxx>


--------------
jack_wang
>sas_eh_bus_reset_handler() amounts to sas_phy_reset() without
>notification of the reset to the lldd.  If this is triggered from
>eh-cmnd recovery there may be sas_tasks for the lldd to terminate, so
>->lldd_I_T_nexus_reset is warranted.
>
>Cc: Xiangliang Yu <yuxiangl@xxxxxxxxxxx>
>Cc: Luben Tuikov <ltuikov@xxxxxxxxx>
>Cc: Jack Wang <jack_wang@xxxxxxxxx>
>Reviewed-by: Jacek Danecki <jacek.danecki@xxxxxxxxx>
>[jacek: modify pm8001_I_T_nexus_reset to return -ENODEV]
>Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
>---
> drivers/scsi/libsas/sas_scsi_host.c |   19 ++++++++-----------
> drivers/scsi/pm8001/pm8001_sas.c    |    3 ++-
> 2 files changed, 10 insertions(+), 12 deletions(-)
>
>diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
>index dec992b..a5c4ce4 100644
>--- a/drivers/scsi/libsas/sas_scsi_host.c
>+++ b/drivers/scsi/libsas/sas_scsi_host.c
>@@ -576,25 +576,22 @@ int sas_eh_device_reset_handler(struct scsi_cmnd *cmd)
> 	return FAILED;
> }
> 
>-/* Attempt to send a phy (bus) reset */
> int sas_eh_bus_reset_handler(struct scsi_cmnd *cmd)
> {
>-	struct domain_device *dev = cmd_to_domain_dev(cmd);
>-	struct sas_phy *phy = sas_get_local_phy(dev);
>-	struct Scsi_Host *host = cmd->device->host;
> 	int res;
>+	struct Scsi_Host *host = cmd->device->host;
>+	struct domain_device *dev = cmd_to_domain_dev(cmd);
>+	struct sas_internal *i = to_sas_internal(host->transportt);
> 
> 	if (current != host->ehandler)
> 		return sas_queue_reset(dev, SAS_DEV_RESET, 0, 0);
> 
>-	res = sas_phy_reset(phy, 1);
>-	if (res)
>-		SAS_DPRINTK("Bus reset of %s failed 0x%x\n",
>-			    kobject_name(&phy->dev.kobj),
>-			    res);
>-	sas_put_local_phy(phy);
>+	if (!i->dft->lldd_I_T_nexus_reset)
>+		return FAILED;
> 
>-	if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE)
>+	res = i->dft->lldd_I_T_nexus_reset(dev);
>+	if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE ||
>+	    res == -ENODEV)
> 		return SUCCESS;
> 
> 	return FAILED;
>diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
>index b111018..3a03b40 100644
>--- a/drivers/scsi/pm8001/pm8001_sas.c
>+++ b/drivers/scsi/pm8001/pm8001_sas.c
>@@ -868,8 +868,9 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
> 	struct pm8001_device *pm8001_dev;
> 	struct pm8001_hba_info *pm8001_ha;
> 	struct sas_phy *phy;
>+
> 	if (!dev || !dev->lldd_dev)
>-		return -1;
>+		return -ENODEV;
> 
> 	pm8001_dev = dev->lldd_dev;
> 	pm8001_ha = pm8001_find_ha_by_dev(dev);
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
>the body of a message to majordomo@xxxxxxxxxxxxxxx
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>__________ Information from ESET NOD32 Antivirus, version of virus signature database 5659 (20101129) __________
>
>The message was checked by ESET NOD32 Antivirus.
>
>http://www.eset.com
>
>
>?韬{.n?????%??檩??w?{.n???{炳??Ф?塄}?财??j:+v??????2??璀??摺?囤??z夸z罐?+?????w棹f



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux