Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp642975rwb; Thu, 27 Jul 2023 19:41:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlF/HFRQsq+0BTmcXvkjkXBOXthS6xatEaYi1RYJNoKYWrgLCXeHuqk01rAbi0YZdZZnQq0w X-Received: by 2002:a05:6e02:1151:b0:345:968b:a147 with SMTP id o17-20020a056e02115100b00345968ba147mr1301147ill.14.1690512076373; Thu, 27 Jul 2023 19:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690512076; cv=none; d=google.com; s=arc-20160816; b=H0cTPkHmyTUj61iDhc5u0bJqdLvHMfuy1Lh0/Atnn5MwrtmIZnXBI3OZLe2TrLThya GnlKrzJ2e1fiEQBoIFw9s/cyCWC9xn4/U3+3680xGR+sjo4TaXmUZnjFh4uTohkdLKl/ hds35qrLCZby5GgX0K/7m3vbNOrJpxnE1kQ88NDXIsU/x/44H8nKkfVwNLNQCasQFlZT RRy08I0wWRxhYE6A8FkOeBb8Pl8/p33Wfb+HaOqt1LOHckQI2QMg8omnir4iRXkc0ztf 4XiXyIn0Rft1FN6k88p+FSz9+08qB7JTpCFsSIqlLqxy4WUsRX+5N7H9CshsEFct4B2+ mUMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=gjJMd9nkH4Mf0R1UnsgI9bP8PjpttgyTbr+YjirneSA=; fh=mTtkOElzoo143pxraHT7fhc+fZxEM3sa9ESShJZKejE=; b=PILLiwZvGCG++iwa9kBfYydy2/dw79v2XpJr/o5d57n3il9Q1IPSLPye8pR6UKbrUh QqnHH8KEZZsJJuYyXptsHHJWStVkdDO6bPEmKpzmhfcbQ5teQXitJCEzr78SKwAf0HBJ Jc8Kue2q0d90zpOLlvKliVP+nKbsbk3m5EiLMXThqLTNIb6VBVN+ryjkoNUoL92Zalot hHFDNw/YCpa5fzZBhMdYHRjowhmBMKFonOAJfpr2z1li7kGi1XNODGVAMR/53i2C5J1b sWI9Bs3LsosQwcQspMd8E5cDZn+W1SfyzMFYIbgzNSg88q0WC17xP+UXvJ3Zq7oz/e3S 79pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=ERFKW72s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 14-20020a630e4e000000b005638dc9751csi1082821pgo.0.2023.07.27.19.40.49; Thu, 27 Jul 2023 19:41:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=ERFKW72s; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231666AbjG1ByQ (ORCPT + 99 others); Thu, 27 Jul 2023 21:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229719AbjG1ByP (ORCPT ); Thu, 27 Jul 2023 21:54:15 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ACFB0173F for ; Thu, 27 Jul 2023 18:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=gjJMd9nkH4Mf0R1Uns gI9bP8PjpttgyTbr+YjirneSA=; b=ERFKW72sPyoH8chSxXlX4yviepByxXzHVh AiL0uaXDWFArT0jOV3jmXcuIGyEAuXmZgZcZ7xWZuB6h1GezdtdcatpMfDtNYJDm /tjuY8Xh6GXs4SlQenMlrJkZoZ+2G8sws7//HOnRQNe0Zs6EAN6AKxsIop402LJT UbFqqpS9I= Received: from localhost.localdomain (unknown [202.112.113.212]) by zwqz-smtp-mta-g2-0 (Coremail) with SMTP id _____wDXBuOkH8NkZOP4BQ--.61958S4; Fri, 28 Jul 2023 09:53:48 +0800 (CST) From: Yuanjun Gong To: christophe.jaillet@wanadoo.fr Cc: airlied@gmail.com, andrew@aj.id.au, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, joel@jms.id.au, linux-kernel@vger.kernel.org, ruc_gongyuanjun@163.com Subject: [PATCH v2 1/1] gpu: drm: aspeed: use devm_clk_get_enabled() in aspeed_gfx_load() Date: Fri, 28 Jul 2023 09:53:35 +0800 Message-Id: <20230728015335.5021-1-ruc_gongyuanjun@163.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <2419973d-1e21-5754-d309-436dc9c62be8@wanadoo.fr> References: <2419973d-1e21-5754-d309-436dc9c62be8@wanadoo.fr> X-CM-TRANSID: _____wDXBuOkH8NkZOP4BQ--.61958S4 X-Coremail-Antispam: 1Uf129KBjvdXoWrtrWfJw1xJF13tw4UAFyUGFg_yoWkAFXE9r 4xursxXrsruFyDCw1rZwn3JFWxKFZ5urWFgry09w4FyF9ruryDW3yDGFy5Zw43Ww47Cr95 tF1UAFW3Cr18GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7VUUO6pDUUUUU== X-Originating-IP: [202.112.113.212] X-CM-SenderInfo: 5uxfsw5rqj53pdqm30i6rwjhhfrp/xtbBiA665VaEF9HHCQAAsD X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L4,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org in aspeed_gfx_load(), clk_prepare_enable() might return an unexpected value. using devm_clk_get_enabled() instead of devm_clk_get() and clk_prepare_enable() can avoid this problem. Fixes: 4f2a8f5898ec ("drm: Add ASPEED GFX driver") Signed-off-by: Yuanjun Gong --- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c index c8c7f8215155..3d3ee70fb5ea 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -193,13 +193,12 @@ static int aspeed_gfx_load(struct drm_device *drm) } reset_control_deassert(priv->rst); - priv->clk = devm_clk_get(drm->dev, NULL); + priv->clk = devm_clk_get_enabled(drm->dev, NULL); if (IS_ERR(priv->clk)) { dev_err(&pdev->dev, "missing or invalid clk device tree entry"); return PTR_ERR(priv->clk); } - clk_prepare_enable(priv->clk); /* Sanitize control registers */ writel(0, priv->base + CRT_CTRL1); -- 2.17.1