Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: if_mvgbe.c regression (openrd ultimate)



>  I have an OpenRD CS (not Ultimate).
> 
>  If OopenRD Ultimate's MII bus isn't really connected to a PHY
> (and connected to a Ethernet swith or something else via any other
way),
> it will panics as your result.

AFAIK, the difference between Client and Ultimate is that PHYs are
configured to use different MDIO addresses (8 & 24 vs. 0 & 1). I haven't
found Ultimate specific schematics and there is no fancy tweaks in the
CS/BS schematics, so I believe this is the only difference what it comes
to Ethernet configuration.
 
> Could you show me the full dmesg on netbsd-6?
 
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 6.0_STABLE (OPENRD_ULTIMATE) #1: Sat Nov  3 20:04:17 EET 2012

pnu@wheezy:/home/pnu/src/netbsd_git/src/sys/arch/evbarm/compile/obj/OPENRD_ULTIMATE
total memory = 512 MB
avail memory = 497 MB
timecounter: Timecounters tick every 10.000 msec
mainbus0 (root)
cpu0 at mainbus0: Sheeva 88SV131 rev 1 (ARM9E-S core)
cpu0: DC enabled IC enabled WB enabled EABT branch prediction enabled
cpu0: 16KB/32B 4-way Instruction cache
cpu0: 16KB/32B 4-way write-back-locking-C Data cache
mvsoc0 at mainbus0: Marvell 88F6281 Rev. A1  Kirkwood
mvsoc0: CPU Clock 1200.000 MHz  SysClock 400.000 MHz  TClock 200.000 MHz
mvsoctmr0 at mvsoc0 unit 0 offset 0x20300-0x203ff: Marvell SoC Timer
mvsocgpp at mvsoc0 unit 0 not configured
mvsocrtc0 at mvsoc0 unit 0 offset 0x10300-0x10317: Marvell SoC Real Time
Clock
com0 at mvsoc0 unit 0 offset 0x12000-0x1201f irq 33: ns16550a, working
fifo
com0: console
com1 at mvsoc0 unit 1 offset 0x12100-0x1211f irq 34: ns16550a, working
fifo
ehci0 at mvsoc0 unit 0 offset 0x50000-0x51fff irq 19: Marvell USB 2.0
Interface
ehci0: EHCI version 1.0
usb0 at ehci0: USB revision 2.0
gttwsi0 at mvsoc0 unit 0 offset 0x11000-0x11fff irq 29: Marvell TWSI
controller
iic0 at gttwsi0: I2C bus
mvcesa at mvsoc0 unit 0 not configured
mvgbec0 at mvsoc0 unit 0 offset 0x70000-0x73fff: Marvell Gigabit
Ethernet Controller
mvgbe0 at mvgbec0 port 0 irq 11
mvgbe0: Ethernet address 02:50:43:0f:d0:a8
OUI 0x000ac2 model 0x000b rev 3 at mvgbe0 phy 0 not configured
mvgbe0: no PHY found!
mvgbec1 at mvsoc0 unit 1 offset 0x74000-0x77fff: Marvell Gigabit
Ethernet Controller
mvgbe1 at mvgbec1 port 0 irq 15
mvgbe1: Ethernet address 02:50:43:0f:d0:a9
OUI 0x000ac2 model 0x000b rev 3 at mvgbe1 phy 1 not configured
mvgbe1: no PHY found!
mvpex at mvsoc0 unit 0 not configured
mvsata0 at mvsoc0 unit 0 offset 0x80000-0x87fff irq 21: Marvell
Serial-ATA Host Controller (SATAHC)
mvsata0: GenIIe, 1hc, 2port/hc
atabus0 at mvsata0 channel 0
atabus1 at mvsata0 channel 1
mvsdio0 at mvsoc0 unit 0 offset 0x90000-0x9ffff irq 28: Marvell Secure
Digital Input/Output Interface
sdmmc0 at mvsdio0
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
timecounter: Timecounter "mvsoctmr0" frequency 200000000 Hz quality 100
uhub0 at usb0: Marvell EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub0: 1 port with 1 removable, self powered
mvsata0 port 0: device present, speed: 3.0Gb/s
wd0 at atabus0 drive 0
ld0 at sdmmc0: <SA02G>
ld0: 1876 MB, 952 cyl, 64 head, 63 sec, 512 bytes/sect x 3842048 sectors
ld0: 4-bit width, bus clock 25.000 MHz
wd0: <SAMSUNG HM250HI>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 232 GB, 484521 cyl, 16 head, 63 sec, 512 bytes/sect x 488397168
sectors
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 6 (Ultra/133)
wd0(mvsata0:0:0): using PIO mode 4, Ultra-DMA mode 6 (Ultra/133) (using
DMA)
uhub1 at uhub0 port 1: Genesys Logic USB2.0 Hub, class 9/0, rev
2.00/77.32, addr 2
uhub1: multiple transaction translators
uhub1: 4 ports with 4 removable, self powered
uhub2 at uhub1 port 1: Genesys Logic USB2.0 Hub, class 9/0, rev
2.00/77.32, addr 3
uhub2: multiple transaction translators
uhub2: 4 ports with 4 removable, self powered
boot device: <unknown>
root on wd0a dumps on wd0b
cprng sysctl: WARNING pseudorandom rekeying.

