[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#999820:



I found the following patch generated against 5.14.0 helps and hasn't
burned the house down in testing so far.

---

diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index 860644d182ab..70c08acd3ee5 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -9034,16 +9034,20 @@ static void niu_try_msix(struct niu *np, u8
*ldg_num_map)
                msi_vec[i].entry = i;
        }

-       num_irqs = pci_enable_msix_range(pdev, msi_vec, 1, num_irqs);
+       if (np->num_ldg == 0)
+               num_irqs = pci_enable_msix_range(pdev, msi_vec, 1, num_irqs);
+
        if (num_irqs < 0) {
                np->flags &= ~NIU_FLAGS_MSIX;
                return;
        }

        np->flags |= NIU_FLAGS_MSIX;
-       for (i = 0; i < num_irqs; i++)
-               np->ldg[i].irq = msi_vec[i].vector;
-       np->num_ldg = num_irqs;
+       if (np->num_ldg == 0) {
+               for (i = 0; i < num_irqs; i++)
+                       np->ldg[i].irq = msi_vec[i].vector;
+               np->num_ldg = num_irqs;
+       }
 }

 static int niu_n2_irq_init(struct niu *np, u8 *ldg_num_map)

---

(I obviously haven't tested it on hardware other than the broken setup.)

I'll try using this for a bit and see if it unexpectedly burns the house down.


Reply to: