From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DF9BC33CA2 for ; Thu, 9 Jan 2020 12:03:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E66D2075D for ; Thu, 9 Jan 2020 12:03:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730741AbgAIMD5 (ORCPT ); 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) > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5183AC32771 for ; Thu, 9 Jan 2020 12:04:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 201B220661 for ; Thu, 9 Jan 2020 12:04:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qH55CZ8M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 201B220661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6XO3CTmkJeGwbHiUWSecwhcstGZKe8JTaVPdWV5GPxM=; b=qH55CZ8Me0usneitrKBlXUmR7 5CAssGpzFUr4r1Vt9ogjijQRnAbud3sQONe21ZJTVJdVJx/qXTX2dtsNAxT/OnpF2XLB7kzjpfXAB bRroINfcmTUvSnnvTktGVhkSc8PNceYzuRf6Fu8I/B4mg/YHQMwqqPxqFn7ncv9VPWmUJHZEbtltI uZIHvSkJw3WdcjRqcxa58K3jHZBg5ZlY8aMAjH+MeEbthKhkwCRfDqsto1/KPI++t8V3BqSyQtrI0 Uhw0W00tlOS4OpZiGXRwYMMqE7U/EGM5B4y8g92/t8Bb3y7lQcVOj1/a2Fuavo2T8rcxmS+qPEhdS g1XhMYIpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipWXv-0006LU-As; Thu, 09 Jan 2020 12:04:15 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipWXc-00069B-Tq; Thu, 09 Jan 2020 12:03:58 +0000 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 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-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200109_040357_048967_F1691397 X-CRM114-Status: GOOD ( 15.38 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Tomeu Vizoso , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Liam Girdwood , Mark Brown , linux-mediatek@lists.infradead.org, Alyssa Rosenzweig , hsinyi@chromium.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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) > _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBFEEC32771 for ; Thu, 9 Jan 2020 12:04:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8BA6620661 for ; Thu, 9 Jan 2020 12:04:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UcsoY+LQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BA6620661 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lvhmrpAvUptnlxfu3dWtLlTZIyJt5r79WQW44tJm24w=; b=UcsoY+LQVVaOvdtTKMSKT6bGO qam6egpPtwA/RW5dulaElR3J9qJtRAMMMkEDmo2yzRSaXU8oMFzDSxkbz6w35ECR0ycSIw9CJGwlR oj2sq8T/aEleAyKNn93R8gNS9PXL2YY/5QVTQoTWyGKRGNmYGHzGOgub+w/6X/3Jre6adM2HK10b/ PwT7MJ0Iax+kZh/lItk6MRbonUiNqeVhiNk7NcaakTw0H7eSM0+RkNn5qKgxE8SwVA7KXGY4mplVr JR4L9S7UMuGVF4N+MWM3cnhVLnc44N0i2K8p+gS5lzVUdY5KHkS8zxvdf4Ckdb/1Juyg4M7tmFes9 Mw8mlgBMg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipWXg-00069r-9y; Thu, 09 Jan 2020 12:04:00 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipWXc-00069B-Tq; Thu, 09 Jan 2020 12:03:58 +0000 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 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-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200109_040357_048967_F1691397 X-CRM114-Status: GOOD ( 15.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Tomeu Vizoso , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Liam Girdwood , Mark Brown , linux-mediatek@lists.infradead.org, Alyssa Rosenzweig , hsinyi@chromium.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74647C33CA1 for ; Thu, 9 Jan 2020 12:03:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 554A92077C for ; Thu, 9 Jan 2020 12:03:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 554A92077C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A9B86E904; Thu, 9 Jan 2020 12:03:58 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id C1EB26E904 for ; Thu, 9 Jan 2020 12:03:56 +0000 (UTC) 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 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-Language: en-GB X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Tomeu Vizoso , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Liam Girdwood , Mark Brown , linux-mediatek@lists.infradead.org, Alyssa Rosenzweig , hsinyi@chromium.org, Matthias Brugger , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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) > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel