Lines Matching +full:non +full:- +full:operational
1 // SPDX-License-Identifier: GPL-2.0
55 orb->eadm.compat1 = 1; in orb_init()
56 orb->eadm.compat2 = 1; in orb_init()
57 orb->eadm.fmt = 1; in orb_init()
58 orb->eadm.x = 1; in orb_init()
63 union orb *orb = &get_eadm_private(sch)->orb; in eadm_subchannel_start()
67 orb->eadm.aob = virt_to_dma32(aob); in eadm_subchannel_start()
68 orb->eadm.intparm = (u32)virt_to_phys(sch); in eadm_subchannel_start()
69 orb->eadm.key = PAGE_DEFAULT_KEY >> 4; in eadm_subchannel_start()
72 EADM_LOG_HEX(6, &sch->schid, sizeof(sch->schid)); in eadm_subchannel_start()
74 cc = ssch(sch->schid, orb); in eadm_subchannel_start()
77 sch->schib.scsw.eadm.actl |= SCSW_ACTL_START_PEND; in eadm_subchannel_start()
81 return -EBUSY; in eadm_subchannel_start()
82 case 3: /* not operational */ in eadm_subchannel_start()
83 return -ENODEV; in eadm_subchannel_start()
92 cc = csch(sch->schid); in eadm_subchannel_clear()
94 return -ENODEV; in eadm_subchannel_clear()
96 sch->schib.scsw.eadm.actl |= SCSW_ACTL_CLEAR_PEND; in eadm_subchannel_clear()
103 struct subchannel *sch = private->sch; in eadm_subchannel_timeout()
105 spin_lock_irq(&sch->lock); in eadm_subchannel_timeout()
107 EADM_LOG_HEX(1, &sch->schid, sizeof(sch->schid)); in eadm_subchannel_timeout()
110 spin_unlock_irq(&sch->lock); in eadm_subchannel_timeout()
118 timer_delete(&private->timer); in eadm_subchannel_set_timeout()
120 mod_timer(&private->timer, jiffies + expires); in eadm_subchannel_set_timeout()
126 struct eadm_scsw *scsw = &sch->schib.scsw.eadm; in eadm_subchannel_irq()
135 if ((scsw->stctl & (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND)) in eadm_subchannel_irq()
136 && scsw->eswf == 1 && irb->esw.eadm.erw.r) in eadm_subchannel_irq()
139 if (scsw->fctl & SCSW_FCTL_CLEAR_FUNC) in eadm_subchannel_irq()
144 if (private->state != EADM_BUSY) { in eadm_subchannel_irq()
147 private->state = EADM_NOT_OPER; in eadm_subchannel_irq()
151 scm_irq_handler(dma32_to_virt(scsw->aob), error); in eadm_subchannel_irq()
152 private->state = EADM_IDLE; in eadm_subchannel_irq()
154 if (private->completion) in eadm_subchannel_irq()
155 complete(private->completion); in eadm_subchannel_irq()
166 sch = private->sch; in eadm_get_idle_sch()
167 spin_lock(&sch->lock); in eadm_get_idle_sch()
168 if (private->state == EADM_IDLE) { in eadm_get_idle_sch()
169 private->state = EADM_BUSY; in eadm_get_idle_sch()
170 list_move_tail(&private->head, &eadm_list); in eadm_get_idle_sch()
171 spin_unlock(&sch->lock); in eadm_get_idle_sch()
176 spin_unlock(&sch->lock); in eadm_get_idle_sch()
192 return -EBUSY; in eadm_start_aob()
194 spin_lock_irqsave(&sch->lock, flags); in eadm_start_aob()
203 private->state = EADM_NOT_OPER; in eadm_start_aob()
207 spin_unlock_irqrestore(&sch->lock, flags); in eadm_start_aob()
220 return -ENOMEM; in eadm_subchannel_probe()
222 INIT_LIST_HEAD(&private->head); in eadm_subchannel_probe()
223 timer_setup(&private->timer, eadm_subchannel_timeout, 0); in eadm_subchannel_probe()
225 spin_lock_irq(&sch->lock); in eadm_subchannel_probe()
227 private->state = EADM_IDLE; in eadm_subchannel_probe()
228 private->sch = sch; in eadm_subchannel_probe()
229 sch->isc = EADM_SCH_ISC; in eadm_subchannel_probe()
233 spin_unlock_irq(&sch->lock); in eadm_subchannel_probe()
237 spin_unlock_irq(&sch->lock); in eadm_subchannel_probe()
240 list_add(&private->head, &eadm_list); in eadm_subchannel_probe()
252 spin_lock_irq(&sch->lock); in eadm_quiesce()
253 if (private->state != EADM_BUSY) in eadm_quiesce()
259 private->completion = &completion; in eadm_quiesce()
260 spin_unlock_irq(&sch->lock); in eadm_quiesce()
264 spin_lock_irq(&sch->lock); in eadm_quiesce()
265 private->completion = NULL; in eadm_quiesce()
271 } while (ret == -EBUSY); in eadm_quiesce()
273 spin_unlock_irq(&sch->lock); in eadm_quiesce()
281 list_del(&private->head); in eadm_subchannel_remove()
286 spin_lock_irq(&sch->lock); in eadm_subchannel_remove()
288 spin_unlock_irq(&sch->lock); in eadm_subchannel_remove()
299 * eadm_subchannel_sch_event - process subchannel event
301 * @process: non-zero if function is called in process context
304 * to the current operational state of the subchannel. Return zero when the
305 * event has been handled sufficiently or -EAGAIN when this function should
313 spin_lock_irqsave(&sch->lock, flags); in eadm_subchannel_sch_event()
314 if (!device_is_registered(&sch->dev)) in eadm_subchannel_sch_event()
317 if (work_pending(&sch->todo_work)) in eadm_subchannel_sch_event()
325 if (private->state == EADM_NOT_OPER) in eadm_subchannel_sch_event()
326 private->state = EADM_IDLE; in eadm_subchannel_sch_event()
329 spin_unlock_irqrestore(&sch->lock, flags); in eadm_subchannel_sch_event()
358 return -ENXIO; in eadm_sch_init()
362 return -ENOMEM; in eadm_sch_init()