From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B332C433F5 for ; Tue, 31 May 2022 21:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347891AbiEaVNp (ORCPT ); Tue, 31 May 2022 17:13:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346313AbiEaVNp (ORCPT ); Tue, 31 May 2022 17:13:45 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBED736B75 for ; Tue, 31 May 2022 14:13:43 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id f9so29134662ejc.0 for ; Tue, 31 May 2022 14:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2D0n0MD9FVM5CduT1NCFZoyK1Wf+YfR32ZwltpKGpW0=; b=ZQT68xf2h4yPB1aO3z6MMCxjgrGQxzK6GsAwKC4AbtmM7jt7hPu9NP/5/38W/CoGs4 /U426ZyODXRJ/hIK1zizXSQUiCeTA65NiXm2tba9pIlaxq1ArpOmj55sVibamQlHpil1 HXArJ8lpnCJ5gJjSUw7JSWNWLGFhmor2Mb+W4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2D0n0MD9FVM5CduT1NCFZoyK1Wf+YfR32ZwltpKGpW0=; b=suJXUn0qOwsewoF7YiAuEMQR8WHDJtq2lUeRgSmVRAfnRMBSE7nQUVrLUMUIO40cFD CCt4fF/O7Ar4Wt0VotUexEL4YsSfIkisS8Q3gbVixosFQNF2qhYcNqe566CMqS3pJE0I yqRsgHA8qFGFXEB0LwiGxdKXkCk1G5Zzy9CQOesqNBK6ym4QMK71AOoEi/njK368eDvl 37hA4CmKvAqvWhHo4JaPye0RbpiYADjGtMxf+0tSgmWl698MYpU6lT5T+efiuOkunR2L cpgmAZ6RE0JogTzkTphm7YwH6U3ZoNGfTOolplpqcww0PUw02NU5uU1CtTiqLceeUIEN +sMA== X-Gm-Message-State: AOAM533ox4Bw7O+SSgZwfkOV6bbNjL6zsHhh32I4Q6Jw/Fv9fyG7BkIP nDyDwGaeP7JCgFVSc6JIxaAWoSmt7iBi47Zf X-Google-Smtp-Source: ABdhPJzzZz4kRiZ1mtTrqtDbMYC69l+JTG5UgAvLrOXVTEfYA9MGJEikmQt9UIVWJFwJYthz5bPcew== X-Received: by 2002:a17:907:972a:b0:6f4:f456:50a7 with SMTP id jg42-20020a170907972a00b006f4f45650a7mr54274035ejc.431.1654031622298; Tue, 31 May 2022 14:13:42 -0700 (PDT) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com. [209.85.128.54]) by smtp.gmail.com with ESMTPSA id d21-20020a170906641500b006febce7081esm5415052ejm.177.2022.05.31.14.13.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 14:13:41 -0700 (PDT) Received: by mail-wm1-f54.google.com with SMTP id f23-20020a7bcc17000000b003972dda143eso1924368wmh.3 for ; Tue, 31 May 2022 14:13:41 -0700 (PDT) X-Received: by 2002:a05:600c:3d8e:b0:397:73e3:8c83 with SMTP id bi14-20020a05600c3d8e00b0039773e38c83mr25043368wmb.29.1654031205884; Tue, 31 May 2022 14:06:45 -0700 (PDT) MIME-Version: 1.0 References: <20220510192944.2408515-1-dianders@chromium.org> <20220510122726.v3.3.Iba4b9bf6c7a1ee5ea2835ad7bd5eaf84d7688520@changeid> <20220521091751.opeiqbmc5c2okdq6@houat> In-Reply-To: From: Doug Anderson Date: Tue, 31 May 2022 14:06:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 3/4] drm/bridge: Add devm_drm_bridge_add() To: Maxime Ripard Cc: dri-devel , Hsin-Yi Wang , Abhinav Kumar , Philip Chen , Sankeerth Billakanti , Robert Foss , freedreno , Dmitry Baryshkov , linux-arm-msm , Stephen Boyd , Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Maxime, On Mon, May 23, 2022 at 10:00 AM Doug Anderson wrote: > > Hi, > > On Sat, May 21, 2022 at 2:17 AM Maxime Ripard wrote: > > > > Hi, > > > > On Tue, May 10, 2022 at 12:29:43PM -0700, Douglas Anderson wrote: > > > This adds a devm managed version of drm_bridge_add(). Like other > > > "devm" function listed in drm_bridge.h, this function takes an > > > explicit "dev" to use for the lifetime management. A few notes: > > > * In general we have a "struct device" for bridges that makes a good > > > candidate for where the lifetime matches exactly what we want. > > > * The "bridge->dev->dev" device appears to be the encoder > > > device. That's not the right device to use for lifetime management. > > > > > > Suggested-by: Dmitry Baryshkov > > > Signed-off-by: Douglas Anderson > > > > If we are to introduce more managed helpers, I think it'd be wiser to > > introduce them as DRM-managed, and not device managed. > > > > Otherwise, you'll end up in a weird state when a device has been removed > > but the DRM device is still around. > > I'm kinda confused. In this case there is no DRM device for the bridge > and, as per my CL description, "bridge-dev->dev" appears to be the > encoder device. I wasn't personally involved in discussions about it, > but I was under the impression that this was expected / normal. Thus > we can't make this DRM-managed. Since I didn't hear a reply, I'll assume that my response addressed your concerns. Assuming I get reviews for the other two patches in this series I'll plan to land this with Dmitry's review. -Doug From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C19F0C433F5 for ; Tue, 31 May 2022 21:06:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DC3D310E262; Tue, 31 May 2022 21:06:50 +0000 (UTC) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1645310E262 for ; Tue, 31 May 2022 21:06:50 +0000 (UTC) Received: by mail-ej1-x630.google.com with SMTP id f21so28945469ejh.11 for ; Tue, 31 May 2022 14:06:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2D0n0MD9FVM5CduT1NCFZoyK1Wf+YfR32ZwltpKGpW0=; b=ZQT68xf2h4yPB1aO3z6MMCxjgrGQxzK6GsAwKC4AbtmM7jt7hPu9NP/5/38W/CoGs4 /U426ZyODXRJ/hIK1zizXSQUiCeTA65NiXm2tba9pIlaxq1ArpOmj55sVibamQlHpil1 HXArJ8lpnCJ5gJjSUw7JSWNWLGFhmor2Mb+W4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2D0n0MD9FVM5CduT1NCFZoyK1Wf+YfR32ZwltpKGpW0=; b=ApAUXujSL6Wc7GbpHWaV1BBm4iN0dNjM926XPIRPh9py6IpKOLs36iVdKuoHjeWwg2 a9Ue7dwSqCVNNFH3clnWdcW3jLBtheVTlz6nRAsfzUvCmQ6ZB63dxh+miLu0d5ptzsnb Tvw0ZQCL3Z275cfda3jY1wd24V0TCI5BZtZDKLyAsGD6GD07B9Ud2KxiLLrDlWoy5wzk pEj5wB8fT1uPpaYFiWqEEvJ85KQWfVT+cy7lrFCGM2ZrlunbRFgd47i60uDeiiJQbnbo D9b3hGjWAp5mA69dczYyRLhWc5IsQwuD8kNaPCPjvvM7pUsdAiGk/UW4DMYsNP7Ah1q4 ojAg== X-Gm-Message-State: AOAM531AcDYUhZMsyjtPAJ+8e8bQYNOOJYIVQucLg1M7+05cnWfn7eGL oAmvOR05kY5jdydvn5fzTPGS6XXs+SUTunYG X-Google-Smtp-Source: ABdhPJxu4LfS8R3yBK/Xa+27jLXvaBBQZqsmDf9kqZlenFN2daJfmwlbZrP7aQQicQ0+bOb8+WN8xA== X-Received: by 2002:a17:907:3f98:b0:6fe:e28c:472c with SMTP id hr24-20020a1709073f9800b006fee28c472cmr40426860ejc.519.1654031208428; Tue, 31 May 2022 14:06:48 -0700 (PDT) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com. [209.85.128.49]) by smtp.gmail.com with ESMTPSA id f20-20020a056402355400b0042aca5edba7sm9219717edd.57.2022.05.31.14.06.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 31 May 2022 14:06:47 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id c5-20020a1c3505000000b0038e37907b5bso1942753wma.0 for ; Tue, 31 May 2022 14:06:46 -0700 (PDT) X-Received: by 2002:a05:600c:3d8e:b0:397:73e3:8c83 with SMTP id bi14-20020a05600c3d8e00b0039773e38c83mr25043368wmb.29.1654031205884; Tue, 31 May 2022 14:06:45 -0700 (PDT) MIME-Version: 1.0 References: <20220510192944.2408515-1-dianders@chromium.org> <20220510122726.v3.3.Iba4b9bf6c7a1ee5ea2835ad7bd5eaf84d7688520@changeid> <20220521091751.opeiqbmc5c2okdq6@houat> In-Reply-To: From: Doug Anderson Date: Tue, 31 May 2022 14:06:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 3/4] drm/bridge: Add devm_drm_bridge_add() To: Maxime Ripard Content-Type: text/plain; charset="UTF-8" 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: Sankeerth Billakanti , Philip Chen , Thomas Zimmermann , David Airlie , linux-arm-msm , Abhinav Kumar , Robert Foss , Stephen Boyd , dri-devel , Hsin-Yi Wang , Dmitry Baryshkov , freedreno , LKML Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Maxime, On Mon, May 23, 2022 at 10:00 AM Doug Anderson wrote: > > Hi, > > On Sat, May 21, 2022 at 2:17 AM Maxime Ripard wrote: > > > > Hi, > > > > On Tue, May 10, 2022 at 12:29:43PM -0700, Douglas Anderson wrote: > > > This adds a devm managed version of drm_bridge_add(). Like other > > > "devm" function listed in drm_bridge.h, this function takes an > > > explicit "dev" to use for the lifetime management. A few notes: > > > * In general we have a "struct device" for bridges that makes a good > > > candidate for where the lifetime matches exactly what we want. > > > * The "bridge->dev->dev" device appears to be the encoder > > > device. That's not the right device to use for lifetime management. > > > > > > Suggested-by: Dmitry Baryshkov > > > Signed-off-by: Douglas Anderson > > > > If we are to introduce more managed helpers, I think it'd be wiser to > > introduce them as DRM-managed, and not device managed. > > > > Otherwise, you'll end up in a weird state when a device has been removed > > but the DRM device is still around. > > I'm kinda confused. In this case there is no DRM device for the bridge > and, as per my CL description, "bridge-dev->dev" appears to be the > encoder device. I wasn't personally involved in discussions about it, > but I was under the impression that this was expected / normal. Thus > we can't make this DRM-managed. Since I didn't hear a reply, I'll assume that my response addressed your concerns. Assuming I get reviews for the other two patches in this series I'll plan to land this with Dmitry's review. -Doug