summaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2019-04-12 16:57:55 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2019-04-15 18:55:00 -0400
commit085f104a83d565097644889bf1f6f1aa6d345cb5 (patch)
treec3c531c4172c6591a5914741384929ed742e4c80 /include/scsi
parenta5b38d3159eac6a30c1c57d67707c141b9ac3efb (diff)
downloadlinux-085f104a83d565097644889bf1f6f1aa6d345cb5.tar.bz2
scsi: libsas: Inject revalidate event for root port event
According to the SAS spec, an expander device shall transmit BROADCAST (CHANGE) from at least one phy in each expander port other than the expander port that is the cause for transmitting BROADCAST (CHANGE). As such, for when the link is lost for a root PHY attached to an expander PHY, we get no broadcast event. This causes an issue for libsas, in that we will not revalidate the domain for these events. As a solution, for when a root PHY is formed or deformed from a root port, insert a broadcast event to trigger a domain revalidation. Signed-off-by: John Garry <john.garry@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/libsas.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index cfaaf1254211..b08febec7895 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -224,6 +224,13 @@ struct sas_work {
struct work_struct work;
};
+/* Lots of code duplicates this in the SCSI tree, which can be factored out */
+static inline bool sas_dev_type_is_expander(enum sas_device_type type)
+{
+ return type == SAS_EDGE_EXPANDER_DEVICE ||
+ type == SAS_FANOUT_EXPANDER_DEVICE;
+}
+
static inline void INIT_SAS_WORK(struct sas_work *sw, void (*fn)(struct work_struct *))
{
INIT_WORK(&sw->work, fn);