Bug 207910 - problem to detect modem on multifunction pcmcia cards
problem to detect modem on multifunction pcmcia cards
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2006-09-25 07:12 EDT by Fabrice Bellet
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version: 2.6.20-1.2925.fc6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-03-15 17:33:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
linux-2.6.17-pcmcia-rescan-when-rewriting-cis.patch (346 bytes, patch)
2006-10-01 14:58 EDT, Fabrice Bellet
no flags Details | Diff
linux-2.6.17-pcmcia-delete-devices-after-cis-update.patch (536 bytes, patch)
2006-10-01 15:16 EDT, Fabrice Bellet
no flags Details | Diff
start over after CIS override (2.91 KB, patch)
2006-11-03 10:56 EST, Dominik Brodowski
no flags Details | Diff
log with 3cxem556-b multifunction card, kernel-2.6.19-rc4-git7 + dominik patch (7.44 KB, text/plain)
2006-11-06 08:08 EST, Fabrice Bellet
no flags Details

  None (edit)
Description Fabrice Bellet 2006-09-25 07:12:16 EDT
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 ?
Comment 1 Fabrice Bellet 2006-09-30 12:46:26 EDT
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 ?
Comment 2 Fabrice Bellet 2006-10-01 14:58:29 EDT
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.
Comment 3 Fabrice Bellet 2006-10-01 15:16:33 EDT
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
Comment 4 Dominik Brodowski 2006-11-03 10:56:58 EST
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.
Comment 5 Fabrice Bellet 2006-11-06 08:06:27 EST
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 ?) 
Comment 6 Fabrice Bellet 2006-11-06 08:08:34 EST
Created attachment 140463 [details]
log with 3cxem556-b multifunction card, kernel-2.6.19-rc4-git7 + dominik patch
Comment 7 Romano Giannetti 2006-11-14 07:05:20 EST
Please see 

It is fixed for me now! Thanks to all the people involved!
Comment 8 Fabrice Bellet 2007-03-15 17:31:06 EDT
Now it works fine with kernel-2.6.20-1.2925.fc6

Note You need to log in before you can comment on or make changes to this bug.