From: Dan Williams <dan.j.williams@intel.com>
To: linux-scsi@vger.kernel.org
Cc: linux-ide@vger.kernel.org
Subject: [PATCH v6 5/7] libsas: delete device on sas address changed
Date: Fri, 20 Jan 2012 17:51:05 -0800 [thread overview]
Message-ID: <20120121015105.24930.38118.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20120121014910.24930.54011.stgit@localhost6.localdomain6>
If the phy is attached to a new sas address unregister the first address
before processing the new attachment.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
drivers/scsi/libsas/sas_expander.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index dc6bba5..3d6ba30 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -1997,6 +1997,15 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last)
return res;
}
+ /* delete the old link */
+ if (SAS_ADDR(phy->attached_sas_addr) &&
+ SAS_ADDR(sas_addr) != SAS_ADDR(phy->attached_sas_addr)) {
+ SAS_DPRINTK("ex %016llx phy 0x%x replace %016llx\n",
+ SAS_ADDR(dev->sas_addr), phy_id,
+ SAS_ADDR(phy->attached_sas_addr));
+ sas_unregister_devs_sas_addr(dev, phy_id, last);
+ }
+
return sas_discover_new(dev, phy_id);
}
next prev parent reply other threads:[~2012-01-21 1:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-21 1:50 [PATCH v6 0/7] libsas error handling + discovery v6 Dan Williams
2012-01-21 1:50 ` [PATCH v6 1/7] libsas: fix sas_unregister_ports vs sas_drain_work Dan Williams
2012-01-21 1:50 ` [PATCH v6 2/7] libsas: improve ata debug statements Dan Williams
2012-01-21 5:36 ` Jack Wang
2012-01-21 20:26 ` Douglas Gilbert
2012-01-23 20:51 ` Dan Williams
2012-01-21 1:50 ` [PATCH v6 3/7] libsas: fix sas port naming Dan Williams
2012-01-21 1:51 ` [PATCH v6 4/7] libsas: let libata recover links that fail to transmit initial sig-fis Dan Williams
2012-01-21 1:51 ` Dan Williams [this message]
2012-01-21 1:51 ` [PATCH v6 6/7] libsas: restore scan order Dan Williams
2012-01-21 1:51 ` [PATCH v6 7/7] libsas: async ata scanning Dan Williams
2012-01-21 6:12 ` [PATCH v6 0/7] libsas error handling + discovery v6 Jack Wang
2012-01-23 20:57 ` Dan Williams
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=20120121015105.24930.38118.stgit@localhost6.localdomain6 \
--to=dan.j.williams@intel.com \
--cc=linux-ide@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).