From: Xiang Chen chenxiang66@hisilicon.com
Spinlock asd_sas_port->dev_list_lock is used when domain_dev is added or removed. But some places use spin_lock()/spin_unlock() while other places use spin_lock_irq() /spin_unlock_irq(). Actually all those places are called in process context (workqueue) now, so use spin_lock/unlock() instead of spin_lock/unlock_irq().
Signed-off-by: Xiang Chen chenxiang66@hisilicon.com --- drivers/scsi/libsas/sas_discover.c | 16 ++++++++-------- drivers/scsi/libsas/sas_expander.c | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 2faa7a372284..7773b0e59877 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -152,9 +152,9 @@ static int sas_get_port_device(struct asd_sas_port *port) if (dev_is_sata(dev) || dev->dev_type == SAS_END_DEVICE) list_add_tail(&dev->disco_list_node, &port->disco_list); else { - spin_lock_irq(&port->dev_list_lock); + spin_lock(&port->dev_list_lock); list_add_tail(&dev->dev_list_node, &port->dev_list); - spin_unlock_irq(&port->dev_list_lock); + spin_unlock(&port->dev_list_lock); }
spin_lock(&port->phy_list_lock); @@ -211,9 +211,9 @@ static void sas_probe_devices(struct asd_sas_port *port)
/* devices must be domain members before link recovery and probe */ list_for_each_entry(dev, &port->disco_list, disco_list_node) { - spin_lock_irq(&port->dev_list_lock); + spin_lock(&port->dev_list_lock); list_add_tail(&dev->dev_list_node, &port->dev_list); - spin_unlock_irq(&port->dev_list_lock); + spin_unlock(&port->dev_list_lock); }
sas_probe_sata(port); @@ -321,11 +321,11 @@ static void sas_unregister_common_dev(struct asd_sas_port *port, struct domain_d else list_del_init(&dev->siblings);
- spin_lock_irq(&port->dev_list_lock); + spin_lock(&port->dev_list_lock); list_del_init(&dev->dev_list_node); if (dev_is_sata(dev)) sas_ata_end_eh(dev->sata_dev.ap); - spin_unlock_irq(&port->dev_list_lock); + spin_unlock(&port->dev_list_lock);
spin_lock_irq(&ha->lock); if (dev->dev_type == SAS_END_DEVICE && @@ -473,9 +473,9 @@ static void sas_discover_domain(struct work_struct *work) if (error) { sas_rphy_free(dev->rphy); list_del_init(&dev->disco_list_node); - spin_lock_irq(&port->dev_list_lock); + spin_lock(&port->dev_list_lock); list_del_init(&dev->dev_list_node); - spin_unlock_irq(&port->dev_list_lock); + spin_unlock(&port->dev_list_lock);
sas_put_device(dev); port->port_dev = NULL; diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index aa79ff1ff31a..58d1db404c64 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -902,9 +902,9 @@ static struct domain_device *sas_ex_discover_end_dev( out_list_del: sas_rphy_free(child->rphy); list_del(&child->disco_list_node); - spin_lock_irq(&parent->port->dev_list_lock); + spin_lock(&parent->port->dev_list_lock); list_del(&child->dev_list_node); - spin_unlock_irq(&parent->port->dev_list_lock); + spin_unlock(&parent->port->dev_list_lock); out_free: sas_port_delete(phy->port); out_err: @@ -997,16 +997,16 @@ static struct domain_device *sas_ex_discover_expander( sas_fill_in_rphy(child, rphy); sas_rphy_add(rphy);
- spin_lock_irq(&parent->port->dev_list_lock); + spin_lock(&parent->port->dev_list_lock); list_add_tail(&child->dev_list_node, &parent->port->dev_list); - spin_unlock_irq(&parent->port->dev_list_lock); + spin_unlock(&parent->port->dev_list_lock);
res = sas_discover_expander(child); if (res) { sas_rphy_delete(rphy); - spin_lock_irq(&parent->port->dev_list_lock); + spin_lock(&parent->port->dev_list_lock); list_del(&child->dev_list_node); - spin_unlock_irq(&parent->port->dev_list_lock); + spin_unlock(&parent->port->dev_list_lock); sas_put_device(child); sas_port_delete(phy->port); phy->port = NULL;