Bug 113406 - [xl] Page fault in XL0 device driver (regression)
Summary: [xl] Page fault in XL0 device driver (regression)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 6.2-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-06 12:20 UTC by Richard Smith
Modified: 2008-04-24 10:46 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Smith 2007-06-06 12:20:02 UTC
Installed device causing problem:
xl0: <3Com 3c900B-COMBO Etherlink XL> port 0xb800-0xb87f mem 0xefdfff80-0xefdfffff irq 10 at device 6.0 on pci2
xl0: selecting 10baseT transceiver, half duplex
xl0: Ethernet address: 00:50:da:43:bc:b4

Command causing problem:
ifconfig xl0 media 10base2/BNC

Full details of panic copied from the screen:
Fatal trap 12: page fault while in kernel mode
fault virtual address = 0x24
fault code = supervisor read, page not present
instruction pointer = 0x20:0xc0692dde
stack pointer = 0x28:0xd0a04c54
frame pointer = 0x28:0xd0a04c68
code segment = base rx0, limit 0xfffff, type 0x1b
 = DPL 0, pres 1, def32 1, gran 1
processor eflags = resume, IOPL = 0
current process = 23 (irq10: rl0 xl0+)
trap number = 12
panic: page fault

Problem also appears in:
FreeBSD 6.2-RELEASE

Problem does NOT appear in:
FreeBSD 5.4-RELEASE

Fix: 

The only fix we currently have is to use an alternative OS version (e.g.
5.4-R) or an alternative combo card (e.g. we have combo cards using the
ed0 device that do not present a problem).
How-To-Repeat: Install a COMBO NIC (one supporting 10base2/BNC and 10baseT/UTP) for the
XL0 device driver and issue the following command:

ifconfig xl0 inet 10.1.1.1 netmask 255.255.255.0
ifconfig xl0 media 10base2/BNC

immediate panic
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2007-06-11 14:31:17 UTC
Responsible Changed
From-To: freebsd-i386->freebsd-bin

This does not sound i386-specific.
Comment 2 NORCOTT381 2007-09-04 19:51:34 UTC
Hi, On my pc running the ifconfig command 2 times recreates the error. 
Looking at the code in if_xl.c:
 
 
 
static int
xl_ifmedia_upd(struct ifnet *ifp)
{
struct xl_softc *sc  = ifp->if_softc;
struct ifmedia *ifm = NULL;
struct mii_data *mii =  NULL;

XL_LOCK(sc);

if (sc->xl_miibus != NULL)
mii =  device_get_softc(sc->xl_miibus);
if (mii == NULL)
ifm =  &sc->ifmedia;
else
ifm = &mii->mii_media;

switch  (IFM_SUBTYPE(ifm->ifm_media)) {
case IFM_100_FX:
case  IFM_10_FL:
case IFM_10_2:
case IFM_10_5:
xl_setmode(sc,  ifm->ifm_media);
return (0);    <---------- *** does not release lock  ****
break;
default:
break;
}

if (sc->xl_media &  XL_MEDIAOPT_MII ||
sc->xl_media & XL_MEDIAOPT_BTX  ||
sc->xl_media & XL_MEDIAOPT_BT4)  {
xl_init_locked(sc);
} else {
xl_setmode(sc,  ifm->ifm_media);
}

XL_UNLOCK(sc);

return (0);
}



This return does not release the lock at the begining.
 
I removed the 'return(0);' and the pc does not produce the error and allows  
me to change the media.
 
At the moment I cannot test the BNC part.
 
 
 
pn.



   
Comment 3 dfilter service freebsd_committer freebsd_triage 2008-03-24 17:49:13 UTC
marius      2008-03-24 17:49:06 UTC

  FreeBSD src repository

  Modified files:
    sys/pci              if_xl.c if_xlreg.h 
  Log:
  - Take advantage of bus_dmamap_load_mbuf_sg(9).
  - Take advantage of m_collapse(9).
  - Sync with other NIC drivers and prepend a TX mbuf if the first attempt
    to load it fails with an error other than EFBIG and stop trying instead
    of freeing it and keeping on trying to enqueue more mbufs. Also ensure
    the driver queue isn't empty before trying to enqueue mbufs in order to
    reduce locking operations.
  - In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1]
  - Const'ify the xl_devs array.
  - Remove an outdated comment.
  
  PR:             113406 [1]
  MFC after:      1 month
  
  Revision  Changes    Path
  1.213     +69 -93    src/sys/pci/if_xl.c
  1.60      +2 -1      src/sys/pci/if_xlreg.h
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 dfilter service freebsd_committer freebsd_triage 2008-04-23 22:28:36 UTC
marius      2008-04-23 21:28:30 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_7)
    sys/pci              if_xl.c if_xlreg.h 
  Log:
  - Spelling fix for interupt -> interrupt
  - Take advantage of bus_dmamap_load_mbuf_sg(9).
  - Take advantage of m_collapse(9).
  - Sync with other NIC drivers and prepend a TX mbuf if the first attempt
    to load it fails with an error other than EFBIG and stop trying instead
    of freeing it and keeping on trying to enqueue more mbufs. Also ensure
    the driver queue isn't empty before trying to enqueue mbufs in order to
    reduce locking operations.
  - In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1]
  - Const'ify the xl_devs array.
  - Remove an outdated comment.
  
  PR:             113406 [1]
  
  Revision   Changes    Path
  1.210.2.2  +71 -95    src/sys/pci/if_xl.c
  1.59.2.1   +2 -1      src/sys/pci/if_xlreg.h
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 dfilter service freebsd_committer freebsd_triage 2008-04-23 22:38:34 UTC
marius      2008-04-23 21:38:29 UTC

  FreeBSD src repository

  Modified files:        (Branch: RELENG_6)
    sys/pci              if_xl.c if_xlreg.h 
  Log:
  MFC: if_xl.c 1.211, 1.212, 1.213 (partial); if_xlreg.h 1.60
  
  - Spelling fix for interupt -> interrupt
  - Fix function prototype for device_shutdown method.
  - Take advantage of bus_dmamap_load_mbuf_sg(9).
  - Sync with other NIC drivers and prepend a TX mbuf if the first attempt
    to load it fails with an error other than EFBIG and stop trying instead
    of freeing it and keeping on trying to enqueue more mbufs. Also ensure
    the driver queue isn't empty before trying to enqueue mbufs in order to
    reduce locking operations.
  - In xl_ifmedia_upd() add a missing XL_UNLOCK(). [1]
  - Const'ify the xl_devs array.
  - Remove an outdated comment.
  
  PR:             113406 [1]
  
  Revision    Changes    Path
  1.190.2.12  +75 -97    src/sys/pci/if_xl.c
  1.55.2.3    +2 -1      src/sys/pci/if_xlreg.h
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Marius Strobl freebsd_committer freebsd_triage 2008-04-24 10:46:25 UTC
State Changed
From-To: open->closed


Close; this PR has been fully dealt with.