From patchwork Fri Aug 28 04:30:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1352999 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) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bd69n1xlxz9sSn for ; Fri, 28 Aug 2020 14:31:25 +1000 (AEST) 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.a=rsa-sha256 header.s=20161025 header.b=UjDeA1hC; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4Bd69n1VZzzDqm6 for ; Fri, 28 Aug 2020 14:31:25 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::1043; helo=mail-pj1-x1043.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.a=rsa-sha256 header.s=20161025 header.b=UjDeA1hC; dkim-atps=neutral Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Bd69X5TGgzDqlf; Fri, 28 Aug 2020 14:31:11 +1000 (AEST) Received: by mail-pj1-x1043.google.com with SMTP id q1so15160pjd.1; Thu, 27 Aug 2020 21:31:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0n/0QUzwiiXB4ODJTd3C1iznTa5ctsTtxP5/myCQu7w=; b=UjDeA1hCcjKLZbR+O7PVRa+LbLh7xvhM4avj3SA9Olxkqdg3qPxo/b+MxenEvih2Gm bhIS9U+otTPRi1qUO5Ch5+kMeiESHZmVuvhNN4LQPhomnwWQtKyq5AAK3XFLcY0mPofD RZFXeTg687CunfseQACzfQZFBrISKHU27CJGniKeMb6ZVa10J90+sH/c0Drrys6HgaNY M1b23Nz3LMTeQx+JDRvEWKx1BBUyrLZTxdRTp/VQjobzyY86dpH7EHDQTw6kQBgVahGp 2Wkgv0R398HSTZTqJ/eiPA/E0bQcRJx7BZ5Jt4NoFD2LizbwD2b3J3f35ZVn2gg91Hlm T1Hw== 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:mime-version :content-transfer-encoding; bh=0n/0QUzwiiXB4ODJTd3C1iznTa5ctsTtxP5/myCQu7w=; b=L7E+R5R4mqq9NNB7OVG8s/lGuVPhE5AZFdECzhW9I+fetp420AiRCQ2IaORxf/992H oFfZvW1rGGByvDB4s17L1tFhs+CADoSuTR+0r+2zhpTf8t4rj7LODRR6yKws83tXEI0t W2JLexaLafuYuDV9o6NOhYMtDvf+ycCiaortE99sBQTlpY/b+4PvfXlcujjoM2p/Stsl oBlQ2usIAP0HI5lXyuSfJgay+/TPukhQZiKO/vMZS5PQViinInhZTwX8l/MUtvqTvsF6 MhRv18qT4PMEl9JK9M80MyabX223HGJYc1/YMTP+x8YPalJna6LFMMsxTCtOZIqlaFKf n0NQ== X-Gm-Message-State: AOAM530EaKjC114RJwmOvHyvsbifYwwfzINlowYaUXMOUt0wOuoqROjh P8a/6xMgAbs4crKVHcTeVp/YNBMUFk77mw== X-Google-Smtp-Source: ABdhPJyzhPjZHW+LqBaZZohg9WDbiasRcS+cdGMhzEsBiEEAZiOcc3TvGBSJYOC+8zVBWxLT5neahA== X-Received: by 2002:a17:90a:eb17:: with SMTP id j23mr11102pjz.151.1598589067131; Thu, 27 Aug 2020 21:31:07 -0700 (PDT) Received: from localhost.ibm.com (194-193-34-182.tpgi.com.au. [194.193.34.182]) by smtp.gmail.com with ESMTPSA id np4sm37151pjb.4.2020.08.27.21.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 21:31:06 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 28 Aug 2020 14:30:54 +1000 Message-Id: <20200828043055.1563069-1-oohall@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Skiboot] [PATCH 1/2] hw/phb4: Actually enable error reporting 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: , Cc: skiboot-stable@lists.ozlabs.org Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" PHB3 had an errata about correctable errors and when Ben was doing the initial PHB4 port he deleted the corresponding config write to DEVCTL. Whoops. Cc: skiboot-stable@lists.ozlabs.org Signed-off-by: Oliver O'Halloran --- hw/phb4.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/phb4.c b/hw/phb4.c index 3f22a2c4d98f..328621917667 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -785,6 +785,7 @@ static void phb4_endpoint_init(struct phb *phb, val16 |= (PCICAP_EXP_DEVCTL_NFE_REPORT | PCICAP_EXP_DEVCTL_FE_REPORT | PCICAP_EXP_DEVCTL_UR_REPORT); + pci_cfg_write16(phb, bdfn, ecap + PCICAP_EXP_DEVCTL, val16); /* Enable ECRC generation and check */ pci_cfg_read32(phb, bdfn, aercap + PCIECAP_AER_CAPCTL, &val32); From patchwork Fri Aug 28 04:30:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1353001 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Bd6B95TTWz9sSn for ; Fri, 28 Aug 2020 14:31:45 +1000 (AEST) 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.a=rsa-sha256 header.s=20161025 header.b=O5LEVcNF; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4Bd6B94459zDqlr for ; Fri, 28 Aug 2020 14:31:45 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.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.a=rsa-sha256 header.s=20161025 header.b=O5LEVcNF; dkim-atps=neutral Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Bd69X5Vn6zDqlh; Fri, 28 Aug 2020 14:31:12 +1000 (AEST) Received: by mail-pf1-x444.google.com with SMTP id t185so5159437pfd.13; Thu, 27 Aug 2020 21:31:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/2yoI/B6E47WWK4C1jky6+YGksunM5trUAT4Co1wgxQ=; b=O5LEVcNFcCZRER+FjPB2J1EGzTvqKHtA9berplq2RA9uIPfTiNq91cvmJa3boIrJJv 9r9qxm3r5sb6XtOrFLKnyvblJrgducA7bYAYfbhfBu/nFE7IXFPAB1YsqU0LFigy77K3 Cd4auS1F9jzCSmjPv78CiuHDywVVayk/aXlWXaivJ181WHh6XTwQFPY6vGLbW2FlDFl0 p6vB5ZL4KEIqoOkGD24L4daZb+BOTAAPhraPEYyMFljCgR6a38ArSQTk5iBIJ35tyViw TmY8My13kKHNp2EVf/25uPRkS7eZNBBEKFzffX7k9i34+jNWyMd6rlDfQ35uMIJs7dGB 5g5A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=/2yoI/B6E47WWK4C1jky6+YGksunM5trUAT4Co1wgxQ=; b=YxmmsLWvwAyBwJeeR4WwiqgmmutO025dXV1V/AYA4Z88fIJ1s1z2VZw3TtnkeFqRyP 2B7LMpfMtcytD2uRO5c9O/0WrUUITj8aMhIt9SwwdJTT7Gz/YAXjxj2GP8cqUELRLoa6 SqsSOnI4FHpeDEudRf3bDhfITYWjwO+ZRNP8BL1MPyVfSpWDAJltsVrqQJEFnRBJ3p3s us2Nr/YhBiIxGDSuwiwuJWKPWQ/dGfe+225SFBz0F+4VLIz9AHt7A47/ZvmuDGAHwLGD jVcXcLshIc/CrVIXzW1g5cqDl334Zjblcma/fn4q078dcEouRyZ5KVjdxRhfmreNNQIz UTzA== X-Gm-Message-State: AOAM532kv/nFccNz+ZAsMCgSIF3RPXnmXSrQZef/Wrkln8XKJfmgERRS zqhoVylYsm+l6RfcGKLqhBoCEo+EjoSVOQ== X-Google-Smtp-Source: ABdhPJyTuYl/aW2La82KjlzvzPmPLCHqyRhZQ/HDAZadnVQ4Oef57s4sN20IWxdaNh8pqCPTrpbr9g== X-Received: by 2002:a65:568b:: with SMTP id v11mr16898680pgs.396.1598589069603; Thu, 27 Aug 2020 21:31:09 -0700 (PDT) Received: from localhost.ibm.com (194-193-34-182.tpgi.com.au. [194.193.34.182]) by smtp.gmail.com with ESMTPSA id np4sm37151pjb.4.2020.08.27.21.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 21:31:09 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 28 Aug 2020 14:30:55 +1000 Message-Id: <20200828043055.1563069-2-oohall@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200828043055.1563069-1-oohall@gmail.com> References: <20200828043055.1563069-1-oohall@gmail.com> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 2/2] hw/phb4: Verify AER support before initialising AER regs 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: , Cc: skiboot-stable@lists.ozlabs.org Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Check the AER capability offset pointer is non-zero before enabling the AER messages. If the device doesn't support AER we end up writing garbage to config offset 0x0 + PCIECAP_AER_CAPCTL, or 0x18. For a normal device this is one of the BARs so this doesn't do much, but for a bridge this results in overriding: 0x18 - The primary bus number 0x19 - The secondary bus number 0x1A - The subordinate bus number 0x1B - The latency timer 0x1B is hardwired to zero for PCIe devices, but overwriting the bus number register can cause issues with routing of config space accesses. It's worth pointing out that we write actual values for the secondary and subordinate bus numbers before scanning the secondary bus, but the primary bus number is never restored. Cc: skiboot-stable@lists.ozlabs.org Signed-off-by: Oliver O'Halloran --- hw/phb4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/phb4.c b/hw/phb4.c index 328621917667..17a233f39ff1 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -788,6 +788,9 @@ static void phb4_endpoint_init(struct phb *phb, pci_cfg_write16(phb, bdfn, ecap + PCICAP_EXP_DEVCTL, val16); /* Enable ECRC generation and check */ + if (!aercap) + return; + pci_cfg_read32(phb, bdfn, aercap + PCIECAP_AER_CAPCTL, &val32); val32 |= (PCIECAP_AER_CAPCTL_ECRCG_EN | PCIECAP_AER_CAPCTL_ECRCC_EN);