Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 188561a4 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky
Browse files

s390/cio: wait_cons_dev don't use static variable



wait_cons_dev is used to busy wait for an interrupt on the console
ccw device. Stop using the static console_subchannel and add a
parameter to this function to specify on which ccw device/subchannel
we have to do the polling.

While at it rename the function to ccw_device_wait_idle and
move it to device.c

Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 91c15a95
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -220,6 +220,7 @@ extern void ccw_device_get_id(struct ccw_device *, struct ccw_dev_id *);
#define to_ccwdrv(n) container_of(n, struct ccw_driver, driver)
#define to_ccwdrv(n) container_of(n, struct ccw_driver, driver)


extern struct ccw_device *ccw_device_probe_console(void);
extern struct ccw_device *ccw_device_probe_console(void);
extern void ccw_device_wait_idle(struct ccw_device *);
extern int ccw_device_force_console(void);
extern int ccw_device_force_console(void);


int ccw_device_siosl(struct ccw_device *);
int ccw_device_siosl(struct ccw_device *);
+0 −2
Original line number Original line Diff line number Diff line
@@ -296,8 +296,6 @@ static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
	return 0;
	return 0;
}
}


extern void wait_cons_dev(void);

extern void css_schedule_reprobe(void);
extern void css_schedule_reprobe(void);


extern void reipl_ccw_dev(struct ccw_dev_id *id);
extern void reipl_ccw_dev(struct ccw_dev_id *id);
+1 −1
Original line number Original line Diff line number Diff line
@@ -502,7 +502,7 @@ static void raw3215_make_room(struct raw3215_info *raw, unsigned int length)
		raw3215_try_io(raw);
		raw3215_try_io(raw);
		raw->flags &= ~RAW3215_FLUSHING;
		raw->flags &= ~RAW3215_FLUSHING;
#ifdef CONFIG_TN3215_CONSOLE
#ifdef CONFIG_TN3215_CONSOLE
		wait_cons_dev();
		ccw_device_wait_idle(raw->cdev);
#endif
#endif
		/* Enough room freed up ? */
		/* Enough room freed up ? */
		if (RAW3215_BUFFER_SIZE - raw->count >= length)
		if (RAW3215_BUFFER_SIZE - raw->count >= length)
+2 −2
Original line number Original line Diff line number Diff line
@@ -796,7 +796,7 @@ struct raw3270 __init *raw3270_setup_console(struct ccw_device *cdev)
	do {
	do {
		__raw3270_reset_device(rp);
		__raw3270_reset_device(rp);
		while (!raw3270_state_final(rp)) {
		while (!raw3270_state_final(rp)) {
			wait_cons_dev();
			ccw_device_wait_idle(rp->cdev);
			barrier();
			barrier();
		}
		}
	} while (rp->state != RAW3270_STATE_READY);
	} while (rp->state != RAW3270_STATE_READY);
@@ -810,7 +810,7 @@ raw3270_wait_cons_dev(struct raw3270 *rp)
	unsigned long flags;
	unsigned long flags;


	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
	spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
	wait_cons_dev();
	ccw_device_wait_idle(rp->cdev);
	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
	spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
}
}


+2 −18
Original line number Original line Diff line number Diff line
@@ -656,9 +656,9 @@ static int console_subchannel_in_use;


/*
/*
 * Use cio_tsch to update the subchannel status and call the interrupt handler
 * Use cio_tsch to update the subchannel status and call the interrupt handler
 * if status had been pending. Called with the console_subchannel lock.
 * if status had been pending. Called with the subchannel's lock held.
 */
 */
static void cio_tsch(struct subchannel *sch)
void cio_tsch(struct subchannel *sch)
{
{
	struct irb *irb;
	struct irb *irb;
	int irq_context;
	int irq_context;
@@ -690,22 +690,6 @@ void *cio_get_console_priv(void)
	return &console_priv;
	return &console_priv;
}
}


/*
 * busy wait for the next interrupt on the console
 */
void wait_cons_dev(void)
{
	if (!console_subchannel_in_use)
		return;

	while (1) {
		cio_tsch(&console_subchannel);
		if (console_subchannel.schib.scsw.cmd.actl == 0)
			break;
		udelay_simple(100);
	}
}

static int
static int
cio_test_for_console(struct subchannel_id schid, void *data)
cio_test_for_console(struct subchannel_id schid, void *data)
{
{
Loading