public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pciehp:  Handle interrupts that happen during initialization.
Date: Tue, 17 Feb 2009 15:17:18 -0800	[thread overview]
Message-ID: <m1y6w4u001.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <49991D8C.1050705@jp.fujitsu.com> (Kenji Kaneshige's message of "Mon\, 16 Feb 2009 17\:02\:20 +0900")

Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> writes:

> Eric W. Biederman wrote:
>> ebiederm@xmission.com (Eric W. Biederman) writes:
>> 
>>> And on the big gotcha's I have found one more I am tracking.
>>>
>>> I am seeing pci bridges with a NULL pointer for the subordinate bus.
>>> Earlier I had thought that this was a symptom of the double remove
>>> but I have been able to reproduce it without that.
>>>
>>> On just a little bit deeper investigation it looks like the cases
>>> are dying are all coming when the nested bridge reappears.
>>>
>>> Which is wrong on so many levels as I am toggle power to the outer
>>> slot, so the nested bridge should not even exist at that time.  Ugh.
>>> More tracing to for me on that one.
>> 
>> Ok. Got it.  I was processing the interrupt for a device after it had
>> been hot removed but before the device state had disappeared.
>> 
>> pcie_isr looks like it would be even worse in that situation.  Looping forever
>> if pciehp_readw(ctrl, PCIE_EXPSLTA) always succeed sand returns 0xffff.
>> 
>> That loop in there appears impossibly misguided.  If the pending interrupt
>> values change after you have received the interrupt another instance
>> of the same interrupt should be pending so the loop should be completely
>> unnecessary.
>> 
>
> For level-triggered interrupt, I think it's true.
>
> But for edge-triggered interrupt, I don't think it's true. I think
> only one interrupt is generated if the first hotplug event occurs
> and the second hotplug event occurs before clearing the status of
> first hotplug event.

My test case is edge-triggered MSI's.  The issue is that I get an interrupt
from the card that I am unplugging, but by the time the interrupt handler
is executed the card is physically absent, but the pci_dev structure is
still present in the kernel.

Eric

  reply	other threads:[~2009-02-17 23:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29  3:31 [PATCH] pciehp: Handle interrupts that happen during initialization Eric W. Biederman
2009-01-29  7:34 ` Kenji Kaneshige
2009-02-13 19:29   ` Jesse Barnes
2009-02-14  4:06     ` Eric W. Biederman
2009-02-14 12:53       ` Eric W. Biederman
2009-02-14 14:56         ` Eric W. Biederman
2009-02-16  8:02           ` Kenji Kaneshige
2009-02-17 23:17             ` Eric W. Biederman [this message]
2009-02-18  5:48               ` Kenji Kaneshige
2009-02-23 11:08                 ` Eric W. Biederman
2009-02-24 17:05                   ` Jesse Barnes
2009-02-24 17:08                   ` Jesse Barnes
2009-02-16  8:00       ` Kenji Kaneshige
2009-02-18  0:40         ` Eric W. Biederman
2009-02-18  7:12           ` Kenji Kaneshige
2009-02-18  8:47             ` Eric W. Biederman
2009-02-20  6:18               ` Kenji Kaneshige
2009-02-23 11:17               ` Eric W. Biederman
2009-02-24 17:38 ` Jesse Barnes

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=m1y6w4u001.fsf@fess.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@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