public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "jack_wang" <jack_wang@usish.com>
To: "James.Bottomley@suse.de" <James.Bottomley@suse.de>
Cc: lindar_liu <lindar_liu@usish.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	jack_wang <jack_wang@usish.com>
Subject: [PATCH]libsas: fix loopback topology bug during discovery
Date: Sat, 19 Feb 2011 18:20:53 +0800	[thread overview]
Message-ID: <201102191820533434720@usish.com> (raw)

[-- 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


                 reply	other threads:[~2011-02-19 10:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201102191820533434720@usish.com \
    --to=jack_wang@usish.com \
    --cc=James.Bottomley@suse.de \
    --cc=lindar_liu@usish.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox