Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751593AbbDBFt4 (ORCPT ); Thu, 2 Apr 2015 01:49:56 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:40672 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750973AbbDBFtx (ORCPT ); Thu, 2 Apr 2015 01:49:53 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Fam Zheng Cc: "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, Bjorn Helgaas , linux-pci@vger.kernel.org, Yinghai Lu , Yijing Wang References: <1427641227-7574-1-git-send-email-mst@redhat.com> <1427641227-7574-3-git-send-email-mst@redhat.com> <20150402033827.GE15412@fam-t430.nay.redhat.com> Date: Thu, 02 Apr 2015 00:45:53 -0500 In-Reply-To: <20150402033827.GE15412@fam-t430.nay.redhat.com> (Fam Zheng's message of "Thu, 2 Apr 2015 11:38:27 +0800") Message-ID: <87lhibt75a.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX18s+YoO53JJbgHTSwNYFR1tBi/UeFZIeUk= X-SA-Exim-Connect-IP: 70.59.163.10 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.7 XMSubLong Long Subject * 1.0 XMGappySubj_02 Gappier still * 0.5 XMGappySubj_01 Very gappy subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Fam Zheng X-Spam-Relay-Country: X-Spam-Timing: total 373 ms - load_scoreonly_sql: 0.20 (0.1%), signal_user_changed: 6 (1.5%), b_tie_ro: 3.7 (1.0%), parse: 1.47 (0.4%), extract_message_metadata: 17 (4.5%), get_uri_detail_list: 3.4 (0.9%), tests_pri_-1000: 7 (1.8%), tests_pri_-950: 1.53 (0.4%), tests_pri_-900: 1.23 (0.3%), tests_pri_-400: 25 (6.7%), check_bayes: 24 (6.3%), b_tokenize: 8 (2.1%), b_tok_get_all: 8 (2.0%), b_comp_prob: 2.4 (0.7%), b_tok_touch_all: 3.2 (0.8%), b_finish: 0.88 (0.2%), tests_pri_0: 302 (81.1%), tests_pri_500: 7 (2.0%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v5 02/10] pci: move pci_msi_init_pci_dev to probe.c X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3287 Lines: 94 Fam Zheng 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 Acked-by: "Eric W. Biederman" 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 >> Signed-off-by: Michael S. Tsirkin >> --- >> 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 >> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/