From patchwork Tue May 5 15:16:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 11529415 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DECA14B4 for ; Tue, 5 May 2020 15:18:45 +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 EFDB32073B for ; Tue, 5 May 2020 15:18:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hgVE+HNb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFDB32073B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 A338E6E7D5; Tue, 5 May 2020 15:18:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9FCC46E7D4 for ; Tue, 5 May 2020 15:18:41 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id i10so3189406wrv.10 for ; Tue, 05 May 2020 08:18:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BH08Zd37jgMT5BJkCh3yo4A8owT2Xvzs0j2NLhOEre4=; b=hgVE+HNbSGvrlG+Mvk0PLSbaCRStrFUPIZCgURxldl2oKmrWvo4WnDW0iJt0VD0Wqx 0+JlKqm3PO5chKSXDBdRFr6LgFXJ6+JvYPL42O+0zmYMFDoaWE3R4WlSG/6qtNHQu1U0 CwxoVDMqhjg6ySlSYbyqFeVhuXII+BeyDEB6gXCcPR/Mch9rhlAHf4bgI//07C/czZ9c 3GBFdKoPvzcnIOzMzO+Pqns/PwKDnJB2Y3SaJGxw8MqGWV9vT+L8zv4n1nqN/a/a4eNW z+oaRROKtF+J53Ix/6KWWRcH2IuZwfxtSChQJGhL7NkGzrLKTLCY3xP9hArywSnVJ2Nd un/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BH08Zd37jgMT5BJkCh3yo4A8owT2Xvzs0j2NLhOEre4=; b=KHmgSXm244hYlTiJhS6Ag481brgG2CW3I/hc6o7hqs9TK48AO1k2UYZwz/TWkQJA50 VhMjyyjE38NRt0ru/DW1hFZa+ryauDGF6/36si9O1S7Ak/eRs38IoOvZqK/Lh9sctcu6 legd/uM7+j1U4WXHpvfRa1psZTLyq1xJQwNC36Vq4qTRU4sFShojrIzJHBq1IdGj3Nlw xrYufM3r0XvQsb6bCjdbho1joAKG2CIbxy3XKG/W3FA+W0gUZMZTS4+1jPhhmFdjFIgJ S46/F5WtZCnqPvsTVWJXYmmTeV0zHQwl24gpY7mfLFIW5IENay+RXqe0ufK0ZI+lpVFL E1sw== X-Gm-Message-State: AGi0PubqGVeokdStCpD5NF02cbZD9/0XyevCXkzuhfU5ikABSBnR7Tdp /Gic2xR3LHWUvF3VffMi9Fp7FQqs X-Google-Smtp-Source: APiQypJyXLOGfh0t7V+cfgbcXHDLUOsrWVfqwPuqJnmHdXVNzLoAe66UMtnclqS6QrwDItEacgxa7Q== X-Received: by 2002:adf:decb:: with SMTP id i11mr3223066wrn.172.1588691919615; Tue, 05 May 2020 08:18:39 -0700 (PDT) Received: from localhost.localdomain (cpc91192-cmbg18-2-0-cust374.5-4.cable.virginm.net. [80.6.113.119]) by smtp.gmail.com with ESMTPSA id o18sm3662662wrp.23.2020.05.05.08.18.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2020 08:18:37 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/rockchip: vop: call vop_cfg_done() under reg_lock Date: Tue, 5 May 2020 16:16:13 +0100 Message-Id: <20200505151613.2932456-1-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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: emil.l.velikov@gmail.com, Sandy Huang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Emil Velikov The function vop_cfg_done() is a simple VOP_REG_SET(). As such it should be done under a reg_lock. A quick look through the driver shows that all other instances (apart from driver init) have the lock. Do the same here Cc: Sandy Huang Cc: Heiko Stübner Signed-off-by: Emil Velikov Reviewed-by: Sandy Huang --- Noticed while skimming through the code and thus untested. --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 33463b79a37b..1d76455ca933 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -645,10 +645,10 @@ static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) s->enable_afbc = false; } - spin_unlock(&vop->reg_lock); - vop_cfg_done(vop); + spin_unlock(&vop->reg_lock); + /* * At here, vop clock & iommu is enable, R/W vop regs would be safe. */