From patchwork Mon Jul 11 11:50:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Munsie X-Patchwork-Id: 646910 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 3rp3PB1s32z9t0P for ; Mon, 11 Jul 2016 21:52:30 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030690AbcGKLw0 (ORCPT ); Mon, 11 Jul 2016 07:52:26 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:11395 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1030631AbcGKLwX (ORCPT ); Mon, 11 Jul 2016 07:52:23 -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 u6BBnPKj092498 for ; Mon, 11 Jul 2016 07:52:22 -0400 Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) by mx0b-001b2d01.pphosted.com with ESMTP id 243euc6egk-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 11 Jul 2016 07:52:22 -0400 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Jul 2016 21:52:18 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 11 Jul 2016 21:52:17 +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 d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id CF0A13578053 for ; Mon, 11 Jul 2016 21:52:16 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u6BBqGJS11665540 for ; Mon, 11 Jul 2016 21:52:16 +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 u6BBqFQ5031675 for ; Mon, 11 Jul 2016 21:52:16 +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 u6BBqFtY031672; Mon, 11 Jul 2016 21:52:15 +1000 Received: from x230.au.ibm.com (unknown [9.192.198.207]) (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 589FCA01FC; Mon, 11 Jul 2016 21:52:06 +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 , Ian Munsie Subject: [PATCH 13/15] PCI/hotplug: pnv_php: export symbols and move struct types needed by cxl Date: Mon, 11 Jul 2016 21:50:20 +1000 X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468237822-26276-1-git-send-email-imunsie@au.ibm.com> References: <1468237822-26276-1-git-send-email-imunsie@au.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16071111-1617-0000-0000-000001391C7E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16071111-1618-0000-0000-000046405E55 Message-Id: <1468237822-26276-14-git-send-email-imunsie@au.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-11_06:, , 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-1607110122 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 Signed-off-by: Ian Munsie Acked-by: Gavin Shan --- V1->V2: - Dropped extraneous "select HOTPLUG_PCI_POWERNV_BASE" in Kconfig, which was accidentally left in from an earlier non-public revision. Thanks to Gavin Shan for pointing it out --- arch/powerpc/include/asm/pnv-pci.h | 28 ++++++++++++++++++++++++++++ drivers/pci/hotplug/pnv_php.c | 32 +++++--------------------------- 2 files changed, 33 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/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) {