From patchwork Thu Sep 12 08:20:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 274462 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B25582C039D for ; Thu, 12 Sep 2013 18:20:46 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753895Ab3ILIUp (ORCPT ); Thu, 12 Sep 2013 04:20:45 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:52908 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753348Ab3ILIUo (ORCPT ); Thu, 12 Sep 2013 04:20:44 -0400 Received: from 172.24.2.119 (EHLO szxeml209-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BIE53086; Thu, 12 Sep 2013 16:20:41 +0800 (CST) Received: from SZXEML450-HUB.china.huawei.com (10.82.67.193) by szxeml209-edg.china.huawei.com (172.24.2.184) with Microsoft SMTP Server (TLS) id 14.1.323.7; Thu, 12 Sep 2013 16:20:19 +0800 Received: from localhost (10.135.76.69) by szxeml450-hub.china.huawei.com (10.82.67.193) with Microsoft SMTP Server id 14.1.323.7; Thu, 12 Sep 2013 16:20:13 +0800 From: Yijing Wang To: Bjorn Helgaas CC: , Yijing Wang , Hanjun Guo Subject: [PATCH 2/2] PCI: Warn if power_state != PCI_D0 when write MSI message Date: Thu, 12 Sep 2013 16:20:12 +0800 Message-ID: <1378974012-13364-1-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.11.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.135.76.69] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 --- 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 +