[ltp] Serial/PCMCIA problems with TP600E

Tom Grydeland linux-thinkpad@www.bm-soft.com
Thu, 15 Feb 2001 22:11:03 +0100 (MET)


If it works, don't break it...

With the appearance of the source for the MWAVE drivers, the recent
developments of the IrDA stack and the 2.2 backport of USB, I finally
decided to upgrade the kernel on my trusted thinkpad 600E.  Many things
have worked remarkably well, but some things have left me stumped, so
I'm asking the list for help.

Specifically, I am currently unable to use either the built-in or the
PCMCIA modem -- whenever I try to use them, I will get an error (more
details below) or the machine freezes up completely.  Not quite what I
wanted. :-/

Now that drivers are available, I would like to be able to use all of
the following (although not at the same time, I want to switch between
them without rebooting):
    * The built-in serial port
    * The IR port
    * The built-in modem
I'm not asking too much, am I?

This gets kind of long -- if you don't think you can help, you can
safely delete this message now.

I have gone through the various devices in PS2.EXE and the following
options are set:

Serial-A (built-in serial port): enabled COM1
    I/O:	0x3f8
    IRQ:	4

IR: enabled
    ADD:	<empty>
    DMA:	3
    I/O:	0x3e8
    IRQ:	7

PARAllel port: disabled
    Add:	1
    Mode:	Bi
    DMA:	Disabled
    IRQ:	Disabled (7)

IMODEM: Enabled
    IRQ:	10 3
    DSPADD:	0x130
    IMODEMADD:	0x2f8
    DMA:	7

AUdio:
    Addr:	530
    IRQ:	5
    SBaddr:	220
    DMA:	0 1

MIDI:
    ADDr:	330
    IRQ:	9

In addition, IRQ 11 is assigned to the PCI bus and IRQ 15 to the UltraBay.

Sound works great (even the MIDI synthesizer), although on boot I get the
message
------------------------------
ad1848: Interrupt test failed (IRQ5)
------------------------------
which doesn't seem to make any difference.

I have built tpctl_1.0 against this kernel and I can use it to inspect
the settings of some of the hardware.  The tpctl-relevant pieces of
/etc/conf.modules look as follows:
------------------------------
keep
options thinkpad enable_smapi=1 enable_superio=1 enable_rtcmosram=1

keep     # Added by tpctlify
path[thinkpad]=/lib/modules/`uname -r`

alias char-major-10-170 thinkpad
------------------------------


Upon boot, the serial driver reports the following:
------------------------------
Serial driver version 4.27 with no serial options enabled
ttyS00 at 0x03f8 (irq = 4) is a 16550A
ttyS02 at 0x03e8 (irq = 4) is a 16550A
------------------------------

Checking the settings with setserial:
------------------------------
[root@ska /root]# setserial /dev/ttyS0 autoconfig auto_irq; setserial /dev/ttyS0
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
[root@ska /root]# setserial /dev/ttyS2 autoconfig auto_irq; setserial /dev/ttyS2
/dev/ttyS2, UART: 16550A, Port: 0x03e8, IRQ: 4
------------------------------

And with tpctl:
------------------------------
resource state:                                       current
   floppy controller:                                 enable  0x3f0 IRQ6
   parallel port:                                     disable 0x3bc IRQ0 COMP
   serial port 1:                                     enable  0x3f8 IRQ4
   serial port 2:                                     enable  0x3e8 IRQ7
------------------------------

I have been able to talk to the built-in serial port in this
configuration.  I haven't tried the IR port yet.  I don't know why
setserial and the serial drivers believe the IR port uses IRQ 7.

