From patchwork Mon Jul 4 13:22:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Munsie X-Patchwork-Id: 9212659 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 267A860572 for ; Mon, 4 Jul 2016 13:23:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 185B3286FA for ; Mon, 4 Jul 2016 13:23:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C2F9286F9; Mon, 4 Jul 2016 13:23:08 +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 D8844286F9 for ; Mon, 4 Jul 2016 13:23:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753746AbcGDNXF (ORCPT ); Mon, 4 Jul 2016 09:23:05 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:24105 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753670AbcGDNXE (ORCPT ); Mon, 4 Jul 2016 09:23:04 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u64DIjXc126787 for ; Mon, 4 Jul 2016 09:23:02 -0400 Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by mx0b-001b2d01.pphosted.com with ESMTP id 23x7ruyp3u-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 04 Jul 2016 09:23:02 -0400 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 Jul 2016 23:22:59 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 4 Jul 2016 23:22:57 +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 d23relay08.au.ibm.com (d23relay08.au.ibm.com [9.185.71.33]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 3D80F3578052 for ; Mon, 4 Jul 2016 23:22:57 +1000 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u64DMvrO11600184 for ; Mon, 4 Jul 2016 23:22:57 +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 u64DMt9J018134 for ; Mon, 4 Jul 2016 23:22:56 +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 u64DMstT018099; Mon, 4 Jul 2016 23:22:55 +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 F1195A01E4; Mon, 4 Jul 2016 23:22:54 +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 13/14] PCI/hotplug: pnv_php: handle OPAL_PCI_SLOT_OFFLINE power state Date: Mon, 4 Jul 2016 23:22:11 +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-0016-0000-0000-000001AE454F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16070413-0017-0000-0000-000004F2B4FF Message-Id: <1467638532-9250-14-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 When calling pnv_php_set_slot_power_state() with state == OPAL_PCI_SLOT_OFFLINE, remove devices from the device tree as if we're dealing with OPAL_PCI_SLOT_POWER_OFF. Cc: Gavin Shan Cc: linux-pci@vger.kernel.org Cc: Bjorn Helgaas Signed-off-by: Andrew Donnellan Acked-by: Gavin Shan --- drivers/pci/hotplug/pnv_php.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 2d2f704..e6245b0 100644 --- a/drivers/pci/hotplug/pnv_php.c +++ b/drivers/pci/hotplug/pnv_php.c @@ -317,7 +317,7 @@ int pnv_php_set_slot_power_state(struct hotplug_slot *slot, return ret; } - if (state == OPAL_PCI_SLOT_POWER_OFF) + if (state == OPAL_PCI_SLOT_POWER_OFF || state == OPAL_PCI_SLOT_OFFLINE) pnv_php_rmv_devtree(php_slot); else ret = pnv_php_add_devtree(php_slot);