From: Jani Nikula <jani.nikula@intel.com>
To: Maxime Ripard <mripard@kernel.org>, Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
Dave Airlie <airlied@redhat.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
dri-devel@lists.freedesktop.org,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v2 1/4] drm/dp: Add a way to init/add a connector in separate steps
Date: Fri, 29 Nov 2024 17:58:56 +0200 [thread overview]
Message-ID: <874j3q6ngf.fsf@intel.com> (raw)
In-Reply-To: <20241129-wild-cobra-of-thunder-829d1f@houat>
On Fri, 29 Nov 2024, Maxime Ripard <mripard@kernel.org> wrote:
> On Fri, Nov 29, 2024 at 04:26:01PM +0200, Imre Deak wrote:
>> Adding more people from DRM core domain. Any comment, objection to this
>> change?
>>
>> On Tue, Nov 26, 2024 at 06:18:56PM +0200, Imre Deak wrote:
>> > Atm when the connector is added to the drm_mode_config::connector_list,
>> > the connector may not be fully initialized yet. This is not a problem
>> > for user space, which will see the connector only after it's registered
>> > later, it could be a problem for in-kernel users looking up connectors
>> > via the above list.
>
> It could be, or it actually is a problem? If so, in what situation?
It's an actual problem.
While in most cases connectors are created at probe, for DP MST they're
created at runtime via the ->add_connector hook. We want to call
drm_connector_init() on them soon in that hook, so we can pass the
connector around and expect it to have connector->dev etc. initialized
while we continue its initialization.
But there's a race. As soon as we call drm_connector_init(), the
connector gets added to dev->mode_config.connector_list, and any drm
code may discover it. For example connector polling. And we might not be
done with the initialization yet.
>> > To resolve the above issue, add a way to separately initialize the DRM
>> > core specific parts of the connector and add it to the above list. This
>> > will move adding the connector to the list after the properties on the
>> > connector have been added, this is ok since these steps don't have a
>> > dependency.
>> >
>> > v2: (Jani)
>> > - Let initing DDC as well via drm_connector_init_core().
>> > - Rename __drm_connector_init to drm_connector_init_core_and_add().
>> >
>> > Cc: Jani Nikula <jani.nikula@intel.com>
>> > Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (v1)
>> > Signed-off-by: Imre Deak <imre.deak@intel.com>
>
> If we do have an actual problem to solve, we'll need kunit tests too.
That's not an unreasonable request, per se, but what exactly should they
test? That the new init core didn't add stuff to the list, and the new
add connector did?
BR,
Jani.
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-11-29 15:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-26 16:18 [PATCH v2 0/4] drm/dp: Expose only a properly inited connector Imre Deak
2024-11-26 16:18 ` [PATCH v2 1/4] drm/dp: Add a way to init/add a connector in separate steps Imre Deak
2024-11-29 14:26 ` Imre Deak
2024-11-29 14:46 ` Maxime Ripard
2024-11-29 15:58 ` Jani Nikula [this message]
2024-12-02 10:45 ` Maxime Ripard
2024-11-29 16:12 ` Imre Deak
2024-12-02 10:48 ` Maxime Ripard
2024-12-02 12:07 ` Jani Nikula
2024-12-02 13:24 ` Imre Deak
2024-12-02 15:07 ` Maxime Ripard
2024-12-02 15:31 ` Imre Deak
2024-12-02 15:06 ` Maxime Ripard
2024-12-02 15:44 ` Jani Nikula
2024-12-03 9:36 ` Maxime Ripard
2024-12-03 11:17 ` Jani Nikula
2024-12-02 16:35 ` Simona Vetter
2024-12-02 20:07 ` Imre Deak
2024-12-06 20:48 ` Simona Vetter
2024-11-26 16:18 ` [PATCH v2 2/4] drm/i915/dp_mst: Expose a connector to kernel users after it's properly initialized Imre Deak
2024-11-26 16:18 ` [PATCH v2 3/4] drm/i915/dp_mst: Fix error handling while adding a connector Imre Deak
2024-11-26 16:18 ` [PATCH v2 4/4] drm/i915/dp_mst: Use intel_connector vs. drm_connector pointer in intel_dp_mst.c Imre Deak
2024-11-26 16:51 ` ✗ Fi.CI.SPARSE: warning for drm/dp: Expose only a properly inited connector Patchwork
2024-11-26 17:05 ` ✓ i915.CI.BAT: success " Patchwork
2024-11-26 18:30 ` ✗ i915.CI.Full: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874j3q6ngf.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=airlied@redhat.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox