Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2099428ioo; Mon, 23 May 2022 10:03:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzffEDOMdTMKeucB51Ke0ogIItDbHTFJrrdD3+b0z9kFDoB0BDOqfsyziTfW+wqB1iedu9F X-Received: by 2002:a63:551e:0:b0:3fa:288f:d87 with SMTP id j30-20020a63551e000000b003fa288f0d87mr7542298pgb.586.1653325417783; Mon, 23 May 2022 10:03:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653325417; cv=none; d=google.com; s=arc-20160816; b=OVv/zX/jMwsZwlZN2Igg7GL+0JDtVy4pBVoX7Kg9na99AXCYVQtPmRaZgXWZUmDBLv hMGguqa9Bz+5YDHN4bNLq9B1wIdM+GeU7l/7+tjVerGGiRLi8Zqc+DKN3Dcr/7wM0H++ yRCikjZw0NAHGd+P1qxt06D8mr0taHa4Bj2U8pNrX7k4ix0Vj1Io679zquG7UedsPucO tjH+Q7wM9G8nyEEoBKsCr0Q0+k5K3kvljmAaRKP60Ewp1qKQXIyrwV5l9ugKZSZq3c/Z Kl5dkwvNtVV4mOopNnRrRyosgK613oKI90P/ZIl6DuZPp+UGYaZvk1VgPvIMZB0/9LVR GCjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+yqE1pGHx1x3KKc79e6Yq8sNIx1yXpNzstv/8bzqb5s=; b=RHn5lmmNhjZJ/xHXKJzfPJzdWPx2DvV6+RvdbGQDXf34IPdLvBgZgLLZR6lyDLpyp8 IeYQqKkinrtTZD5dQVcG8/O/oWUAo9S5VQtf+hZd/prESU1IXtmHQhMF47JyReG+7n2w 4znL9UfGU1YPWm5pMh6nsBrxIsoTSuLsFqpkoJe0K/SoTmu4dj2ljvwZuTFbl6nns2BN pCEX/Q5Hwp2B/smfYeck1faPID2yl5hVNXLOewwST2+NIN/wK7bC9PHymFhrpbbLlgpy GYiLQDwshhga+/dzrqfzHQcfgDQjnc38V+pZWkbsBTKtYKSoAN/rvjgunmty/jdFk6XQ e8uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZjtsMPgQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id g23-20020a170902d5d700b0015d21512abfsi9780856plh.527.2022.05.23.10.03.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:03:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZjtsMPgQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0149512A88; Mon, 23 May 2022 10:01:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231968AbiEWRBG (ORCPT + 99 others); Mon, 23 May 2022 13:01:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238994AbiEWRBD (ORCPT ); Mon, 23 May 2022 13:01:03 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C12527A for ; Mon, 23 May 2022 10:00:58 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id ck4so25856640ejb.8 for ; Mon, 23 May 2022 10:00:58 -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=+yqE1pGHx1x3KKc79e6Yq8sNIx1yXpNzstv/8bzqb5s=; b=ZjtsMPgQV6WFMaPsFE5wXrme9HyysqJfDxmCwYeAGbvKIHUWff1Cpyv4vRAIzb2+6g CaBM3u9mN7ChwiUoZn0x2jmbmh8Ids9Twb+q9Mx4bev++DIoBHEX+JPi/peV3/cHXpnt ki/dDbMZHLrt1JuRTfIjOmj46abGOccIRmJ+w= 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=+yqE1pGHx1x3KKc79e6Yq8sNIx1yXpNzstv/8bzqb5s=; b=TncHQMtRYEF2BLKehSO0vrYHAAaNIbD9SNlV5zJEUY2lPOVclmJHqnSEiVWXQj4Ufi TX29fMWXkPu3Ykj+PxbOq5M2gt8nufmR0jisJfu2fkl/SXUlxpA7HOC58lxQyhSZMak/ UUS3tHg0bT0vTY+xA/JaLj9PCXj70dZiHdp67mc8DQX66bZgeprU8xM/UByuMAYIqA9B 6TxmRjYrQUiRwYowXIYosEtP6J8BqaY+W70rznnuWHOOm7evDAD26qpLKqojj3cOQas4 5w/4a9p5UC/bYbUtMnEBAooZvuJgZZ+icNQttYegPbTuxpt9ko3GAd/LB+tfULawM/5a jn8Q== X-Gm-Message-State: AOAM532Vx4i9saYOxSvkM1NW00p0Hi8p+uswTy8q2zk/bvjpa49c3pN3 ifWZ0JovY603zPUwlvPT9t9gllVsQXcPOrHGzDo= X-Received: by 2002:a17:906:9b8b:b0:6fe:fdc9:82c0 with SMTP id dd11-20020a1709069b8b00b006fefdc982c0mr1001589ejc.629.1653325256526; Mon, 23 May 2022 10:00:56 -0700 (PDT) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com. [209.85.221.43]) by smtp.gmail.com with ESMTPSA id rh6-20020a17090720e600b006fee7b400e6sm1143010ejb.111.2022.05.23.10.00.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 May 2022 10:00:54 -0700 (PDT) Received: by mail-wr1-f43.google.com with SMTP id r23so22307237wrr.2 for ; Mon, 23 May 2022 10:00:53 -0700 (PDT) X-Received: by 2002:a05:6000:1c03:b0:20e:5cac:1eb5 with SMTP id ba3-20020a0560001c0300b0020e5cac1eb5mr19994642wrb.422.1653325252721; Mon, 23 May 2022 10:00:52 -0700 (PDT) MIME-Version: 1.0 References: <20220510192944.2408515-1-dianders@chromium.org> <20220510122726.v3.3.Iba4b9bf6c7a1ee5ea2835ad7bd5eaf84d7688520@changeid> <20220521091751.opeiqbmc5c2okdq6@houat> In-Reply-To: <20220521091751.opeiqbmc5c2okdq6@houat> From: Doug Anderson Date: Mon, 23 May 2022 10:00:39 -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" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -Doug