/dev/lpt0 - always busy, except when acpi is disabled

Andrew Konstantinov andrei at andruxa.sytes.net
Wed Aug 27 17:00:35 PDT 2003


Hello,

I am running: FreeBSD xxxxxxx.xxxxx.xxx 5.1-CURRENT FreeBSD 5.1-CURRENT #0:
Tue Aug 26 21:02:35 PDT 2003
root at xxxxxxx.xxxxx.xxx:/usr/obj/usr/src/sys/CUSTOM i386

I have a problem accessing the printer connected to the box via parallel
port. Whenever I try to send something to /dev/lpt0, it always responds with
'device busy' error message, while that device is not being used by any
other program. This behavior started once I upgraded to 5.1-release and
continues through 'current.' When I was using 5.0-release, the system worked
fine and I never had this problem, but once I upgraded, this mystery started
to happen.

Here is some background info.

My kernel configuration file contains the following devices:
device          ppc
device          ppbus           # Parallel port bus (required)
device          lpt             # Printer
device          ppi             # Parallel port interface device

PPC hints in the /boot/device.hints file are:
hint.ppc.0.at="isa"
hint.ppc.0.irq="7"

As you can see, irq number is specified, so the system is supposed to
communicate with the printer in interrupt-driven mode. But, for some
misterious reason that doesn't happen. Here is the part of my dmesg output
related to pp* and lpt:

ppc0 port 0-0x7 on acpi0
ppc0: Generic chipset (ECP/PS2/NIBBLE) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
lpt0: <Printer> on ppbus0
lpt0: Polled port
ppi0: <Parallel I/O> on ppbus0

As you can see, the communication is carried out in polled mode. I am not
sure why...?

I was going back and forth trying to make the printer work and found a
'solution' for that problem. The 'solution' is to disable acpi.
hint.acpi.0.disabled="1" - works like a charm. After disabling acpi I get
the ability to use my printer and the following dmesg output:

ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode
ppbus0: <Parallel port bus> on ppc0
ppbus0: IEEE1284 device found /NIBBLE
Probing for PnP devices on ppbus0:
ppbus0: <EPSON Stylus COLOR 777> PRINTER ESCPL2,BDC,D4
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0

As I already mentioned, this never happened when my box was running
5.0-release, but started to happen right after the moment when I upgraded to
5.1-release, and continues to happen on 5.1-current.

I am wondering if this is a bug in the source code and can only be fixed
with a patch, or there is a work around through acpi configuration? ACPI
manual page says that one can disable parts of acpi through
'debug.acpi.disable' kernel environment variable. In that case, what is the
minimal set of sub-devices that I would temporarly have to disable to
resolve this problem?
Perhaps I got right in the middle of ongoing work with acpi?

Any hints, pointers or links will be greatly appreciated!
Thanks in advance.

Andrew


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20030827/f673f762/attachment.bin


More information about the freebsd-hackers mailing list