public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Wen Xiong <wenxiong@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, gjoyce@linux.ibm.com,
	linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/1] genirq/msi: Dynamic remove/add stroage adapter hits EEH
Date: Thu, 20 Mar 2025 09:23:06 +0100	[thread overview]
Message-ID: <877c4k3yc5.ffs@tglx> (raw)
In-Reply-To: <90777da90abe02c87d30968bfedc9168@linux.ibm.com>

On Wed, Mar 19 2025 at 21:58, Wen Xiong wrote:
>> The real problem has nothing to do with a remove/add operation. The
>> problem is solely in the probe function.
>
> I don't think we have problems in probe function since this driver has 
> been in productions for many many years.

Seriously?

It does not matter at all whether you had it many years in production or
not. Fact is that the driver is operational and after that a device
reset happens, which wipes the config space. That _IS_ the problem.

> Also we didn't see the issue before the "MSI domain" patchset dropping 
> into linux interrupt code(no issue in rhel92 release).

That's completely irrelevant. See above.

> Device reset is not called in probe function.

Right. The reset is part of PCI error handling, which happens _AFTER_
the driver has set up interrupts.

> We don't see the issue without dynamically remove/add operation.
> There is a small window which irqbalance daemon kicks in during device
> reset. So it took about over 6 hours to recreate the issue when doing
> remove/add loop operation.

Sure. You need a loop to hit the window. And it does not matter whether
it's the probe or the remove which triggers it. Fact is that the reset
wipes out the config space, which means that any read from the config
space between reset and restore will return garbage. That problem is not
restricted to the interrupt code. It's a general problem.

> We can't find the good way to fix the issue in both of device drivers. 
> So we look for some help in interrupt code.

No. This is _NOT_ a interrupt specific problem. You are observing the
symptom related to interrupts, but any other code which reads from
config space during the reset window has exactly the same problem.

The PCI error handling resets the device asynchronously to any other
operation which might access the config space. Yes, set_affinity() is
one possible way to hit that due to the implementation detail of
pseries_msi_compose_msg(), which reads the MSI message composed by the
underlying hypervisor back from config space. But even if it would not
read back and compose the message itself then set_affinity() would
create inconsistent state because:

       reset()
                        compose()
                        write()
       restore()

I.e. the reset machinery overwrites the new message, which means this
ends up with inconsistent state.

So this is a general problem with PCI error handling and _not_ a problem
of the interrupt subsystem. I have no idea what to do about that, but
this needs to be looked at from the PCI error handling side and not
papered over at the messenger.

Thanks,

        tglx

  reply	other threads:[~2025-03-20  8:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-19 12:14 [PATCH 1/1] genirq/msi: Dynamic remove/add stroage adapter hits EEH wenxiong
2025-03-19 16:15 ` Thomas Gleixner
2025-03-20  2:58   ` Wen Xiong
2025-03-20  8:23     ` Thomas Gleixner [this message]
2025-03-20  8:48       ` Thomas Gleixner
2025-03-27 21:36         ` Wen Xiong
2025-03-28 11:27           ` Thomas Gleixner
2025-04-01 20:14             ` Wen Xiong
2025-04-02  8:33               ` Thomas Gleixner

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=877c4k3yc5.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=gjoyce@linux.ibm.com \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=wenxiong@linux.ibm.com \
    /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