diff options
-rw-r--r-- | drivers/net/atl1/atl1_main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index 3b8f633ec05e..6aa2dc32727e 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -917,7 +917,10 @@ static u32 atl1_configure(struct atl1_adapter *adapter) | |||
917 | iowrite32(value, hw->hw_addr + REG_DMA_CTRL); | 917 | iowrite32(value, hw->hw_addr + REG_DMA_CTRL); |
918 | 918 | ||
919 | /* config CMB / SMB */ | 919 | /* config CMB / SMB */ |
920 | value = hw->cmb_rrd | ((u32) hw->cmb_tpd << 16); | 920 | value = (hw->cmb_tpd > adapter->tpd_ring.count) ? |
921 | hw->cmb_tpd : adapter->tpd_ring.count; | ||
922 | value <<= 16; | ||
923 | value |= hw->cmb_rrd; | ||
921 | iowrite32(value, hw->hw_addr + REG_CMB_WRITE_TH); | 924 | iowrite32(value, hw->hw_addr + REG_CMB_WRITE_TH); |
922 | value = hw->cmb_rx_timer | ((u32) hw->cmb_tx_timer << 16); | 925 | value = hw->cmb_rx_timer | ((u32) hw->cmb_tx_timer << 16); |
923 | iowrite32(value, hw->hw_addr + REG_CMB_WRITE_TIMER); | 926 | iowrite32(value, hw->hw_addr + REG_CMB_WRITE_TIMER); |