aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libsas/sas_port.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2012-01-28 17:24:40 -0800
committerJames Bottomley <JBottomley@Parallels.com>2012-02-29 15:40:33 -0600
commit899fcf40f3177697ccfb029d0484cb8ec09a51ca (patch)
tree2983a14444ca62958e50e2fdbd4dc945d7a38849 /drivers/scsi/libsas/sas_port.c
parent[SCSI] libsas: revert ata srst (diff)
downloadlinux-dev-899fcf40f3177697ccfb029d0484cb8ec09a51ca.tar.xz
linux-dev-899fcf40f3177697ccfb029d0484cb8ec09a51ca.zip
[SCSI] libsas: set attached device type and target protocols for local phys
Before: $ cat /sys/class/sas_phy/phy-6\:3/device_type none $ cat /sys/class/sas_phy/phy-6\:3/target_port_protocols none After: $ cat /sys/class/sas_phy/phy-6\:3/device_type end device $ cat /sys/class/sas_phy/phy-6\:3/target_port_protocols sata Also downgrade the phy_list_lock to _irq instead of _irqsave since libsas will never call sas_get_port_device with interrupts disbled. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_port.c')
-rw-r--r--drivers/scsi/libsas/sas_port.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c
index 29f8fd335523..eb19c016d500 100644
--- a/drivers/scsi/libsas/sas_port.c
+++ b/drivers/scsi/libsas/sas_port.c
@@ -104,6 +104,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
/* add the phy to the port */
list_add_tail(&phy->port_phy_el, &port->phy_list);
+ sas_phy_set_target(phy, port->port_dev);
phy->port = port;
port->num_phys++;
port->phy_mask |= (1U << phy->id);
@@ -182,6 +183,7 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone)
spin_lock(&port->phy_list_lock);
list_del_init(&phy->port_phy_el);
+ sas_phy_set_target(phy, NULL);
phy->port = NULL;
port->num_phys--;
port->phy_mask &= ~(1U << phy->id);