FreeBSD Bugzilla – Attachment 152470 Details for
Bug 197266
DWC interface panics ODROID-C1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for dwc panic
if_dwc.patch (text/plain), 1.94 KB, created by
john
on 2015-02-02 06:54:23 UTC
(
hide
)
Description:
patch for dwc panic
Filename:
MIME Type:
Creator:
john
Created:
2015-02-02 06:54:23 UTC
Size:
1.94 KB
patch
obsolete
>Index: sys/dev/dwc/if_dwc.c >=================================================================== >--- sys/dev/dwc/if_dwc.c (revision 278021) >+++ sys/dev/dwc/if_dwc.c (working copy) >@@ -84,6 +84,7 @@ > #define WRITE4(_sc, _reg, _val) \ > bus_write_4((_sc)->res[0], _reg, _val) > >+#define MAC_RESET_TIMEOUT 100 > #define WATCHDOG_TIMEOUT_SECS 5 > #define STATS_HARVEST_INTERVAL 2 > #define MII_CLK_VAL 2 >@@ -1103,19 +1104,6 @@ > sc->bst = rman_get_bustag(sc->res[0]); > sc->bsh = rman_get_bushandle(sc->res[0]); > >- mtx_init(&sc->mtx, device_get_nameunit(sc->dev), >- MTX_NETWORK_LOCK, MTX_DEF); >- >- callout_init_mtx(&sc->dwc_callout, &sc->mtx, 0); >- >- /* Setup interrupt handler. */ >- error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_NET | INTR_MPSAFE, >- NULL, dwc_intr, sc, &sc->intr_cookie); >- if (error != 0) { >- device_printf(dev, "could not setup interrupt handler.\n"); >- return (ENXIO); >- } >- > /* Read MAC before reset */ > if (dwc_get_hwaddr(sc, macaddr)) { > device_printf(sc->dev, "can't get mac\n"); >@@ -1127,12 +1115,12 @@ > reg |= (BUS_MODE_SWR); > WRITE4(sc, BUS_MODE, reg); > >- for (i = 0; i < 100; i++) { >+ for (i = 0; i < MAC_RESET_TIMEOUT; i++) { > if ((READ4(sc, BUS_MODE) & BUS_MODE_SWR) == 0) > break; > DELAY(10); > } >- if (i == 0) { >+ if (i >= MAC_RESET_TIMEOUT) { > device_printf(sc->dev, "Can't reset DWC.\n"); > return (ENXIO); > } >@@ -1156,6 +1144,19 @@ > WRITE4(sc, RX_DESCR_LIST_ADDR, sc->rxdesc_ring_paddr); > WRITE4(sc, TX_DESCR_LIST_ADDR, sc->txdesc_ring_paddr); > >+ mtx_init(&sc->mtx, device_get_nameunit(sc->dev), >+ MTX_NETWORK_LOCK, MTX_DEF); >+ >+ callout_init_mtx(&sc->dwc_callout, &sc->mtx, 0); >+ >+ /* Setup interrupt handler. */ >+ error = bus_setup_intr(dev, sc->res[1], INTR_TYPE_NET | INTR_MPSAFE, >+ NULL, dwc_intr, sc, &sc->intr_cookie); >+ if (error != 0) { >+ device_printf(dev, "could not setup interrupt handler.\n"); >+ return (ENXIO); >+ } >+ > /* Set up the ethernet interface. */ > sc->ifp = ifp = if_alloc(IFT_ETHER); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 197266
: 152470