Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/sclp: Remove sclp base power management support

Power management support was removed for s390 with
commit 394216275c7d ("s390: remove broken hibernate / power management
support").

Remove leftover sclp base-related power management code. Note that we
keep the registration of the sclp platform driver since it is used to
externalize non-PM related attributes in sysfs.

Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Peter Oberparleiter and committed by
Vasily Gorbik
2f7e5208 9b357ccd

+1 -187
+1 -173
drivers/s390/char/sclp.c
··· 17 17 #include <linux/reboot.h> 18 18 #include <linux/jiffies.h> 19 19 #include <linux/init.h> 20 - #include <linux/suspend.h> 21 - #include <linux/completion.h> 22 20 #include <linux/platform_device.h> 23 21 #include <asm/types.h> 24 22 #include <asm/irq.h> ··· 46 48 static void *sclp_read_sccb; 47 49 static struct init_sccb *sclp_init_sccb; 48 50 49 - /* Suspend request */ 50 - static DECLARE_COMPLETION(sclp_request_queue_flushed); 51 - 52 51 /* Number of console pages to allocate, used by sclp_con.c and sclp_vt220.c */ 53 52 int sclp_console_pages = SCLP_CONSOLE_PAGES; 54 53 /* Flag to indicate if buffer pages are dropped on buffer full condition */ 55 54 int sclp_console_drop = 1; 56 55 /* Number of times the console dropped buffer pages */ 57 56 unsigned long sclp_console_full; 58 - 59 - static void sclp_suspend_req_cb(struct sclp_req *req, void *data) 60 - { 61 - complete(&sclp_request_queue_flushed); 62 - } 63 57 64 58 static int __init sclp_setup_console_pages(char *str) 65 59 { ··· 76 86 } 77 87 78 88 __setup("sclp_con_drop=", sclp_setup_console_drop); 79 - 80 - static struct sclp_req sclp_suspend_req; 81 89 82 90 /* Timer for request retries. */ 83 91 static struct timer_list sclp_request_timer; ··· 109 121 sclp_mask_state_idle, 110 122 sclp_mask_state_initializing 111 123 } sclp_mask_state = sclp_mask_state_idle; 112 - 113 - /* Internal state: is the driver suspended? */ 114 - static enum sclp_suspend_state_t { 115 - sclp_suspend_state_running, 116 - sclp_suspend_state_suspended, 117 - } sclp_suspend_state = sclp_suspend_state_running; 118 124 119 125 /* Maximum retry counts */ 120 126 #define SCLP_INIT_RETRY 3 ··· 295 313 del_timer(&sclp_request_timer); 296 314 while (!list_empty(&sclp_req_queue)) { 297 315 req = list_entry(sclp_req_queue.next, struct sclp_req, list); 298 - if (!req->sccb) 299 - goto do_post; 300 316 rc = __sclp_start_request(req); 301 317 if (rc == 0) 302 318 break; ··· 306 326 sclp_request_timeout_normal); 307 327 break; 308 328 } 309 - do_post: 310 329 /* Post-processing for aborted request */ 311 330 list_del(&req->list); 312 331 if (req->callback) { ··· 319 340 320 341 static int __sclp_can_add_request(struct sclp_req *req) 321 342 { 322 - if (req == &sclp_suspend_req || req == &sclp_init_req) 343 + if (req == &sclp_init_req) 323 344 return 1; 324 - if (sclp_suspend_state != sclp_suspend_state_running) 325 - return 0; 326 345 if (sclp_init_state != sclp_init_state_initialized) 327 346 return 0; 328 347 if (sclp_activation_state != sclp_activation_state_active) ··· 354 377 /* Start if request is first in list */ 355 378 if (sclp_running_state == sclp_running_state_idle && 356 379 req->list.prev == &sclp_req_queue) { 357 - if (!req->sccb) { 358 - list_del(&req->list); 359 - rc = -ENODATA; 360 - goto out; 361 - } 362 380 rc = __sclp_start_request(req); 363 381 if (rc) 364 382 list_del(&req->list); 365 383 } 366 - out: 367 384 spin_unlock_irqrestore(&sclp_lock, flags); 368 385 return rc; 369 386 } ··· 663 692 /* Trigger initial state change callback */ 664 693 reg->sclp_receive_mask = 0; 665 694 reg->sclp_send_mask = 0; 666 - reg->pm_event_posted = 0; 667 695 list_add(&reg->list, &sclp_reg_list); 668 696 spin_unlock_irqrestore(&sclp_lock, flags); 669 697 rc = sclp_init_mask(1); ··· 980 1010 .notifier_call = sclp_reboot_event 981 1011 }; 982 1012 983 - /* 984 - * Suspend/resume SCLP notifier implementation 985 - */ 986 - 987 - static void sclp_pm_event(enum sclp_pm_event sclp_pm_event, int rollback) 988 - { 989 - struct sclp_register *reg; 990 - unsigned long flags; 991 - 992 - if (!rollback) { 993 - spin_lock_irqsave(&sclp_lock, flags); 994 - list_for_each_entry(reg, &sclp_reg_list, list) 995 - reg->pm_event_posted = 0; 996 - spin_unlock_irqrestore(&sclp_lock, flags); 997 - } 998 - do { 999 - spin_lock_irqsave(&sclp_lock, flags); 1000 - list_for_each_entry(reg, &sclp_reg_list, list) { 1001 - if (rollback && reg->pm_event_posted) 1002 - goto found; 1003 - if (!rollback && !reg->pm_event_posted) 1004 - goto found; 1005 - } 1006 - spin_unlock_irqrestore(&sclp_lock, flags); 1007 - return; 1008 - found: 1009 - spin_unlock_irqrestore(&sclp_lock, flags); 1010 - if (reg->pm_event_fn) 1011 - reg->pm_event_fn(reg, sclp_pm_event); 1012 - reg->pm_event_posted = rollback ? 0 : 1; 1013 - } while (1); 1014 - } 1015 - 1016 - /* 1017 - * Susend/resume callbacks for platform device 1018 - */ 1019 - 1020 - static int sclp_freeze(struct device *dev) 1021 - { 1022 - unsigned long flags; 1023 - int rc; 1024 - 1025 - sclp_pm_event(SCLP_PM_EVENT_FREEZE, 0); 1026 - 1027 - spin_lock_irqsave(&sclp_lock, flags); 1028 - sclp_suspend_state = sclp_suspend_state_suspended; 1029 - spin_unlock_irqrestore(&sclp_lock, flags); 1030 - 1031 - /* Init supend data */ 1032 - memset(&sclp_suspend_req, 0, sizeof(sclp_suspend_req)); 1033 - sclp_suspend_req.callback = sclp_suspend_req_cb; 1034 - sclp_suspend_req.status = SCLP_REQ_FILLED; 1035 - init_completion(&sclp_request_queue_flushed); 1036 - 1037 - rc = sclp_add_request(&sclp_suspend_req); 1038 - if (rc == 0) 1039 - wait_for_completion(&sclp_request_queue_flushed); 1040 - else if (rc != -ENODATA) 1041 - goto fail_thaw; 1042 - 1043 - rc = sclp_deactivate(); 1044 - if (rc) 1045 - goto fail_thaw; 1046 - return 0; 1047 - 1048 - fail_thaw: 1049 - spin_lock_irqsave(&sclp_lock, flags); 1050 - sclp_suspend_state = sclp_suspend_state_running; 1051 - spin_unlock_irqrestore(&sclp_lock, flags); 1052 - sclp_pm_event(SCLP_PM_EVENT_THAW, 1); 1053 - return rc; 1054 - } 1055 - 1056 - static int sclp_undo_suspend(enum sclp_pm_event event) 1057 - { 1058 - unsigned long flags; 1059 - int rc; 1060 - 1061 - rc = sclp_reactivate(); 1062 - if (rc) 1063 - return rc; 1064 - 1065 - spin_lock_irqsave(&sclp_lock, flags); 1066 - sclp_suspend_state = sclp_suspend_state_running; 1067 - spin_unlock_irqrestore(&sclp_lock, flags); 1068 - 1069 - sclp_pm_event(event, 0); 1070 - return 0; 1071 - } 1072 - 1073 - static int sclp_thaw(struct device *dev) 1074 - { 1075 - return sclp_undo_suspend(SCLP_PM_EVENT_THAW); 1076 - } 1077 - 1078 - static int sclp_restore(struct device *dev) 1079 - { 1080 - return sclp_undo_suspend(SCLP_PM_EVENT_RESTORE); 1081 - } 1082 - 1083 - static const struct dev_pm_ops sclp_pm_ops = { 1084 - .freeze = sclp_freeze, 1085 - .thaw = sclp_thaw, 1086 - .restore = sclp_restore, 1087 - }; 1088 - 1089 1013 static ssize_t con_pages_show(struct device_driver *dev, char *buf) 1090 1014 { 1091 1015 return sprintf(buf, "%i\n", sclp_console_pages); ··· 1018 1154 static struct platform_driver sclp_pdrv = { 1019 1155 .driver = { 1020 1156 .name = "sclp", 1021 - .pm = &sclp_pm_ops, 1022 1157 .groups = sclp_drv_attr_groups, 1023 1158 }, 1024 1159 }; 1025 - 1026 - static struct platform_device *sclp_pdev; 1027 1160 1028 1161 /* Initialize SCLP driver. Return zero if driver is operational, non-zero 1029 1162 * otherwise. */ ··· 1075 1214 return rc; 1076 1215 } 1077 1216 1078 - /* 1079 - * SCLP panic notifier: If we are suspended, we thaw SCLP in order to be able 1080 - * to print the panic message. 1081 - */ 1082 - static int sclp_panic_notify(struct notifier_block *self, 1083 - unsigned long event, void *data) 1084 - { 1085 - if (sclp_suspend_state == sclp_suspend_state_suspended) 1086 - sclp_undo_suspend(SCLP_PM_EVENT_THAW); 1087 - return NOTIFY_OK; 1088 - } 1089 - 1090 - static struct notifier_block sclp_on_panic_nb = { 1091 - .notifier_call = sclp_panic_notify, 1092 - .priority = SCLP_PANIC_PRIO, 1093 - }; 1094 - 1095 1217 static __init int sclp_initcall(void) 1096 1218 { 1097 1219 int rc; ··· 1083 1239 if (rc) 1084 1240 return rc; 1085 1241 1086 - sclp_pdev = platform_device_register_simple("sclp", -1, NULL, 0); 1087 - rc = PTR_ERR_OR_ZERO(sclp_pdev); 1088 - if (rc) 1089 - goto fail_platform_driver_unregister; 1090 - 1091 - rc = atomic_notifier_chain_register(&panic_notifier_list, 1092 - &sclp_on_panic_nb); 1093 - if (rc) 1094 - goto fail_platform_device_unregister; 1095 - 1096 1242 return sclp_init(); 1097 - 1098 - fail_platform_device_unregister: 1099 - platform_device_unregister(sclp_pdev); 1100 - fail_platform_driver_unregister: 1101 - platform_driver_unregister(&sclp_pdrv); 1102 - return rc; 1103 1243 } 1104 1244 1105 1245 arch_initcall(sclp_initcall);
-13
drivers/s390/char/sclp.h
··· 81 81 82 82 #define GDS_KEY_SELFDEFTEXTMSG 0x31 83 83 84 - enum sclp_pm_event { 85 - SCLP_PM_EVENT_FREEZE, 86 - SCLP_PM_EVENT_THAW, 87 - SCLP_PM_EVENT_RESTORE, 88 - }; 89 - 90 - #define SCLP_PANIC_PRIO 1 91 - #define SCLP_PANIC_PRIO_CLIENT 0 92 - 93 84 typedef u64 sccb_mask_t; 94 85 95 86 struct sccb_header { ··· 284 293 void (*state_change_fn)(struct sclp_register *); 285 294 /* called for events in cp_receive_mask/sclp_receive_mask */ 286 295 void (*receiver_fn)(struct evbuf_header *); 287 - /* called for power management events */ 288 - void (*pm_event_fn)(struct sclp_register *, enum sclp_pm_event); 289 - /* pm event posted flag */ 290 - int pm_event_posted; 291 296 }; 292 297 293 298 /* externals from sclp.c */
-1
drivers/s390/char/sclp_ftp.c
··· 231 231 .receive_mask = EVTYP_DIAG_TEST_MASK, /* want rx events */ 232 232 .receiver_fn = sclp_ftp_rxcb, /* async callback (rx) */ 233 233 .state_change_fn = NULL, 234 - .pm_event_fn = NULL, 235 234 }; 236 235 237 236 /**