From patchwork Mon Apr 1 08:42:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 232680 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 D7BF32C010E for ; Mon, 1 Apr 2013 19:43:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757860Ab3DAInm (ORCPT ); Mon, 1 Apr 2013 04:43:42 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:19780 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757737Ab3DAInm (ORCPT ); Mon, 1 Apr 2013 04:43:42 -0400 Received: from 172.24.2.119 (EHLO szxeml211-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id AZK37234; Mon, 01 Apr 2013 16:43:37 +0800 (CST) Received: from SZXEML423-HUB.china.huawei.com (10.82.67.162) by szxeml211-edg.china.huawei.com (172.24.2.182) with Microsoft SMTP Server (TLS) id 14.1.323.7; Mon, 1 Apr 2013 16:43:37 +0800 Received: from localhost (10.135.76.69) by szxeml423-hub.china.huawei.com (10.82.67.162) with Microsoft SMTP Server id 14.1.323.7; Mon, 1 Apr 2013 16:43:26 +0800 From: Yijing Wang To: Bjorn Helgaas , Tony Luck CC: , , Hanjun Guo , , Yijing Wang , Kenji Kaneshige , Shengzhou Liu Subject: [PATCH 1/2] PCI: decrease pci_dev->enable_cnt when no pcie capability found Date: Mon, 1 Apr 2013 16:42:54 +0800 Message-ID: <1364805775-12396-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 We should decrease dev->enable_cnt when no pcie port capability found for balance. Signed-off-by: Yijing Wang Cc: Jiang Liu Cc: Kenji Kaneshige Cc: Shengzhou Liu --- drivers/pci/pcie/portdrv_core.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index 31063ac..dd95d6f 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c @@ -369,8 +369,10 @@ int pcie_port_device_register(struct pci_dev *dev) /* Get and check PCI Express port services */ capabilities = get_port_device_capability(dev); - if (!capabilities) + if (!capabilities) { + pci_disable_device(dev); return 0; + } pci_set_master(dev); /*