]> Pileus Git - ~andy/linux/commit
8139cp: set ring address after enabling C+ mode
authorDavid Woodhouse <dwmw2@infradead.org>
Wed, 21 Nov 2012 10:27:19 +0000 (10:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 25 Nov 2012 20:53:31 +0000 (15:53 -0500)
commita9dbe40fc10cea2efe6e1ff9e03c62dd7579c5ba
treee9eac61be2534827fb758fd8b91efec8909dffeb
parent071e3ef4a94a021b16a2912f3885c86f4ff36b49
8139cp: set ring address after enabling C+ mode

This fixes (for me) a regression introduced by commit b01af457 ("8139cp:
set ring address before enabling receiver"). That commit configured the
descriptor ring addresses earlier in the initialisation sequence, in
order to avoid the possibility of triggering stray DMA before the
correct address had been set up.

Unfortunately, it seems that the hardware will scribble garbage into the
TxRingAddr registers when we enable "plus mode" Tx in the CpCmd
register. Observed on a Traverse Geos router board.

To deal with this, while not reintroducing the problem which led to the
original commit, we augment cp_start_hw() to write to the CpCmd register
*first*, then set the descriptor ring addresses, and then finally to
enable Rx and Tx in the original 8139 Cmd register. The datasheet
actually indicates that we should enable Tx/Rx in the Cmd register
*before* configuring the descriptor addresses, but that would appear to
re-introduce the problem that the offending commit b01af457 was trying
to solve. And this variant appears to work fine on real hardware.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Cc: stable@kernel.org [3.5+]
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/8139cp.c