Lines Matching refs:ha

13 int sas_queue_work(struct sas_ha_struct *ha, struct sas_work *sw)  in sas_queue_work()  argument
18 if (!test_bit(SAS_HA_REGISTERED, &ha->state)) in sas_queue_work()
21 if (test_bit(SAS_HA_DRAINING, &ha->state)) { in sas_queue_work()
24 list_add_tail(&sw->drain_node, &ha->defer_q); in sas_queue_work()
26 rc = queue_work(ha->event_q, &sw->work); in sas_queue_work()
32 struct sas_ha_struct *ha) in sas_queue_event() argument
37 spin_lock_irqsave(&ha->lock, flags); in sas_queue_event()
38 rc = sas_queue_work(ha, work); in sas_queue_event()
39 spin_unlock_irqrestore(&ha->lock, flags); in sas_queue_event()
45 void __sas_drain_work(struct sas_ha_struct *ha) in __sas_drain_work() argument
50 set_bit(SAS_HA_DRAINING, &ha->state); in __sas_drain_work()
52 spin_lock_irq(&ha->lock); in __sas_drain_work()
53 spin_unlock_irq(&ha->lock); in __sas_drain_work()
55 drain_workqueue(ha->event_q); in __sas_drain_work()
56 drain_workqueue(ha->disco_q); in __sas_drain_work()
58 spin_lock_irq(&ha->lock); in __sas_drain_work()
59 clear_bit(SAS_HA_DRAINING, &ha->state); in __sas_drain_work()
60 list_for_each_entry_safe(sw, _sw, &ha->defer_q, drain_node) { in __sas_drain_work()
62 ret = sas_queue_work(ha, sw); in __sas_drain_work()
67 spin_unlock_irq(&ha->lock); in __sas_drain_work()
70 int sas_drain_work(struct sas_ha_struct *ha) in sas_drain_work() argument
74 err = mutex_lock_interruptible(&ha->drain_mutex); in sas_drain_work()
77 if (test_bit(SAS_HA_REGISTERED, &ha->state)) in sas_drain_work()
78 __sas_drain_work(ha); in sas_drain_work()
79 mutex_unlock(&ha->drain_mutex); in sas_drain_work()
85 void sas_disable_revalidation(struct sas_ha_struct *ha) in sas_disable_revalidation() argument
87 mutex_lock(&ha->disco_mutex); in sas_disable_revalidation()
88 set_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state); in sas_disable_revalidation()
89 mutex_unlock(&ha->disco_mutex); in sas_disable_revalidation()
92 void sas_enable_revalidation(struct sas_ha_struct *ha) in sas_enable_revalidation() argument
96 mutex_lock(&ha->disco_mutex); in sas_enable_revalidation()
97 clear_bit(SAS_HA_ATA_EH_ACTIVE, &ha->state); in sas_enable_revalidation()
98 for (i = 0; i < ha->num_phys; i++) { in sas_enable_revalidation()
99 struct asd_sas_port *port = ha->sas_port[i]; in sas_enable_revalidation()
115 mutex_unlock(&ha->disco_mutex); in sas_enable_revalidation()
138 struct sas_ha_struct *ha = phy->ha; in sas_notify_port_event() local
150 ret = sas_queue_event(event, &ev->work, ha); in sas_notify_port_event()
161 struct sas_ha_struct *ha = phy->ha; in sas_notify_phy_event() local
173 ret = sas_queue_event(event, &ev->work, ha); in sas_notify_phy_event()