Lines Matching refs:rcd
129 void __aspm_ctx_disable(struct hfi1_ctxtdata *rcd)
136 spin_lock_irqsave(&rcd->aspm_lock, flags);
138 if (!rcd->aspm_intr_enable)
141 prev = rcd->aspm_ts_last_intr;
143 rcd->aspm_ts_last_intr = now;
149 restart_timer = ktime_to_ns(ktime_sub(now, rcd->aspm_ts_timer_sched)) >
154 if (rcd->aspm_enabled && close_interrupts) {
155 aspm_disable_inc(rcd->dd);
156 rcd->aspm_enabled = false;
161 mod_timer(&rcd->aspm_timer,
163 rcd->aspm_ts_timer_sched = now;
166 spin_unlock_irqrestore(&rcd->aspm_lock, flags);
172 struct hfi1_ctxtdata *rcd = from_timer(rcd, t, aspm_timer);
175 spin_lock_irqsave(&rcd->aspm_lock, flags);
176 aspm_enable_dec(rcd->dd);
177 rcd->aspm_enabled = true;
178 spin_unlock_irqrestore(&rcd->aspm_lock, flags);
187 struct hfi1_ctxtdata *rcd;
192 rcd = hfi1_rcd_get_by_index(dd, i);
193 if (rcd) {
194 del_timer_sync(&rcd->aspm_timer);
195 spin_lock_irqsave(&rcd->aspm_lock, flags);
196 rcd->aspm_intr_enable = false;
197 spin_unlock_irqrestore(&rcd->aspm_lock, flags);
198 hfi1_rcd_put(rcd);
209 struct hfi1_ctxtdata *rcd;
219 rcd = hfi1_rcd_get_by_index(dd, i);
220 if (rcd) {
221 spin_lock_irqsave(&rcd->aspm_lock, flags);
222 rcd->aspm_intr_enable = true;
223 rcd->aspm_enabled = true;
224 spin_unlock_irqrestore(&rcd->aspm_lock, flags);
225 hfi1_rcd_put(rcd);
230 static void aspm_ctx_init(struct hfi1_ctxtdata *rcd)
232 spin_lock_init(&rcd->aspm_lock);
233 timer_setup(&rcd->aspm_timer, aspm_ctx_timer_function, 0);
234 rcd->aspm_intr_supported = rcd->dd->aspm_supported &&
236 rcd->ctxt < rcd->dd->first_dyn_alloc_ctxt;
241 struct hfi1_ctxtdata *rcd;
248 rcd = hfi1_rcd_get_by_index(dd, i);
249 if (rcd)
250 aspm_ctx_init(rcd);
251 hfi1_rcd_put(rcd);