mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Fam Zheng <famz@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	linux-kernel@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	linux-pci@vger.kernel.org,
	Yinghai Lu <yhlu.kernel.send@gmail.com>,
	Yijing Wang <wangyijing@huawei.com>
Subject: Re: [PATCH v5 02/10] pci: move pci_msi_init_pci_dev to probe.c
Date: Thu, 02 Apr 2015 00:45:53 -0500	[thread overview]
Message-ID: <87lhibt75a.fsf@x220.int.ebiederm.org> (raw)
In-Reply-To: <20150402033827.GE15412@fam-t430.nay.redhat.com> (Fam Zheng's message of "Thu, 2 Apr 2015 11:38:27 +0800")

Fam Zheng <famz@redhat.com> writes:

> On Sun, 03/29 17:04, Michael S. Tsirkin wrote:
>> commit d5dea7d95c48d7bc951cee4910a7fd9c0cd26fb0
>>     "PCI: msi: Disable msi interrupts when we initialize a pci device"
>> fixes kexec when the booting kernel does not enable msi interupts.
>> 
>> Unfortunately the relevant functionality is in msi.c so it isn't
>> compiled in when CONFIG_PCI_MSI is off, which means such configurations
>> would still get interrupt storms.
>> 
>> Fix by moving part of the functionality probe.c, and compiling it
>> unconditionally.
>
> Reviewed-by: Fam Zheng <famz@redhat.com>

Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>

I am a little surprised that there are systems that compile out MSI
support, but I do remember the problem being a limitation of the code
when wrote it and given how nasty screaming irqs are during boot up
it seems well worth it to have a little extra code to turn them off.

Eric

>> Cc: Eric W. Biederman <ebiederm@xmission.com>
>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>> ---
>>  drivers/pci/msi.c   | 12 ------------
>>  drivers/pci/probe.c | 16 ++++++++++++++++
>>  2 files changed, 16 insertions(+), 12 deletions(-)
>> 
>> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
>> index 9942f68..f66be86 100644
>> --- a/drivers/pci/msi.c
>> +++ b/drivers/pci/msi.c
>> @@ -1041,18 +1041,6 @@ EXPORT_SYMBOL(pci_msi_enabled);
>>  void pci_msi_init_pci_dev(struct pci_dev *dev)
>>  {
>>  	INIT_LIST_HEAD(&dev->msi_list);
>> -
>> -	/* Disable the msi hardware to avoid screaming interrupts
>> -	 * during boot.  This is the power on reset default so
>> -	 * usually this should be a noop.
>> -	 */
>> -	dev->msi_cap = pci_find_capability(dev, PCI_CAP_ID_MSI);
>> -	if (dev->msi_cap)
>> -		pci_msi_set_enable(dev, 0);
>> -
>> -	dev->msix_cap = pci_find_capability(dev, PCI_CAP_ID_MSIX);
>> -	if (dev->msix_cap)
>> -		pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);
>>  }
>>  
>>  /**
>> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
>> index 8d2f400..50dd934 100644
>> --- a/drivers/pci/probe.c
>> +++ b/drivers/pci/probe.c
>> @@ -1483,10 +1483,26 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn)
>>  	return dev;
>>  }
>>  
>> +static void pci_msi_setup_pci_dev(struct pci_dev *dev)
>> +{
>> +	/* Disable the msi hardware to avoid screaming interrupts
>> +	 * during boot.  This is the power on reset default so
>> +	 * usually this should be a noop.
>> +	 */
>> +	dev->msi_cap = pci_find_capability(dev, PCI_CAP_ID_MSI);
>> +	if (dev->msi_cap)
>> +		pci_msi_set_enable(dev, 0);
>> +
>> +	dev->msix_cap = pci_find_capability(dev, PCI_CAP_ID_MSIX);
>> +	if (dev->msix_cap)
>> +		pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);
>> +}
>> +
>>  static void pci_init_capabilities(struct pci_dev *dev)
>>  {
>>  	/* MSI/MSI-X list */
>>  	pci_msi_init_pci_dev(dev);
>> +	pci_msi_setup_pci_dev(dev);
>>  
>>  	/* Buffers for saving PCIe and PCI-X capabilities */
>>  	pci_allocate_cap_save_buffers(dev);
>> -- 
>> MST
>> 

  reply	other threads:[~2015-04-02  5:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-29 15:03 [PATCH v5 00/10] pci: fix unhandled interrupt on shutdown Michael S. Tsirkin
2015-03-29 15:04 ` [PATCH v5 01/10] pci: export functions for msi/msix ctrl Michael S. Tsirkin
2015-04-02  3:31   ` Fam Zheng
2015-03-29 15:04 ` [PATCH v5 02/10] pci: move pci_msi_init_pci_dev to probe.c Michael S. Tsirkin
2015-04-02  3:38   ` Fam Zheng
2015-04-02  5:45     ` Eric W. Biederman [this message]
2015-03-29 15:04 ` [PATCH v5 03/10] pci: drop some duplicate code Michael S. Tsirkin
2015-04-02  3:52   ` Fam Zheng
2015-03-29 15:04 ` [PATCH v5 04/10] pci: don't disable msi/msix at shutdown Michael S. Tsirkin
2015-04-02  3:54   ` Fam Zheng
2015-04-10 18:33   ` Bjorn Helgaas
2015-04-12  8:52     ` Michael S. Tsirkin
2015-03-29 15:04 ` [PATCH v5 05/10] pci: make msi/msix shutdown functions static Michael S. Tsirkin
2015-04-02  3:55   ` Fam Zheng
2015-03-29 15:04 ` [PATCH v5 06/10] virtio_pci: drop msi_off on probe Michael S. Tsirkin
2015-04-02  3:55   ` Fam Zheng
2015-03-29 15:04 ` [PATCH v5 07/10] ntb: drop pci_msi_off call " Michael S. Tsirkin
2015-03-29 15:04 ` [PATCH v5 08/10] mic: " Michael S. Tsirkin
2015-03-29 15:04 ` [PATCH v5 09/10] pci: drop pci_msi_off calls from quirks Michael S. Tsirkin
2015-03-29 15:04 ` [PATCH v5 10/10] pci: unexport pci_msi_off Michael S. Tsirkin
2015-04-08 22:16 ` [PATCH v5 00/10] pci: fix unhandled interrupt on shutdown 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=87lhibt75a.fsf@x220.int.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=bhelgaas@google.com \
    --cc=famz@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=wangyijing@huawei.com \
    --cc=yhlu.kernel.send@gmail.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

all inboxes | Powered by JetHome®