Skip to content

Commit

Permalink
s390/sclp: Remove console power management support
Browse files Browse the repository at this point in the history
Power management support was removed for s390 with
commit 3942162 ("s390: remove broken hibernate / power management
support").

Remove leftover sclp console-related power management code.

Acked-by: Heiko Carstens <[email protected]>
Signed-off-by: Peter Oberparleiter <[email protected]>
Signed-off-by: Vasily Gorbik <[email protected]>
  • Loading branch information
oberpar authored and Vasily Gorbik committed Jun 18, 2021
1 parent 21adcf1 commit 5602bf8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 63 deletions.
53 changes: 3 additions & 50 deletions drivers/s390/char/sclp_con.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,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;

Expand All @@ -63,7 +61,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;
Expand All @@ -85,7 +83,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;
Expand Down Expand Up @@ -179,8 +177,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);
Expand Down Expand Up @@ -213,7 +209,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);
}

Expand All @@ -234,32 +229,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)
{
Expand All @@ -269,7 +238,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 = {
Expand All @@ -290,22 +259,6 @@ static struct console sclp_console =
.index = 0 /* ttyS0 */
};

/*
* 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.
*/
Expand Down
7 changes: 0 additions & 7 deletions drivers/s390/char/sclp_rw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

/*
Expand Down
6 changes: 0 additions & 6 deletions drivers/s390/char/sclp_rw.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

0 comments on commit 5602bf8

Please sign in to comment.