From patchwork Wed Nov 7 00:52:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 994018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42qSZM6wbNz9sDL for ; Wed, 7 Nov 2018 11:52:59 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cxQL5Txz"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42qSZM4RrkzF3Dy for ; Wed, 7 Nov 2018 11:52:59 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cxQL5Txz"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::642; helo=mail-pl1-x642.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cxQL5Txz"; dkim-atps=neutral Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42qSZD2PMwzF3DW for ; Wed, 7 Nov 2018 11:52:52 +1100 (AEDT) Received: by mail-pl1-x642.google.com with SMTP id o19-v6so7021063pll.12 for ; Tue, 06 Nov 2018 16:52:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GoKu1mHAq2ym2ooC7E2fGmlcLx9kahMK972pMVLN7MI=; b=cxQL5TxzKDeJjUiKo9mtAgkFFXVkpQ/pBlyCYr5gd5exkh5onjfskt6QcHzNZ0W+jW g+/LCZLT74+2XfOAnSBbXb6sE6/ppKHm6U60TOYOIUJ2n2T85XJtHfBFXyHIsnHsmd8k kh8UjCy17t5pHk0oD3QOvwFOWdSM1PJJikP4a+1fdVeDeZxqD5scR5J7HEErtKqMdfR9 a4T9n+/8J22ABrq3SlOr3LmgG2172nccBpwJtAUeXApTmIYxnh9cN0jOlBp8pEO1OIkj DbwFNV7J5aZhJ5fxVQyx8+qVVin3AN2RQeYxMGo/P2/wlFC1n9Z6azGFBIJFvwzNeZlD OzcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GoKu1mHAq2ym2ooC7E2fGmlcLx9kahMK972pMVLN7MI=; b=K0Gfnz7+pM8jmirBuyxniZNqTR3XwSt+Dyi6AFPeDTUgxLzXNAR2A4N++1fR2LM9e3 czdEaykmGX0ZDfw3VwO4p9jm3XJuHE5szdULNo0UGcgTP9geGGu4j5B6eVqyiCugyARP TVkxQZbaHbTmxDuO7GsYvBjB1IcqvVsBPJRnwY8NzudUIA4/3EuRmv2QcbUYfmC8E0LS omM2ZpJQhdwHBXogVj4g6sTYQgQPxOPa9uPqBNbpZFU9sa9r4lp3/Ci4Wr6qd9K532NA kvcyykCQLK4odpn1CAJrz44G3NqBvOMJqXsUr1eGGxZbLiNR7Q2cKJEpGo1kCowRoCin ZINQ== X-Gm-Message-State: AGRZ1gKMB140Poq51zrlgiBReaZRjlKF2tim0QlwmEmFCmrZ9vdOiziR yiEjBsC2GfMxPMKg5gy5RNnhFHtA X-Google-Smtp-Source: AJdET5cTBL7+OpvmWqFKo8tnyDE998hsoCUli5CTa9h+Kkv96kTNL5yLPm8IqUqi/MJC7wriwdREMw== X-Received: by 2002:a17:902:7e4c:: with SMTP id a12-v6mr28239476pln.149.1541551969824; Tue, 06 Nov 2018 16:52:49 -0800 (PST) Received: from wafer.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id e204-v6sm13257152pfh.68.2018.11.06.16.52.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Nov 2018 16:52:49 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Wed, 7 Nov 2018 11:52:36 +1100 Message-Id: <20181107005236.30971-1-oohall@gmail.com> X-Mailer: git-send-email 2.17.2 Subject: [Skiboot] [PATCH] phb4_creset: Skip the freset presence detect check X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The phb4_creset() function uses phb4_freset() to bring up the slot after the PHB logic is brought out of reset. When switching to using the freset logic it resets the slot state to PHB4_SLOT_NORMAL. When entering phb4_freset in the normal state we check if there is a card present in the slot and take an early exit if there is no card detected. This is broken when there is no physical presence detect signal (optional for non-hotplug slots) because we rely on the in-band presence detect mechanism which will always report no presence while PERST# is asserted. We can fix this by skipping the PHB4_SLOT_NORMAL state and entering PHB4_SLOT_FRESET_START directly, which is what we do at boot time. --- hw/phb4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/phb4.c b/hw/phb4.c index 49ce1cdfd959..2de7c71ba353 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -3264,7 +3264,8 @@ static int64_t phb4_creset(struct pci_slot *slot) pci_slot_set_state(slot, PHB4_SLOT_CRESET_FRESET); return pci_slot_set_sm_timeout(slot, msecs_to_tb(100)); case PHB4_SLOT_CRESET_FRESET: - pci_slot_set_state(slot, PHB4_SLOT_NORMAL); + pci_slot_set_state(slot, PHB4_SLOT_FRESET_START); + return slot->ops.freset(slot); default: PHBERR(p, "CRESET: Unexpected slot state %08x, resetting...\n",