Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4888882ybl; Mon, 13 Jan 2020 23:17:30 -0800 (PST) X-Google-Smtp-Source: APXvYqxnHMWoh3nZwSOW/QMfQrNrMDukxhZC+V+SRw0neSg0YCPYM9uOwulpeWf70mfuzhQ76sSN X-Received: by 2002:aca:1a06:: with SMTP id a6mr14989782oia.148.1578986250884; Mon, 13 Jan 2020 23:17:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578986250; cv=none; d=google.com; s=arc-20160816; b=gMCMt1Ad/r5NeVIZaTJq4ggPWahNXNKjQw8RbOGZgLWGh+An0HodXLQfgjeUMI7lzL iOUXy4zueOdbo5m2v5GzdIypaw3JYFIPHbzp6w7DR6rI7HrghRdyTM4d9ehFrzMRT1/9 iMkRbkFgkBoALFHH7Ct9OuXEgPQEp6xI67sInczG9nv+q9nPID8ph4g1eSKRQzPUXVV2 X4roAYxR7YKbeyDDRC5x+tRWOk03KHeD6VxwacpJSqMzs8riAx7YL5ZmB+yxuCdpHngB BuClVot02spdOULx5AT1qoS7O/J+FxW1Dd+gmGoDimVZxcW3Lg077N2+nxtkztxDXHs5 HvPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+Qk1FvG6eeViNWsiravQSfAZxl3lDcu4afmru4xzZG0=; b=s8CfbWvx+pEPAft36EI+YRPPe2vn2Ogw0VXKChMTqw/aM2xH44NvuURtAMRlwVlJLJ Wz79zIr+pNdv7kVckchcJjqV3HbhfBFX23R+ToASMRG9FOzQ7N46h5qBzbK6DiWB5dGI ON8zKPJhzefA/92ipA/w7w9SYrP6AWURFFSJHQRuHRY9KBzJMud3o/VWMTOn5kGkbT/l T/sAwabez/sMN89DzaVsQYKZPF6ssKpBiMqeeeG5B2UNsETCc/nNC3CvlAUFWkQC2LeG JT4U/pxl+mls6CGtRXYqlYwdrfY+Ri92ZE7uzqG28cQ8LjLV0mXbFY1qs71SbT9cVGhK /HDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kpku5Ruy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t185si7370878oib.39.2020.01.13.23.17.19; Mon, 13 Jan 2020 23:17:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kpku5Ruy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729015AbgANHQU (ORCPT + 99 others); Tue, 14 Jan 2020 02:16:20 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42079 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728950AbgANHQR (ORCPT ); Tue, 14 Jan 2020 02:16:17 -0500 Received: by mail-pl1-f196.google.com with SMTP id p9so4865782plk.9 for ; Mon, 13 Jan 2020 23:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+Qk1FvG6eeViNWsiravQSfAZxl3lDcu4afmru4xzZG0=; b=kpku5RuywKMHl5ZcaerHmBR3blXr+BKVtuWbEftoijf6zbjlLpjhN91tXw35Fo58dn xTXhTbMh5ix0EZTaVErnFQDR5hNTEemNwcK4X3OpJEuhr2I/Ckiq0N4cHg4yN3NpUKzq PjDj62n+MeAuKGo/riGAaYYSsB4yZ3/JVkYBk= 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=+Qk1FvG6eeViNWsiravQSfAZxl3lDcu4afmru4xzZG0=; b=QdSACkXu4S8H4X2QwelCb5kXaDkJ4IdbYBi5xmrUkt8xzy3lJxwaqrMM9ZblnIBHid ic44WV8em9QgDmBIIDp48kyCHiT+M5j8BwFouwDltOdORMDLFEIs8MqBa6c5xHniX5m9 M5MKSBxEjLft+dHolvxbcQzEKMFYcR0DEnp+EU5qhoA+p2MEhtxgdMe7Ggn0xLrr8Egt 6F4rZrEh8hN/vg9BeKXgoDEiV3JqAhXQYjftNrIeua3v4HAldxRlFcS6F/8UfDE8p5J9 9gUw3MtlWiItwuBBXwAAD4ykREmg3YMBnwJl1Gk3ojOSz4Y9BBcU7u1R/pKo/JgF6Ev9 XaRA== X-Gm-Message-State: APjAAAUa0NO1vlZXtmbLHBy2Jxnxv+Z19l5ySML1bgDHuinkIVOem6oC 4OjlAtE6Ru3rhbD7jIT53EcmIw== X-Received: by 2002:a17:90a:3244:: with SMTP id k62mr27867920pjb.43.1578986177409; Mon, 13 Jan 2020 23:16:17 -0800 (PST) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:d8b7:33af:adcb:b648]) by smtp.gmail.com with ESMTPSA id b4sm17092976pfd.18.2020.01.13.23.16.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jan 2020 23:16:16 -0800 (PST) From: Nicolas Boichat To: Rob Herring Cc: David Airlie , Daniel Vetter , Mark Rutland , Matthias Brugger , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , Liam Girdwood , Mark Brown , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, hsinyi@chromium.org Subject: [PATCH v3 3/7] drm/panfrost: Improve error reporting in panfrost_gpu_power_on Date: Tue, 14 Jan 2020 15:15:58 +0800 Message-Id: <20200114071602.47627-4-drinkcat@chromium.org> X-Mailer: git-send-email 2.25.0.rc1.283.g88dfdc4193-goog In-Reply-To: <20200114071602.47627-1-drinkcat@chromium.org> References: <20200114071602.47627-1-drinkcat@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is useful to know which component cannot be powered on. Signed-off-by: Nicolas Boichat Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- Was useful when trying to probe Bifrost GPU, to understand what issue we are facing. v3: - Rebased on https://patchwork.kernel.org/patch/11325689/ drivers/gpu/drm/panfrost/panfrost_gpu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index 460fc190de6e815..856f2fd1fa8ed27 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -308,17 +308,20 @@ void panfrost_gpu_power_on(struct panfrost_device *pfdev) gpu_write(pfdev, L2_PWRON_LO, pfdev->features.l2_present); ret = readl_relaxed_poll_timeout(pfdev->iomem + L2_READY_LO, val, val == pfdev->features.l2_present, 100, 1000); + if (ret) + dev_err(pfdev->dev, "error powering up gpu L2"); gpu_write(pfdev, SHADER_PWRON_LO, pfdev->features.shader_present); - ret |= readl_relaxed_poll_timeout(pfdev->iomem + SHADER_READY_LO, + ret = readl_relaxed_poll_timeout(pfdev->iomem + SHADER_READY_LO, val, val == pfdev->features.shader_present, 100, 1000); + if (ret) + dev_err(pfdev->dev, "error powering up gpu shader"); gpu_write(pfdev, TILER_PWRON_LO, pfdev->features.tiler_present); - ret |= readl_relaxed_poll_timeout(pfdev->iomem + TILER_READY_LO, + ret = readl_relaxed_poll_timeout(pfdev->iomem + TILER_READY_LO, val, val == pfdev->features.tiler_present, 100, 1000); - if (ret) - dev_err(pfdev->dev, "error powering up gpu"); + dev_err(pfdev->dev, "error powering up gpu tiler"); } void panfrost_gpu_power_off(struct panfrost_device *pfdev) -- 2.25.0.rc1.283.g88dfdc4193-goog