netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Dullfire <dullfire@yahoo.com>, Bjorn Helgaas <helgaas@kernel.org>
Cc: davem@davemloft.net, sparclinux@vger.kernel.org,
	netdev@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: Kernel panic with niu module
Date: Wed, 06 Nov 2024 18:32:01 +0100	[thread overview]
Message-ID: <87cyj8p8tq.ffs@tglx> (raw)
In-Reply-To: <973e2e20-51d9-4fe4-a361-0e07bcf95bab@yahoo.com>

On Wed, Nov 06 2024 at 10:04, dullfire@yahoo.com wrote:
>> 7d5ec3d36123 had the mask_all() invocation _before_ setting up the the
>> entries and reading back the descriptors. So that commit cannot break
>> the niu device when your problem analysis is correct.
>
> In 7d5ec3d36123 (and later) msix_mask_all() only writes to
> PCI_MSIX_ENTRY_VECTOR_CTRL. I have tried all the MSIX registers, and only 
> writes to PCI_MSIX_ENTRY_DATA were able to prevent a fatal trap on a read.
> However the only write to PCI_MSIX_ENTRY_DATA I see is in
> __pci_write_msi_msg() for 7d5ec3d36123, or pci_write_msg_msix(), in 6.11.5.

Yuck. They really went a great lenght to make this hard to handle.

Something like the obviously uncompiled below should work.

Thanks,

        tglx
---
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -611,6 +611,8 @@ void msix_prepare_msi_desc(struct pci_de
 	if (desc->pci.msi_attrib.can_mask) {
 		void __iomem *addr = pci_msix_desc_addr(desc);
 
+		if (dev->dev_flags & PCI_MSIX_TOUCH_ENTRY_DATA_FIRST)
+			writel(0x0, addr + PCI_MSIX_ENTRY_DATA);
 		desc->pci.msix_ctrl = readl(addr + PCI_MSIX_ENTRY_VECTOR_CTRL);
 	}
 }


  reply	other threads:[~2024-11-06 17:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f7c43842-270e-48f8-ba89-9b5e67910131.ref@yahoo.com>
2024-11-04 11:34 ` Kernel panic with niu module Dullfire
2024-11-04 23:44   ` Bjorn Helgaas
2024-11-05 11:24     ` Dullfire
2024-11-06 15:36     ` Thomas Gleixner
2024-11-06 16:04       ` Dullfire
2024-11-06 17:32         ` Thomas Gleixner [this message]
2024-11-06 22:12           ` Dullfire

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-all 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=87cyj8p8tq.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=dullfire@yahoo.com \
    --cc=helgaas@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).