From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3D61994001B for ; Fri, 28 Jul 2023 04:00:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3fZq9CXOmgUDKOOiF2dtOdvqUJwyak4uvL96pZ80hIg=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:From:To:Cc:Subject:Date:Message-Id:MIME-Version:X-CM-TRANSID:X-Coremail-Antispam:X-Originating-IP:X-CM-SenderInfo:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Transfer-Encoding; s=20140610; t=1690516837; v=1; b=oFWn6MXcqI2LMV8HwDmPzryJGpxwRPvS/YaJedQKuqr1cHsYzOsppps6/WnV7KWOH4tCKfbv 9Gk4tOhCpxAbVNAR1+PNmlrGTrsK2gEMrO6v2QCog5LmycJB5qzc/L6+nEuXtg7wQi9jPx8DWvE MjRX1+kPt7crKjzOZwRBJfdg= X-Received: by 127.0.0.2 with SMTP id BzagYY7687511xSR2V85QRlf; Thu, 27 Jul 2023 21:00:37 -0700 X-Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.214]) by mx.groups.io with SMTP id smtpd.web11.25793.1690516836487839731 for ; Thu, 27 Jul 2023 21:00:37 -0700 X-Received: from localhost.localdomain (unknown [219.141.235.82]) by zwqz-smtp-mta-g4-3 (Coremail) with SMTP id _____wB3S0A_PcNkvSY3Bg--.14904S2; Fri, 28 Jul 2023 12:00:00 +0800 (CST) From: "wangy" To: devel@edk2.groups.io Cc: pedro.falcato@gmail.com, Yang Wang , Leif Lindholm , Ard Biesheuvel , Ran Wang Subject: [edk2-devel] [edk2-platforms][PATCH V1] Silicon/Synopsys/DesignWare: DwEmacSnpDxe: Fix bug in EmacGetDmaStatus Date: Fri, 28 Jul 2023 11:59:57 +0800 Message-Id: MIME-Version: 1.0 X-CM-TRANSID: _____wB3S0A_PcNkvSY3Bg--.14904S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7AF18Ar4xJw1xuw13Ww1DAwb_yoW8Zw1xpF ZrArZrurn8GFyrA3WYyF4qqF15GFZxGrWvk347twnaqFnxJFn3uFyagFW3JFnrGry0yry3 GFZaq34xGrZ5taUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pEasUJUUUUU= X-Originating-IP: [219.141.235.82] X-CM-SenderInfo: 5zdqw5p2kd06i6rwjhhfrp/xtbBDQG6JVaEPqZyNgAAsd Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wangyzhaoz@163.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: vnD2jxeZC7ZiuZiS7BAZ9yTfx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=oFWn6MXc; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=163.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io From: Yang Wang If IrqStat is NULL, the interrupt status will not be read from the device.When the interrupt status is read, it will also be cleared. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Ran Wang Signed-off-by: Yang Wang --- .../Drivers/DwEmacSnpDxe/EmacDxeUtil.c | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDxe/EmacDxeUtil.c= b/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDxe/EmacDxeUtil.c index 3b982ce984..26d3ff6138 100755 --- a/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDxe/EmacDxeUtil.c +++ b/Silicon/Synopsys/DesignWare/Drivers/DwEmacSnpDxe/EmacDxeUtil.c @@ -500,24 +500,30 @@ EmacGetDmaStatus ( UINT32 ErrorBit;=0D UINT32 Mask =3D 0;=0D =0D + if (IrqStat !=3D NULL) {=0D + *IrqStat =3D 0;=0D + }=0D +=0D DmaStatus =3D MmioRead32 (MacBaseAddress +=0D DW_EMAC_DMAGRP_STATUS_OFST);=0D if (DmaStatus & DW_EMAC_DMAGRP_STATUS_NIS_SET_MSK) {=0D Mask |=3D DW_EMAC_DMAGRP_STATUS_NIS_SET_MSK;=0D // Rx interrupt=0D if (DmaStatus & DW_EMAC_DMAGRP_STATUS_RI_SET_MSK) {=0D - *IrqStat |=3D EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;=0D - Mask |=3D DW_EMAC_DMAGRP_STATUS_RI_SET_MSK;=0D - } else {=0D - *IrqStat &=3D ~EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;=0D + if (IrqStat !=3D NULL) {=0D + *IrqStat |=3D EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT;=0D + Mask |=3D DW_EMAC_DMAGRP_STATUS_RI_SET_MSK;=0D + }=0D }=0D +=0D // Tx interrupt=0D if (DmaStatus & DW_EMAC_DMAGRP_STATUS_TI_SET_MSK) {=0D - *IrqStat |=3D EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;=0D - Mask |=3D DW_EMAC_DMAGRP_STATUS_TI_SET_MSK;=0D - } else {=0D - *IrqStat &=3D ~EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;=0D + if (IrqStat !=3D NULL) {=0D + *IrqStat |=3D EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT;=0D + Mask |=3D DW_EMAC_DMAGRP_STATUS_TI_SET_MSK;=0D + }=0D }=0D +=0D // Tx Buffer=0D if (DmaStatus & DW_EMAC_DMAGRP_STATUS_TU_SET_MSK){=0D Mask |=3D DW_EMAC_DMAGRP_STATUS_TU_SET_MSK;=0D --=20 2.25.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107311): https://edk2.groups.io/g/devel/message/107311 Mute This Topic: https://groups.io/mt/100404855/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-