Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1977819ybl; Thu, 9 Jan 2020 04:59:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyiaSM/X1pTxQlo6vmFnh+L8ZSgQJG9C/XcTvfMm95PrGXhOIGMfvKDt+wzMww5aWMQJC7T X-Received: by 2002:a9d:4e97:: with SMTP id v23mr7766139otk.201.1578574740910; Thu, 09 Jan 2020 04:59:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578574740; cv=none; d=google.com; s=arc-20160816; b=lSs0t6AvLP7Q6c6y4/XaOOMNdV9gL55dpwK+Rxhcu+lCRkhSdlBsNMdBVf0WrqaIrx iFdlaFGdk8K8n2PV3s2DTZRLm5errFlYHjahvLiR00ANHt8mjslWb/4ryiNQNXaFvWLO KEbMTseGV1gqIQAWZtVqR8kF6WziDExiXoVKvcCwSM3x4wT0I5ZZujVnbWcTNMcZ90ss ARgbil5a6b6trQ2YM2l9Qt1wNw/WC4RnAYXLDimBFD6uFjThHlFCAakBQG3MbrRbBG7O DBtkQf51dK0QCKD6/BSVBe83+/8XYFi4WcpobPuSca4q8CX0DYybQlY4skZEE4IacDmI L9GA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=O5MsTHrFRCRrNuMij7ISybwQfFT4IGuY8pgbJmCJPuY=; b=w7hkZ9VicIvDPJdBaXfmlWhmAZ8+ZEyX9tcZsVmKXL8ZyUS/rWqXmE2qaBarFFsXOt W/murWwIMUx8coMBwtRci2MRoVbmdN86p5rBiOJnnVzWlfWC+pIcLTaZbjtKvwYiX1+O KMYe2iRRT7O+LfCZ0NGZxLs55/rlacpksv3N1nbGLNAX6j9HYVYU75nryrf1horRNh4I mETP7fd2vAJvaohCHiS9iVSgtxVQQjtzl6BvAdDyclh2sqn/XMLLSIfqFp4iLQ0INUOw 66WPi/amToAMZJTGcOiiMgNCZuDqZNHCkWcAn6XH+4Wb5eRfBV/MvVhMrPkSp7/6TtlH cjoQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si3329948oic.108.2020.01.09.04.58.49; Thu, 09 Jan 2020 04:59:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730737AbgAIMD5 (ORCPT + 99 others); Thu, 9 Jan 2020 07:03:57 -0500 Received: from foss.arm.com ([217.140.110.172]:58044 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729113AbgAIMD5 (ORCPT ); Thu, 9 Jan 2020 07:03:57 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7293831B; Thu, 9 Jan 2020 04:03:56 -0800 (PST) Received: from [10.1.32.29] (e122027.cambridge.arm.com [10.1.32.29]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5C6553F534; Thu, 9 Jan 2020 04:03:53 -0800 (PST) Subject: Re: [PATCH v2 3/7] drm/panfrost: Improve error reporting in panfrost_gpu_power_on To: Nicolas Boichat , Rob Herring Cc: Mark Rutland , devicetree@vger.kernel.org, Tomeu Vizoso , David Airlie , linux-kernel@vger.kernel.org, Liam Girdwood , dri-devel@lists.freedesktop.org, Mark Brown , linux-mediatek@lists.infradead.org, Alyssa Rosenzweig , hsinyi@chromium.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org References: <20200108052337.65916-1-drinkcat@chromium.org> <20200108052337.65916-4-drinkcat@chromium.org> From: Steven Price Message-ID: <3997e444-e388-929f-b764-537d62643bae@arm.com> Date: Thu, 9 Jan 2020 12:03:51 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200108052337.65916-4-drinkcat@chromium.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/01/2020 05:23, Nicolas Boichat wrote: > It is useful to know which component cannot be powered on. > > Signed-off-by: Nicolas Boichat Looks like helpful error reporting. Reviewed-by: Steven Price > > --- > > Was useful when trying to probe bifrost GPU, to understand what > issue we are facing. > --- > drivers/gpu/drm/panfrost/panfrost_gpu.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c > index 8822ec13a0d619f..ba02bbfcf28c011 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c > +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c > @@ -308,21 +308,26 @@ 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, STACK_PWRON_LO, pfdev->features.stack_present); > - ret |= readl_relaxed_poll_timeout(pfdev->iomem + STACK_READY_LO, > + ret = readl_relaxed_poll_timeout(pfdev->iomem + STACK_READY_LO, > val, val == pfdev->features.stack_present, 100, 1000); > + if (ret) > + dev_err(pfdev->dev, "error powering up gpu stack"); As mentioned in my previous email - we could just drop this entire section dealing with the core stacks and let the GPU's own dependency management code handle it. Of course there might be a GPU out there for which that is broken... in which case some sort of quirk handling will be needed :( Steve > > 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) >