[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.0.1 64/73] igb: Clear IMS bits when committing ICR access
From: |
Michael Tokarev |
Subject: |
[Stable-8.0.1 64/73] igb: Clear IMS bits when committing ICR access |
Date: |
Sun, 28 May 2023 09:57:02 +0300 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
The datasheet says contradicting statements regarding ICR accesses so it
is not reliable to determine the behavior of ICR accesses. However,
e1000e does clear IMS bits when reading ICR accesses and Linux also
expects ICR accesses will clear IMS bits according to:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/net/ethernet/intel/igb/igb_main.c?h=v6.2#n8048
Fixes: 3a977deebe ("Intrdocue igb device emulation")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit f0b1df5c4502b5ec89f83417924935ab201511d0)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
index bc7af7963a..e0ee70d1d7 100644
--- a/hw/net/igb_core.c
+++ b/hw/net/igb_core.c
@@ -2451,16 +2451,16 @@ igb_set_ims(IGBCore *core, int index, uint32_t val)
static void igb_commit_icr(IGBCore *core)
{
/*
- * If GPIE.NSICR = 0, then the copy of IAM to IMS will occur only if at
+ * If GPIE.NSICR = 0, then the clear of IMS will occur only if at
* least one bit is set in the IMS and there is a true interrupt as
* reflected in ICR.INTA.
*/
if ((core->mac[GPIE] & E1000_GPIE_NSICR) ||
(core->mac[IMS] && (core->mac[ICR] & E1000_ICR_INT_ASSERTED))) {
- igb_set_ims(core, IMS, core->mac[IAM]);
- } else {
- igb_update_interrupt_state(core);
+ igb_clear_ims_bits(core, core->mac[IAM]);
}
+
+ igb_update_interrupt_state(core);
}
static void igb_set_icr(IGBCore *core, int index, uint32_t val)
--
2.39.2
- [Stable-8.0.1 v3 00/59] Patch Round-up for stable 8.0.1, frozen on 2023-05-27, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 60/73] e1000e: Fix tx/rx counters, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 62/73] igb: Fix Rx packet type encoding, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 61/73] e1000x: Fix BPRC and MPRC, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 63/73] igb: Do not require CTRL.VME for tx VLAN tagging, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 66/73] e1000e: Always copy ethernet header, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 65/73] net/net_rx_pkt: Use iovec for net_rx_pkt_set_protocols(), Michael Tokarev, 2023/05/28
- [Stable-8.0.1 64/73] igb: Clear IMS bits when committing ICR access,
Michael Tokarev <=
- [Stable-8.0.1 67/73] igb: Always copy ethernet header, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 68/73] rtl8139: fix large_send_mss divide-by-zero, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 69/73] util/vfio-helpers: Use g_file_read_link(), Michael Tokarev, 2023/05/28
- [Stable-8.0.1 70/73] usb/ohci: Set pad to 0 after frame update, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 72/73] machine: do not crash if default RAM backend name has been stolen, Michael Tokarev, 2023/05/28
- [Stable-8.0.1 71/73] hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI controller (CVE-2023-0330), Michael Tokarev, 2023/05/28
- [Stable-8.0.1 73/73] virtio: qmp: fix memory leak, Michael Tokarev, 2023/05/28