From patchwork Wed Oct 16 06:32:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenzhong Duan X-Patchwork-Id: 3050541 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 7A7F3BF924 for ; Wed, 16 Oct 2013 06:32:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99207201FD for ; Wed, 16 Oct 2013 06:32:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DE55720459 for ; Wed, 16 Oct 2013 06:32:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754040Ab3JPGcM (ORCPT ); Wed, 16 Oct 2013 02:32:12 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:34723 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753702Ab3JPGcI (ORCPT ); Wed, 16 Oct 2013 02:32:08 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r9G6W126020898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 16 Oct 2013 06:32:02 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9G6W0BW008342 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Oct 2013 06:32:00 GMT Received: from abhmt117.oracle.com (abhmt117.oracle.com [141.146.116.69]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r9G6W0A8008331; Wed, 16 Oct 2013 06:32:00 GMT Received: from [10.191.7.247] (/10.191.7.247) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 15 Oct 2013 23:31:59 -0700 Message-ID: <525E32FC.3010604@oracle.com> Date: Wed, 16 Oct 2013 14:32:28 +0800 From: Zhenzhong Duan Reply-To: zhenzhong.duan@oracle.com Organization: oracle User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , xen-devel CC: Bjorn Helgaas , Konrad Rzeszutek Wilk , Feng Jin , Sucheta Chakraborty Subject: [PATCH 1/3] PCI: Refactor restore_msi_irqs - code movement X-Source-IP: acsinet21.oracle.com [141.146.126.237] 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.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Move default_restore_msi_irqs down to reference msi_mask_irq and msix_mask_irq. This patch lays the groundwork for patch titled: 'PCI: Refactor MSI/MSIX mask restore code to fix interrupt lost issue' Tested-by: Sucheta Chakraborty Signed-off-by: Zhenzhong Duan Acked-by: Konrad Rzeszutek Wilk Reviewed-by: Jingoo Han --- drivers/pci/msi.c | 36 ++++++++++++++++++------------------ 1 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index d5f90d6..ecd4cdf 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -116,24 +116,6 @@ void __weak arch_teardown_msi_irqs(struct pci_dev *dev) return default_teardown_msi_irqs(dev); } -void default_restore_msi_irqs(struct pci_dev *dev, int irq) -{ - struct msi_desc *entry; - - entry = NULL; - if (dev->msix_enabled) { - list_for_each_entry(entry, &dev->msi_list, list) { - if (irq == entry->irq) - break; - } - } else if (dev->msi_enabled) { - entry = irq_get_msi_desc(irq); - } - - if (entry) - write_msi_msg(irq, &entry->msg); -} - void __weak arch_restore_msi_irqs(struct pci_dev *dev, int irq) { return default_restore_msi_irqs(dev, irq); @@ -252,6 +234,24 @@ void unmask_msi_irq(struct irq_data *data) msi_set_mask_bit(data, 0); } +void default_restore_msi_irqs(struct pci_dev *dev, int irq) +{ + struct msi_desc *entry; + + entry = NULL; + if (dev->msix_enabled) { + list_for_each_entry(entry, &dev->msi_list, list) { + if (irq == entry->irq) + break; + } + } else if (dev->msi_enabled) { + entry = irq_get_msi_desc(irq); + } + + if (entry) + write_msi_msg(irq, &entry->msg); +} + void __read_msi_msg(struct msi_desc *entry, struct msi_msg *msg) { BUG_ON(entry->dev->current_state != PCI_D0);