public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]libsas: fix loopback topology bug during discovery
@ 2011-02-19 10:20 jack_wang
  0 siblings, 0 replies; only message in thread
From: jack_wang @ 2011-02-19 10:20 UTC (permalink / raw)
  To: James.Bottomley@suse.de; +Cc: lindar_liu, linux-scsi@vger.kernel.org, jack_wang

[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]

 From e8a58c706308409dec0ba21971d382dee4adc39e Mon Sep 17 00:00:00 2001
From: Jack Wang <jack_wang@usish.com>
Date: Sat, 19 Feb 2011 17:52:24 +0800
Subject: [PATCH] Fix loopback topology bug during discovery
 In some test envirenment, there is loopback topology test. We should
 handle this during discovery.

Signed-off-by: Jack Wang <jack_wang@usish.com>
---
 drivers/scsi/libsas/sas_expander.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 505ffe3..1a113c4 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -244,6 +244,12 @@ static int sas_ex_phy_discover_helper(struct domain_device *dev, u8 *disc_req,
 		 * dev to host FIS as described in section G.5 of
 		 * sas-2 r 04b */
 		dr = &((struct smp_resp *)disc_resp)->disc;
+		if (memcmp(dev->sas_addr, dr->attached_sas_addr,
+			  SAS_ADDR_SIZE) == 0) {
+			sas_printk("Found loopback topology,"
+			"just ignore it!\n");
+			return 0;
+		}
 		if (!(dr->attached_dev_type == 0 &&
 		      dr->attached_sata_dev))
 			break;
-- 

2011-02-19 



jack_wang 

[-- Attachment #2: 0001-Fix-loopback-topology-bug-during-discovery.patch --]
[-- Type: application/octet-stream, Size: 1151 bytes --]

From e8a58c706308409dec0ba21971d382dee4adc39e Mon Sep 17 00:00:00 2001
From: Jack Wang <jack_wang@usish.com>
Date: Sat, 19 Feb 2011 17:52:24 +0800
Subject: [PATCH] Fix loopback topology bug during discovery
 In some test envirenment, there is loopback topology test. We should
 handle this during discovery.

Signed-off-by: Jack Wang <jack_wang@usish.com>
---
 drivers/scsi/libsas/sas_expander.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index 505ffe3..1a113c4 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -244,6 +244,12 @@ static int sas_ex_phy_discover_helper(struct domain_device *dev, u8 *disc_req,
 		 * dev to host FIS as described in section G.5 of
 		 * sas-2 r 04b */
 		dr = &((struct smp_resp *)disc_resp)->disc;
+		if (memcmp(dev->sas_addr, dr->attached_sas_addr,
+			  SAS_ADDR_SIZE) == 0) {
+			sas_printk("Found loopback topology,"
+			"just ignore it!\n");
+			return 0;
+		}
 		if (!(dr->attached_dev_type == 0 &&
 		      dr->attached_sata_dev))
 			break;
-- 
1.7.4.msysgit.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-19 10:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-19 10:20 [PATCH]libsas: fix loopback topology bug during discovery jack_wang

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