modprobe succeeding despite mismatch on PCI-ID

Jim Cromie jim.cromie at gmail.com
Wed Apr 4 04:35:39 EDT 2012


hi all,

I have a card which modprobes, despite a PCI-ID mismatch (though its a
near match)

root at voyage:~# lsmod | grep mwl8k
mwl8k                  30986  0
mac80211              261375  2 mwl8k,rtl8180

root at voyage:~# lsmod | grep mwl8k
mwl8k                  30986  0
mac80211              261375  2 mwl8k,rtl8180
cfg80211              123158  3 mwl8k,rtl8180,mac80211

root at voyage:~# modinfo mwl8k
filename:
/lib/modules/3.3.0-next-20120328-ske+/kernel/drivers/net/wireless/mwl8k.ko
license:        GPL
author:         Lennert Buytenhek <buytenh at marvell.com>
version:        0.13
description:    Marvell TOPDOG(R) 802.11 Wireless Network Driver
...
firmware:       mwl8k/helper_8363.fw
srcversion:     7DE0D6B47B634A3BAF6D101
alias:          pci:v000011ABd00002A43sv*sd*bc*sc*i*
alias:          pci:v000011ABd00002A40sv*sd*bc*sc*i*
alias:          pci:v000011ABd00002A30sv*sd*bc*sc*i*
alias:          pci:v000011ABd00002A2Bsv*sd*bc*sc*i*
alias:          pci:v000011ABd00002A24sv*sd*bc*sc*i*
alias:          pci:v000011ABd00002A0Csv*sd*bc*sc*i*
alias:          pci:v000011ABd00002A0Asv*sd*bc*sc*i*

that last alias is the closest to the cards ID, but this isnt
horseshoes. Or is it ?

root at voyage:~# lspci -vvnnk -s 00:e
00:0e.0 Ethernet controller [0200]: Marvell Technology Group Ltd.
88W8361 [TopDog] 802.11n Wireless [11ab:2a02] (rev 03)
	Subsystem: Marvell Technology Group Ltd. 88W8361 [TopDog] 802.11n
Wireless [11ab:2a02]
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 63, Cache Line Size: 32 bytes
	Interrupt: pin A routed to IRQ 5
	Region 0: Memory at a0010000 (32-bit, non-prefetchable) [size=64K]
	Region 1: Memory at a0020000 (32-bit, non-prefetchable) [size=64K]
	Capabilities: [40] Power Management version 2
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-


I note that the -k option doesnt show a kernel driver bound to it,
unlike others:

00:13.0 USB Controller [0c03]: Compaq Computer Corporation ZFMicro
Chipset USB [0e11:a0f8] (rev 08) 	Kernel driver in use: ohci_hcd
	Kernel modules: ohci-hcd


Given the pci-id mismatch shouldnt this just fail to modprobe ?
is it a bug ?
if not, why not - what reasons could justify a zombie
(useless, taking up space) module ?


the relevant code is:  (I see nothing surprising)

static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
        { PCI_VDEVICE(MARVELL, 0x2a0a), .driver_data = MWL8363, },
        { PCI_VDEVICE(MARVELL, 0x2a0c), .driver_data = MWL8363, },
        { PCI_VDEVICE(MARVELL, 0x2a24), .driver_data = MWL8363, },
        { PCI_VDEVICE(MARVELL, 0x2a2b), .driver_data = MWL8687, },
        { PCI_VDEVICE(MARVELL, 0x2a30), .driver_data = MWL8687, },
        { PCI_VDEVICE(MARVELL, 0x2a40), .driver_data = MWL8366, },
        { PCI_VDEVICE(MARVELL, 0x2a43), .driver_data = MWL8366, },
        { },
};
MODULE_DEVICE_TABLE(pci, mwl8k_pci_id_table);
...
static struct pci_driver mwl8k_driver = {
        .name           = MWL8K_NAME,
        .id_table       = mwl8k_pci_id_table,
        .probe          = mwl8k_probe,
        .remove         = __devexit_p(mwl8k_remove),
        .shutdown       = __devexit_p(mwl8k_shutdown),
};

static int __init mwl8k_init(void)
{
        return pci_register_driver(&mwl8k_driver);
}


Given that the "impossible" is happening, I guess Id blame mwl8k_probe,
but doesnt/shouldnt pci_register_driver insist that the .id_table has a match ??


thanks
Jim



More information about the Kernelnewbies mailing list