Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1745964pxb; Thu, 4 Feb 2021 23:47:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlNThfugZATKnGEzdvkia2whArNoD/s93VcjH+WeTCVUXMJYGVgcofm1Jm3xhE6QnxB3IO X-Received: by 2002:a05:6402:4253:: with SMTP id g19mr2312676edb.343.1612511254039; Thu, 04 Feb 2021 23:47:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612511254; cv=none; d=google.com; s=arc-20160816; b=nG4oSyoEtlomkpYI+tvo3UJajajSuFjUej7u1Ac6vtngqKq2FBeHrOeo6GiVSO13w0 u2ibhMB4Dr6ZZftO/6JCBmO3T5epvl/fUBYqdpFsXw1nGbadqVV5vNfxmhR7bOruaht3 EUE3o/dAT51qjzNfA1KXZaIxliCFAB4ANpobrgL1AaSiihDaUrGxTHFYVOHRBj00BPGY rXHcepjJUr0OtsfmzwVB5MLMghUV7COCbiJOlQnGw6ABokUczf938BTbPAt1Deym3s7S ykN5jJlP2LMGe5W7nAXH6FY+jPzg3/WpSFx8kqZreiU+yA/psXkJIDPivhGqqXJvOP7Q EoZQ== 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=aSpfLkF/ij3s2gh42g+FyW7GPnjIVsUi/InXL83F+CI=; b=aN9G8DXcQrcD++EPUas2pAiEPgRvcPmR9B+grI5FADYQyUB79tQF0CovmKlqogIPRU MgcIG9repbelbkxMRpL9JAUKkKpV48D9xpQgn/suBQAjy1q1eJWdHDRmV5d/vFVT4Cno zRo2mMxtVo6ihjaeheDCNoYIqLrL7kFq8HRO8gK1nwoqINFcirsChx6fmx9I188hz11n 6PLzPfh2JeqyEy1NP28O9fyalNkviNEHEt8x5xJODEKHGRoZmGBImhESSWhmZID1wzcY vmnRfJ1LoI4k8cXj5WnMyyfIJdHr2wukE+v96nshemgO7gZqkmTQmdQcPz65lrjaToGk ZOwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=khu5n8zo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh26si4577464ejb.465.2021.02.04.23.47.09; Thu, 04 Feb 2021 23:47:34 -0800 (PST) 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=@chromium.org header.s=google header.b=khu5n8zo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231557AbhBEHnP (ORCPT + 99 others); Fri, 5 Feb 2021 02:43:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231576AbhBEHnE (ORCPT ); Fri, 5 Feb 2021 02:43:04 -0500 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D1CFC0613D6 for ; Thu, 4 Feb 2021 23:42:24 -0800 (PST) Received: by mail-yb1-xb35.google.com with SMTP id i71so5856746ybg.7 for ; Thu, 04 Feb 2021 23:42:24 -0800 (PST) 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=aSpfLkF/ij3s2gh42g+FyW7GPnjIVsUi/InXL83F+CI=; b=khu5n8zof/YLgW30jVewG+qIYV8ZJBFd+3TICC0xZsJ6LemvfI5SpqmDdgDVaTIgVo WSs7urrfCjqegA/eIQIYgFpYToi00Daufg070GieCRsRa9omiZ7LvH/pvwVJKc6SXpER VEa+5JHVV/cTKH/c+uWCOCnQoU0p7BjnYsEN0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aSpfLkF/ij3s2gh42g+FyW7GPnjIVsUi/InXL83F+CI=; b=oLSOvGXWCejZeEcWOoiKbIHR6thGCZjOH6aIilXZ+0ltoqhmXPfdS7HRQt6HD3k5lE lIoHvtzkO5qR6j7qe5hDpRqW+U5fW3CkDDcBWO94pmYsxVFUBmD0B5koCVyIOuva/8as WexiSlJeSJmXp0Uqo+9SjYPm5NPomDaJXmP4ZoYShbkZemwzp1vCuhAhNXvXLqJmyuNi P1UZtEVenyo9bmUxiEbfdUrcG4LDmnG4AnNQvcsIk0VhZf9rVoRm46WAr+sdJv7ujCCR N1cwHGtDyeLAtKrQkvDt5ioeJ9pGNJXz9f+kAfa/+pUWXUo2LTaGtT/U9SLrnz/pL4q3 /Zdw== X-Gm-Message-State: AOAM530nbgAcfTFTrXsTiI/Eg991vacpeNbdFk2W8GhW86u3DMbBmfOP mvBq49AV8+WzAo92EjCACcFKXnzSo+lo26wbu7UnIw== X-Received: by 2002:a25:6ad6:: with SMTP id f205mr4328880ybc.41.1612510943572; Thu, 04 Feb 2021 23:42:23 -0800 (PST) MIME-Version: 1.0 References: <20200923121320.v3.1.I8693156f555875e5c8342e86ab37ce968dfdd277@changeid> <20200923121320.v3.3.I6c917ff82a1d2ae2253a3bd4d750d58879387cac@changeid> In-Reply-To: From: Sam McNally Date: Fri, 5 Feb 2021 18:41:46 +1100 Message-ID: Subject: Re: [PATCH v3 3/4] drm_dp_mst_topology: export two functions To: lyude@redhat.com Cc: LKML , Thomas Zimmermann , David Airlie , Hans Verkuil , Hans Verkuil , dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2 Feb 2021 at 09:03, Lyude Paul wrote: > > On Wed, 2020-09-23 at 12:13 +1000, Sam McNally wrote: > > From: Hans Verkuil > > > > These are required for the CEC MST support. > > > > Signed-off-by: Hans Verkuil > > Signed-off-by: Sam McNally > > --- > > > > (no changes since v1) > > > > drivers/gpu/drm/drm_dp_mst_topology.c | 6 ++---- > > include/drm/drm_dp_mst_helper.h | 4 ++++ > > 2 files changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c > > b/drivers/gpu/drm/drm_dp_mst_topology.c > > index 0d753201adbd..c783a2a1c114 100644 > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > > @@ -62,8 +62,6 @@ struct drm_dp_pending_up_req { > > static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, > > char *buf); > > > > -static void drm_dp_mst_topology_put_port(struct drm_dp_mst_port *port); > > - > > static int drm_dp_dpcd_write_payload(struct drm_dp_mst_topology_mgr *mgr, > > int id, > > struct drm_dp_payload *payload); > > @@ -1864,7 +1862,7 @@ static void drm_dp_mst_topology_get_port(struct > > drm_dp_mst_port *port) > > * drm_dp_mst_topology_try_get_port() > > * drm_dp_mst_topology_get_port() > > */ > > -static void drm_dp_mst_topology_put_port(struct drm_dp_mst_port *port) > > +void drm_dp_mst_topology_put_port(struct drm_dp_mst_port *port) > > Mhhhhhh-can you think of some way around this? I really don't think it's a good > idea for us to be exposing topology references to things as-is, the thing is > they're really meant to be used for critical sections in code where it'd become > very painful to deal with an mst port disappearing from under us. Outside of MST > helpers, everyone else should be dealing with the expectation that these things > can disappear as a result of hotplugs at any moment. > > Note that we do expose malloc refs, but that's intentional as holding a malloc > ref to something doesn't cause it to stay around even when it's unplugged - it > just stops it from being unallocated. > > Yes, it turns out we won't need this after all. > > { > > topology_ref_history_lock(port->mgr); > > > > @@ -1935,7 +1933,7 @@ drm_dp_mst_topology_get_port_validated_locked(struct > > drm_dp_mst_branch *mstb, > > return NULL; > > } > > > > -static struct drm_dp_mst_port * > > +struct drm_dp_mst_port * > > drm_dp_mst_topology_get_port_validated(struct drm_dp_mst_topology_mgr *mgr, > > struct drm_dp_mst_port *port) > > { > > diff --git a/include/drm/drm_dp_mst_helper.h b/include/drm/drm_dp_mst_helper.h > > index c7c79e0ced18..d036222e0d64 100644 > > --- a/include/drm/drm_dp_mst_helper.h > > +++ b/include/drm/drm_dp_mst_helper.h > > @@ -754,6 +754,10 @@ drm_dp_mst_detect_port(struct drm_connector *connector, > > struct drm_dp_mst_topology_mgr *mgr, > > struct drm_dp_mst_port *port); > > > > +struct drm_dp_mst_port *drm_dp_mst_topology_get_port_validated > > +(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port); > > +void drm_dp_mst_topology_put_port(struct drm_dp_mst_port *port); > > + > > struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct > > drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port); > > > > > > -- > Sincerely, > Lyude Paul (she/her) > Software Engineer at Red Hat > > Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've > asked me a question, are waiting for a review/merge on a patch, etc. and I > haven't responded in a while, please feel free to send me another email to check > on my status. I don't bite! >