在 2022/1/7 0:01, John Garry 写道:
On 24/12/2021 06:07, chenxiang wrote:
From: Xiang Chenchenxiang66@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().
Please use form spin_{lock, unlock}_irq(), and similar for other places.
ok
So do you have an idea why spin_lock_irq() was used in the first place? There has to be a reason. Where some interrupt handlers using the locks?
spin_lock_irq() in the first place is only called by sas_discover_domain() which is not in interrupt handlers. I check all those places which call asd_sas_port->dev_list_lock, and don't find any place which is called in interrupt handlers. Actually there are some places which use spin_lock() and other places which use spin_lock_irq() for asd_sas_port->dev_list_lock, if it were used in interrupt handler, i think all the places should use spin_lock_irq() instead.
Thanks, John .