Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1255679pxb; Thu, 23 Sep 2021 23:45:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdljIp3TBQM8Ns89yPFWEK75V5mPC5EErC6lUneoRXbtZgoqdEO75vMkKxizOj2RUvSC5d X-Received: by 2002:a02:9699:: with SMTP id w25mr7667238jai.143.1632465947487; Thu, 23 Sep 2021 23:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632465947; cv=none; d=google.com; s=arc-20160816; b=IcaD8P+ZOQ7033J7C1YrLb8VGfXDoPZfEc83hqq7fqmk2KAl89A/NWq3RYJZHlsKil N2K1QAPTQUZwwqt/mdyk7MGtcMqgydh+zmmVdzbsSjUtk6sp16ABjdwN/oVaOnX1b2Ao tjKl4Adq9N4WQjeR141GQb5QccYzPeI31QvywEX2OpKFwrozROBOe8Q15HgULl1AyJan BNasRgq5Eipj7eqK0/IYZuNRZZLpOkUnXxLxjS3a/Pc1zGsP38t5lUcHoofsSgB/9ncV xFK5XDuQuB8tmYzS2hcq/crbZge07cpENInnwN57NKdSgmbDIF9wHmcEjmGn5LJ/UzX0 VBxQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=r21xTV04JhLQhFFcwkc0d4AVLdWU1vIuTxgVGoPXBxw=; b=oUceJIadqKqIRiCaORzySrSGqSXVSU6pE3ArAAvqnh7s0SBe3QB5PF8wELsBThhAoP R9jZTDvJOTVW57KoulVHvDTYDMNsOPNI8BArgJ85TtiMK3Y5qubOqZ5TXYQsIMZDPIQX 3fx2GJ9K6hzWo8NcIg+tydhCRImPSSps7isD8r+d8konx2DvlzXq6esfIqLuQrTSMJGG +FFbmsy7C80awRLHcILKYlAvVXCofBjc6WPF2v5UoCHuhNwbNa5AgLgntSccLwzHs7ig Mf26sUxwPh4q73/MxplpesUfgLarZ4b25e4Av3REW7WeVd1ezIbVlNpT020xExXM8RaH 3I5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@u92.eu header.s=fm3 header.b=M7ahpHCP; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=EfH71FX5; 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 m19si10070032jat.15.2021.09.23.23.45.12; Thu, 23 Sep 2021 23:45:47 -0700 (PDT) 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; dkim=pass header.i=@u92.eu header.s=fm3 header.b=M7ahpHCP; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=EfH71FX5; 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 S244244AbhIXGpg (ORCPT + 99 others); Fri, 24 Sep 2021 02:45:36 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:54703 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244366AbhIXGpf (ORCPT ); Fri, 24 Sep 2021 02:45:35 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 4C667581073; Fri, 24 Sep 2021 02:44:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 24 Sep 2021 02:44:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=u92.eu; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=r21xTV04JhLQh FFcwkc0d4AVLdWU1vIuTxgVGoPXBxw=; b=M7ahpHCPB7321OXSbKVvrjkxlGxiv ssKom+46HIxjIovT9mByAOO4Z4xj6yTjt2ETbwIqZrHo2hxnWOpCTQVmjAdIHp/i ni8IfdFwjthv0vUiJQ3J19IAwF6TQTz65SSpEn4vdmswzJirYSBPvW2ZbtitDNal AoduoBTEcL4ca5REzpJBG5Nuv/CGIPEis1ub9dIV2y3T+VYb940fcxcTLn8Foq0z d6bT+M1kxV0AHip45O0DRxWYKaH4FxiZIqO1pD7bR/ho0sSXhHCP/E2+WOX6gzdM UFX2qfZ+rL2d9T1UqA1+XQwLIEyREFQHKUfD34PcsRN/tLSs5+1sEEh0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=r21xTV04JhLQhFFcwkc0d4AVLdWU1vIuTxgVGoPXBxw=; b=EfH71FX5 /yTI3z7wTTcxOGH+JLGUH40I8oWztFOUdvGNz9cLweZTaNrDrUtY6PWYRmQfiLtj RAcvEL+Qbkt+epV5b8oR/9D8odJVtKIGq0TwgU7qcis2Ls3qP73O6hQA04LqgT8I cPFBld2PFvurjHdqGCZSR4qpw3pXjYODzorVLDiLE9xbcSGSmsdMgCtQeCNfi0qh rKXerajm5qYGMmjoCPP5TZUWTlH9qcW2Q2K01OKMjBzvYTIHHqGZ8dVbmnBkVDg9 r9cT7WOv37O1b4jh79Krk/MpUNxH91pMxy+pu396DvAf5H2NtJR9wVR64BgcBST8 YZiRcbt4cmKNZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejtddguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefhvghrnhgrnhguohcutfgrmhhoshcuoehgrhgvvghnfhho ohesuhelvddrvghuqeenucggtffrrghtthgvrhhnpeekleekjedtheejheekfefggeevvd fgueegffeuveduhfehueegkeeijedvvdejfeenucevlhhushhtvghrufhiiigvpedvnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvvghnfhhoohesuhelvddrvghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 24 Sep 2021 02:43:59 -0400 (EDT) From: Fernando Ramos To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, sean@poorly.run, linux-doc@vger.kernel.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH v2 10/17] drm/nouveau: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN() Date: Fri, 24 Sep 2021 08:43:17 +0200 Message-Id: <20210924064324.229457-11-greenfoo@u92.eu> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210924064324.229457-1-greenfoo@u92.eu> References: <20210924064324.229457-1-greenfoo@u92.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As requested in Documentation/gpu/todo.rst, replace driver calls to drm_modeset_lock_all() with DRM_MODESET_LOCK_ALL_BEGIN() and DRM_MODESET_LOCK_ALL_END() Signed-off-by: Fernando Ramos Reviewed-by: Sean Paul --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index d7b9f7f8c9e3..86e18a844953 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -667,16 +668,18 @@ nv50_audio_component_bind(struct device *kdev, struct device *hda_kdev, struct drm_device *drm_dev = dev_get_drvdata(kdev); struct nouveau_drm *drm = nouveau_drm(drm_dev); struct drm_audio_component *acomp = data; + struct drm_modeset_acquire_ctx ctx; + int ret; if (WARN_ON(!device_link_add(hda_kdev, kdev, DL_FLAG_STATELESS))) return -ENOMEM; - drm_modeset_lock_all(drm_dev); + DRM_MODESET_LOCK_ALL_BEGIN(drm_dev, ctx, 0, ret); acomp->ops = &nv50_audio_component_ops; acomp->dev = kdev; drm->audio.component = acomp; - drm_modeset_unlock_all(drm_dev); - return 0; + DRM_MODESET_LOCK_ALL_END(drm_dev, ctx, ret); + return ret; } static void @@ -686,12 +689,14 @@ nv50_audio_component_unbind(struct device *kdev, struct device *hda_kdev, struct drm_device *drm_dev = dev_get_drvdata(kdev); struct nouveau_drm *drm = nouveau_drm(drm_dev); struct drm_audio_component *acomp = data; + struct drm_modeset_acquire_ctx ctx; + int ret; - drm_modeset_lock_all(drm_dev); + DRM_MODESET_LOCK_ALL_BEGIN(drm_dev, ctx, 0, ret); drm->audio.component = NULL; acomp->ops = NULL; acomp->dev = NULL; - drm_modeset_unlock_all(drm_dev); + DRM_MODESET_LOCK_ALL_END(drm_dev, ctx, ret); } static const struct component_ops nv50_audio_component_bind_ops = { -- 2.33.0