Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp3013013pxx; Sun, 1 Nov 2020 19:18:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbKNVw52ebhlk5ypwz+bHNd9i14psEP1oUSDTgMeqopIpefwMuBaAzXesJMQ9hxfmE47P8 X-Received: by 2002:a17:906:2548:: with SMTP id j8mr13213350ejb.140.1604287092658; Sun, 01 Nov 2020 19:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604287092; cv=none; d=google.com; s=arc-20160816; b=WBwCo0qqftmbWdZtOAV1YUR0hLu1S7msnAyVJiD8cB4xhrx8tMmgSm5YMSc4bULN6j qn6CSi3cAlXiqalTEfTzmKrQz78eofBD4Axeu0b2NtyagQBsln5oK85sUfPBNiG8waT8 c63BPOw28B8WZgfkI2UE4IspRquncUu0ex8Js7Jv0IfXASncEk/wWR0+t457gbv1tILC /kuItIPxC2rdqKc+Qb5B7N8eyI4306dtEB718XE5EQvAgMzr6sFnV1wOB6GRdgQMKFik +6NH8KdCb28PVWOUS0SYtNvOp/OO+o1V0OLYbiwqfL3z1rg0IFNptPdfblyK04TkO8/X +saw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=2uy+9PK/vBrPhy0PGpHdNxLxksleaTHlsKIfzvuB1Vo=; b=LPrqHMkdk65gIFhktt+X0nLiLgeUpIsKSD4t+hi5yvKBAuSUI9luzufA4E147jsFul dIMFbHhTyfK02k3ev8uEjDROLCuklH6iqVjTY1lghzo/a4SSJqWltOmWnOxvVOWYDXoA vFekZ+WVTItNJPWcQryCU3FPNNYVcwIDbtaeWFvTnTNhAkrr7qjghn1unt3zqKUFd9k8 d98SJWes++3wAjh4WpKPJM9nsYILt2wTxHhDGpskjra0aZCLUf4Nmmvtaggl6Vujqume upgmJIi27VLi1WflolYlUh1WRPOdzeaQD23RACTbRJlhwm4Vk92e+g/ODACp8u3s7Jus 8Biw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w23si7344347ejv.504.2020.11.01.19.17.50; Sun, 01 Nov 2020 19:18:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727767AbgKBDOf (ORCPT + 99 others); Sun, 1 Nov 2020 22:14:35 -0500 Received: from mail-m17613.qiye.163.com ([59.111.176.13]:40956 "EHLO mail-m17613.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727450AbgKBDOe (ORCPT ); Sun, 1 Nov 2020 22:14:34 -0500 Received: from ubuntu.localdomain (unknown [58.213.83.157]) by mail-m17613.qiye.163.com (Hmail) with ESMTPA id 4A8E148293A; Mon, 2 Nov 2020 11:14:30 +0800 (CST) From: Bernard Zhao To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Daniel Vetter , Evan Quan , Luben Tuikov , Xiaojie Yuan , Changfeng , Dave Airlie , Nicholas Kazlauskas , Thomas Zimmermann , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Bernard Zhao Subject: [PATCH] drm/amd: move DRM_ERROR log out of the mutex protect area Date: Sun, 1 Nov 2020 19:14:17 -0800 Message-Id: <20201102031423.4033-1-bernard@vivo.com> X-Mailer: git-send-email 2.29.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZT0seQx4aGEJOTUhKVkpNS09JQ01DTEtNQk9VEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKQ1VLWQY+ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6Nz46Pio6PD8vSiFRShgiD04Z AxJPCR9VSlVKTUtPSUNNQ0xKSk5OVTMWGhIXVRkeCRUaCR87DRINFFUYFBZFWVdZEgtZQVlOQ1VJ SkhVQ0hVSk5MWVdZCAFZQUlOQkw3Bg++ X-HM-Tid: 0a7586f2f45893bakuws4a8e148293a Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In function amdgpu_register_gpu_instance, there is no need to protect DRM_ERROR in mutex mgpu_info.mutex. This change is to make the code to run a bit fast. Signed-off-by: Bernard Zhao --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index efda38349a03..cc61b0a5b8d1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -104,8 +104,8 @@ void amdgpu_register_gpu_instance(struct amdgpu_device *adev) mutex_lock(&mgpu_info.mutex); if (mgpu_info.num_gpu >= MAX_GPU_INSTANCE) { - DRM_ERROR("Cannot register more gpu instance\n"); mutex_unlock(&mgpu_info.mutex); + DRM_ERROR("Cannot register more gpu instance\n"); return; } -- 2.29.0