From: Dan Williams <dan.j.williams@intel.com>
To: linux-scsi@vger.kernel.org
Cc: linux-ide@vger.kernel.org, Jack Wang <jack_wang@usish.com>,
Luben Tuikov <ltuikov@yahoo.com>,
Xiangliang Yu <yuxiangl@marvell.com>
Subject: [PATCH v8 08/13] libsas: libsas.force_hard_reset module parameter
Date: Fri, 10 Feb 2012 00:45:20 -0800 [thread overview]
Message-ID: <20120210084520.25701.83280.stgit@dwillia2-linux.jf.intel.com> (raw)
In-Reply-To: <20120210084411.25701.94502.stgit@dwillia2-linux.jf.intel.com>
It is possible for a host to get "locked out" from talking to sata
devices in the domain if, for example, its sas address changes but the
expander topology has existing affiliations with the old address. If
the system is booted userspace can write to
/sys/class/sas_phy/<phy-X>/hard_reset to clear the affiliation, however
if this condition exists for the root device the module parameter can be
used to promote all ata resets to hard resets.
After the system is booted this state can be cleared via
/sys/module/libsas/parameters/force_hard_reset
Cc: Xiangliang Yu <yuxiangl@marvell.com>
Cc: Luben Tuikov <ltuikov@yahoo.com>
Cc: Jack Wang <jack_wang@usish.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
Documentation/kernel-parameters.txt | 6 ++++++
drivers/scsi/libsas/sas_init.c | 6 +++++-
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 81c287f..ffefa3b 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1283,6 +1283,12 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
If there are multiple matching configurations changing
the same attribute, the last one is used.
+ libsas.force_hard_reset=
+ [LIBSAS] Clear SATA affiliations with every reset, for
+ cases where affiliation errors are causing boot
+ failures, otherwise use sysfs hard_reset interface to
+ clear individual phys.
+
memblock=debug [KNL] Enable memblock debug messages.
load_ramdisk= [RAM] List of ramdisks to load from floppy
diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c
index 120bff6..2fc23d3 100644
--- a/drivers/scsi/libsas/sas_init.c
+++ b/drivers/scsi/libsas/sas_init.c
@@ -293,6 +293,10 @@ static int sas_phy_enable(struct sas_phy *phy, int enable)
return ret;
}
+static bool force_hard_reset;
+module_param(force_hard_reset, bool, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(force_hard_reset, "clear sata affiliations on every reset");
+
int sas_phy_reset(struct sas_phy *phy, int hard_reset)
{
int ret;
@@ -301,7 +305,7 @@ int sas_phy_reset(struct sas_phy *phy, int hard_reset)
if (!phy->enabled)
return -ENODEV;
- if (hard_reset)
+ if (hard_reset || force_hard_reset)
reset_type = PHY_FUNC_HARD_RESET;
else
reset_type = PHY_FUNC_LINK_RESET;
next prev parent reply other threads:[~2012-02-10 8:45 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-10 8:44 [PATCH v8 00/13] libsas error handling + discovery v8 Dan Williams
2012-02-10 8:44 ` [PATCH v8 01/13] libsas: close scsi_remove_target() vs libata-eh race Dan Williams
2012-02-10 18:32 ` Jeff Garzik
2012-02-10 19:09 ` Dan Williams
2012-02-10 8:44 ` [PATCH v8 02/13] libsas: improve debug statements Dan Williams
2012-02-10 8:44 ` [PATCH v8 03/13] libsas: async ata scanning Dan Williams
2012-02-10 18:34 ` Jeff Garzik
2012-02-10 8:45 ` [PATCH v8 04/13] libsas: set attached device type and target protocols for local phys Dan Williams
2012-02-10 8:45 ` [PATCH v8 05/13] libsas: fixup target_port_protocols for expanders that don't report sata Dan Williams
2012-02-10 8:45 ` [PATCH v8 06/13] libsas: don't recover end devices attached to disabled phys Dan Williams
2012-02-10 8:45 ` [PATCH v8 07/13] scsi_transport_sas: 'enable' phys on reset Dan Williams
2012-02-10 8:45 ` Dan Williams [this message]
2012-02-29 21:55 ` [PATCH v8 08/13] libsas: libsas.force_hard_reset module parameter James Bottomley
2012-02-29 22:40 ` Douglas Gilbert
2012-02-29 23:27 ` Dan Williams
2012-03-01 0:23 ` Douglas Gilbert
2012-03-01 0:35 ` Dan Williams
2012-02-29 23:22 ` Dan Williams
2012-03-01 14:27 ` James Bottomley
2012-02-10 8:45 ` [PATCH v8 09/13] libsas: enforce eh strategy handlers only in eh context Dan Williams
2012-02-29 22:05 ` James Bottomley
2012-03-01 0:28 ` Dan Williams
2012-03-01 14:29 ` James Bottomley
2012-03-06 19:17 ` Dan Williams
2012-02-10 8:45 ` [PATCH v8 10/13] libsas: add sas_eh_abort_handler Dan Williams
2012-02-10 8:45 ` [PATCH v8 11/13] libsas: use ->lldd_I_T_nexus_reset for ->eh_bus_reset_handler Dan Williams
2012-02-10 8:45 ` [PATCH v8 12/13] isci: use sas eh strategy handlers Dan Williams
2012-02-10 8:45 ` [PATCH v8 13/13] libsas: trim sas_task of slow path infrastructure Dan Williams
2012-02-15 1:09 ` Jack Wang
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=20120210084520.25701.83280.stgit@dwillia2-linux.jf.intel.com \
--to=dan.j.williams@intel.com \
--cc=jack_wang@usish.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=ltuikov@yahoo.com \
--cc=yuxiangl@marvell.com \
/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).