public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] lldd_I_T_nexus_reset use in sas_ata.c
@ 2010-12-23 19:34 Chuck Tuffli
  2010-12-23 21:05 ` James Bottomley
  0 siblings, 1 reply; 3+ messages in thread
From: Chuck Tuffli @ 2010-12-23 19:34 UTC (permalink / raw)
  To: linux-scsi

Can some shed light on why sas_ata_phy_reset() does an I_T nexus
reset? It seems like calling sas_phy_reset() might be more accurate in
this case. Thanks.

---chuck

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index e1a395b..b012d15 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -241,15 +241,11 @@ static bool sas_ata_qc_fill_rtf(struct ata_queued_cmd *qc)
 static void sas_ata_phy_reset(struct ata_port *ap)
 {
 	struct domain_device *dev = ap->private_data;
-	struct sas_internal *i =
-		to_sas_internal(dev->port->ha->core.shost->transportt);
-	int res = TMF_RESP_FUNC_FAILED;
-
-	if (i->dft->lldd_I_T_nexus_reset)
-		res = i->dft->lldd_I_T_nexus_reset(dev);
+	int res;

-	if (res != TMF_RESP_FUNC_COMPLETE)
-		SAS_DPRINTK("%s: Unable to reset I T nexus?\n", __func__);
+	res = sas_phy_reset(sas_find_local_phy(dev), 0);
+	if (res)
+		SAS_DPRINTK("%s: Unable to reset phy 0x%x\n", __func__, res);

 	switch (dev->sata_dev.command_set) {
 		case ATA_COMMAND_SET:

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC] lldd_I_T_nexus_reset use in sas_ata.c
  2010-12-23 19:34 [RFC] lldd_I_T_nexus_reset use in sas_ata.c Chuck Tuffli
@ 2010-12-23 21:05 ` James Bottomley
  2010-12-23 22:56   ` Chuck Tuffli
  0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2010-12-23 21:05 UTC (permalink / raw)
  To: Chuck Tuffli; +Cc: linux-scsi

On Thu, 2010-12-23 at 11:34 -0800, Chuck Tuffli wrote:
> Can some shed light on why sas_ata_phy_reset() does an I_T nexus
> reset? It seems like calling sas_phy_reset() might be more accurate in
> this case. Thanks.

It needs an ATA reset that propagates.  ATA resets don't key off SAS phy
resets, they have a separate reset sequence, which is triggered by the
I_T nexus reset.

James



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] lldd_I_T_nexus_reset use in sas_ata.c
  2010-12-23 21:05 ` James Bottomley
@ 2010-12-23 22:56   ` Chuck Tuffli
  0 siblings, 0 replies; 3+ messages in thread
From: Chuck Tuffli @ 2010-12-23 22:56 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

On Thu, Dec 23, 2010 at 1:05 PM, James Bottomley
<James.Bottomley@suse.de> wrote:
> On Thu, 2010-12-23 at 11:34 -0800, Chuck Tuffli wrote:
>> Can some shed light on why sas_ata_phy_reset() does an I_T nexus
>> reset? It seems like calling sas_phy_reset() might be more accurate in
>> this case. Thanks.
>
> It needs an ATA reset that propagates.  ATA resets don't key off SAS phy
> resets, they have a separate reset sequence, which is triggered by the
> I_T nexus reset.

Maybe this is a misunderstanding on my part, but I thought there were
two ways to reset ATA devices connected to SAS/SMP:
- SRST FIS or
- issuing a link reset via LOCAL_PHY_CONTROL / SMP_PHY_CONTROL

Since sas_phy_reset() triggers the second case and three of the SAS
drivers (aic94xx, mvsas, pm8001) all internally call sas_phy_reset()
as a part of the I_T nexus reset, it seemed like this was a more
direct and consistent approach.

---chuck
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-23 22:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-23 19:34 [RFC] lldd_I_T_nexus_reset use in sas_ata.c Chuck Tuffli
2010-12-23 21:05 ` James Bottomley
2010-12-23 22:56   ` Chuck Tuffli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox