Changeset 34177


Ignore:
Timestamp:
2012-11-12T22:35:01+01:00 (5 years ago)
Author:
blogic
Message:

[ramips] move ethernet hw init to init/uninit functions

This should fix the stalled irq problem seen by several people.
This is not the real fix, but rather moves the bug to the un/init patch of the driver.
The real bug still needs to be fixed, but this workaround should be suffcient to make
the ethernet stable.

Location:
trunk/target/linux/ramips
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ramips/files/drivers/net/ethernet/ramips/ramips_main.c

    r33548 r34177  
    928928 
    929929static int 
    930 ramips_eth_open(struct net_device *dev) 
     930ramips_eth_hw_init(struct net_device *dev) 
    931931{ 
    932932        struct raeth_priv *re = netdev_priv(dev); 
     
    946946 
    947947        ramips_setup_dma(re); 
    948         ramips_fe_twr((ramips_fe_trr(RAETH_REG_PDMA_GLO_CFG) & 0xff) | 
    949                 (RAMIPS_TX_WB_DDONE | RAMIPS_RX_DMA_EN | 
    950                 RAMIPS_TX_DMA_EN | RAMIPS_PDMA_SIZE_4DWORDS), 
    951                 RAETH_REG_PDMA_GLO_CFG); 
    952948        ramips_fe_wr((ramips_fe_rr(RAMIPS_FE_GLO_CFG) & 
    953949                ~(RAMIPS_US_CYC_CNT_MASK << RAMIPS_US_CYC_CNT_SHIFT)) | 
     
    959955        tasklet_init(&re->rx_tasklet, ramips_eth_rx_hw, (unsigned long)dev); 
    960956 
    961         ramips_phy_start(re); 
    962957 
    963958        ramips_fe_twr(RAMIPS_DELAY_INIT, RAETH_REG_DLY_INT_CFG); 
     
    979974        ramips_fe_wr(0, RAMIPS_FE_RST_GL); 
    980975 
     976        return 0; 
     977 
     978err_free_irq: 
     979        free_irq(dev->irq, dev); 
     980        return err; 
     981} 
     982 
     983static int 
     984ramips_eth_open(struct net_device *dev) 
     985{ 
     986        struct raeth_priv *re = netdev_priv(dev); 
     987 
     988        ramips_fe_twr((ramips_fe_trr(RAETH_REG_PDMA_GLO_CFG) & 0xff) | 
     989                (RAMIPS_TX_WB_DDONE | RAMIPS_RX_DMA_EN | 
     990                RAMIPS_TX_DMA_EN | RAMIPS_PDMA_SIZE_4DWORDS), 
     991                RAETH_REG_PDMA_GLO_CFG); 
     992        ramips_phy_start(re); 
    981993        netif_start_queue(dev); 
    982994        return 0; 
    983  
    984  err_free_irq: 
    985         free_irq(dev->irq, dev); 
    986         return err; 
    987995} 
    988996 
     
    9961004                     RAETH_REG_PDMA_GLO_CFG); 
    9971005 
    998         /* disable all interrupts in the hw */ 
    999         ramips_fe_twr(0, RAETH_REG_FE_INT_ENABLE); 
    1000  
     1006        netif_stop_queue(dev); 
    10011007        ramips_phy_stop(re); 
    1002         free_irq(dev->irq, dev); 
    1003         netif_stop_queue(dev); 
    1004         tasklet_kill(&re->tx_housekeeping_tasklet); 
    1005         tasklet_kill(&re->rx_tasklet); 
    1006         ramips_ring_cleanup(re); 
    1007         ramips_ring_free(re); 
    10081008        RADEBUG("ramips_eth: stopped\n"); 
    10091009        return 0; 
     
    10391039                goto err_phy_disconnect; 
    10401040 
     1041        err = ramips_eth_hw_init(dev); 
     1042        if (err) 
     1043                goto err_debugfs; 
     1044 
    10411045        return 0; 
    10421046 
     1047err_debugfs: 
     1048        raeth_debugfs_exit(re); 
    10431049err_phy_disconnect: 
    10441050        ramips_phy_disconnect(re); 
     
    10561062        ramips_phy_disconnect(re); 
    10571063        ramips_mdio_cleanup(re); 
     1064        ramips_fe_twr(0, RAETH_REG_FE_INT_ENABLE); 
     1065        free_irq(dev->irq, dev); 
     1066        tasklet_kill(&re->tx_housekeeping_tasklet); 
     1067        tasklet_kill(&re->rx_tasklet); 
     1068        ramips_ring_cleanup(re); 
     1069        ramips_ring_free(re); 
    10581070} 
    10591071 
  • trunk/target/linux/ramips/image/Makefile

    r33852 r34177  
    127127endef 
    128128 
    129 mtdlayout_8M=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),6976k(rootfs),7872k@0x50000(firmware) 
    130 kernel_size_8M=917504 
    131 rootfs_size_8M=7143424 
     129mtdlayout_8M=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,960k(kernel),6912k(rootfs),7808k@0x50000(firmware) 
     130kernel_size_8M=983040 
     131rootfs_size_8M=7077888 
    132132define BuildFirmware/GENERIC_8M 
    133133        $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M)),$(kernel_size_8M),$(rootfs_size_8M)) 
Note: See TracChangeset for help on using the changeset viewer.