From patchwork Sun Feb 19 23:57:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 729679 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vRNzK2J7Wz9s86 for ; Mon, 20 Feb 2017 10:59:41 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vRNzK1RbJzDqHZ for ; Mon, 20 Feb 2017 10:59:41 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vRNyy63wszDqGx for ; Mon, 20 Feb 2017 10:59:22 +1100 (AEDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1JNwOde044307 for ; Sun, 19 Feb 2017 18:59:20 -0500 Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) by mx0a-001b2d01.pphosted.com with ESMTP id 28pphukw8v-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Sun, 19 Feb 2017 18:59:20 -0500 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Feb 2017 09:59:17 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 20 Feb 2017 09:59:16 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id 609692CE8054 for ; Mon, 20 Feb 2017 10:59:16 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1JNx8kT35455170 for ; Mon, 20 Feb 2017 10:59:16 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1JNwinn018831 for ; Mon, 20 Feb 2017 10:58:44 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1JNwiCi018341; Mon, 20 Feb 2017 10:58:44 +1100 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id 111AEA03B2; Mon, 20 Feb 2017 10:57:58 +1100 (AEDT) Received: from gwshan.ozlabs.ibm.com (shangw.ozlabs.ibm.com [10.61.2.199]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id 045FEE38CA; Mon, 20 Feb 2017 10:57:58 +1100 (AEDT) Received: by gwshan.ozlabs.ibm.com (Postfix, from userid 1000) id EBE0DAC24C7; Mon, 20 Feb 2017 10:57:57 +1100 (AEDT) From: Gavin Shan To: skiboot@lists.ozlabs.org Date: Mon, 20 Feb 2017 10:57:51 +1100 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487548672-20356-1-git-send-email-gwshan@linux.vnet.ibm.com> References: <1487548672-20356-1-git-send-email-gwshan@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17021923-1617-0000-0000-000001AA1343 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17021923-1618-0000-0000-000047C35554 Message-Id: <1487548672-20356-8-git-send-email-gwshan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-19_18:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1702190236 Subject: [Skiboot] [PATCH v2 7/8] astbmc/p8dnu: Enable PCI slot's power supply on PEX8718 in hot-add path X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: hankmax0000@gmail.com, Gavin Shan , williel@supermicro.com.tw MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" This issue is reported from superMicro's "p8dnu" platform. PEX8718 is connected to PHB direct slot. We create dynamic PCI slots for its (2) downstream ports and all of them support surprise hotplug capability. The problem is power supply lost on hot-remove and it isn't turned on automatically on hot-add. It means the PCIe link behind the slot isn't up and the PCI adapter behind the slot can't be probed successfully. This fixes the issue by forcing to turn on the power supply on hardware when user (kernel) requests to do so, as we did for PEX9733. Reported-by: Hank Chang Signed-off-by: Gavin Shan Tested-by: Willie Liauw --- platforms/astbmc/slots.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platforms/astbmc/slots.c b/platforms/astbmc/slots.c index f28ad7d..8be7426 100644 --- a/platforms/astbmc/slots.c +++ b/platforms/astbmc/slots.c @@ -175,9 +175,11 @@ static void create_dynamic_slot(struct phb *phb, struct pci_device *pd) * isn't turned on automatically when inserting PCI adapter to * the slot at later point. We set a flag to the slot here, to * turn on the power supply in (suprise or managed) hot-add path. + * + * We have same issue with PEX8718 as above on "p8dnu" platform. */ - if (dt_node_is_compatible(dt_root, "supermicro,p8dnu") && - slot->pd && slot->pd->vdid == 0x973310b5) + if (dt_node_is_compatible(dt_root, "supermicro,p8dnu") && slot->pd && + (slot->pd->vdid == 0x973310b5 || slot->pd->vdid == 0x871810b5)) pci_slot_add_flags(slot, PCI_SLOT_FLAG_FORCE_POWERON); }