From patchwork Mon Jul 4 13:22:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Munsie X-Patchwork-Id: 9212661 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4CA6C60572 for ; Mon, 4 Jul 2016 13:23:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E960286FC for ; Mon, 4 Jul 2016 13:23:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33212286FE; Mon, 4 Jul 2016 13:23:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACF8F286FC for ; Mon, 4 Jul 2016 13:23:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753403AbcGDNXI (ORCPT ); Mon, 4 Jul 2016 09:23:08 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:3701 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753695AbcGDNXE (ORCPT ); Mon, 4 Jul 2016 09:23:04 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u64DIekl069617 for ; Mon, 4 Jul 2016 09:23:03 -0400 Received: from e23smtp09.au.ibm.com (e23smtp09.au.ibm.com [202.81.31.142]) by mx0b-001b2d01.pphosted.com with ESMTP id 23x9rkmyr2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 04 Jul 2016 09:23:03 -0400 Received: from localhost by e23smtp09.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 Jul 2016 23:22:58 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp09.au.ibm.com (202.81.31.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 4 Jul 2016 23:22:56 +1000 X-IBM-Helo: d23dlp03.au.ibm.com X-IBM-MailFrom: imunsie@au1.ibm.com X-IBM-RcptTo: linux-pci@vger.kernel.org Received: from d23relay06.au.ibm.com (d23relay06.au.ibm.com [9.185.63.219]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 98ADD3578058 for ; Mon, 4 Jul 2016 23:22:55 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay06.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u64DMt1a12059006 for ; Mon, 4 Jul 2016 23:22:55 +1000 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u64DMsjI018102 for ; Mon, 4 Jul 2016 23:22:55 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u64DMstR018099; Mon, 4 Jul 2016 23:22:54 +1000 Received: from x230.au.ibm.com (unknown [9.192.161.209]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 56793A0389; Mon, 4 Jul 2016 23:22:53 +1000 (AEST) From: "Ian Munsie" To: Michael Ellerman , Michael Neuling , Frederic Barrat , Andrew Donnellan , linuxppc-dev@lists.ozlabs.org, Huy Nguyen Cc: Gavin Shan , linux-pci@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 12/14] PCI/hotplug: pnv_php: export symbols and move struct types needed by cxl Date: Mon, 4 Jul 2016 23:22:10 +1000 X-Mailer: git-send-email 2.8.1 In-Reply-To: <1467638532-9250-1-git-send-email-imunsie@au.ibm.com> References: <1467638532-9250-1-git-send-email-imunsie@au.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16070413-0052-0000-0000-000001AA6289 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16070413-0053-0000-0000-0000064FC8C5 Message-Id: <1467638532-9250-13-git-send-email-imunsie@au.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-04_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607040124 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andrew Donnellan The cxl driver will use infrastructure from pnv_php to handle device tree updates when switching bi-modal CAPI cards into CAPI mode. To enable this, export pnv_php_find_slot() and pnv_php_set_slot_power_state(), and add corresponding declarations, as well as the definition of struct pnv_php_slot, to asm/pnv-pci.h. Cc: Gavin Shan Cc: linux-pci@vger.kernel.org Cc: Bjorn Helgaas Signed-off-by: Andrew Donnellan Acked-by: Gavin Shan --- arch/powerpc/include/asm/pnv-pci.h | 28 ++++++++++++++++++++++++++++ drivers/pci/hotplug/Kconfig | 1 + drivers/pci/hotplug/pnv_php.c | 32 +++++--------------------------- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/arch/powerpc/include/asm/pnv-pci.h b/arch/powerpc/include/asm/pnv-pci.h index c47097f..0cbd813 100644 --- a/arch/powerpc/include/asm/pnv-pci.h +++ b/arch/powerpc/include/asm/pnv-pci.h @@ -11,6 +11,7 @@ #define _ASM_PNV_PCI_H #include +#include #include #include @@ -47,4 +48,31 @@ void pnv_cxl_phb_set_peer_afu(struct pci_dev *dev, struct cxl_afu *afu); #endif +struct pnv_php_slot { + struct hotplug_slot slot; + struct hotplug_slot_info slot_info; + uint64_t id; + char *name; + int slot_no; + struct kref kref; +#define PNV_PHP_STATE_INITIALIZED 0 +#define PNV_PHP_STATE_REGISTERED 1 +#define PNV_PHP_STATE_POPULATED 2 +#define PNV_PHP_STATE_OFFLINE 3 + int state; + struct device_node *dn; + struct pci_dev *pdev; + struct pci_bus *bus; + bool power_state_check; + void *fdt; + void *dt; + struct of_changeset ocs; + struct pnv_php_slot *parent; + struct list_head children; + struct list_head link; +}; +extern struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn); +extern int pnv_php_set_slot_power_state(struct hotplug_slot *slot, + uint8_t state); + #endif diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig index aadce45..b719a72 100644 --- a/drivers/pci/hotplug/Kconfig +++ b/drivers/pci/hotplug/Kconfig @@ -117,6 +117,7 @@ config HOTPLUG_PCI_POWERNV tristate "PowerPC PowerNV PCI Hotplug driver" depends on PPC_POWERNV && EEH select OF_DYNAMIC + select HOTPLUG_PCI_POWERNV_BASE help Say Y here if you run PowerPC PowerNV platform that supports PCI Hotplug diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 6086db6..2d2f704 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c @@ -22,30 +22,6 @@ #define DRIVER_AUTHOR "Gavin Shan, IBM Corporation" #define DRIVER_DESC "PowerPC PowerNV PCI Hotplug Driver" -struct pnv_php_slot { - struct hotplug_slot slot; - struct hotplug_slot_info slot_info; - uint64_t id; - char *name; - int slot_no; - struct kref kref; -#define PNV_PHP_STATE_INITIALIZED 0 -#define PNV_PHP_STATE_REGISTERED 1 -#define PNV_PHP_STATE_POPULATED 2 -#define PNV_PHP_STATE_OFFLINE 3 - int state; - struct device_node *dn; - struct pci_dev *pdev; - struct pci_bus *bus; - bool power_state_check; - void *fdt; - void *dt; - struct of_changeset ocs; - struct pnv_php_slot *parent; - struct list_head children; - struct list_head link; -}; - static LIST_HEAD(pnv_php_slot_list); static DEFINE_SPINLOCK(pnv_php_lock); @@ -91,7 +67,7 @@ static struct pnv_php_slot *pnv_php_match(struct device_node *dn, return NULL; } -static struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn) +struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn) { struct pnv_php_slot *php_slot, *tmp; unsigned long flags; @@ -108,6 +84,7 @@ static struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn) return NULL; } +EXPORT_SYMBOL_GPL(pnv_php_find_slot); /* * Remove pdn for all children of the indicated device node. @@ -316,8 +293,8 @@ out: return ret; } -static int pnv_php_set_slot_power_state(struct hotplug_slot *slot, - uint8_t state) +int pnv_php_set_slot_power_state(struct hotplug_slot *slot, + uint8_t state) { struct pnv_php_slot *php_slot = slot->private; struct opal_msg msg; @@ -347,6 +324,7 @@ static int pnv_php_set_slot_power_state(struct hotplug_slot *slot, return ret; } +EXPORT_SYMBOL_GPL(pnv_php_set_slot_power_state); static int pnv_php_get_power_state(struct hotplug_slot *slot, u8 *state) {