Lines Matching refs:creg_ctrl

126 	if (card->creg_ctrl.active || list_empty(&card->creg_ctrl.queue))  in creg_kick_queue()
129 card->creg_ctrl.active = 1; in creg_kick_queue()
130 card->creg_ctrl.active_cmd = list_first_entry(&card->creg_ctrl.queue, in creg_kick_queue()
132 list_del(&card->creg_ctrl.active_cmd->list); in creg_kick_queue()
133 card->creg_ctrl.q_depth--; in creg_kick_queue()
141 mod_timer(&card->creg_ctrl.cmd_timer, in creg_kick_queue()
144 creg_issue_cmd(card, card->creg_ctrl.active_cmd); in creg_kick_queue()
162 if (card->creg_ctrl.reset) in creg_queue_cmd()
183 spin_lock_bh(&card->creg_ctrl.lock); in creg_queue_cmd()
184 list_add_tail(&cmd->list, &card->creg_ctrl.queue); in creg_queue_cmd()
185 card->creg_ctrl.q_depth++; in creg_queue_cmd()
187 spin_unlock_bh(&card->creg_ctrl.lock); in creg_queue_cmd()
194 struct rsxx_cardinfo *card = from_timer(card, t, creg_ctrl.cmd_timer); in creg_cmd_timed_out()
197 spin_lock(&card->creg_ctrl.lock); in creg_cmd_timed_out()
198 cmd = card->creg_ctrl.active_cmd; in creg_cmd_timed_out()
199 card->creg_ctrl.active_cmd = NULL; in creg_cmd_timed_out()
200 spin_unlock(&card->creg_ctrl.lock); in creg_cmd_timed_out()
203 card->creg_ctrl.creg_stats.creg_timeout++; in creg_cmd_timed_out()
215 spin_lock(&card->creg_ctrl.lock); in creg_cmd_timed_out()
216 card->creg_ctrl.active = 0; in creg_cmd_timed_out()
218 spin_unlock(&card->creg_ctrl.lock); in creg_cmd_timed_out()
229 creg_ctrl.done_work); in creg_cmd_done()
235 if (del_timer_sync(&card->creg_ctrl.cmd_timer) == 0) in creg_cmd_done()
236 card->creg_ctrl.creg_stats.failed_cancel_timer++; in creg_cmd_done()
238 spin_lock_bh(&card->creg_ctrl.lock); in creg_cmd_done()
239 cmd = card->creg_ctrl.active_cmd; in creg_cmd_done()
240 card->creg_ctrl.active_cmd = NULL; in creg_cmd_done()
241 spin_unlock_bh(&card->creg_ctrl.lock); in creg_cmd_done()
249 card->creg_ctrl.creg_stats.stat = ioread32(card->regmap + CREG_STAT); in creg_cmd_done()
250 cmd->status = card->creg_ctrl.creg_stats.stat; in creg_cmd_done()
291 spin_lock_bh(&card->creg_ctrl.lock); in creg_cmd_done()
292 card->creg_ctrl.active = 0; in creg_cmd_done()
294 spin_unlock_bh(&card->creg_ctrl.lock); in creg_cmd_done()
307 if (!mutex_trylock(&card->creg_ctrl.reset_lock)) in creg_reset()
310 card->creg_ctrl.reset = 1; in creg_reset()
319 spin_lock_bh(&card->creg_ctrl.lock); in creg_reset()
320 list_for_each_entry_safe(cmd, tmp, &card->creg_ctrl.queue, list) { in creg_reset()
322 card->creg_ctrl.q_depth--; in creg_reset()
328 cmd = card->creg_ctrl.active_cmd; in creg_reset()
329 card->creg_ctrl.active_cmd = NULL; in creg_reset()
331 if (timer_pending(&card->creg_ctrl.cmd_timer)) in creg_reset()
332 del_timer_sync(&card->creg_ctrl.cmd_timer); in creg_reset()
338 card->creg_ctrl.active = 0; in creg_reset()
340 spin_unlock_bh(&card->creg_ctrl.lock); in creg_reset()
342 card->creg_ctrl.reset = 0; in creg_reset()
347 mutex_unlock(&card->creg_ctrl.reset_lock); in creg_reset()
399 card->creg_ctrl.q_depth + 20000); in __issue_creg_rw()
698 cmd = card->creg_ctrl.active_cmd; in rsxx_eeh_save_issued_creg()
699 card->creg_ctrl.active_cmd = NULL; in rsxx_eeh_save_issued_creg()
702 del_timer_sync(&card->creg_ctrl.cmd_timer); in rsxx_eeh_save_issued_creg()
704 spin_lock_bh(&card->creg_ctrl.lock); in rsxx_eeh_save_issued_creg()
705 list_add(&cmd->list, &card->creg_ctrl.queue); in rsxx_eeh_save_issued_creg()
706 card->creg_ctrl.q_depth++; in rsxx_eeh_save_issued_creg()
707 card->creg_ctrl.active = 0; in rsxx_eeh_save_issued_creg()
708 spin_unlock_bh(&card->creg_ctrl.lock); in rsxx_eeh_save_issued_creg()
714 spin_lock_bh(&card->creg_ctrl.lock); in rsxx_kick_creg_queue()
715 if (!list_empty(&card->creg_ctrl.queue)) in rsxx_kick_creg_queue()
717 spin_unlock_bh(&card->creg_ctrl.lock); in rsxx_kick_creg_queue()
723 card->creg_ctrl.active_cmd = NULL; in rsxx_creg_setup()
725 card->creg_ctrl.creg_wq = in rsxx_creg_setup()
727 if (!card->creg_ctrl.creg_wq) in rsxx_creg_setup()
730 INIT_WORK(&card->creg_ctrl.done_work, creg_cmd_done); in rsxx_creg_setup()
731 mutex_init(&card->creg_ctrl.reset_lock); in rsxx_creg_setup()
732 INIT_LIST_HEAD(&card->creg_ctrl.queue); in rsxx_creg_setup()
733 spin_lock_init(&card->creg_ctrl.lock); in rsxx_creg_setup()
734 timer_setup(&card->creg_ctrl.cmd_timer, creg_cmd_timed_out, 0); in rsxx_creg_setup()
746 spin_lock_bh(&card->creg_ctrl.lock); in rsxx_creg_destroy()
747 list_for_each_entry_safe(cmd, tmp, &card->creg_ctrl.queue, list) { in rsxx_creg_destroy()
759 cmd = card->creg_ctrl.active_cmd; in rsxx_creg_destroy()
760 card->creg_ctrl.active_cmd = NULL; in rsxx_creg_destroy()
762 if (timer_pending(&card->creg_ctrl.cmd_timer)) in rsxx_creg_destroy()
763 del_timer_sync(&card->creg_ctrl.cmd_timer); in rsxx_creg_destroy()
771 spin_unlock_bh(&card->creg_ctrl.lock); in rsxx_creg_destroy()
773 cancel_work_sync(&card->creg_ctrl.done_work); in rsxx_creg_destroy()