aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2017-08-28 15:29:34 -0500
committerDavid S. Miller <davem@davemloft.net>2017-08-29 15:31:10 -0700
commitf602b976b6b0eab8de59e438f9313da72b47a8e4 (patch)
treed73b436921bbb845c8a8187454a16c132efccff3 /drivers/net/ethernet/amd/xgbe/xgbe-dev.c
parentMerge branch 'nsh-headers-GSO' (diff)
downloadlinux-dev-f602b976b6b0eab8de59e438f9313da72b47a8e4.tar.xz
linux-dev-f602b976b6b0eab8de59e438f9313da72b47a8e4.zip
amd-xgbe: Interrupt summary bits are h/w version dependent
There is a difference in the bit position of the normal interrupt summary enable (NIE) and abnormal interrupt summary enable (AIE) between revisions of the hardware. For older revisions the NIE and AIE bits are positions 16 and 15 respectively. For newer revisions the NIE and AIE bits are positions 15 and 14. The effect in changing the bit position is that newer hardware won't receive AIE interrupts in the current version of the driver. Specifically, the driver uses this interrupt to collect statistics on when a receive buffer unavailable event occurs and to restart the driver/device when a fatal bus error occurs. Update the driver to set the interrupt enable bit based on the reported version of the hardware. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-dev.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
index 671203dbea3d..e107e180e2c8 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
@@ -649,13 +649,15 @@ static void xgbe_config_flow_control(struct xgbe_prv_data *pdata)
static void xgbe_enable_dma_interrupts(struct xgbe_prv_data *pdata)
{
struct xgbe_channel *channel;
- unsigned int i;
+ unsigned int i, ver;
/* Set the interrupt mode if supported */
if (pdata->channel_irq_mode)
XGMAC_IOWRITE_BITS(pdata, DMA_MR, INTM,
pdata->channel_irq_mode);
+ ver = XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER);
+
for (i = 0; i < pdata->channel_count; i++) {
channel = pdata->channel[i];
@@ -671,8 +673,13 @@ static void xgbe_enable_dma_interrupts(struct xgbe_prv_data *pdata)
* AIE - Abnormal Interrupt Summary Enable
* FBEE - Fatal Bus Error Enable
*/
- XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE, 1);
- XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE, 1);
+ if (ver < 0x21) {
+ XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE20, 1);
+ XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE20, 1);
+ } else {
+ XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE, 1);
+ XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE, 1);
+ }
XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, FBEE, 1);
if (channel->tx_ring) {