[comp.unix.xenix] Hang when parallel printer turned off - IBM Xenix 2.0

stan@ucla-an.UUCP (Stan Stead MD) (09/07/87)

I have just changed printers on my IBM Xenix 2.0 system, and lo and behold,
there is quite a bug.  Depending upon the type of parallel printer installed,
when a parallel printer is powered down, after device lp has been used,
the Xenix system hangs and needs a cold boot.

Example:
	Epson FX, IBM graphics printer, will NOT hang Xenix.
Example:
	HP Laserjet II when powered off hangs Xenix.

Repeat by:
	Connect a HP Laserjet II to the parallel port.
	After Xenix is booted, print something on the printer. Now, power
	down the printer.  The Xenix system hangs.

	I have tried this out on a variety of printers.  Citizen printers
	will also cause the hang.  Some TI printers will cause a hang,
	others not.  It seems that the act of turning off the printer
	generates a series of interrupts on the parallel port.  I wrote a
	little program in dos to look at this, and it confirms that the
	printers that hang generate mulitple interrupts during power-down.
	Those that do generate interrupts on power-down do NOT cause a Xenix
	hang.

Question:
	What is causing the hang? A spurious hardware interrupt?

		In looking over the Application Development Guide, Sample
	drivers, it appears that a spurious call to lpintr() could occur.
	The test for the interrupt being spurious is:
		if ((lp_flags & ACTIVE) == 0) return;
	This should prevent the any spurious interrupts occuring, but it
	does not. If you look farther in the sample driver, it seems that
	once /dev/lp has been opened, it enables interrupts on the parallel
	interface.  The corresponding close on the device does nothing at
	all.  Should it turn OFF the interrupts until the devices is
	re-opened?  

	Is there a fix for this hanging problem?

As always, thanks in advance.
Stanley W. Stead
UCLA School of Medicine / Dept of Anesthesiology
BELL: (213) 206-6238
ARPA: ucla-an!stan@ee.UCLA.EDU
UUCP:  {trwrb|ucla-cs|cepu}\
                            !ucla-an!stan
UUCP: {ihnp4|decvax}!hermix/