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=-11.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 63212C00A89 for ; Mon, 2 Nov 2020 09:11:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12FA5222E8 for ; Mon, 2 Nov 2020 09:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728313AbgKBJLq (ORCPT ); Mon, 2 Nov 2020 04:11:46 -0500 Received: from foss.arm.com ([217.140.110.172]:56344 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728004AbgKBJLp (ORCPT ); Mon, 2 Nov 2020 04:11:45 -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 78F84101E; Mon, 2 Nov 2020 01:11:45 -0800 (PST) Received: from [192.168.1.179] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4083C3F718; Mon, 2 Nov 2020 01:11:44 -0800 (PST) Subject: Re: [PATCH] drm/panfrost: Add support for non-existent reset node To: Yejune Deng , robh@kernel.org, tomeu.vizoso@collabora.com, alyssa.rosenzweig@collabora.com, airlied@linux.ie, daniel@ffwll.ch, p.zabel@pengutronix.de Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <1604307289-32110-1-git-send-email-yejune.deng@gmail.com> From: Steven Price Message-ID: <64fb3d99-d42b-6135-0670-ab50205714ad@arm.com> Date: Mon, 2 Nov 2020 09:11:43 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1604307289-32110-1-git-send-email-yejune.deng@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/11/2020 08:54, Yejune Deng wrote: > Some dts hasn't no reset node, is should ok. > > Signed-off-by: Yejune Deng > --- > drivers/gpu/drm/panfrost/panfrost_device.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c > index ea8d318..a982878 100644 > --- a/drivers/gpu/drm/panfrost/panfrost_device.c > +++ b/drivers/gpu/drm/panfrost/panfrost_device.c > @@ -18,7 +18,12 @@ > > static int panfrost_reset_init(struct panfrost_device *pfdev) > { > - pfdev->rstc = devm_reset_control_array_get(pfdev->dev, false, true); > + pfdev->rstc = devm_reset_control_array_get_optional_exclusive(pfdev->dev); This change is fine - it should have no functional change and makes the code more readable. > + if (!pfdev->rstc) { > + dev_info(pfdev->dev, "reset does not exist\n"); I don't think this output is particularly useful. > + return 0; The early return isn't necessary. IS_ERR(NULL) is false, and reset_control_deassert() deals fine with NULL, so the path below would be fine. > + } > + > if (IS_ERR(pfdev->rstc)) { > dev_err(pfdev->dev, "get reset failed %ld\n", PTR_ERR(pfdev->rstc)); > return PTR_ERR(pfdev->rstc); > @@ -29,7 +34,8 @@ static int panfrost_reset_init(struct panfrost_device *pfdev) > > static void panfrost_reset_fini(struct panfrost_device *pfdev) > { > - reset_control_assert(pfdev->rstc); > + if (pfdev->rstc) > + reset_control_assert(pfdev->rstc); reset_control_assert() deals fine with a NULL input, so this is unneeded. > } > > static int panfrost_clk_init(struct panfrost_device *pfdev) > Have you actually seen a problem on a platform without a reset node - it works fine for me and I can't see any functional change with this patch. Steve