From: Bandan Das <bsd@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: linux-kernel@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org,
Alex Williamson <alex.williamson@redhat.com>
Subject: Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown
Date: Thu, 12 Mar 2015 23:09:51 -0400 [thread overview]
Message-ID: <jpg8uf1twxs.fsf@redhat.com> (raw)
In-Reply-To: <20150313020919.GD32054@ad.nay.redhat.com> (Fam Zheng's message of "Fri, 13 Mar 2015 10:09:19 +0800")
Ccing Alex, he can probably confirm if my understanding is indeed correct.
Fam Zheng <famz@redhat.com> writes:
> On Thu, 03/12 19:56, Bandan Das wrote:
>> Hi Fam,
>>
>> Fam Zheng <famz@redhat.com> writes:
>>
>> > If the device doesn't support shutdown, disabling interrupts may cause
>> > trouble. For example, virtio-scsi-pci doesn't implement shutdown, and
>> > after we disable MSI-X, futher notifications from device will be
>> > delivered to IRQ, which is unexpected. This IRQ will not be cleared, and
>> > may prevent us from making progress, by keep triggering interrupts.
>> >
>> > Signed-off-by: Fam Zheng <famz@redhat.com>
>> > ---
>> > drivers/pci/pci-driver.c | 7 ++++---
>> > 1 file changed, 4 insertions(+), 3 deletions(-)
>> >
>> > diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
>> > index 3cb2210..fb29c96 100644
>> > --- a/drivers/pci/pci-driver.c
>> > +++ b/drivers/pci/pci-driver.c
>> > @@ -448,10 +448,11 @@ static void pci_device_shutdown(struct device *dev)
>> >
>> > pm_runtime_resume(dev);
>> >
>> > - if (drv && drv->shutdown)
>> > + if (drv && drv->shutdown) {
>> > drv->shutdown(pci_dev);
>> > - pci_msi_shutdown(pci_dev);
>> > - pci_msix_shutdown(pci_dev);
>> > + pci_msi_shutdown(pci_dev);
>> > + pci_msix_shutdown(pci_dev);
>> > + }
>>
>> If the driver doesn't provide a shutdown method and doesn't itself
>> disable MSI/MSI-X, then pci_msi(x)_shutdown won't be called anymore,
>> no ?
>
> Right.
>
>>
>> This is probably ok (but unclean) for a system shutdown, but could
>> cause problems for something like kexec ?
>
> Doesn't the reset in kexec clean this up during initialization?
I guess it would take the same path as a reboot.
> Without shutdown, anything in the driver is unclean anyway, for example
> free_irq is not called.
True, And that is why the MSI/-X shutdown functions are called here
because pci can't always rely on the individual device drivers to do
the right thing, but atleast can make a best effort at cleaning up.
> Fam
next prev parent reply other threads:[~2015-03-13 3:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 5:21 [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown Fam Zheng
2015-03-12 16:21 ` Paolo Bonzini
2015-03-12 23:21 ` Fam Zheng
2015-03-13 13:03 ` Paolo Bonzini
2015-03-12 23:56 ` Bandan Das
2015-03-13 2:09 ` Fam Zheng
2015-03-13 3:09 ` Bandan Das [this message]
2015-03-13 3:17 ` Fam Zheng
2015-03-13 3:35 ` Bandan Das
2015-03-13 4:13 ` Alex Williamson
2015-03-13 4:53 ` Fam Zheng
2015-03-16 12:14 ` Michael S. Tsirkin
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=jpg8uf1twxs.fsf@redhat.com \
--to=bsd@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=bhelgaas@google.com \
--cc=famz@redhat.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