Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2394108pxb; Fri, 17 Sep 2021 08:49:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpaYXju1y7sdYTWzzg5YboFqEzic6edhcfLXKyFnqeMs1ekWMesfAZzRclrztE70l4HhFW X-Received: by 2002:a05:6e02:1103:: with SMTP id u3mr8760594ilk.233.1631893759222; Fri, 17 Sep 2021 08:49:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631893759; cv=none; d=google.com; s=arc-20160816; b=ubJEO9qTUj9FRLP0gVciHBj1fb1B7VBy6oNzBbLQB0NMPW2Kj8EM9iUqvZOsz8KmkE r7EekVeq25C4hKLsTJ3Tv4iBR5FQlA7amS51365E7bEDTw6fIhrNCJHrzy8gYLE4EuAw vwjP8MB2LTNI8r4D4WYNSLA5EVCU1UrN3KjRyX0C8Al0FKq9efpGIbZ9/5W3zWQPjksF O1WmxVDzv22AtZXSApMP/6zBhTIRdVprbP+gMWyGsqDC0MKP3ispMEAV6COk0ZN4NIob GoXDcbbHo4AoEpGYnbnVcimWv/1ScwfX1lX35M8oKLV4ISzIH6OUfYXYMKXcB3Uzhqa9 XTNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=QZO8NMAjMQkXQJzuQx47mPXuOG2i+pU24PwiydWpDeM=; b=Pi8x3za+zZYmtA9ZP9UDCEHnP9UVlpCYAFotROlsh3o6bW3EHLjHLnfJwpOesLeMJg QANRjFnMnTAE5sNst7XWS7CC9PkFIAEep+uPEBXkFGxdSdj+qouauEyokun0hoRLG1xi gk82vR1Z9hGIDa1wEu3M+qVDFXDebpbFBj0cIxf0w4+yIi67L6RfgiyVfMkcDCA6/60M r2uqUFnQUI9R1vjL4LzA5HuqPc5+oz/cqGdrtn/Dufz/WOYebWzccCS8at96LGpM0vjP kvnjXVZC65mI7J2yZi6ynRXkax2i+vcC1wb3Byh8egFy7T6m5/KAgcLshpvdpNa2VUZ4 SeQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=QSUPKbjl; 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 t195si7151201iof.69.2021.09.17.08.49.08; Fri, 17 Sep 2021 08:49:19 -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=@poorly.run header.s=google header.b=QSUPKbjl; 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 S242119AbhIQPne (ORCPT + 99 others); Fri, 17 Sep 2021 11:43:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238821AbhIQPnd (ORCPT ); Fri, 17 Sep 2021 11:43:33 -0400 Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAD23C061766 for ; Fri, 17 Sep 2021 08:42:11 -0700 (PDT) Received: by mail-qk1-x736.google.com with SMTP id p4so18733730qki.3 for ; Fri, 17 Sep 2021 08:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QZO8NMAjMQkXQJzuQx47mPXuOG2i+pU24PwiydWpDeM=; b=QSUPKbjlIZXzcgl73QzCldp54G6vcvodAvbVZuE3jtlcyyYXYA1Nti1qUlSPg4uUiB 0I/Iq6SJFmn1IttowvF/JMR79YSGKAeBrdjW+CCxmrvXfIWEgMwxsqvKB1QK9GIqGyAV SMJdcHsj5HUav2SDLNCQR71lQwEdIjxJRmaLPa/oBq9kV/9cq2ycR60owTGUyRXWD8tR 5Hnc0X90MeyQI3BmpnJ4dje2o+63d3K8WVZKD+j9pbfPZq/5+ejWGTnPp/Btb9SukgLZ G+5y9BLcPfSxlDAhiL7q3cjZrBKUErLPUu4Rehtr5GHRXT7jxlCqIzodKSNW/8NAP6zY K34w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QZO8NMAjMQkXQJzuQx47mPXuOG2i+pU24PwiydWpDeM=; b=Skj3mXvX40KJ7hBMjXg5Yuzvgrzr/ppAF0Ae9FZ5d6T0vDpjoKo39uR7vl1hnnCqDI 2qaDp2t8GQB9eiiQf9Gwp1oIdNXZSj0vgbceo+KfquoDi4HRrkTBu/VRyiJPo8BdmHK6 MrkddvnPw5MG7xLIEjwULVPTHdV6dX0TjHM/47fTQoEYrPCbP5pxlCLwL2NLWeXHhep8 UWx5B+0kHzRWpeQmdgld0Dr/RCPjASj7dUSQ5zcxq7+aTPf13OYrYM92qsJrMoC2/o89 uasu764OJUUK1ucog77CbYcYMdvWOu6Ufyf8znGQER0PGjrasgFUPWTW/Kz94L4V1E6O VISw== X-Gm-Message-State: AOAM531U4P2A+2t+rKAqWkeD0QbN+lms0pZdm+8Ie/9TUJ14ML19qbH7 YxW2hCkiwL0nkH5Y+ZeLQLZ9qg== X-Received: by 2002:a05:620a:2185:: with SMTP id g5mr11148090qka.244.1631893330985; Fri, 17 Sep 2021 08:42:10 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id p10sm916118qkk.10.2021.09.17.08.42.10 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Sep 2021 08:42:10 -0700 (PDT) Date: Fri, 17 Sep 2021 11:42:09 -0400 From: Sean Paul To: Fernando Ramos Cc: dri-devel@lists.freedesktop.org, 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: Re: [PATCH 10/15] drm/nouveau: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN() Message-ID: <20210917154209.GK2515@art_vandelay> References: <20210916211552.33490-1-greenfoo@u92.eu> <20210916211552.33490-11-greenfoo@u92.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210916211552.33490-11-greenfoo@u92.eu> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 16, 2021 at 11:15:47PM +0200, Fernando Ramos wrote: > 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 > --- > drivers/gpu/drm/nouveau/dispnv50/disp.c | 12 ++++++++---- > 1 file changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c > index d7b9f7f8c9e3..eb613af4cdd5 100644 > --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c > +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c > @@ -667,15 +667,17 @@ 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); > + DRM_MODESET_LOCK_ALL_END(drm_dev, ctx, ret); > return 0; Return ret here, with that fixed, Reviewed-by: Sean Paul > } > > @@ -686,12 +688,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 > -- Sean Paul, Software Engineer, Google / Chromium OS