Red Hat Bugzilla – Bug 207910
problem to detect modem on multifunction pcmcia cards
Last modified: 2007-11-30 17:11:44 EST
The pcmcia subsystem fails to detect the modem part of a multifunction pcmcia
card (3com megahertz 3cxem556b net+modem). This card worked fine with pcmcia-cs,
and the problem appeared in FC5 and also in rawhide, with pcmciautils. I tested
this case with two laptops, a T60p with FC5 fully updated, and a T40 running
rawhide. This is what I obtain, when I insert the card (pccardctl eject ;
pccardctl insert), there's no trace of the modem function:
Sep 24 22:47:02 localhost kernel: pccard: PCMCIA card inserted into slot 0
Sep 24 22:47:02 localhost kernel: pcmcia: registering new device pcmcia0.0
Sep 24 22:47:02 localhost kernel: eth0: 3Com 3c589, io 0x300, irq 3, hw_addr
Sep 24 22:47:02 localhost kernel: 8K FIFO split 5:3 Rx:Tx, auto xcvr
I grabbed the cis file from the old pcmcia-cs package, and put it in
/lib/firmware/3CXEM556.cis to make udev helper functions happy.
I also recompiled cardmgr from the latest pcmcia-cs tarball, and went a bit
further, when launching cardmgr, the modem capabilities are detected by the
kernel, the serial_cs module is loaded, the /dev/modem is created:
pcmcia: Detected deprecated PCMCIA ioctl usage from process: cardmgr.
pcmcia: This interface will soon be removed from the kernel; please expect
breakage unless you upgrade to new tools.
pcmcia: see http://www.kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html for
pcmcia: registering new device pcmcia0.1
0.1: ttyS0 at I/O 0x3f8 (irq = 3) is a 16550A
eth0: interrupt(s) dropped!
2.6. kernels use pcmciamtd instead of memory_cs.c and do not require special
MTD handling any more.
The modem is detected, but doesn't respond to any at commands (same irq thatn
network ? conflict with pcmciautils ? maybe). But as pcmcia-cs is deprecated,
this is certainly not the way to solve this issue. Anyway, this demonstrates
that the modem function is available, and probably should work out-of-the-box
with kernel support+pcmciautils.
[root@bonobo pcmcia]# find /sys/bus/pcmcia/
[root@bonobo pcmcia]# find /sys/class/pcmcia_socket/
Any hint on how I can investigate further on this issue ?
I inserted some debug statements with jprobes in the pcmcia code, and I have a
better view of what certainly occurs: when powered up, the pcmcia card shows a
single function (network), so the 3c589_cs is loaded. Then the 3CXEM556.cis
firmware is loaded by the network driver, that overrides the cards buggy cis.
Now the cis tells that the card has multifunctions (network+modem), but it's too
late, because there's no pcmcia_bus_rescan() occuring after the new cis has been
loaded. Does it make sense ?
Created attachment 137504 [details]
The ret variable is not supposed to be zero here, because it is initialised to
the value of count (size of the cis file), and is only modified when
pcmcia_replace_cis() fails (-EIO). This patch forces a pcmcia_bus_rescan() when
writing a new cis file through the /sys/ interface.
Created attachment 137505 [details]
When a new cis file is loaded, pcmcia_bus_rescan() is called, and nothing will
occur if the previous cis already provided a function that got registered.
This is the case with the megahertz 3CXEM556 B network/modem card : initially,
only the network function is advertized by the card.
Maybe we can assume that the previous registered information simply needs to be
dropped, before re-adding the card _from scratch_. This is what this patch
It works for me : the modem function is correctly detected, I just need to
manually launch pcmcia-socket-startup, so pcmcia_bus_rescan() is called after
the new cis file has been loaded, triggered by the 3c589_cs module.
But : there's still an IRQ conflict between network and modem functions, that
cannot be used simultaneously. This is not really a problem, because a
workaround consists simply to disable the network device, and to autoconfigure
the serial port :
# ifconfig eth0 down
# setserial autoconfig auto_irq /dev/ttyS0
Created attachment 140264 [details]
start over after CIS override
Many thanks for debugging this issue. The attached patch should address it in a
slightly different way; for only in the "replace CIS" codepath devices will be
removed and re-added.
It works for me (2.6.19-rc4-git7). The pre-required steps now to make the modem
function of my pcmcia card usable are :
- prevents the network driver from being loaded (install 3c589_cs /bin/true in
modprobe.conf), else there's irq conflict between network and modem function
(see following log, "pcmcia: request for exclusive IRQ could not be fulfilled")
- manually load the CIS file via sysfs (cat /lib/firmware/3CXEM556.cis >
/sys/class/pcmcia_socket/pcmcia_socket0/cis), altough the CIS has already been
loaded by the network driver from another code path (see following log too, "ds:
trying to load firmware 3CXEM556.cis").
I'm wondering if the setup process could be somewhat automatized via the generic
udev rules (does it make sense to blacklist this card in pcmcia-check-broken-cis
for example ?)
Created attachment 140463 [details]
log with 3cxem556-b multifunction card, kernel-2.6.19-rc4-git7 + dominik patch
It is fixed for me now! Thanks to all the people involved!
Now it works fine with kernel-2.6.20-1.2925.fc6