From patchwork Wed Nov 27 04:47:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1201308 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 47N7ZV2cWsz9sSd for ; Wed, 27 Nov 2019 15:48:34 +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="buG0dxCY"; 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 47N7ZV0Z3YzDqkj for ; Wed, 27 Nov 2019 15:48:34 +1100 (AEDT) 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::441; helo=mail-pf1-x441.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="buG0dxCY"; dkim-atps=neutral Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (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 47N7Z907PGzDqjk for ; Wed, 27 Nov 2019 15:48:13 +1100 (AEDT) Received: by mail-pf1-x441.google.com with SMTP id 193so10316676pfc.13 for ; Tue, 26 Nov 2019 20:48:13 -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:mime-version :content-transfer-encoding; bh=3M4i18gcA5pBrONPtPNie2iaFDgbJFMJUtCvpziSPg8=; b=buG0dxCY8dxzufCcNk5ih3vul4YyVBJGojjq8jBEm3ujHe1y9HYrC8aqc7aqHiPkQZ 9207rosLqaBK8fZXr2siE98cmQqdrJ3BZuHo9aNyGHv4Rv+0K97KWTaIz1annD7QA/aE 2wiOSHHq3JlD5mfRx1v+go4C7cNLVW/DOBNnK092chVmQsSoLniZYp94ab/wpKCZjgAB N819xsH7bpHa9CeBydZREDLH0AJwYsugihJnLwZgdUjV/9vADwAKwhODYmTZ1J5Nwjj6 B/txfWka/9UfJJPolbdLu23Im43DIA+91b5MgCkOWNhJEQT1yP7zbdjPi4bu3B32DfXK QTLg== 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=3M4i18gcA5pBrONPtPNie2iaFDgbJFMJUtCvpziSPg8=; b=fKHh0unKS+xchNHfqHGAHnracQJLruocg+Mgk/iC97+gn9oddpe2lKEq2Zno72VznZ 3IjYOOlwgmXSlwL8Cn5T6yxMhwsBRsiSdO8IOcHZT6GwPl3DQTjyr0Q0rvqNPL4M5A7X MLMJdx0yWkGv1zmZTh3ZwmonKJmJieBFok7AY8XxNWjjkls+cQIz6kSVcZ0D60lPvd8E Cie+4i/ecgMEvdUpSNyEzStHQeozbCGTbp23APlDEijsEw2b+5Rgo0Go2uw6elXszKO3 gVrXqgiuIlJXqEEhlF4zgxBbkuONC/4Ys9WG8TtHAYAjBm0mJEmfo1MY1KUdLRjTcxW4 7inA== X-Gm-Message-State: APjAAAU+4hXDOUcQSSZ0fg7F9lW1/f7QpoWUVrCDmM5DJWZx9T2EbMOE tdLGjuwkAD696x1Z9P6n6wm0MWm8 X-Google-Smtp-Source: APXvYqy+lfOcQQmIfgJ7PiaS6WM5kqzGpFPzZ18QExy4VCJTP1MM2V4eyCjHeu6JbF+k2hpsQPhT9A== X-Received: by 2002:a62:ab0d:: with SMTP id p13mr22922600pff.135.1574830090126; Tue, 26 Nov 2019 20:48:10 -0800 (PST) Received: from wafer.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id c84sm15015712pfc.112.2019.11.26.20.48.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Nov 2019 20:48:09 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Wed, 27 Nov 2019 15:47:58 +1100 Message-Id: <20191127044758.32596-1-oohall@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Skiboot] [PATCH] witherspoon: Squash spurious I2C errors 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: Andrew Donnellan Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" On witherspoon there's an I2C bus connecting the each chip to the GPUs connected to that chip via NVLink. That bus has a 750kOhm pullup on the system planar with prevents the bus from operating correctly. Each GPU has a smaller pullup which makes the bus usable when a GPU is plugged in, but on systems without GPUs we get a lot of spurious I2C master errors. Specificly, because of the oversized pullup the SDA and SCL for that bus cannot return to '1' fast enough, so the master assumes that another master is driving the bus and that it should stop. Work around this by disabling the affected port when there's no GPUs detected in the system. Cc: Andrew Donnellan Signed-off-by: Oliver O'Halloran Reviewed-by: Andrew Donnellan --- Tested on a system with a GPU on each socket and on a system with none. Couldn't find a mixed system. --- platforms/astbmc/witherspoon.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/platforms/astbmc/witherspoon.c b/platforms/astbmc/witherspoon.c index edf84fb89601..081996684603 100644 --- a/platforms/astbmc/witherspoon.c +++ b/platforms/astbmc/witherspoon.c @@ -465,6 +465,7 @@ static void npu2_phb_nvlink_dt(struct phb *npuphb) static void witherspoon_finalise_dt(bool is_reboot) { struct dt_node *np; + struct proc_chip *c; if (is_reboot) return; @@ -479,6 +480,30 @@ static void witherspoon_finalise_dt(bool is_reboot) continue; npu2_phb_nvlink_dt(npphb); } + + /* + * The I2C bus on used to talk to the GPUs has a 750K pullup + * which is way too big. If there's no GPUs connected to the + * chip all I2C transactions fail with an Arb loss error since + * SCL/SDA don't return to the idle state fast enough. Disable + * the port to squash the errors. + */ + for (c = next_chip(0); c; c = next_chip(c)) { + bool detected = false; + int i; + + np = dt_find_by_path(c->devnode, "i2cm@a1000/i2c-bus@4"); + if (!np) + continue; + + for (i = 0; i < 3; i++) + detected |= occ_get_gpu_presence(c, i); + + if (!detected) { + dt_check_del_prop(np, "status"); + dt_add_property_string(np, "status", "disabled"); + } + } } /* The only difference between these is the PCI slot handling */