aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaud Patard \(Rtp\) <arnaud.patard@rtp-net.org>2013-07-29 15:56:47 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-30 22:32:36 -0400
commitaded09555b7a0748a692d0d644ac54c10c1c0757 (patch)
tree134b748250bc346617d81efc83038a1f54bc6ef5
parent7b70176421993866e616f1cbc4d0dd4054f1bf78 (diff)
mvneta: Fix hang when loading the mvneta driver
When the mvneta driver is compiled, it'll be loaded with clocks disabled. This implies that the clocks should be enabled again before any register access or it'll hang. To fix it: - enable clock earlier - move timer callback after setting timer.data Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/marvell/mvneta.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 712779fb12b7..3ac29c64bd6c 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2728,20 +2728,10 @@ static int mvneta_probe(struct platform_device *pdev)
2728 2728
2729 pp = netdev_priv(dev); 2729 pp = netdev_priv(dev);
2730 2730
2731 pp->tx_done_timer.function = mvneta_tx_done_timer_callback;
2732 init_timer(&pp->tx_done_timer);
2733 clear_bit(MVNETA_F_TX_DONE_TIMER_BIT, &pp->flags);
2734
2735 pp->weight = MVNETA_RX_POLL_WEIGHT; 2731 pp->weight = MVNETA_RX_POLL_WEIGHT;
2736 pp->phy_node = phy_node; 2732 pp->phy_node = phy_node;
2737 pp->phy_interface = phy_mode; 2733 pp->phy_interface = phy_mode;
2738 2734
2739 pp->base = of_iomap(dn, 0);
2740 if (pp->base == NULL) {
2741 err = -ENOMEM;
2742 goto err_free_irq;
2743 }
2744
2745 pp->clk = devm_clk_get(&pdev->dev, NULL); 2735 pp->clk = devm_clk_get(&pdev->dev, NULL);
2746 if (IS_ERR(pp->clk)) { 2736 if (IS_ERR(pp->clk)) {
2747 err = PTR_ERR(pp->clk); 2737 err = PTR_ERR(pp->clk);
@@ -2765,7 +2755,16 @@ static int mvneta_probe(struct platform_device *pdev)
2765 } 2755 }
2766 } 2756 }
2767 2757
2758 pp->base = of_iomap(dn, 0);
2759 if (pp->base == NULL) {
2760 err = -ENOMEM;
2761 goto err_free_irq;
2762 }
2763
2768 pp->tx_done_timer.data = (unsigned long)dev; 2764 pp->tx_done_timer.data = (unsigned long)dev;
2765 pp->tx_done_timer.function = mvneta_tx_done_timer_callback;
2766 init_timer(&pp->tx_done_timer);
2767 clear_bit(MVNETA_F_TX_DONE_TIMER_BIT, &pp->flags);
2769 2768
2770 pp->tx_ring_size = MVNETA_MAX_TXD; 2769 pp->tx_ring_size = MVNETA_MAX_TXD;
2771 pp->rx_ring_size = MVNETA_MAX_RXD; 2770 pp->rx_ring_size = MVNETA_MAX_RXD;