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: 2876861 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DD617BF43F for ; Thu, 12 Sep 2013 08:20:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF9A5202DD for ; Thu, 12 Sep 2013 08:20:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82BCB20257 for ; Thu, 12 Sep 2013 08:20:46 +0000 (UTC) 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 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 +