>  The following patch fixes the panic.
 
Thanks, it did.

Next I'd like to get both PHYs online. Are they working on CS?

-- 
-panu


On Thu, 2012-12-20 at 18:49 +-0900, Masanobu SAITOH wrote:
> Hello, panu.
> 
> (2012/12/20 4:44), panu finnila wrote:
> > It seems that this is some kind of a pointer type confusion:
> > 
> > (gdb) hbreak if_mvgbe.c:432
> > Hardware assisted breakpoint 1 at 0xc08c17f4:
> > file /home/pnu/src/netbsd_cvs/src/sys/dev/marvell/if_mvgbe.c, line 432.
> > 
> > (gdb) c
> > Continuing.
> > 
> > Program received signal SIGINT, Interrupt.
> > mvgbec_attach (parent=<optimized out>, self=<optimized out>,
> > aux=0xc0ccde18)
> > at /home/pnu/src/netbsd_cvs/src/sys/dev/marvell/if_mvgbe.c:432
> > 
> > (gdb) list
> > 427                         child = config_found_sm_loc(csc->sc_dev, 
> > "mvgbec", NULL,
> > 428                             &gbea, mvgbec_print, mvgbec_search);
> > 429                         if (child) {
> > 430                                 port = device_private(child);
> > 431                                 mii  = 
> > LIST_FIRST(&port->sc_mii.mii_phys);
> > *432*                                       phyaddr |= 
> > MVGBE_PHYADDR_PHYAD(j, mii->mii_phy);
> > 433                         }
> > 434                 }
> > 435                 break;
> > 436         }
> > 
> > (gdb) p mii
> > +ACQ-2 = (struct mii_softc *) 0x0
> > 
> > (gdb) p port->sc_mii
> > +ACQ-7 = {
> >    mii_media = {
> >      ifm_mask = 0,
> >      ifm_media = 0,
> >      ifm_cur = 0xc29d3674,
> >      ifm_list = {
> >        tqh_first = 0xc29d3674,
> >        tqh_last = 0xc29d3674
> >      },
> >      ifm_change = 0xc08befe8 <mvgbe_mediachange>,
> >      ifm_status = 0xc08befe4 <mvgbe_mediastatus>
> >    },
> >    mii_ifp = 0xc29e4018,
> >    mii_flags = 1,
> >    mii_phys = {
> >      lh_first = 0x0
> >    },
> >    mii_instance = 0,
> >    mii_media_status = 0,
> >    mii_media_active = 0,
> >    mii_readreg = 0xc08bf15c <mvgbec_miibus_readreg>,
> >    mii_writereg = 0xc08befec <mvgbec_miibus_writereg>,
> >    mii_statchg = 0xc08beb6c <mvgbec_miibus_statchg>
> > }
> 
>  I have an OpenRD CS (not Ultimate).
> 
>  If OopenRD Ultimate's MII bus isn't really connected to a PHY
> (and connected to a Ethernet swith or something else via any other way),
> it will panics as your result.
> 
> >  Could you show me the full dmesg on netbsd-6?
> 
>  The following patch fixes the panic.
> 
> Index: if_mvgbe.c
> ===================================================================
> RCS file: /cvsroot/src/sys/dev/marvell/if_mvgbe.c,v
> retrieving revision 1.32
> diff -u -r1.32 if_mvgbe.c
> --- if_mvgbe.c        9 Nov 2012 09:04:19 -0000       1.32
> +ACsAKwAr- if_mvgbe.c        20 Dec 2012 09:37:01 -0000
> @@ -429,7 +-429,9 @@
>                       if (child) {
>                               port = device_private(child);
>                               mii  = LIST_FIRST(&port->sc_mii.mii_phys);
> -                             phyaddr |= MVGBE_PHYADDR_PHYAD(j, mii->mii_phy);
> +-                             if (mii != NULL)
> +-                                     phyaddr |= MVGBE_PHYADDR_PHYAD(j,
> +-                                         mii->mii_phy);
>                       }
>               }
>               break;
> 
> 
>  Perhaps the panic appeard afrer the following change:
> 
>       http://mail-index.netbsd.org/source-changes/2012/10/22/msg038132.html
> 
> Before this change, accessing to the first page (by null pointer) in kernel
> don't panic because the page is mapped. After the change, it panics because
> the page is not mapped. This change is not pulled up yet (because the code is 
> little different between netbsd-6 and -current). I'll make a patch and send 
> the pullup request.
> 



Home | Main Index | Thread Index | Old Index