struct asd_sas_port *port = phy->port;
        struct sas_internal *si =
                to_sas_internal(sas_ha->core.shost->transportt);
+       unsigned long flags;
 
        if (port) {
                if (memcmp(port->attached_sas_addr, phy->attached_sas_addr,
        }
 
        /* find a port */
-       spin_lock(&sas_ha->phy_port_lock);
+       spin_lock_irqsave(&sas_ha->phy_port_lock, flags);
        for (i = 0; i < sas_ha->num_phys; i++) {
                port = sas_ha->sas_port[i];
                spin_lock(&port->phy_list_lock);
        if (i >= sas_ha->num_phys) {
                printk(KERN_NOTICE "%s: couldn't find a free port, bug?\n",
                       __FUNCTION__);
-               spin_unlock(&sas_ha->phy_port_lock);
+               spin_unlock_irqrestore(&sas_ha->phy_port_lock, flags);
                return;
        }
 
        } else
                port->linkrate = max(port->linkrate, phy->linkrate);
        spin_unlock(&port->phy_list_lock);
-       spin_unlock(&sas_ha->phy_port_lock);
+       spin_unlock_irqrestore(&sas_ha->phy_port_lock, flags);
 
        if (!port->port) {
                port->port = sas_port_alloc(phy->phy->dev.parent, port->id);
        struct asd_sas_port *port = phy->port;
        struct sas_internal *si =
                to_sas_internal(sas_ha->core.shost->transportt);
+       unsigned long flags;
 
        if (!port)
                return;           /* done by a phy event */
        if (si->dft->lldd_port_deformed)
                si->dft->lldd_port_deformed(phy);
 
-       spin_lock(&sas_ha->phy_port_lock);
+       spin_lock_irqsave(&sas_ha->phy_port_lock, flags);
        spin_lock(&port->phy_list_lock);
 
        list_del_init(&phy->port_phy_el);
                port->phy_mask = 0;
        }
        spin_unlock(&port->phy_list_lock);
-       spin_unlock(&sas_ha->phy_port_lock);
+       spin_unlock_irqrestore(&sas_ha->phy_port_lock, flags);
 
        return;
 }
 
        struct sas_ha_struct *ha = SHOST_TO_SAS_HA(shost);
        struct domain_device *found_dev = NULL;
        int i;
+       unsigned long flags;
 
-       spin_lock(&ha->phy_port_lock);
+       spin_lock_irqsave(&ha->phy_port_lock, flags);
        for (i = 0; i < ha->num_phys; i++) {
                struct asd_sas_port *port = ha->sas_port[i];
                struct domain_device *dev;
                spin_unlock(&port->dev_list_lock);
        }
  found:
-       spin_unlock(&ha->phy_port_lock);
+       spin_unlock_irqrestore(&ha->phy_port_lock, flags);
 
        return found_dev;
 }