linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] PCI: Warn if power_state != PCI_D0 when write MSI message
@ 2013-09-12  8:20 Yijing Wang
  2013-09-27 21:03 ` Bjorn Helgaas
  0 siblings, 1 reply; 5+ messages in thread
From: Yijing Wang @ 2013-09-12  8:20 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci, Yijing Wang, Hanjun Guo

When we setup MSI, if device power state is not equal to PCI_D0,
system will silently ignore writing MSI message, but pci_enable_msi()
still return 0 which seems setup successfully. So we should warn here
to help diagnose this issue.

Signed-off-by: Yijing Wang <wangyijing@huawei.com>
---
 drivers/pci/msi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index aca7578..25ed59d 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -291,6 +291,8 @@ void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg)
 {
 	if (entry->dev->current_state != PCI_D0) {
 		/* Don't touch the hardware now */
+		dev_warn(&entry->dev->dev,
+			"current_state != PCI_D0, ignore writing MSI message!\n");
 	} else if (entry->msi_attrib.is_msix) {
 		void __iomem *base;
 		base = entry->mask_base +
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-09-29  1:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-12  8:20 [PATCH 2/2] PCI: Warn if power_state != PCI_D0 when write MSI message Yijing Wang
2013-09-27 21:03 ` Bjorn Helgaas
2013-09-28  2:28   ` Ben Hutchings
2013-09-29  1:38     ` Yijing Wang
2013-09-29  1:32   ` Yijing Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).