|
@@ -69,7 +69,6 @@ void sas_init_dev(struct domain_device *dev)
|
|
|
*/
|
|
|
static int sas_get_port_device(struct asd_sas_port *port)
|
|
|
{
|
|
|
- unsigned long flags;
|
|
|
struct asd_sas_phy *phy;
|
|
|
struct sas_rphy *rphy;
|
|
|
struct domain_device *dev;
|
|
@@ -78,9 +77,9 @@ static int sas_get_port_device(struct asd_sas_port *port)
|
|
|
if (!dev)
|
|
|
return -ENOMEM;
|
|
|
|
|
|
- spin_lock_irqsave(&port->phy_list_lock, flags);
|
|
|
+ spin_lock_irq(&port->phy_list_lock);
|
|
|
if (list_empty(&port->phy_list)) {
|
|
|
- spin_unlock_irqrestore(&port->phy_list_lock, flags);
|
|
|
+ spin_unlock_irq(&port->phy_list_lock);
|
|
|
sas_put_device(dev);
|
|
|
return -ENODEV;
|
|
|
}
|
|
@@ -89,7 +88,7 @@ static int sas_get_port_device(struct asd_sas_port *port)
|
|
|
memcpy(dev->frame_rcvd, phy->frame_rcvd, min(sizeof(dev->frame_rcvd),
|
|
|
(size_t)phy->frame_rcvd_size));
|
|
|
spin_unlock(&phy->frame_rcvd_lock);
|
|
|
- spin_unlock_irqrestore(&port->phy_list_lock, flags);
|
|
|
+ spin_unlock_irq(&port->phy_list_lock);
|
|
|
|
|
|
if (dev->frame_rcvd[0] == 0x34 && port->oob_mode == SATA_OOB_MODE) {
|
|
|
struct dev_to_host_fis *fis =
|
|
@@ -134,6 +133,11 @@ static int sas_get_port_device(struct asd_sas_port *port)
|
|
|
sas_put_device(dev);
|
|
|
return -ENODEV;
|
|
|
}
|
|
|
+
|
|
|
+ spin_lock_irq(&port->phy_list_lock);
|
|
|
+ list_for_each_entry(phy, &port->phy_list, port_phy_el)
|
|
|
+ sas_phy_set_target(phy, dev);
|
|
|
+ spin_unlock_irq(&port->phy_list_lock);
|
|
|
rphy->identify.phy_identifier = phy->phy->identify.phy_identifier;
|
|
|
memcpy(dev->sas_addr, port->attached_sas_addr, SAS_ADDR_SIZE);
|
|
|
sas_fill_in_rphy(dev, rphy);
|