Lines Matching refs:sch

39 int vfio_ccw_sch_quiesce(struct subchannel *sch)  in vfio_ccw_sch_quiesce()  argument
41 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_quiesce()
45 spin_lock_irq(sch->lock); in vfio_ccw_sch_quiesce()
46 if (!sch->schib.pmcw.ena) in vfio_ccw_sch_quiesce()
48 ret = cio_disable_subchannel(sch); in vfio_ccw_sch_quiesce()
55 ret = cio_cancel_halt_clear(sch, &iretry); in vfio_ccw_sch_quiesce()
59 sch->schid.ssid, sch->schid.sch_no); in vfio_ccw_sch_quiesce()
68 spin_unlock_irq(sch->lock); in vfio_ccw_sch_quiesce()
75 spin_lock_irq(sch->lock); in vfio_ccw_sch_quiesce()
76 ret = cio_disable_subchannel(sch); in vfio_ccw_sch_quiesce()
80 spin_unlock_irq(sch->lock); in vfio_ccw_sch_quiesce()
132 static void vfio_ccw_sch_irq(struct subchannel *sch) in vfio_ccw_sch_irq() argument
134 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_irq()
140 static struct vfio_ccw_private *vfio_ccw_alloc_private(struct subchannel *sch) in vfio_ccw_alloc_private() argument
148 private->sch = sch; in vfio_ccw_alloc_private()
216 static int vfio_ccw_sch_probe(struct subchannel *sch) in vfio_ccw_sch_probe() argument
218 struct pmcw *pmcw = &sch->schib.pmcw; in vfio_ccw_sch_probe()
223 dev_warn(&sch->dev, "vfio: ccw: does not support QDIO: %s\n", in vfio_ccw_sch_probe()
224 dev_name(&sch->dev)); in vfio_ccw_sch_probe()
228 private = vfio_ccw_alloc_private(sch); in vfio_ccw_sch_probe()
232 dev_set_drvdata(&sch->dev, private); in vfio_ccw_sch_probe()
234 spin_lock_irq(sch->lock); in vfio_ccw_sch_probe()
235 sch->isc = VFIO_CCW_ISC; in vfio_ccw_sch_probe()
236 ret = cio_enable_subchannel(sch, (u32)(unsigned long)sch); in vfio_ccw_sch_probe()
237 spin_unlock_irq(sch->lock); in vfio_ccw_sch_probe()
243 ret = vfio_ccw_mdev_reg(sch); in vfio_ccw_sch_probe()
247 if (dev_get_uevent_suppress(&sch->dev)) { in vfio_ccw_sch_probe()
248 dev_set_uevent_suppress(&sch->dev, 0); in vfio_ccw_sch_probe()
249 kobject_uevent(&sch->dev.kobj, KOBJ_ADD); in vfio_ccw_sch_probe()
253 sch->schid.cssid, sch->schid.ssid, in vfio_ccw_sch_probe()
254 sch->schid.sch_no); in vfio_ccw_sch_probe()
258 cio_disable_subchannel(sch); in vfio_ccw_sch_probe()
260 dev_set_drvdata(&sch->dev, NULL); in vfio_ccw_sch_probe()
265 static void vfio_ccw_sch_remove(struct subchannel *sch) in vfio_ccw_sch_remove() argument
267 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_remove()
269 vfio_ccw_sch_quiesce(sch); in vfio_ccw_sch_remove()
270 vfio_ccw_mdev_unreg(sch); in vfio_ccw_sch_remove()
272 dev_set_drvdata(&sch->dev, NULL); in vfio_ccw_sch_remove()
277 sch->schid.cssid, sch->schid.ssid, in vfio_ccw_sch_remove()
278 sch->schid.sch_no); in vfio_ccw_sch_remove()
281 static void vfio_ccw_sch_shutdown(struct subchannel *sch) in vfio_ccw_sch_shutdown() argument
283 vfio_ccw_sch_quiesce(sch); in vfio_ccw_sch_shutdown()
296 static int vfio_ccw_sch_event(struct subchannel *sch, int process) in vfio_ccw_sch_event() argument
298 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_event()
302 spin_lock_irqsave(sch->lock, flags); in vfio_ccw_sch_event()
303 if (!device_is_registered(&sch->dev)) in vfio_ccw_sch_event()
306 if (work_pending(&sch->todo_work)) in vfio_ccw_sch_event()
309 if (cio_update_schib(sch)) { in vfio_ccw_sch_event()
315 private = dev_get_drvdata(&sch->dev); in vfio_ccw_sch_event()
323 spin_unlock_irqrestore(sch->lock, flags); in vfio_ccw_sch_event()
355 static int vfio_ccw_chp_event(struct subchannel *sch, in vfio_ccw_chp_event() argument
358 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); in vfio_ccw_chp_event()
359 int mask = chp_ssd_get_mask(&sch->ssd_info, link); in vfio_ccw_chp_event()
365 trace_vfio_ccw_chp_event(private->sch->schid, mask, event); in vfio_ccw_chp_event()
367 mdev_uuid(private->mdev), sch->schid.cssid, in vfio_ccw_chp_event()
368 sch->schid.ssid, sch->schid.sch_no, in vfio_ccw_chp_event()
371 if (cio_update_schib(sch)) in vfio_ccw_chp_event()
377 sch->opm &= ~mask; in vfio_ccw_chp_event()
378 sch->lpm &= ~mask; in vfio_ccw_chp_event()
379 if (sch->schib.pmcw.lpum & mask) in vfio_ccw_chp_event()
380 cio_cancel_halt_clear(sch, &retry); in vfio_ccw_chp_event()
384 if (sch->schib.pmcw.lpum & mask) in vfio_ccw_chp_event()
385 cio_cancel_halt_clear(sch, &retry); in vfio_ccw_chp_event()
391 sch->opm |= mask; in vfio_ccw_chp_event()
392 sch->lpm |= mask; in vfio_ccw_chp_event()
396 sch->lpm |= mask & sch->opm; in vfio_ccw_chp_event()