Lines Matching full:device

18  * - A device is connected to an lcu as long as the device exists.
20 * device is checked by the eckd discipline and
22 * before the device is deleted.
24 * functions mark the point when a device is 'ready for service'.
28 * - dasd_alias_get_start_dev will find an alias device that can be used
29 * instead of the base device and does some (very simple) load balancing.
174 * so this function must be called first for a new device.
179 int dasd_alias_make_device_known_to_lcu(struct dasd_device *device) in dasd_alias_make_device_known_to_lcu() argument
181 struct dasd_eckd_private *private = device->private; in dasd_alias_make_device_known_to_lcu()
187 device->discipline->get_uid(device, &uid); in dasd_alias_make_device_known_to_lcu()
223 list_add(&device->alias_list, &lcu->inactive_devices); in dasd_alias_make_device_known_to_lcu()
232 * This function removes a device from the scope of alias management.
236 void dasd_alias_disconnect_device_from_lcu(struct dasd_device *device) in dasd_alias_disconnect_device_from_lcu() argument
238 struct dasd_eckd_private *private = device->private; in dasd_alias_disconnect_device_from_lcu()
249 device->discipline->get_uid(device, &uid); in dasd_alias_disconnect_device_from_lcu()
251 /* make sure that the workers don't use this device */ in dasd_alias_disconnect_device_from_lcu()
252 if (device == lcu->suc_data.device) { in dasd_alias_disconnect_device_from_lcu()
256 if (device == lcu->suc_data.device) { in dasd_alias_disconnect_device_from_lcu()
257 dasd_put_device(device); in dasd_alias_disconnect_device_from_lcu()
258 lcu->suc_data.device = NULL; in dasd_alias_disconnect_device_from_lcu()
262 if (device == lcu->ruac_data.device) { in dasd_alias_disconnect_device_from_lcu()
267 if (device == lcu->ruac_data.device) { in dasd_alias_disconnect_device_from_lcu()
268 dasd_put_device(device); in dasd_alias_disconnect_device_from_lcu()
269 lcu->ruac_data.device = NULL; in dasd_alias_disconnect_device_from_lcu()
277 list_del_init(&device->alias_list); in dasd_alias_disconnect_device_from_lcu()
300 * in the lcu is up to date and will update the device uid before
305 struct dasd_device *device, in _add_device_to_lcu() argument
309 struct dasd_eckd_private *private = device->private; in _add_device_to_lcu()
313 spin_lock(get_ccwdev_lock(device->cdev)); in _add_device_to_lcu()
318 spin_unlock(get_ccwdev_lock(device->cdev)); in _add_device_to_lcu()
321 list_move(&device->alias_list, &lcu->active_devices); in _add_device_to_lcu()
343 list_move(&device->alias_list, &group->baselist); in _add_device_to_lcu()
345 list_move(&device->alias_list, &group->aliaslist); in _add_device_to_lcu()
351 struct dasd_device *device) in _remove_device_from_lcu() argument
353 struct dasd_eckd_private *private = device->private; in _remove_device_from_lcu()
356 list_move(&device->alias_list, &lcu->inactive_devices); in _remove_device_from_lcu()
366 if (group->next == device) in _remove_device_from_lcu()
407 static int read_unit_address_configuration(struct dasd_device *device, in read_unit_address_configuration() argument
418 device, NULL); in read_unit_address_configuration()
421 cqr->startdev = device; in read_unit_address_configuration()
422 cqr->memdev = device; in read_unit_address_configuration()
461 /* suborder not supported or device unusable for IO */ in read_unit_address_configuration()
478 struct dasd_device *device, *tempdev; in _lcu_update() local
484 list_for_each_entry_safe(device, tempdev, &pavgroup->baselist, in _lcu_update()
486 list_move(&device->alias_list, &lcu->active_devices); in _lcu_update()
487 private = device->private; in _lcu_update()
490 list_for_each_entry_safe(device, tempdev, &pavgroup->aliaslist, in _lcu_update()
492 list_move(&device->alias_list, &lcu->active_devices); in _lcu_update()
493 private = device->private; in _lcu_update()
509 * but especially do not add the device to an LCU with pending in _lcu_update()
528 list_for_each_entry_safe(device, tempdev, &lcu->active_devices, in _lcu_update()
530 _add_device_to_lcu(lcu, device, refdev); in _lcu_update()
541 struct dasd_device *device; in lcu_update_work() local
547 device = ruac_data->device; in lcu_update_work()
548 rc = _lcu_update(device, lcu); in lcu_update_work()
551 * prepare_update or a new device a new device while we were still in lcu_update_work()
556 DBF_DEV_EVENT(DBF_WARNING, device, "could not update" in lcu_update_work()
559 dasd_put_device(device); in lcu_update_work()
561 dasd_put_device(device); in lcu_update_work()
562 lcu->ruac_data.device = NULL; in lcu_update_work()
569 struct dasd_device *device) in _schedule_lcu_update() argument
575 if (lcu->ruac_data.device) { in _schedule_lcu_update()
579 if (device && !list_empty(&device->alias_list)) in _schedule_lcu_update()
580 usedev = device; in _schedule_lcu_update()
599 * if we haven't found a proper device yet, give up for now, the next in _schedule_lcu_update()
600 * device that will be set active will trigger an lcu update in _schedule_lcu_update()
605 lcu->ruac_data.device = usedev; in _schedule_lcu_update()
611 int dasd_alias_add_device(struct dasd_device *device) in dasd_alias_add_device() argument
613 struct dasd_eckd_private *private = device->private; in dasd_alias_add_device()
622 * Check if device and lcu type differ. If so, the uac data may be in dasd_alias_add_device()
627 DBF_DEV_EVENT(DBF_WARNING, device, "%s", in dasd_alias_add_device()
631 rc = _add_device_to_lcu(lcu, device, device); in dasd_alias_add_device()
636 list_move(&device->alias_list, &lcu->active_devices); in dasd_alias_add_device()
638 _schedule_lcu_update(lcu, device); in dasd_alias_add_device()
644 int dasd_alias_update_add_device(struct dasd_device *device) in dasd_alias_update_add_device() argument
646 struct dasd_eckd_private *private = device->private; in dasd_alias_update_add_device()
649 return dasd_alias_add_device(device); in dasd_alias_update_add_device()
652 int dasd_alias_remove_device(struct dasd_device *device) in dasd_alias_remove_device() argument
654 struct dasd_eckd_private *private = device->private; in dasd_alias_remove_device()
662 _remove_device_from_lcu(lcu, device); in dasd_alias_remove_device()
684 * use base device to do IO in dasd_alias_get_start_dev()
728 struct dasd_device *device, in reset_summary_unit_check() argument
747 cqr->startdev = device; in reset_summary_unit_check()
748 cqr->memdev = device; in reset_summary_unit_check()
761 struct dasd_device *device; in _restart_all_base_devices_on_lcu() local
765 list_for_each_entry(device, &lcu->active_devices, alias_list) { in _restart_all_base_devices_on_lcu()
766 private = device->private; in _restart_all_base_devices_on_lcu()
769 dasd_schedule_block_bh(device->block); in _restart_all_base_devices_on_lcu()
770 dasd_schedule_device_bh(device); in _restart_all_base_devices_on_lcu()
772 list_for_each_entry(device, &lcu->inactive_devices, alias_list) { in _restart_all_base_devices_on_lcu()
773 private = device->private; in _restart_all_base_devices_on_lcu()
776 dasd_schedule_block_bh(device->block); in _restart_all_base_devices_on_lcu()
777 dasd_schedule_device_bh(device); in _restart_all_base_devices_on_lcu()
780 list_for_each_entry(device, &pavgroup->baselist, alias_list) { in _restart_all_base_devices_on_lcu()
781 dasd_schedule_block_bh(device->block); in _restart_all_base_devices_on_lcu()
782 dasd_schedule_device_bh(device); in _restart_all_base_devices_on_lcu()
790 struct dasd_device *device, *temp; in flush_all_alias_devices_on_lcu() local
807 list_for_each_entry_safe(device, temp, &lcu->active_devices, in flush_all_alias_devices_on_lcu()
809 private = device->private; in flush_all_alias_devices_on_lcu()
812 list_move(&device->alias_list, &active); in flush_all_alias_devices_on_lcu()
819 device = list_first_entry(&active, struct dasd_device, in flush_all_alias_devices_on_lcu()
822 dasd_flush_device_queue(device); in flush_all_alias_devices_on_lcu()
825 * only move device around if it wasn't moved away while we in flush_all_alias_devices_on_lcu()
828 if (device == list_first_entry(&active, in flush_all_alias_devices_on_lcu()
830 list_move(&device->alias_list, &lcu->active_devices); in flush_all_alias_devices_on_lcu()
831 private = device->private; in flush_all_alias_devices_on_lcu()
841 struct dasd_device *device; in _stop_all_devices_on_lcu() local
843 list_for_each_entry(device, &lcu->active_devices, alias_list) { in _stop_all_devices_on_lcu()
844 spin_lock(get_ccwdev_lock(device->cdev)); in _stop_all_devices_on_lcu()
845 dasd_device_set_stop_bits(device, DASD_STOPPED_SU); in _stop_all_devices_on_lcu()
846 spin_unlock(get_ccwdev_lock(device->cdev)); in _stop_all_devices_on_lcu()
848 list_for_each_entry(device, &lcu->inactive_devices, alias_list) { in _stop_all_devices_on_lcu()
849 spin_lock(get_ccwdev_lock(device->cdev)); in _stop_all_devices_on_lcu()
850 dasd_device_set_stop_bits(device, DASD_STOPPED_SU); in _stop_all_devices_on_lcu()
851 spin_unlock(get_ccwdev_lock(device->cdev)); in _stop_all_devices_on_lcu()
854 list_for_each_entry(device, &pavgroup->baselist, alias_list) { in _stop_all_devices_on_lcu()
855 spin_lock(get_ccwdev_lock(device->cdev)); in _stop_all_devices_on_lcu()
856 dasd_device_set_stop_bits(device, DASD_STOPPED_SU); in _stop_all_devices_on_lcu()
857 spin_unlock(get_ccwdev_lock(device->cdev)); in _stop_all_devices_on_lcu()
859 list_for_each_entry(device, &pavgroup->aliaslist, alias_list) { in _stop_all_devices_on_lcu()
860 spin_lock(get_ccwdev_lock(device->cdev)); in _stop_all_devices_on_lcu()
861 dasd_device_set_stop_bits(device, DASD_STOPPED_SU); in _stop_all_devices_on_lcu()
862 spin_unlock(get_ccwdev_lock(device->cdev)); in _stop_all_devices_on_lcu()
870 struct dasd_device *device; in _unstop_all_devices_on_lcu() local
872 list_for_each_entry(device, &lcu->active_devices, alias_list) { in _unstop_all_devices_on_lcu()
873 spin_lock(get_ccwdev_lock(device->cdev)); in _unstop_all_devices_on_lcu()
874 dasd_device_remove_stop_bits(device, DASD_STOPPED_SU); in _unstop_all_devices_on_lcu()
875 spin_unlock(get_ccwdev_lock(device->cdev)); in _unstop_all_devices_on_lcu()
877 list_for_each_entry(device, &lcu->inactive_devices, alias_list) { in _unstop_all_devices_on_lcu()
878 spin_lock(get_ccwdev_lock(device->cdev)); in _unstop_all_devices_on_lcu()
879 dasd_device_remove_stop_bits(device, DASD_STOPPED_SU); in _unstop_all_devices_on_lcu()
880 spin_unlock(get_ccwdev_lock(device->cdev)); in _unstop_all_devices_on_lcu()
883 list_for_each_entry(device, &pavgroup->baselist, alias_list) { in _unstop_all_devices_on_lcu()
884 spin_lock(get_ccwdev_lock(device->cdev)); in _unstop_all_devices_on_lcu()
885 dasd_device_remove_stop_bits(device, DASD_STOPPED_SU); in _unstop_all_devices_on_lcu()
886 spin_unlock(get_ccwdev_lock(device->cdev)); in _unstop_all_devices_on_lcu()
888 list_for_each_entry(device, &pavgroup->aliaslist, alias_list) { in _unstop_all_devices_on_lcu()
889 spin_lock(get_ccwdev_lock(device->cdev)); in _unstop_all_devices_on_lcu()
890 dasd_device_remove_stop_bits(device, DASD_STOPPED_SU); in _unstop_all_devices_on_lcu()
891 spin_unlock(get_ccwdev_lock(device->cdev)); in _unstop_all_devices_on_lcu()
901 struct dasd_device *device; in summary_unit_check_handling_work() local
906 device = suc_data->device; in summary_unit_check_handling_work()
912 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); in summary_unit_check_handling_work()
913 dasd_device_remove_stop_bits(device, in summary_unit_check_handling_work()
915 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); in summary_unit_check_handling_work()
916 reset_summary_unit_check(lcu, device, suc_data->reason); in summary_unit_check_handling_work()
922 _schedule_lcu_update(lcu, device); in summary_unit_check_handling_work()
923 lcu->suc_data.device = NULL; in summary_unit_check_handling_work()
924 dasd_put_device(device); in summary_unit_check_handling_work()
930 struct dasd_device *device = container_of(work, struct dasd_device, in dasd_alias_handle_summary_unit_check() local
932 struct dasd_eckd_private *private = device->private; in dasd_alias_handle_summary_unit_check()
938 DBF_DEV_EVENT(DBF_WARNING, device, "%s", in dasd_alias_handle_summary_unit_check()
939 "device not ready to handle summary" in dasd_alias_handle_summary_unit_check()
944 /* If this device is about to be removed just return and wait for in dasd_alias_handle_summary_unit_check()
945 * the next interrupt on a different device in dasd_alias_handle_summary_unit_check()
947 if (list_empty(&device->alias_list)) { in dasd_alias_handle_summary_unit_check()
948 DBF_DEV_EVENT(DBF_WARNING, device, "%s", in dasd_alias_handle_summary_unit_check()
949 "device is in offline processing," in dasd_alias_handle_summary_unit_check()
953 if (lcu->suc_data.device) { in dasd_alias_handle_summary_unit_check()
955 DBF_DEV_EVENT(DBF_WARNING, device, "%s", in dasd_alias_handle_summary_unit_check()
964 lcu->suc_data.device = device; in dasd_alias_handle_summary_unit_check()
965 dasd_get_device(device); in dasd_alias_handle_summary_unit_check()
967 dasd_put_device(device); in dasd_alias_handle_summary_unit_check()
971 clear_bit(DASD_FLAG_SUC, &device->flags); in dasd_alias_handle_summary_unit_check()
972 dasd_put_device(device); in dasd_alias_handle_summary_unit_check()