Port-arm archive

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

Re: if_mvgbe.c regression (openrd ultimate)



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
> $2 = (struct mii_softc *) 0x0
> 
> (gdb) p port->sc_mii
> $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
+++ 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.

-- 
-----------------------------------------------
                SAITOH Masanobu (msaitoh%execsw.org@localhost
                                 msaitoh%netbsd.org@localhost)


Home | Main Index | Thread Index | Old Index