• Home
  • Raw
  • Download

Lines Matching refs:sch

152 static int io_subchannel_prepare(struct subchannel *sch)  in io_subchannel_prepare()  argument
159 cdev = sch_get_cdev(sch); in io_subchannel_prepare()
287 struct subchannel *sch; in ccw_device_set_offline() local
301 sch = to_subchannel(cdev->dev.parent); in ccw_device_set_offline()
322 io_subchannel_quiesce(sch); in ccw_device_set_offline()
554 struct subchannel *sch; in available_show() local
564 sch = to_subchannel(dev->parent); in available_show()
565 if (!sch->lpm) in available_show()
579 struct subchannel *sch = to_subchannel(dev); in initiate_logging() local
582 rc = chsc_siosl(sch->schid); in initiate_logging()
585 sch->schid.ssid, sch->schid.sch_no, rc); in initiate_logging()
589 sch->schid.ssid, sch->schid.sch_no); in initiate_logging()
596 struct subchannel *sch = to_subchannel(dev); in vpm_show() local
598 return sprintf(buf, "%02x\n", sch->vpm); in vpm_show()
697 static struct ccw_device * io_subchannel_allocate_dev(struct subchannel *sch) in io_subchannel_allocate_dev() argument
714 static int io_subchannel_initialize_dev(struct subchannel *sch, in io_subchannel_initialize_dev() argument
723 priv->dev_id.devno = sch->schib.pmcw.dev; in io_subchannel_initialize_dev()
724 priv->dev_id.ssid = sch->schid.ssid; in io_subchannel_initialize_dev()
732 cdev->ccwlock = sch->lock; in io_subchannel_initialize_dev()
733 cdev->dev.parent = &sch->dev; in io_subchannel_initialize_dev()
742 if (!get_device(&sch->dev)) { in io_subchannel_initialize_dev()
747 spin_lock_irq(sch->lock); in io_subchannel_initialize_dev()
748 sch_set_cdev(sch, cdev); in io_subchannel_initialize_dev()
749 spin_unlock_irq(sch->lock); in io_subchannel_initialize_dev()
758 static struct ccw_device * io_subchannel_create_ccwdev(struct subchannel *sch) in io_subchannel_create_ccwdev() argument
763 cdev = io_subchannel_allocate_dev(sch); in io_subchannel_create_ccwdev()
765 ret = io_subchannel_initialize_dev(sch, cdev); in io_subchannel_create_ccwdev()
774 static void sch_create_and_recog_new_device(struct subchannel *sch) in sch_create_and_recog_new_device() argument
779 cdev = io_subchannel_create_ccwdev(sch); in sch_create_and_recog_new_device()
782 css_sch_device_unregister(sch); in sch_create_and_recog_new_device()
786 io_subchannel_recog(cdev, sch); in sch_create_and_recog_new_device()
794 struct subchannel *sch; in io_subchannel_register() local
798 sch = to_subchannel(cdev->dev.parent); in io_subchannel_register()
805 if (!device_is_registered(&sch->dev)) in io_subchannel_register()
807 css_update_ssd_info(sch); in io_subchannel_register()
831 dev_set_uevent_suppress(&sch->dev, 0); in io_subchannel_register()
832 kobject_uevent(&sch->dev.kobj, KOBJ_ADD); in io_subchannel_register()
839 spin_lock_irqsave(sch->lock, flags); in io_subchannel_register()
840 sch_set_cdev(sch, NULL); in io_subchannel_register()
841 spin_unlock_irqrestore(sch->lock, flags); in io_subchannel_register()
856 struct subchannel *sch; in ccw_device_call_sch_unregister() local
861 sch = to_subchannel(cdev->dev.parent); in ccw_device_call_sch_unregister()
862 css_sch_device_unregister(sch); in ccw_device_call_sch_unregister()
864 put_device(&sch->dev); in ccw_device_call_sch_unregister()
897 static void io_subchannel_recog(struct ccw_device *cdev, struct subchannel *sch) in io_subchannel_recog() argument
903 spin_lock_irq(sch->lock); in io_subchannel_recog()
905 spin_unlock_irq(sch->lock); in io_subchannel_recog()
909 struct subchannel *sch) in ccw_device_move_to_sch() argument
916 if (!get_device(&sch->dev)) in ccw_device_move_to_sch()
928 put_device(&sch->dev); in ccw_device_move_to_sch()
933 mutex_lock(&sch->reg_mutex); in ccw_device_move_to_sch()
934 rc = device_move(&cdev->dev, &sch->dev, DPM_ORDER_PARENT_BEFORE_DEV); in ccw_device_move_to_sch()
935 mutex_unlock(&sch->reg_mutex); in ccw_device_move_to_sch()
939 cdev->private->dev_id.devno, sch->schid.ssid, in ccw_device_move_to_sch()
940 sch->schib.pmcw.dev, rc); in ccw_device_move_to_sch()
948 put_device(&sch->dev); in ccw_device_move_to_sch()
961 spin_lock_irq(sch->lock); in ccw_device_move_to_sch()
962 cdev->ccwlock = sch->lock; in ccw_device_move_to_sch()
963 if (!sch_is_pseudo_sch(sch)) in ccw_device_move_to_sch()
964 sch_set_cdev(sch, cdev); in ccw_device_move_to_sch()
965 spin_unlock_irq(sch->lock); in ccw_device_move_to_sch()
966 if (!sch_is_pseudo_sch(sch)) in ccw_device_move_to_sch()
967 css_update_ssd_info(sch); in ccw_device_move_to_sch()
973 struct subchannel *sch = to_subchannel(cdev->dev.parent); in ccw_device_move_to_orph() local
974 struct channel_subsystem *css = to_css(sch->dev.parent); in ccw_device_move_to_orph()
979 static void io_subchannel_irq(struct subchannel *sch) in io_subchannel_irq() argument
983 cdev = sch_get_cdev(sch); in io_subchannel_irq()
986 CIO_TRACE_EVENT(6, dev_name(&sch->dev)); in io_subchannel_irq()
993 void io_subchannel_init_config(struct subchannel *sch) in io_subchannel_init_config() argument
995 memset(&sch->config, 0, sizeof(sch->config)); in io_subchannel_init_config()
996 sch->config.csense = 1; in io_subchannel_init_config()
999 static void io_subchannel_init_fields(struct subchannel *sch) in io_subchannel_init_fields() argument
1001 if (cio_is_console(sch->schid)) in io_subchannel_init_fields()
1002 sch->opm = 0xff; in io_subchannel_init_fields()
1004 sch->opm = chp_get_sch_opm(sch); in io_subchannel_init_fields()
1005 sch->lpm = sch->schib.pmcw.pam & sch->opm; in io_subchannel_init_fields()
1006 sch->isc = cio_is_console(sch->schid) ? CONSOLE_ISC : IO_SCH_ISC; in io_subchannel_init_fields()
1010 sch->schib.pmcw.dev, sch->schid.ssid, in io_subchannel_init_fields()
1011 sch->schid.sch_no, sch->schib.pmcw.pim, in io_subchannel_init_fields()
1012 sch->schib.pmcw.pam, sch->schib.pmcw.pom); in io_subchannel_init_fields()
1014 io_subchannel_init_config(sch); in io_subchannel_init_fields()
1021 static int io_subchannel_probe(struct subchannel *sch) in io_subchannel_probe() argument
1027 if (cio_is_console(sch->schid)) { in io_subchannel_probe()
1028 rc = sysfs_create_group(&sch->dev.kobj, in io_subchannel_probe()
1034 sch->schid.ssid, sch->schid.sch_no, rc); in io_subchannel_probe()
1040 dev_set_uevent_suppress(&sch->dev, 0); in io_subchannel_probe()
1041 kobject_uevent(&sch->dev.kobj, KOBJ_ADD); in io_subchannel_probe()
1042 cdev = sch_get_cdev(sch); in io_subchannel_probe()
1053 io_subchannel_init_fields(sch); in io_subchannel_probe()
1054 rc = cio_commit_config(sch); in io_subchannel_probe()
1057 rc = sysfs_create_group(&sch->dev.kobj, in io_subchannel_probe()
1066 set_io_private(sch, io_priv); in io_subchannel_probe()
1067 css_schedule_eval(sch->schid); in io_subchannel_probe()
1071 spin_lock_irq(sch->lock); in io_subchannel_probe()
1072 css_sched_sch_todo(sch, SCH_TODO_UNREG); in io_subchannel_probe()
1073 spin_unlock_irq(sch->lock); in io_subchannel_probe()
1078 io_subchannel_remove (struct subchannel *sch) in io_subchannel_remove() argument
1080 struct io_subchannel_private *io_priv = to_io_private(sch); in io_subchannel_remove()
1083 cdev = sch_get_cdev(sch); in io_subchannel_remove()
1086 io_subchannel_quiesce(sch); in io_subchannel_remove()
1089 sch_set_cdev(sch, NULL); in io_subchannel_remove()
1090 set_io_private(sch, NULL); in io_subchannel_remove()
1096 sysfs_remove_group(&sch->dev.kobj, &io_subchannel_attr_group); in io_subchannel_remove()
1100 static void io_subchannel_verify(struct subchannel *sch) in io_subchannel_verify() argument
1104 cdev = sch_get_cdev(sch); in io_subchannel_verify()
1109 static void io_subchannel_terminate_path(struct subchannel *sch, u8 mask) in io_subchannel_terminate_path() argument
1113 cdev = sch_get_cdev(sch); in io_subchannel_terminate_path()
1116 if (cio_update_schib(sch)) in io_subchannel_terminate_path()
1119 if (scsw_actl(&sch->schib.scsw) == 0 || sch->schib.pmcw.lpum != mask) in io_subchannel_terminate_path()
1125 if (cio_clear(sch)) in io_subchannel_terminate_path()
1136 static int io_subchannel_chp_event(struct subchannel *sch, in io_subchannel_chp_event() argument
1139 struct ccw_device *cdev = sch_get_cdev(sch); in io_subchannel_chp_event()
1142 mask = chp_ssd_get_mask(&sch->ssd_info, link); in io_subchannel_chp_event()
1147 sch->opm &= ~mask; in io_subchannel_chp_event()
1148 sch->lpm &= ~mask; in io_subchannel_chp_event()
1151 io_subchannel_terminate_path(sch, mask); in io_subchannel_chp_event()
1154 sch->opm |= mask; in io_subchannel_chp_event()
1155 sch->lpm |= mask; in io_subchannel_chp_event()
1158 io_subchannel_verify(sch); in io_subchannel_chp_event()
1161 if (cio_update_schib(sch)) in io_subchannel_chp_event()
1165 io_subchannel_terminate_path(sch, mask); in io_subchannel_chp_event()
1168 if (cio_update_schib(sch)) in io_subchannel_chp_event()
1170 sch->lpm |= mask & sch->opm; in io_subchannel_chp_event()
1173 io_subchannel_verify(sch); in io_subchannel_chp_event()
1179 static void io_subchannel_quiesce(struct subchannel *sch) in io_subchannel_quiesce() argument
1184 spin_lock_irq(sch->lock); in io_subchannel_quiesce()
1185 cdev = sch_get_cdev(sch); in io_subchannel_quiesce()
1186 if (cio_is_console(sch->schid)) in io_subchannel_quiesce()
1188 if (!sch->schib.pmcw.ena) in io_subchannel_quiesce()
1190 ret = cio_disable_subchannel(sch); in io_subchannel_quiesce()
1201 spin_unlock_irq(sch->lock); in io_subchannel_quiesce()
1204 spin_lock_irq(sch->lock); in io_subchannel_quiesce()
1206 ret = cio_disable_subchannel(sch); in io_subchannel_quiesce()
1209 spin_unlock_irq(sch->lock); in io_subchannel_quiesce()
1212 static void io_subchannel_shutdown(struct subchannel *sch) in io_subchannel_shutdown() argument
1214 io_subchannel_quiesce(sch); in io_subchannel_shutdown()
1228 struct subchannel *sch; in recovery_check() local
1234 sch = to_subchannel(cdev->dev.parent); in recovery_check()
1235 if ((sch->schib.pmcw.pam & sch->opm) == sch->vpm) in recovery_check()
1343 struct subchannel *sch = to_subchannel(cdev->dev.parent); in ccw_device_set_notoper() local
1346 CIO_TRACE_EVENT(2, dev_name(&sch->dev)); in ccw_device_set_notoper()
1348 cio_disable_subchannel(sch); in ccw_device_set_notoper()
1364 static enum io_sch_action sch_get_action(struct subchannel *sch) in sch_get_action() argument
1368 cdev = sch_get_cdev(sch); in sch_get_action()
1369 if (cio_update_schib(sch)) { in sch_get_action()
1380 if (sch->schib.pmcw.dev != cdev->private->dev_id.devno) { in sch_get_action()
1385 if ((sch->schib.pmcw.pam & sch->opm) == 0) { in sch_get_action()
1409 static int io_subchannel_sch_event(struct subchannel *sch, int process) in io_subchannel_sch_event() argument
1417 spin_lock_irqsave(sch->lock, flags); in io_subchannel_sch_event()
1418 if (!device_is_registered(&sch->dev)) in io_subchannel_sch_event()
1420 if (work_pending(&sch->todo_work)) in io_subchannel_sch_event()
1422 cdev = sch_get_cdev(sch); in io_subchannel_sch_event()
1425 action = sch_get_action(sch); in io_subchannel_sch_event()
1427 sch->schid.ssid, sch->schid.sch_no, process, in io_subchannel_sch_event()
1438 io_subchannel_verify(sch); in io_subchannel_sch_event()
1469 spin_unlock_irqrestore(sch->lock, flags); in io_subchannel_sch_event()
1483 spin_lock_irqsave(sch->lock, flags); in io_subchannel_sch_event()
1489 sch_set_cdev(sch, NULL); in io_subchannel_sch_event()
1490 spin_unlock_irqrestore(sch->lock, flags); in io_subchannel_sch_event()
1502 css_sch_device_unregister(sch); in io_subchannel_sch_event()
1507 dev_id.ssid = sch->schid.ssid; in io_subchannel_sch_event()
1508 dev_id.devno = sch->schib.pmcw.dev; in io_subchannel_sch_event()
1511 sch_create_and_recog_new_device(sch); in io_subchannel_sch_event()
1514 rc = ccw_device_move_to_sch(cdev, sch); in io_subchannel_sch_event()
1520 spin_lock_irqsave(sch->lock, flags); in io_subchannel_sch_event()
1522 spin_unlock_irqrestore(sch->lock, flags); in io_subchannel_sch_event()
1532 spin_unlock_irqrestore(sch->lock, flags); in io_subchannel_sch_event()
1552 struct subchannel *sch = to_subchannel(cdev->dev.parent); in ccw_device_enable_console() local
1558 io_subchannel_init_fields(sch); in ccw_device_enable_console()
1559 rc = cio_commit_config(sch); in ccw_device_enable_console()
1562 sch->driver = &io_subchannel_driver; in ccw_device_enable_console()
1563 io_subchannel_recog(cdev, sch); in ccw_device_enable_console()
1593 struct subchannel *sch; in ccw_device_create_console() local
1595 sch = cio_probe_console(); in ccw_device_create_console()
1596 if (IS_ERR(sch)) in ccw_device_create_console()
1597 return ERR_CAST(sch); in ccw_device_create_console()
1601 put_device(&sch->dev); in ccw_device_create_console()
1604 set_io_private(sch, io_priv); in ccw_device_create_console()
1605 cdev = io_subchannel_create_ccwdev(sch); in ccw_device_create_console()
1607 put_device(&sch->dev); in ccw_device_create_console()
1618 struct subchannel *sch = to_subchannel(cdev->dev.parent); in ccw_device_destroy_console() local
1619 struct io_subchannel_private *io_priv = to_io_private(sch); in ccw_device_destroy_console()
1621 set_io_private(sch, NULL); in ccw_device_destroy_console()
1622 put_device(&sch->dev); in ccw_device_destroy_console()
1637 struct subchannel *sch = to_subchannel(cdev->dev.parent); in ccw_device_wait_idle() local
1640 cio_tsch(sch); in ccw_device_wait_idle()
1641 if (sch->schib.scsw.cmd.actl == 0) in ccw_device_wait_idle()
1793 struct subchannel *sch = to_subchannel(cdev->dev.parent); in ccw_device_pm_freeze() local
1807 spin_lock_irq(sch->lock); in ccw_device_pm_freeze()
1809 spin_unlock_irq(sch->lock); in ccw_device_pm_freeze()
1817 spin_lock_irq(sch->lock); in ccw_device_pm_freeze()
1818 ret = cio_disable_subchannel(sch); in ccw_device_pm_freeze()
1819 spin_unlock_irq(sch->lock); in ccw_device_pm_freeze()
1827 struct subchannel *sch = to_subchannel(cdev->dev.parent); in ccw_device_pm_thaw() local
1833 spin_lock_irq(sch->lock); in ccw_device_pm_thaw()
1835 ret = cio_enable_subchannel(sch, (u32)(addr_t)sch); in ccw_device_pm_thaw()
1837 spin_unlock_irq(sch->lock); in ccw_device_pm_thaw()
1855 struct subchannel *sch = to_subchannel(cdev->dev.parent); in __ccw_device_pm_restore() local
1857 spin_lock_irq(sch->lock); in __ccw_device_pm_restore()
1858 if (cio_is_console(sch->schid)) { in __ccw_device_pm_restore()
1859 cio_enable_subchannel(sch, (u32)(addr_t)sch); in __ccw_device_pm_restore()
1868 css_sched_sch_todo(sch, SCH_TODO_EVAL); in __ccw_device_pm_restore()
1869 spin_unlock_irq(sch->lock); in __ccw_device_pm_restore()
1873 sch = to_subchannel(cdev->dev.parent); in __ccw_device_pm_restore()
1874 spin_lock_irq(sch->lock); in __ccw_device_pm_restore()
1880 spin_unlock_irq(sch->lock); in __ccw_device_pm_restore()
1883 spin_lock_irq(sch->lock); in __ccw_device_pm_restore()
1887 spin_unlock_irq(sch->lock); in __ccw_device_pm_restore()
1911 struct subchannel *sch; in ccw_device_pm_restore() local
1915 sch = to_subchannel(cdev->dev.parent); in ccw_device_pm_restore()
1916 spin_lock_irq(sch->lock); in ccw_device_pm_restore()
1917 if (cio_is_console(sch->schid)) in ccw_device_pm_restore()
1953 spin_unlock_irq(sch->lock); in ccw_device_pm_restore()
1955 spin_lock_irq(sch->lock); in ccw_device_pm_restore()
1965 spin_unlock_irq(sch->lock); in ccw_device_pm_restore()
1967 spin_lock_irq(sch->lock); in ccw_device_pm_restore()
1977 spin_unlock_irq(sch->lock); in ccw_device_pm_restore()
1983 spin_unlock_irq(sch->lock); in ccw_device_pm_restore()
2037 struct subchannel *sch; in ccw_device_todo() local
2042 sch = to_subchannel(cdev->dev.parent); in ccw_device_todo()
2062 if (!sch_is_pseudo_sch(sch)) in ccw_device_todo()
2063 css_schedule_eval(sch->schid); in ccw_device_todo()
2066 if (sch_is_pseudo_sch(sch)) in ccw_device_todo()
2113 struct subchannel *sch = to_subchannel(cdev->dev.parent); in ccw_device_siosl() local
2115 return chsc_siosl(sch->schid); in ccw_device_siosl()