From: "Ard Biesheuvel" <ard.biesheuvel@arm.com>
To: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>,
"andrey.warkentin@gmail.com" <andrey.warkentin@gmail.com>
Cc: "leif@nuviainc.com" <leif@nuviainc.com>,
"pete@akeo.ie" <pete@akeo.ie>,
"philmd@redhat.com" <philmd@redhat.com>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH 1/1] BcmGenetDxe: fix reliability issues
Date: Wed, 13 May 2020 00:03:37 +0200 [thread overview]
Message-ID: <85d15d48-68a9-a817-9398-d1783c288f07@arm.com> (raw)
In-Reply-To: <DB7PR08MB3260950D438AF1A15838943790BE0@DB7PR08MB3260.eurprd08.prod.outlook.com>
On 5/12/20 11:57 PM, Samer El-Haj-Mahmoud wrote:
> Tested-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
>
Pushed as 8977ff44a573..3698b912301b
Thanks guys
>> -----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.Biesheuvel@arm.com>; leif@nuviainc.com;
>> pete@akeo.ie; philmd@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.warkentin@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
>>
>>
>>
>
prev parent reply other threads:[~2020-05-12 22:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-12 21:52 [edk2-platforms][PATCH 1/1] BcmGenetDxe: fix reliability issues Andrei Warkentin
2020-05-12 21:57 ` [edk2-devel] " Samer El-Haj-Mahmoud
2020-05-12 22:03 ` Ard Biesheuvel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85d15d48-68a9-a817-9398-d1783c288f07@arm.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox