Tested-by: Samer El-Haj-Mahmoud <samer.el-haj-mahm...@arm.com> > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Andrei > Warkentin via groups.io > Sent: Tuesday, May 12, 2020 5:53 PM > To: devel@edk2.groups.io > Cc: Ard Biesheuvel <ard.biesheu...@arm.com>; l...@nuviainc.com; > p...@akeo.ie; phi...@redhat.com > Subject: [edk2-devel] [edk2-platforms][PATCH 1/1] BcmGenetDxe: fix > reliability issues > > - Failed TFTP boots > - Failed HTTP boots > > The definite problem was that the incorrect PROD index was being written TX > ring. The PROD index should be the TxProdIndex (on the scale of 0-0xffff), > not the descriptor index (on the scale of 0-max descs). > > The other small things were suspect (mod 0xffff is not the same as & 0xffff). > > Signed-off-by: Andrei Warkentin <andrey.warken...@gmail.com> > --- > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c | 4 ++-- > Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c | 3 +-- > 2 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c > b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c > index 4b0995e3..1c4c8527 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/GenetUtil.c > @@ -737,7 +737,7 @@ GenetDmaTriggerTx ( > GenetMmioWrite (Genet, GENET_TX_DESC_STATUS (DescIndex), > DescStatus); > > GenetMmioWrite (Genet, GENET_TX_DMA_PROD_INDEX > (GENET_DMA_DEFAULT_QUEUE), > - (DescIndex + 1) & 0xFFFF); > + Genet->TxProdIndex); > } > > /** > @@ -764,7 +764,7 @@ GenetTxIntr ( > *TxBuf = Genet->TxBuffer[Genet->TxNext]; > Genet->TxQueued--; > Genet->TxNext = (Genet->TxNext + 1) % GENET_DMA_DESC_COUNT; > - Genet->TxConsIndex++; > + Genet->TxConsIndex = (Genet->TxConsIndex + 1) & 0xFFFF; > } else { > *TxBuf = NULL; > } > diff --git a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c > b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c > index 74677927..371216ca 100644 > --- a/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c > +++ b/Silicon/Broadcom/Drivers/Net/BcmGenetDxe/SimpleNetwork.c > @@ -641,9 +641,8 @@ GenetSimpleNetworkTransmit ( > return Status; > } > > + Genet->TxProdIndex = (Genet->TxProdIndex + 1) & 0xFFFF; > GenetDmaTriggerTx (Genet, Desc, DmaDeviceAddress, > DmaNumberOfBytes); > - > - Genet->TxProdIndex = (Genet->TxProdIndex + 1) % 0xFFFF; > Genet->TxQueued++; > > EfiReleaseLock (&Genet->Lock); > -- > 2.17.1 > > >
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#59377): https://edk2.groups.io/g/devel/message/59377 Mute This Topic: https://groups.io/mt/74169369/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-