summaryrefslogtreecommitdiff
path: root/drivers/s390/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-07-04 12:17:38 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-07-04 12:17:38 -0700
commit2bb919b62f6e5959552a90a399d09d683afa3d1d (patch)
tree21e237db2bd0563dd458250d1b27d63a478bbcbe /drivers/s390/char
parent0d4d4c6ff6debde4c44a418c59b304d4b514541c (diff)
parentd4a01902eb59e478ab7c7d36d7bb90d94a315f89 (diff)
Merge tag 's390-5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 updates from Vasily Gorbik: - Rework inline asm to get rid of error prone "register asm" constructs, which are problematic especially when code instrumentation is enabled. In particular introduce and use register pair union to allocate even/odd register pairs. Unfortunately this breaks compatibility with older clang compilers and minimum clang version for s390 has been raised to 13. https://lore.kernel.org/linux-next/CAK7LNARuSmPCEy-ak0erPrPTgZdGVypBROFhtw+=3spoGoYsyw@mail.gmail.com/ - Fix gcc 11 warnings, which triggered various minor reworks all over the code. - Add zstd kernel image compression support. - Rework boot CPU lowcore handling. - De-duplicate and move kernel memory layout setup logic earlier. - Few fixes in preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for mem functions. - Remove broken and unused power management support leftovers in s390 drivers. - Disable stack-protector for decompressor and purgatory to fix buildroot build. - Fix vt220 sclp console name to match the char device name. - Enable HAVE_IOREMAP_PROT and add zpci_set_irq()/zpci_clear_irq() in zPCI code. - Remove some implausible WARN_ON_ONCEs and remove arch specific counter transaction call backs in favour of default transaction handling in perf code. - Extend/add new uevents for online/config/mode state changes of AP card / queue device in zcrypt. - Minor entry and ccwgroup code improvements. - Other small various fixes and improvements all over the code. * tag 's390-5.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (91 commits) s390/dasd: use register pair instead of register asm s390/qdio: get rid of register asm s390/ioasm: use symbolic names for asm operands s390/ioasm: get rid of register asm s390/cmf: get rid of register asm s390/lib,string: get rid of register asm s390/lib,uaccess: get rid of register asm s390/string: get rid of register asm s390/cmpxchg: use register pair instead of register asm s390/mm,pages-states: get rid of register asm s390/lib,xor: get rid of register asm s390/timex: get rid of register asm s390/hypfs: use register pair instead of register asm s390/zcrypt: Switch to flexible array member s390/speculation: Use statically initialized const for instructions virtio/s390: get rid of open-coded kvm hypercall s390/pci: add zpci_set_irq()/zpci_clear_irq() scripts/min-tool-version.sh: Raise minimum clang version to 13.0.0 for s390 s390/ipl: use register pair instead of register asm s390/mem_detect: fix tprot() program check new psw handling ...
Diffstat (limited to 'drivers/s390/char')
-rw-r--r--drivers/s390/char/monreader.c125
-rw-r--r--drivers/s390/char/monwriter.c90
-rw-r--r--drivers/s390/char/sclp.c174
-rw-r--r--drivers/s390/char/sclp.h13
-rw-r--r--drivers/s390/char/sclp_cmd.c34
-rw-r--r--drivers/s390/char/sclp_con.c53
-rw-r--r--drivers/s390/char/sclp_ftp.c1
-rw-r--r--drivers/s390/char/sclp_quiesce.c37
-rw-r--r--drivers/s390/char/sclp_rw.c7
-rw-r--r--drivers/s390/char/sclp_rw.h6
-rw-r--r--drivers/s390/char/sclp_tty.c4
-rw-r--r--drivers/s390/char/sclp_vt220.c56
-rw-r--r--drivers/s390/char/vmlogrdr.c24
13 files changed, 17 insertions, 607 deletions
diff --git a/drivers/s390/char/monreader.c b/drivers/s390/char/monreader.c
index 7bc616b253f1..9fa92e45e0ee 100644
--- a/drivers/s390/char/monreader.c
+++ b/drivers/s390/char/monreader.c
@@ -21,7 +21,6 @@
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/poll.h>
-#include <linux/device.h>
#include <linux/slab.h>
#include <net/iucv/iucv.h>
#include <linux/uaccess.h>
@@ -79,8 +78,6 @@ static u8 user_data_sever[16] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
};
-static struct device *monreader_device;
-
/******************************************************************************
* helper functions *
*****************************************************************************/
@@ -319,7 +316,6 @@ static int mon_open(struct inode *inode, struct file *filp)
goto out_path;
}
filp->private_data = monpriv;
- dev_set_drvdata(monreader_device, monpriv);
return nonseekable_open(inode, filp);
out_path:
@@ -354,7 +350,6 @@ static int mon_close(struct inode *inode, struct file *filp)
atomic_set(&monpriv->msglim_count, 0);
monpriv->write_index = 0;
monpriv->read_index = 0;
- dev_set_drvdata(monreader_device, NULL);
for (i = 0; i < MON_MSGLIM; i++)
kfree(monpriv->msg_array[i]);
@@ -456,94 +451,6 @@ static struct miscdevice mon_dev = {
.minor = MISC_DYNAMIC_MINOR,
};
-
-/******************************************************************************
- * suspend / resume *
- *****************************************************************************/
-static int monreader_freeze(struct device *dev)
-{
- struct mon_private *monpriv = dev_get_drvdata(dev);
- int rc;
-
- if (!monpriv)
- return 0;
- if (monpriv->path) {
- rc = iucv_path_sever(monpriv->path, user_data_sever);
- if (rc)
- pr_warn("Disconnecting the z/VM *MONITOR system service failed with rc=%i\n",
- rc);
- iucv_path_free(monpriv->path);
- }
- atomic_set(&monpriv->iucv_severed, 0);
- atomic_set(&monpriv->iucv_connected, 0);
- atomic_set(&monpriv->read_ready, 0);
- atomic_set(&monpriv->msglim_count, 0);
- monpriv->write_index = 0;
- monpriv->read_index = 0;
- monpriv->path = NULL;
- return 0;
-}
-
-static int monreader_thaw(struct device *dev)
-{
- struct mon_private *monpriv = dev_get_drvdata(dev);
- int rc;
-
- if (!monpriv)
- return 0;
- rc = -ENOMEM;
- monpriv->path = iucv_path_alloc(MON_MSGLIM, IUCV_IPRMDATA, GFP_KERNEL);
- if (!monpriv->path)
- goto out;
- rc = iucv_path_connect(monpriv->path, &monreader_iucv_handler,
- MON_SERVICE, NULL, user_data_connect, monpriv);
- if (rc) {
- pr_err("Connecting to the z/VM *MONITOR system service "
- "failed with rc=%i\n", rc);
- goto out_path;
- }
- wait_event(mon_conn_wait_queue,
- atomic_read(&monpriv->iucv_connected) ||
- atomic_read(&monpriv->iucv_severed));
- if (atomic_read(&monpriv->iucv_severed))
- goto out_path;
- return 0;
-out_path:
- rc = -EIO;
- iucv_path_free(monpriv->path);
- monpriv->path = NULL;
-out:
- atomic_set(&monpriv->iucv_severed, 1);
- return rc;
-}
-
-static int monreader_restore(struct device *dev)
-{
- int rc;
-
- segment_unload(mon_dcss_name);
- rc = segment_load(mon_dcss_name, SEGMENT_SHARED,
- &mon_dcss_start, &mon_dcss_end);
- if (rc < 0) {
- segment_warning(rc, mon_dcss_name);
- panic("fatal monreader resume error: no monitor dcss\n");
- }
- return monreader_thaw(dev);
-}
-
-static const struct dev_pm_ops monreader_pm_ops = {
- .freeze = monreader_freeze,
- .thaw = monreader_thaw,
- .restore = monreader_restore,
-};
-
-static struct device_driver monreader_driver = {
- .name = "monreader",
- .bus = &iucv_bus,
- .pm = &monreader_pm_ops,
-};
-
-
/******************************************************************************
* module init/exit *
*****************************************************************************/
@@ -567,36 +474,16 @@ static int __init mon_init(void)
return rc;
}
- rc = driver_register(&monreader_driver);
- if (rc)
- goto out_iucv;
- monreader_device = kzalloc(sizeof(struct device), GFP_KERNEL);
- if (!monreader_device) {
- rc = -ENOMEM;
- goto out_driver;
- }
-
- dev_set_name(monreader_device, "monreader-dev");
- monreader_device->bus = &iucv_bus;
- monreader_device->parent = iucv_root;
- monreader_device->driver = &monreader_driver;
- monreader_device->release = (void (*)(struct device *))kfree;
- rc = device_register(monreader_device);
- if (rc) {
- put_device(monreader_device);
- goto out_driver;
- }
-
rc = segment_type(mon_dcss_name);
if (rc < 0) {
segment_warning(rc, mon_dcss_name);
- goto out_device;
+ goto out_iucv;
}
if (rc != SEG_TYPE_SC) {
pr_err("The specified *MONITOR DCSS %s does not have the "
"required type SC\n", mon_dcss_name);
rc = -EINVAL;
- goto out_device;
+ goto out_iucv;
}
rc = segment_load(mon_dcss_name, SEGMENT_SHARED,
@@ -604,7 +491,7 @@ static int __init mon_init(void)
if (rc < 0) {
segment_warning(rc, mon_dcss_name);
rc = -EINVAL;
- goto out_device;
+ goto out_iucv;
}
dcss_mkname(mon_dcss_name, &user_data_connect[8]);
@@ -619,10 +506,6 @@ static int __init mon_init(void)
out:
segment_unload(mon_dcss_name);
-out_device:
- device_unregister(monreader_device);
-out_driver:
- driver_unregister(&monreader_driver);
out_iucv:
iucv_unregister(&monreader_iucv_handler, 1);
return rc;
@@ -632,8 +515,6 @@ static void __exit mon_exit(void)
{
segment_unload(mon_dcss_name);
misc_deregister(&mon_dev);
- device_unregister(monreader_device);
- driver_unregister(&monreader_driver);
iucv_unregister(&monreader_iucv_handler, 1);
return;
}
diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c
index fdc0c0b7a6f5..9cd1ea92d619 100644
--- a/drivers/s390/char/monwriter.c
+++ b/drivers/s390/char/monwriter.c
@@ -20,7 +20,6 @@
#include <linux/ctype.h>
#include <linux/poll.h>
#include <linux/mutex.h>
-#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <asm/ebcdic.h>
@@ -40,10 +39,7 @@ struct mon_buf {
char *data;
};
-static LIST_HEAD(mon_priv_list);
-
struct mon_private {
- struct list_head priv_list;
struct list_head list;
struct monwrite_hdr hdr;
size_t hdr_to_read;
@@ -199,7 +195,6 @@ static int monwrite_open(struct inode *inode, struct file *filp)
monpriv->hdr_to_read = sizeof(monpriv->hdr);
mutex_init(&monpriv->thread_mutex);
filp->private_data = monpriv;
- list_add_tail(&monpriv->priv_list, &mon_priv_list);
return nonseekable_open(inode, filp);
}
@@ -217,7 +212,6 @@ static int monwrite_close(struct inode *inode, struct file *filp)
kfree(entry->data);
kfree(entry);
}
- list_del(&monpriv->priv_list);
kfree(monpriv);
return 0;
}
@@ -294,105 +288,23 @@ static struct miscdevice mon_dev = {
};
/*
- * suspend/resume
- */
-
-static int monwriter_freeze(struct device *dev)
-{
- struct mon_private *monpriv;
- struct mon_buf *monbuf;
-
- list_for_each_entry(monpriv, &mon_priv_list, priv_list) {
- list_for_each_entry(monbuf, &monpriv->list, list) {
- if (monbuf->hdr.mon_function != MONWRITE_GEN_EVENT)
- monwrite_diag(&monbuf->hdr, monbuf->data,
- APPLDATA_STOP_REC);
- }
- }
- return 0;
-}
-
-static int monwriter_restore(struct device *dev)
-{
- struct mon_private *monpriv;
- struct mon_buf *monbuf;
-
- list_for_each_entry(monpriv, &mon_priv_list, priv_list) {
- list_for_each_entry(monbuf, &monpriv->list, list) {
- if (monbuf->hdr.mon_function == MONWRITE_START_INTERVAL)
- monwrite_diag(&monbuf->hdr, monbuf->data,
- APPLDATA_START_INTERVAL_REC);
- if (monbuf->hdr.mon_function == MONWRITE_START_CONFIG)
- monwrite_diag(&monbuf->hdr, monbuf->data,
- APPLDATA_START_CONFIG_REC);
- }
- }
- return 0;
-}
-
-static int monwriter_thaw(struct device *dev)
-{
- return monwriter_restore(dev);
-}
-
-static const struct dev_pm_ops monwriter_pm_ops = {
- .freeze = monwriter_freeze,
- .thaw = monwriter_thaw,
- .restore = monwriter_restore,
-};
-
-static struct platform_driver monwriter_pdrv = {
- .driver = {
- .name = "monwriter",
- .pm = &monwriter_pm_ops,
- },
-};
-
-static struct platform_device *monwriter_pdev;
-
-/*
* module init/exit
*/
static int __init mon_init(void)
{
- int rc;
-
if (!MACHINE_IS_VM)
return -ENODEV;
-
- rc = platform_driver_register(&monwriter_pdrv);
- if (rc)
- return rc;
-
- monwriter_pdev = platform_device_register_simple("monwriter", -1, NULL,
- 0);
- if (IS_ERR(monwriter_pdev)) {
- rc = PTR_ERR(monwriter_pdev);
- goto out_driver;
- }
-
/*
* misc_register() has to be the last action in module_init(), because
* file operations will be available right after this.
*/
- rc = misc_register(&mon_dev);
- if (rc)
- goto out_device;
- return 0;
-
-out_device:
- platform_device_unregister(monwriter_pdev);
-out_driver:
- platform_driver_unregister(&monwriter_pdrv);
- return rc;
+ return misc_register(&mon_dev);
}
static void __exit mon_exit(void)
{
misc_deregister(&mon_dev);
- platform_device_unregister(monwriter_pdev);
- platform_driver_unregister(&monwriter_pdrv);
}
module_init(mon_init);
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index 6627820a5eb9..792b4bfa6d9a 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -18,8 +18,6 @@
#include <linux/reboot.h>
#include <linux/jiffies.h>
#include <linux/init.h>
-#include <linux/suspend.h>
-#include <linux/completion.h>
#include <linux/platform_device.h>
#include <asm/types.h>
#include <asm/irq.h>
@@ -49,9 +47,6 @@ static struct sclp_req sclp_init_req;
static void *sclp_read_sccb;
static struct init_sccb *sclp_init_sccb;
-/* Suspend request */
-static DECLARE_COMPLETION(sclp_request_queue_flushed);
-
/* Number of console pages to allocate, used by sclp_con.c and sclp_vt220.c */
int sclp_console_pages = SCLP_CONSOLE_PAGES;
/* Flag to indicate if buffer pages are dropped on buffer full condition */
@@ -59,11 +54,6 @@ int sclp_console_drop = 1;
/* Number of times the console dropped buffer pages */
unsigned long sclp_console_full;
-static void sclp_suspend_req_cb(struct sclp_req *req, void *data)
-{
- complete(&sclp_request_queue_flushed);
-}
-
static int __init sclp_setup_console_pages(char *str)
{
int pages, rc;
@@ -88,8 +78,6 @@ static int __init sclp_setup_console_drop(char *str)
__setup("sclp_con_drop=", sclp_setup_console_drop);
-static struct sclp_req sclp_suspend_req;
-
/* Timer for request retries. */
static struct timer_list sclp_request_timer;
@@ -123,12 +111,6 @@ static volatile enum sclp_mask_state_t {
sclp_mask_state_initializing
} sclp_mask_state = sclp_mask_state_idle;
-/* Internal state: is the driver suspended? */
-static enum sclp_suspend_state_t {
- sclp_suspend_state_running,
- sclp_suspend_state_suspended,
-} sclp_suspend_state = sclp_suspend_state_running;
-
/* Maximum retry counts */
#define SCLP_INIT_RETRY 3
#define SCLP_MASK_RETRY 3
@@ -314,8 +296,6 @@ sclp_process_queue(void)
del_timer(&sclp_request_timer);
while (!list_empty(&sclp_req_queue)) {
req = list_entry(sclp_req_queue.next, struct sclp_req, list);
- if (!req->sccb)
- goto do_post;
rc = __sclp_start_request(req);
if (rc == 0)
break;
@@ -327,7 +307,6 @@ sclp_process_queue(void)
sclp_request_timeout_normal);
break;
}
-do_post:
/* Post-processing for aborted request */
list_del(&req->list);
if (req->callback) {
@@ -341,10 +320,8 @@ do_post:
static int __sclp_can_add_request(struct sclp_req *req)
{
- if (req == &sclp_suspend_req || req == &sclp_init_req)
+ if (req == &sclp_init_req)
return 1;
- if (sclp_suspend_state != sclp_suspend_state_running)
- return 0;
if (sclp_init_state != sclp_init_state_initialized)
return 0;
if (sclp_activation_state != sclp_activation_state_active)
@@ -378,16 +355,10 @@ sclp_add_request(struct sclp_req *req)
/* Start if request is first in list */
if (sclp_running_state == sclp_running_state_idle &&
req->list.prev == &sclp_req_queue) {
- if (!req->sccb) {
- list_del(&req->list);
- rc = -ENODATA;
- goto out;
- }
rc = __sclp_start_request(req);
if (rc)
list_del(&req->list);
}
-out:
spin_unlock_irqrestore(&sclp_lock, flags);
return rc;
}
@@ -693,7 +664,6 @@ sclp_register(struct sclp_register *reg)
/* Trigger initial state change callback */
reg->sclp_receive_mask = 0;
reg->sclp_send_mask = 0;
- reg->pm_event_posted = 0;
list_add(&reg->list, &sclp_reg_list);
spin_unlock_irqrestore(&sclp_lock, flags);
rc = sclp_init_mask(1);
@@ -1011,112 +981,6 @@ static struct notifier_block sclp_reboot_notifier = {
.notifier_call = sclp_reboot_event
};
-/*
- * Suspend/resume SCLP notifier implementation
- */
-
-static void sclp_pm_event(enum sclp_pm_event sclp_pm_event, int rollback)
-{
- struct sclp_register *reg;
- unsigned long flags;
-
- if (!rollback) {
- spin_lock_irqsave(&sclp_lock, flags);
- list_for_each_entry(reg, &sclp_reg_list, list)
- reg->pm_event_posted = 0;
- spin_unlock_irqrestore(&sclp_lock, flags);
- }
- do {
- spin_lock_irqsave(&sclp_lock, flags);
- list_for_each_entry(reg, &sclp_reg_list, list) {
- if (rollback && reg->pm_event_posted)
- goto found;
- if (!rollback && !reg->pm_event_posted)
- goto found;
- }
- spin_unlock_irqrestore(&sclp_lock, flags);
- return;
-found:
- spin_unlock_irqrestore(&sclp_lock, flags);
- if (reg->pm_event_fn)
- reg->pm_event_fn(reg, sclp_pm_event);
- reg->pm_event_posted = rollback ? 0 : 1;
- } while (1);
-}
-
-/*
- * Susend/resume callbacks for platform device
- */
-
-static int sclp_freeze(struct device *dev)
-{
- unsigned long flags;
- int rc;
-
- sclp_pm_event(SCLP_PM_EVENT_FREEZE, 0);
-
- spin_lock_irqsave(&sclp_lock, flags);
- sclp_suspend_state = sclp_suspend_state_suspended;
- spin_unlock_irqrestore(&sclp_lock, flags);
-
- /* Init supend data */
- memset(&sclp_suspend_req, 0, sizeof(sclp_suspend_req));
- sclp_suspend_req.callback = sclp_suspend_req_cb;
- sclp_suspend_req.status = SCLP_REQ_FILLED;
- init_completion(&sclp_request_queue_flushed);
-
- rc = sclp_add_request(&sclp_suspend_req);
- if (rc == 0)
- wait_for_completion(&sclp_request_queue_flushed);
- else if (rc != -ENODATA)
- goto fail_thaw;
-
- rc = sclp_deactivate();
- if (rc)
- goto fail_thaw;
- return 0;
-
-fail_thaw:
- spin_lock_irqsave(&sclp_lock, flags);
- sclp_suspend_state = sclp_suspend_state_running;
- spin_unlock_irqrestore(&sclp_lock, flags);
- sclp_pm_event(SCLP_PM_EVENT_THAW, 1);
- return rc;
-}
-
-static int sclp_undo_suspend(enum sclp_pm_event event)
-{
- unsigned long flags;
- int rc;
-
- rc = sclp_reactivate();
- if (rc)
- return rc;
-
- spin_lock_irqsave(&sclp_lock, flags);
- sclp_suspend_state = sclp_suspend_state_running;
- spin_unlock_irqrestore(&sclp_lock, flags);
-
- sclp_pm_event(event, 0);
- return 0;
-}
-
-static int sclp_thaw(struct device *dev)
-{
- return sclp_undo_suspend(SCLP_PM_EVENT_THAW);
-}
-
-static int sclp_restore(struct device *dev)
-{
- return sclp_undo_suspend(SCLP_PM_EVENT_RESTORE);
-}
-
-static const struct dev_pm_ops sclp_pm_ops = {
- .freeze = sclp_freeze,
- .thaw = sclp_thaw,
- .restore = sclp_restore,
-};
-
static ssize_t con_pages_show(struct device_driver *dev, char *buf)
{
return sprintf(buf, "%i\n", sclp_console_pages);
@@ -1155,13 +1019,10 @@ static const struct attribute_group *sclp_drv_attr_groups[] = {
static struct platform_driver sclp_pdrv = {
.driver = {
.name = "sclp",
- .pm = &sclp_pm_ops,
.groups = sclp_drv_attr_groups,
},
};
-static struct platform_device *sclp_pdev;
-
/* Initialize SCLP driver. Return zero if driver is operational, non-zero
* otherwise. */
static int
@@ -1215,23 +1076,6 @@ fail_unlock:
return rc;
}
-/*
- * SCLP panic notifier: If we are suspended, we thaw SCLP in order to be able
- * to print the panic message.
- */
-static int sclp_panic_notify(struct notifier_block *self,
- unsigned long event, void *data)
-{
- if (sclp_suspend_state == sclp_suspend_state_suspended)
- sclp_undo_suspend(SCLP_PM_EVENT_THAW);
- return NOTIFY_OK;
-}
-
-static struct notifier_block sclp_on_panic_nb = {
- .notifier_call = sclp_panic_notify,
- .priority = SCLP_PANIC_PRIO,
-};
-
static __init int sclp_initcall(void)
{
int rc;
@@ -1240,23 +1084,7 @@ static __init int sclp_initcall(void)
if (rc)
return rc;
- sclp_pdev = platform_device_register_simple("sclp", -1, NULL, 0);
- rc = PTR_ERR_OR_ZERO(sclp_pdev);
- if (rc)
- goto fail_platform_driver_unregister;
-
- rc = atomic_notifier_chain_register(&panic_notifier_list,
- &sclp_on_panic_nb);
- if (rc)
- goto fail_platform_device_unregister;
-
return sclp_init();
-
-fail_platform_device_unregister:
- platform_device_unregister(sclp_pdev);
-fail_platform_driver_unregister:
- platform_driver_unregister(&sclp_pdrv);
- return rc;
}
arch_initcall(sclp_initcall);
diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h
index 6de919944a39..8dd8ad83b78b 100644
--- a/drivers/s390/char/sclp.h
+++ b/drivers/s390/char/sclp.h
@@ -81,15 +81,6 @@ typedef unsigned int sclp_cmdw_t;
#define GDS_KEY_SELFDEFTEXTMSG 0x31
-enum sclp_pm_event {
- SCLP_PM_EVENT_FREEZE,
- SCLP_PM_EVENT_THAW,
- SCLP_PM_EVENT_RESTORE,
-};
-
-#define SCLP_PANIC_PRIO 1
-#define SCLP_PANIC_PRIO_CLIENT 0
-
typedef u64 sccb_mask_t;
struct sccb_header {
@@ -293,10 +284,6 @@ struct sclp_register {
void (*state_change_fn)(struct sclp_register *);
/* called for events in cp_receive_mask/sclp_receive_mask */
void (*receiver_fn)(struct evbuf_header *);
- /* called for power management events */
- void (*pm_event_fn)(struct sclp_register *, enum sclp_pm_event);
- /* pm event posted flag */
- int pm_event_posted;
};
/* externals from sclp.c */
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c
index d41bc144c183..ab0518cfdcfe 100644
--- a/drivers/s390/char/sclp_cmd.c
+++ b/drivers/s390/char/sclp_cmd.c
@@ -20,7 +20,6 @@
#include <linux/mmzone.h>
#include <linux/memory.h>
#include <linux/module.h>
-#include <linux/platform_device.h>
#include <asm/ctl_reg.h>
#include <asm/chpid.h>
#include <asm/setup.h>
@@ -168,7 +167,6 @@ static DEFINE_MUTEX(sclp_mem_mutex);
static LIST_HEAD(sclp_mem_list);
static u8 sclp_max_storage_id;
static DECLARE_BITMAP(sclp_storage_ids, 256);
-static int sclp_mem_state_changed;
struct memory_increment {
struct list_head list;
@@ -359,8 +357,6 @@ static int sclp_mem_notifier(struct notifier_block *nb,
rc = -EINVAL;
break;
}
- if (!rc)
- sclp_mem_state_changed = 1;
mutex_unlock(&sclp_mem_mutex);
return rc ? NOTIFY_BAD : NOTIFY_OK;
}
@@ -456,28 +452,8 @@ static void __init insert_increment(u16 rn, int standby, int assigned)
list_add(&new_incr->list, prev);
}
-static int sclp_mem_freeze(struct device *dev)
-{
- if (!sclp_mem_state_changed)
- return 0;
- pr_err("Memory hotplug state changed, suspend refused.\n");
- return -EPERM;
-}
-
-static const struct dev_pm_ops sclp_mem_pm_ops = {
- .freeze = sclp_mem_freeze,
-};
-
-static struct platform_driver sclp_mem_pdrv = {
- .driver = {
- .name = "sclp_mem",
- .pm = &sclp_mem_pm_ops,
- },
-};
-
static int __init sclp_detect_standby_memory(void)
{
- struct platform_device *sclp_pdev;
struct read_storage_sccb *sccb;
int i, id, assigned, rc;
@@ -530,17 +506,7 @@ static int __init sclp_detect_standby_memory(void)
rc = register_memory_notifier(&sclp_mem_nb);
if (rc)
goto out;
- rc = platform_driver_register(&sclp_mem_pdrv);
- if (rc)
- goto out;
- sclp_pdev = platform_device_register_simple("sclp_mem", -1, NULL, 0);
- rc = PTR_ERR_OR_ZERO(sclp_pdev);
- if (rc)
- goto out_driver;
sclp_add_standby_memory();
- goto out;
-out_driver:
- platform_driver_unregister(&sclp_mem_pdrv);
out:
free_page((unsigned long) sccb);
return rc;
diff --git a/drivers/s390/char/sclp_con.c b/drivers/s390/char/sclp_con.c
index cc01a7b8595d..de028868c6f4 100644
--- a/drivers/s390/char/sclp_con.c
+++ b/drivers/s390/char/sclp_con.c
@@ -36,8 +36,6 @@ static LIST_HEAD(sclp_con_outqueue);
static struct sclp_buffer *sclp_conbuf;
/* Timer for delayed output of console messages */
static struct timer_list sclp_con_timer;
-/* Suspend mode flag */
-static int sclp_con_suspended;
/* Flag that output queue is currently running */
static int sclp_con_queue_running;
@@ -64,7 +62,7 @@ sclp_conbuf_callback(struct sclp_buffer *buffer, int rc)
if (!list_empty(&sclp_con_outqueue))
buffer = list_first_entry(&sclp_con_outqueue,
struct sclp_buffer, list);
- if (!buffer || sclp_con_suspended) {
+ if (!buffer) {
sclp_con_queue_running = 0;
spin_unlock_irqrestore(&sclp_con_lock, flags);
break;
@@ -86,7 +84,7 @@ static void sclp_conbuf_emit(void)
if (sclp_conbuf)
list_add_tail(&sclp_conbuf->list, &sclp_con_outqueue);
sclp_conbuf = NULL;
- if (sclp_con_queue_running || sclp_con_suspended)
+ if (sclp_con_queue_running)
goto out_unlock;
if (list_empty(&sclp_con_outqueue))
goto out_unlock;
@@ -180,8 +178,6 @@ sclp_console_write(struct console *console, const char *message,
if (list_empty(&sclp_con_pages))
sclp_console_full++;
while (list_empty(&sclp_con_pages)) {
- if (sclp_con_suspended)
- goto out;
if (sclp_console_drop_buffer())
break;
spin_unlock_irqrestore(&sclp_con_lock, flags);
@@ -214,7 +210,6 @@ sclp_console_write(struct console *console, const char *message,
!timer_pending(&sclp_con_timer)) {
mod_timer(&sclp_con_timer, jiffies + HZ / 10);
}
-out:
spin_unlock_irqrestore(&sclp_con_lock, flags);
}
@@ -235,32 +230,6 @@ sclp_console_flush(void)
sclp_console_sync_queue();
}
-/*
- * Resume console: If there are cached messages, emit them.
- */
-static void sclp_console_resume(void)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&sclp_con_lock, flags);
- sclp_con_suspended = 0;
- spin_unlock_irqrestore(&sclp_con_lock, flags);
- sclp_conbuf_emit();
-}
-
-/*
- * Suspend console: Set suspend flag and flush console
- */
-static void sclp_console_suspend(void)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&sclp_con_lock, flags);
- sclp_con_suspended = 1;
- spin_unlock_irqrestore(&sclp_con_lock, flags);
- sclp_console_flush();
-}
-
static int sclp_console_notify(struct notifier_block *self,
unsigned long event, void *data)
{
@@ -270,7 +239,7 @@ static int sclp_console_notify(struct notifier_block *self,
static struct notifier_block on_panic_nb = {
.notifier_call = sclp_console_notify,
- .priority = SCLP_PANIC_PRIO_CLIENT,
+ .priority = 1,
};
static struct notifier_block on_reboot_nb = {
@@ -292,22 +261,6 @@ static struct console sclp_console =
};
/*
- * This function is called for SCLP suspend and resume events.
- */
-void sclp_console_pm_event(enum sclp_pm_event sclp_pm_event)
-{
- switch (sclp_pm_event) {
- case SCLP_PM_EVENT_FREEZE:
- sclp_console_suspend();
- break;
- case SCLP_PM_EVENT_RESTORE:
- case SCLP_PM_EVENT_THAW:
- sclp_console_resume();
- break;
- }
-}
-
-/*
* called by console_init() in drivers/char/tty_io.c at boot-time.
*/
static int __init
diff --git a/drivers/s390/char/sclp_ftp.c b/drivers/s390/char/sclp_ftp.c
index dfdd6c8fd17e..1e9de99dcd02 100644
--- a/drivers/s390/char/sclp_ftp.c
+++ b/drivers/s390/char/sclp_ftp.c
@@ -231,7 +231,6 @@ static struct sclp_register sclp_ftp_event = {
.receive_mask = EVTYP_DIAG_TEST_MASK, /* want rx events */
.receiver_fn = sclp_ftp_rxcb, /* async callback (rx) */
.state_change_fn = NULL,
- .pm_event_fn = NULL,
};
/**
diff --git a/drivers/s390/char/sclp_quiesce.c b/drivers/s390/char/sclp_quiesce.c
index 76956c2131cd..ade721467804 100644
--- a/drivers/s390/char/sclp_quiesce.c
+++ b/drivers/s390/char/sclp_quiesce.c
@@ -18,10 +18,6 @@
#include "sclp.h"
-static void (*old_machine_restart)(char *);
-static void (*old_machine_halt)(void);
-static void (*old_machine_power_off)(void);
-
/* Shutdown handler. Signal completion of shutdown by loading special PSW. */
static void do_machine_quiesce(void)
{
@@ -37,42 +33,15 @@ static void do_machine_quiesce(void)
/* Handler for quiesce event. Start shutdown procedure. */
static void sclp_quiesce_handler(struct evbuf_header *evbuf)
{
- if (_machine_restart != (void *) do_machine_quiesce) {
- old_machine_restart = _machine_restart;
- old_machine_halt = _machine_halt;
- old_machine_power_off = _machine_power_off;
- _machine_restart = (void *) do_machine_quiesce;
- _machine_halt = do_machine_quiesce;
- _machine_power_off = do_machine_quiesce;
- }
+ _machine_restart = (void *) do_machine_quiesce;
+ _machine_halt = do_machine_quiesce;
+ _machine_power_off = do_machine_quiesce;
ctrl_alt_del();
}
-/* Undo machine restart/halt/power_off modification on resume */
-static void sclp_quiesce_pm_event(struct sclp_register *reg,
- enum sclp_pm_event sclp_pm_event)
-{
- switch (sclp_pm_event) {
- case SCLP_PM_EVENT_RESTORE:
- if (old_machine_restart) {
- _machine_restart = old_machine_restart;
- _machine_halt = old_machine_halt;
- _machine_power_off = old_machine_power_off;
- old_machine_restart = NULL;
- old_machine_halt = NULL;
- old_machine_power_off = NULL;
- }
- break;
- case SCLP_PM_EVENT_FREEZE:
- case SCLP_PM_EVENT_THAW:
- break;
- }
-}
-
static struct sclp_register sclp_quiesce_event = {
.receive_mask = EVTYP_SIGQUIESCE_MASK,
.receiver_fn = sclp_quiesce_handler,
- .pm_event_fn = sclp_quiesce_pm_event
};
/* Initialize quiesce driver. */
diff --git a/drivers/s390/char/sclp_rw.c b/drivers/s390/char/sclp_rw.c
index d6c84e354df5..de44c15fe03a 100644
--- a/drivers/s390/char/sclp_rw.c
+++ b/drivers/s390/char/sclp_rw.c
@@ -26,16 +26,9 @@
*/
#define MAX_SCCB_ROOM (PAGE_SIZE - sizeof(struct sclp_buffer))
-static void sclp_rw_pm_event(struct sclp_register *reg,
- enum sclp_pm_event sclp_pm_event)
-{
- sclp_console_pm_event(sclp_pm_event);
-}
-
/* Event type structure for write message and write priority message */
static struct sclp_register sclp_rw_event = {
.send_mask = EVTYP_MSG_MASK,
- .pm_event_fn = sclp_rw_pm_event,
};
/*
diff --git a/drivers/s390/char/sclp_rw.h b/drivers/s390/char/sclp_rw.h
index 93d706e4935c..a9127489f224 100644
--- a/drivers/s390/char/sclp_rw.h
+++ b/drivers/s390/char/sclp_rw.h
@@ -88,10 +88,4 @@ int sclp_write(struct sclp_buffer *buffer, const unsigned char *, int);
int sclp_emit_buffer(struct sclp_buffer *,void (*)(struct sclp_buffer *,int));
int sclp_chars_in_buffer(struct sclp_buffer *);
-#ifdef CONFIG_SCLP_CONSOLE
-void sclp_console_pm_event(enum sclp_pm_event sclp_pm_event);
-#else
-static inline void sclp_console_pm_event(enum sclp_pm_event sclp_pm_event) { }
-#endif
-
#endif /* __SCLP_RW_H__ */
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c
index 4456ceb23bd2..f5591bf82a8f 100644
--- a/drivers/s390/char/sclp_tty.c
+++ b/drivers/s390/char/sclp_tty.c
@@ -284,7 +284,6 @@ static int
sclp_tty_chars_in_buffer(struct tty_struct *tty)
{
unsigned long flags;
- struct list_head *l;
struct sclp_buffer *t;
int count;
@@ -292,8 +291,7 @@ sclp_tty_chars_in_buffer(struct tty_struct *tty)
count = 0;
if (sclp_ttybuf != NULL)
count = sclp_chars_in_buffer(sclp_ttybuf);
- list_for_each(l, &sclp_tty_outqueue) {
- t = list_entry(l, struct sclp_buffer, list);
+ list_for_each_entry(t, &sclp_tty_outqueue, list) {
count += sclp_chars_in_buffer(t);
}
spin_unlock_irqrestore(&sclp_tty_lock, flags);
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c
index 5b8a7b090a97..fa40057fd18d 100644
--- a/drivers/s390/char/sclp_vt220.c
+++ b/drivers/s390/char/sclp_vt220.c
@@ -36,8 +36,8 @@
#define SCLP_VT220_MINOR 65
#define SCLP_VT220_DRIVER_NAME "sclp_vt220"
#define SCLP_VT220_DEVICE_NAME "ttysclp"
-#define SCLP_VT220_CONSOLE_NAME "ttyS"
-#define SCLP_VT220_CONSOLE_INDEX 1 /* console=ttyS1 */
+#define SCLP_VT220_CONSOLE_NAME "ttysclp"
+#define SCLP_VT220_CONSOLE_INDEX 0 /* console=ttysclp0 */
/* Representation of a single write request */
struct sclp_vt220_request {
@@ -70,9 +70,6 @@ static LIST_HEAD(sclp_vt220_empty);
/* List of pending requests */
static LIST_HEAD(sclp_vt220_outqueue);
-/* Suspend mode flag */
-static int sclp_vt220_suspended;
-
/* Flag that output queue is currently running */
static int sclp_vt220_queue_running;
@@ -96,15 +93,12 @@ static int __initdata sclp_vt220_init_count;
static int sclp_vt220_flush_later;
static void sclp_vt220_receiver_fn(struct evbuf_header *evbuf);
-static void sclp_vt220_pm_event_fn(struct sclp_register *reg,
- enum sclp_pm_event sclp_pm_event);
static int __sclp_vt220_emit(struct sclp_vt220_request *request);
static void sclp_vt220_emit_current(void);
/* Registration structure for SCLP output event buffers */
static struct sclp_register sclp_vt220_register = {
.send_mask = EVTYP_VT220MSG_MASK,
- .pm_event_fn = sclp_vt220_pm_event_fn,
};
/* Registration structure for SCLP input event buffers */
@@ -136,7 +130,7 @@ sclp_vt220_process_queue(struct sclp_vt220_request *request)
if (!list_empty(&sclp_vt220_outqueue))
request = list_entry(sclp_vt220_outqueue.next,
struct sclp_vt220_request, list);
- if (!request || sclp_vt220_suspended) {
+ if (!request) {
sclp_vt220_queue_running = 0;
spin_unlock_irqrestore(&sclp_vt220_lock, flags);
break;
@@ -242,7 +236,7 @@ sclp_vt220_emit_current(void)
}
sclp_vt220_flush_later = 0;
}
- if (sclp_vt220_queue_running || sclp_vt220_suspended)
+ if (sclp_vt220_queue_running)
goto out_unlock;
if (list_empty(&sclp_vt220_outqueue))
goto out_unlock;
@@ -421,7 +415,7 @@ __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
if (list_empty(&sclp_vt220_empty))
sclp_console_full++;
while (list_empty(&sclp_vt220_empty)) {
- if (may_fail || sclp_vt220_suspended)
+ if (may_fail)
goto out;
if (sclp_vt220_drop_buffer())
break;
@@ -792,46 +786,6 @@ static void __sclp_vt220_flush_buffer(void)
spin_unlock_irqrestore(&sclp_vt220_lock, flags);
}
-/*
- * Resume console: If there are cached messages, emit them.
- */
-static void sclp_vt220_resume(void)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&sclp_vt220_lock, flags);
- sclp_vt220_suspended = 0;
- spin_unlock_irqrestore(&sclp_vt220_lock, flags);
- sclp_vt220_emit_current();
-}
-
-/*
- * Suspend console: Set suspend flag and flush console
- */
-static void sclp_vt220_suspend(void)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&sclp_vt220_lock, flags);
- sclp_vt220_suspended = 1;
- spin_unlock_irqrestore(&sclp_vt220_lock, flags);
- __sclp_vt220_flush_buffer();
-}
-
-static void sclp_vt220_pm_event_fn(struct sclp_register *reg,
- enum sclp_pm_event sclp_pm_event)
-{
- switch (sclp_pm_event) {
- case SCLP_PM_EVENT_FREEZE:
- sclp_vt220_suspend();
- break;
- case SCLP_PM_EVENT_RESTORE:
- case SCLP_PM_EVENT_THAW:
- sclp_vt220_resume();
- break;
- }
-}
-
#ifdef CONFIG_SCLP_VT220_CONSOLE
static void
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index 58333cb4503f..ed970ecfafdf 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -679,34 +679,10 @@ static const struct attribute_group *vmlogrdr_attr_groups[] = {
NULL,
};
-static int vmlogrdr_pm_prepare(struct device *dev)
-{
- int rc;
- struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
-
- rc = 0;
- if (priv) {
- spin_lock_bh(&priv->priv_lock);
- if (priv->dev_in_use)
- rc = -EBUSY;
- spin_unlock_bh(&priv->priv_lock);
- }
- if (rc)
- pr_err("vmlogrdr: device %s is busy. Refuse to suspend.\n",
- dev_name(dev));
- return rc;
-}
-
-
-static const struct dev_pm_ops vmlogrdr_pm_ops = {
- .prepare = vmlogrdr_pm_prepare,
-};
-
static struct class *vmlogrdr_class;
static struct device_driver vmlogrdr_driver = {
.name = "vmlogrdr",
.bus = &iucv_bus,
- .pm = &vmlogrdr_pm_ops,
.groups = vmlogrdr_drv_attr_groups,
};