Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tom Lendacky and committed by
David S. Miller
f602b976 f8045ca9

+16 -5
+6 -2
drivers/net/ethernet/amd/xgbe/xgbe-common.h
··· 210 210 #define DMA_CH_CR_PBLX8_WIDTH 1 211 211 #define DMA_CH_CR_SPH_INDEX 24 212 212 #define DMA_CH_CR_SPH_WIDTH 1 213 - #define DMA_CH_IER_AIE_INDEX 15 213 + #define DMA_CH_IER_AIE20_INDEX 15 214 + #define DMA_CH_IER_AIE20_WIDTH 1 215 + #define DMA_CH_IER_AIE_INDEX 14 214 216 #define DMA_CH_IER_AIE_WIDTH 1 215 217 #define DMA_CH_IER_FBEE_INDEX 12 216 218 #define DMA_CH_IER_FBEE_WIDTH 1 217 - #define DMA_CH_IER_NIE_INDEX 16 219 + #define DMA_CH_IER_NIE20_INDEX 16 220 + #define DMA_CH_IER_NIE20_WIDTH 1 221 + #define DMA_CH_IER_NIE_INDEX 15 218 222 #define DMA_CH_IER_NIE_WIDTH 1 219 223 #define DMA_CH_IER_RBUE_INDEX 7 220 224 #define DMA_CH_IER_RBUE_WIDTH 1
+10 -3
drivers/net/ethernet/amd/xgbe/xgbe-dev.c
··· 649 649 static void xgbe_enable_dma_interrupts(struct xgbe_prv_data *pdata) 650 650 { 651 651 struct xgbe_channel *channel; 652 - unsigned int i; 652 + unsigned int i, ver; 653 653 654 654 /* Set the interrupt mode if supported */ 655 655 if (pdata->channel_irq_mode) 656 656 XGMAC_IOWRITE_BITS(pdata, DMA_MR, INTM, 657 657 pdata->channel_irq_mode); 658 + 659 + ver = XGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER); 658 660 659 661 for (i = 0; i < pdata->channel_count; i++) { 660 662 channel = pdata->channel[i]; ··· 673 671 * AIE - Abnormal Interrupt Summary Enable 674 672 * FBEE - Fatal Bus Error Enable 675 673 */ 676 - XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE, 1); 677 - XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE, 1); 674 + if (ver < 0x21) { 675 + XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE20, 1); 676 + XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE20, 1); 677 + } else { 678 + XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, NIE, 1); 679 + XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, AIE, 1); 680 + } 678 681 XGMAC_SET_BITS(channel->curr_ier, DMA_CH_IER, FBEE, 1); 679 682 680 683 if (channel->tx_ring) {