From patchwork Sun Nov 17 23:48:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dullfire X-Patchwork-Id: 13877991 X-Patchwork-Delegate: kuba@kernel.org Received: from sonic304-10.consmr.mail.bf2.yahoo.com (sonic304-10.consmr.mail.bf2.yahoo.com [74.6.128.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E5BD4437 for ; Mon, 18 Nov 2024 00:00:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.6.128.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731888015; cv=none; b=OobtZfZiwMvU7iZmbArWWsczAMReK/8rCI9uE304ur/35XGinsNDLSttwMe4KggPa90EoJczz2bAThqBVeK93ZzNhLMLLOaudGx6cazxojySFqVvUE3aE3bu/mPaWvrGCEDtXf6dynXeaLLkHEctANTDxEIC9e7ZHQFYmoo4gGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731888015; c=relaxed/simple; bh=YUce759kQ7h05bVUbjxEdZsIcSJvZgYa1EEcx85iesg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UMkxXZgzdozuLZ7xyeb4cfeKDoNk88dfIAlh6YS2AGzWzo4Ty6t8UTs9tAN1bdNUISMF1EKD/RIiJzi0Eu0TbMOJh20fvkG757aeSu2Km9t85+MIiMg7q5ULvdJDxtQwEL4G+EwgNzdD33Xj5Yjrxw1VQ5GqCvjDbhz8m8yVpIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com; spf=pass smtp.mailfrom=yahoo.com; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b=FRvxydlV; arc=none smtp.client-ip=74.6.128.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b="FRvxydlV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1731888013; bh=sRhtt7tAu+00jSTS4pSlYyOtlC3u9JS4ZajQtj5R2sU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=FRvxydlVb9DnHyEB0Qd/+Jdbm0txBdhQGXsrLlDLRK934aF5HsgdrG9p5Hh/GxMw5Yo9xlnyoS0IEHTeu8JDsRpa0eg1BK2T9cvd8JrVMnM31a/DYYVKTaahOw9TjRziqTLBtpPCkIZ4Rsdkve22qSlSHmPTRLZBLHKte/1UkUJoad1vRDRLo3T2nmEC2SPfEoC/ar0ZxDIVosPX/smOrb5LdsN0WeOf9atLEXHtfDvxCbO2MpgA32BzFpEP7s4UImM4XX+8S7dMSh7sEMaydLfGNkehiFEAg/iOtTdzqBxdFzuI9M/JSwqItn4yu3HvlG/P904NUnpKdPIjxiI+Dg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1731888013; bh=86UgW5vsC9UFrjd/hPlhn2JVBmMFjshctjO7PaDmBy3=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=r40Bvl7ZitVnSHPk9YSFgJnTr7vUsE07pS9a66BSzakWztGzsyoBRa5okAqwJCMaFKV5xnKLG7bJPFlk1J9KC4DoLSQwGULvtpNDo9OfbjRqZFDrbp4XXwFhgXN8g6dBABeoeaUmBujMzHsXHTPVx0JATzgqBAPr36uD2ZfAUozh+s+brDCtosyJFspssiR2QhlYWtpcLOGXnHOsl3vQN3oaKq8UMzzH9LEnRNq52cQdHcrwRmvxQtIQeDPJR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Sey.W4MKDHgDYnDG mZC0AIx0.vS6_c5LaZfuBTgbjVs2T2QZ8EuD6M255ovBVxKFJFIG7bFPEkpGWdCc9F1EAMoxKO3a voaFOv3amheJ9SPlp4oVcAL0VsZXRGeStRabj_tOOq.OnmN66NgA.iYQoYJj70bwiwtnnq912SSB XdH7kZ0HrmNz2V4GLvyEm0jNIKAVoOoZirS_MVWB896H1WqY9yLdJUkJ_1o73VEIf4VmyUxJ86Fb Na5SOQDQIkhj5DHSgwGTV5R967U4dzs.dTUPuj3XIfsGx8fYGU8Ie6d3XbuSu0CNedazwqlzDaov cC.aNhpdN X-Sonic-MF: X-Sonic-ID: fdd3bdbc-4c3b-4a06-a8ff-2ca1c6d1e07c Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.bf2.yahoo.com with HTTP; Mon, 18 Nov 2024 00:00:13 +0000 Received: by hermes--production-ne1-bfc75c9cd-n46s2 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID c49c6779fa1a016527bc8d82f3fd465e; Sun, 17 Nov 2024 23:50:01 +0000 (UTC) From: dullfire@yahoo.com To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bjorn Helgaas , Jacob Keller , Simon Horman , Thomas Gleixner , Mostafa Saleh , Marc Zyngier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: Jonathan Currier , stable@vger.kernel.org Subject: [PATCH 2/2] net/niu: niu requires MSIX ENTRY_DATA fields touch before entry reads Date: Sun, 17 Nov 2024 17:48:43 -0600 Message-ID: <20241117234843.19236-3-dullfire@yahoo.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241117234843.19236-1-dullfire@yahoo.com> References: <20241117234843.19236-1-dullfire@yahoo.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org From: Jonathan Currier Fix niu_try_msix() to not cause a fatal trap on sparc systems. Set PCI_DEV_FLAGS_MSIX_TOUCH_ENTRY_DATA_FIRST on the struct pci_dev to work around a bug in the hardware or firmware. For each vector entry in the msix table, niu chips will cause a fatal trap if any registers in that entry are read before that entries' ENTRY_DATA register is written to. Testing indicates writes to other registers are not sufficient to prevent the fatal trap, however the value does not appear to matter. This only needs to happen once after power up, so simply rebooting into a kernel lacking this fix will NOT cause the trap. NON-RESUMABLE ERROR: Reporting on cpu 64 NON-RESUMABLE ERROR: TPC [0x00000000005f6900] NON-RESUMABLE ERROR: RAW [4010000000000016:00000e37f93e32ff:0000000202000080:ffffffffffffffff NON-RESUMABLE ERROR: 0000000800000000:0000000000000000:0000000000000000:0000000000000000] NON-RESUMABLE ERROR: handle [0x4010000000000016] stick [0x00000e37f93e32ff] NON-RESUMABLE ERROR: type [precise nonresumable] NON-RESUMABLE ERROR: attrs [0x02000080] < ASI sp-faulted priv > NON-RESUMABLE ERROR: raddr [0xffffffffffffffff] NON-RESUMABLE ERROR: insn effective address [0x000000c50020000c] NON-RESUMABLE ERROR: size [0x8] NON-RESUMABLE ERROR: asi [0x00] CPU: 64 UID: 0 PID: 745 Comm: kworker/64:1 Not tainted 6.11.5 #63 Workqueue: events work_for_cpu_fn TSTATE: 0000000011001602 TPC: 00000000005f6900 TNPC: 00000000005f6904 Y: 00000000 Not tainted TPC: g0: 00000000000002e9 g1: 000000000000000c g2: 000000c50020000c g3: 0000000000000100 g4: ffff8000470307c0 g5: ffff800fec5be000 g6: ffff800047a08000 g7: 0000000000000000 o0: ffff800014feb000 o1: ffff800047a0b620 o2: 0000000000000011 o3: ffff800047a0b620 o4: 0000000000000080 o5: 0000000000000011 sp: ffff800047a0ad51 ret_pc: 00000000005f7128 RPC: <__pci_enable_msix_range+0x3cc/0x460> l0: 000000000000000d l1: 000000000000c01f l2: ffff800014feb0a8 l3: 0000000000000020 l4: 000000000000c000 l5: 0000000000000001 l6: 0000000020000000 l7: ffff800047a0b734 i0: ffff800014feb000 i1: ffff800047a0b730 i2: 0000000000000001 i3: 000000000000000d i4: 0000000000000000 i5: 0000000000000000 i6: ffff800047a0ae81 i7: 00000000101888b0 I7: Call Trace: [<00000000101888b0>] niu_try_msix.constprop.0+0xc0/0x130 [niu] [<000000001018f840>] niu_get_invariants+0x183c/0x207c [niu] [<00000000101902fc>] niu_pci_init_one+0x27c/0x2fc [niu] [<00000000005ef3e4>] local_pci_probe+0x28/0x74 [<0000000000469240>] work_for_cpu_fn+0x8/0x1c [<000000000046b008>] process_scheduled_works+0x144/0x210 [<000000000046b518>] worker_thread+0x13c/0x1c0 [<00000000004710e0>] kthread+0xb8/0xc8 [<00000000004060c8>] ret_from_fork+0x1c/0x2c [<0000000000000000>] 0x0 Kernel panic - not syncing: Non-resumable error. Fixes: 7d5ec3d36123 ("PCI/MSI: Mask all unused MSI-X entries") Cc: stable@vger.kernel.org Signed-off-by: Jonathan Currier --- drivers/net/ethernet/sun/niu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 41a27ae58ced..f5449b73b9a7 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -9058,6 +9058,8 @@ static void niu_try_msix(struct niu *np, u8 *ldg_num_map) msi_vec[i].entry = i; } + pdev->dev_flags |= PCI_DEV_FLAGS_MSIX_TOUCH_ENTRY_DATA_FIRST; + num_irqs = pci_enable_msix_range(pdev, msi_vec, 1, num_irqs); if (num_irqs < 0) { np->flags &= ~NIU_FLAGS_MSIX;