I have built pcmcia-cs-3.1.24 against this kernel.
/etc/conf.modules contain the following:
------------------------------
pre-install pcmcia_core /etc/rc.d/init.d/pcmcia start
------------------------------
while /etc/pcmcia/config.opts contains
------------------------------
include port 0x100-0x4ff, port 0x1000-0x17ff
include memory 0xc0000-0xfffff, memory 0xa0000000-0xa0ffffff
#
# Extra port range for IBM Token Ring
#
include port 0xa00-0xaff
#
# Resources we should not use, even if they appear to be available
#
# First built-in serial port
exclude irq 4
# built-in MWAVE modem
exclude irq 3
exclude irq 10
# First built-in parallel port
# exclude irq 7
# CS4239 sound card uses two interrupts, 5 and 9
exclude irq 5
exclude irq 9
------------------------------
(I must admit I'm not sure what the "include" lines are there for)

My ethernet PC-card is a 3Com 3C589B.  I seem to be able to use it
without trouble.  When running with this card inserted,
/proc/interrupts contains:
------------------------------
           CPU0       
  0:    1744281          XT-PIC  timer
  1:      35478          XT-PIC  keyboard
  2:          0          XT-PIC  cascade
  5:          0          XT-PIC  Crystal audio controller
  7:      27595          XT-PIC  3c589_cs
  8:          2          XT-PIC  rtc
 11:         15          XT-PIC  usb-uhci, i82365
 12:      46872          XT-PIC  PS/2 Mouse
 13:          1          XT-PIC  fpu
 14:      43827          XT-PIC  ide0
 15:          0          XT-PIC  ide1
NMI:          0
------------------------------
(Where are interrupts from the IR port going to appear? Will this be a
problem?)

/proc/ioports contains
------------------------------
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
01f0-01f7 : ide0
0300-030f : 3c589_cs
0376-0376 : ide1
0388-038b : Yamaha OPL3
03c0-03df : vga+
03e8-03ef : serial(set)
03f6-03f6 : ide0
03f8-03ff : serial(set)
0530-0533 : Crystal audio controller
8400-8413 : usb-uhci
fcf0-fcf7 : ide0
fcf8-fcff : ide1
------------------------------

and /proc/dma:
------------------------------
 0: Crystal audio controller
 1: Crystal audio controller
 4: cascade
------------------------------

My PC-card modem is a 3Com 3CCM156 Global Modem.  If I insert it without
further ado, the following messages appear in the log:
------------------------------
cardmgr[599]: initializing socket 0
cardmgr[599]: socket 0: 3Com 3CCM156 56K Global Modem
cardmgr[599]: executing: 'modprobe serial_cs'
kernel: serial_cs: RequestIRQ: Resource in use 
kernel: register_serial(): autoconfig failed 
kernel: serial_cs: register_serial() at 0x02f8, irq 0 failed 
cardmgr[599]: get dev info on socket 0 failed: Resource temporarily unavailable
------------------------------

Ejecting the ethernet card and reinserting the modem card:

------------------------------
cardmgr[599]: initializing socket 1
cardmgr[599]: socket 1: 3Com 3CCM156 56K Global Modem
cardmgr[599]: executing: 'modprobe serial_cs'
kernel: register_serial(): autoconfig failed 
kernel: serial_cs: register_serial() at 0x02f8, irq 7 failed
cardmgr[599]: get dev info on socket 1 failed: Resource temporarily unavailable
------------------------------
I don't understand this -- ioport 0x2f8 is not used (according to
/proc/ioports) and neither is IRQ 7.

When I now try to disable both serial ports:

------------------------------
# tpctl --rs1=dis --rs2=dis
# setserial /dev/ttyS0 uart none
# setserial /dev/ttyS2 uart none
------------------------------

and reinsert the modem card, the system hangs completely (no reaction to
mouse or keyboard), and I have to reset the system.  The following lines
appear in the log before the system hangs:
------------------------------
cardmgr[599]: initializing socket 1
cardmgr[599]: socket 1: 3Com 3CCM156 56K Global Modem
cardmgr[599]: executing: 'modprobe serial_cs'
------------------------------

I have made several attempts, and invariably the result is either
"Resource temporarily unavailable" or (when disabling the serial ports) a
complete freeze.  I have tried allowing the pcmcia system to use some of
the other interrupts (3, 4), but the result is always the same.

I haven't tried as much with the MWAVE drivers, but so far the results are
very similar to the ones for the PC-card modem.  With enabled serial
ports, I cannot initialise the mwave modem -- with disabled ports, the
system hangs.

(as an aside, with all these reboots, I've noticed that when booting, I
get 50 lines as follows which don't appear in the dmesg log:

can't locate module lo:0
can't locate module lo:1
:
:
can't locate module lo:49

which are annoying, but appear to be harmless.)


I hope some of you can see what silly mistake I've made in the above.

Thanks in advance for all help!

-- 
//Tom Grydeland <Tom.Grydeland@phys.uit.no>


----- The Linux ThinkPad mailing list -----
The linux-thinkpad mailing list home page is at:
http://www.bm-soft.com/~bm/tp_mailing.html