From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>
Cc: Sean Paul <seanpaul@google.com>, David Airlie <airlied@linux.ie>,
nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org,
amd-gfx@lists.freedesktop.org,
Hans de Goede <hdegoede@redhat.com>,
dri-devel@lists.freedesktop.org,
Thomas Zimmermann <tzimmermann@suse.de>,
Alex Deucher <alexander.deucher@amd.com>,
Mikita Lipski <mikita.lipski@amd.com>
Subject: Re: [PATCH 2/3] drm/dp_mst: Don't show connectors as connected before probing available PBN
Date: Thu, 5 Mar 2020 20:29:42 +0200 [thread overview]
Message-ID: <20200305182942.GP13686@intel.com> (raw)
In-Reply-To: <73f52c392431cd21a80a118dd2fd1986e2c535df.camel@redhat.com>
On Thu, Mar 05, 2020 at 01:13:36PM -0500, Lyude Paul wrote:
> On Thu, 2020-03-05 at 15:11 +0200, Ville Syrjälä wrote:
> > On Wed, Mar 04, 2020 at 05:36:12PM -0500, Lyude Paul wrote:
> > > It's next to impossible for us to do connector probing on topologies
> > > without occasionally racing with userspace, since creating a connector
> > > itself causes a hotplug event which we have to send before probing the
> > > available PBN of a connector. Even if we didn't have this hotplug event
> > > sent, there's still always a chance that userspace started probing
> > > connectors before we finished probing the topology.
> > >
> > > This can be a problem when validating a new MST state since the
> > > connector will be shown as connected briefly, but without any available
> > > PBN - causing any atomic state which would enable said connector to fail
> > > with -ENOSPC. So, let's simply workaround this by telling userspace new
> > > MST connectors are disconnected until we've finished probing their PBN.
> > > Since we always send a hotplug event at the end of the link address
> > > probing process, userspace will still know to reprobe the connector when
> > > we're ready.
> > >
> > > Signed-off-by: Lyude Paul <lyude@redhat.com>
> > > Fixes: cd82d82cbc04 ("drm/dp_mst: Add branch bandwidth validation to MST
> > > atomic check")
> > > Cc: Mikita Lipski <mikita.lipski@amd.com>
> > > Cc: Alex Deucher <alexander.deucher@amd.com>
> > > Cc: Sean Paul <seanpaul@google.com>
> > > Cc: Hans de Goede <hdegoede@redhat.com>
> > > ---
> > > drivers/gpu/drm/drm_dp_mst_topology.c | 13 +++++++++++++
> > > 1 file changed, 13 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > > index 207eef08d12c..7b0ff0cff954 100644
> > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > > @@ -4033,6 +4033,19 @@ drm_dp_mst_detect_port(struct drm_connector
> > > *connector,
> > > ret = connector_status_connected;
> > > break;
> > > }
> > > +
> > > + /* We don't want to tell userspace the port is actually plugged into
> > > + * anything until we've finished probing it's available_pbn, otherwise
> >
> > "its"
> >
> > Why is the connector even registered before we've finished the probe?
> >
> Oops, I'm not sure how I did this by accident but the explanation I gave in
> the commit message was uh, completely wrong. I must have forgotten that I made
> sure we didn't expose connectors before probing their PBN back when I started
> my MST cleanup....
>
> So: despite what I said before it's not actually when new connectors are
> created, it's when downstream hotplugs happen which means that the conenctor's
> always going to be there before we probe the available_pbn.
Not sure I understand. You're saying this is going to change for already
existing connectors when something else gets plugged in, and either we
zero it out during the probe or it always was zero to begin with for
whatever reason?
> I did just notice
> though that we send a hotplug on connection status notifications even before
> we've finished the PBN probe, so I might be able to improve on that as well.
> We still definitely want to report the connector as disconnected before we
> have the available PBN though, in case another probe was already going before
> we got the connection status notification.
>
> I'll make sure to fixup the explanation in the commit message on the next
> respin
>
> > > + * userspace will see racy atomic check failures
> > > + *
> > > + * Since we always send a hotplug at the end of probing topology
> > > + * state, we can just let userspace reprobe this connector later.
> > > + */
> > > + if (ret == connector_status_connected && !port->available_pbn) {
> > > + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] not ready yet (PBN not
> > > probed)\n",
> > > + connector->base.id, connector->name);
> > > + ret = connector_status_disconnected;
> > > + }
> > > out:
> > > drm_dp_mst_topology_put_port(port);
> > > return ret;
> > > --
> > > 2.24.1
> > >
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> --
> Cheers,
> Lyude Paul (she/her)
> Associate Software Engineer at Red Hat
--
Ville Syrjälä
Intel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
nouveau@lists.freedesktop.org, Sean Paul <seanpaul@google.com>,
David Airlie <airlied@linux.ie>,
linux-kernel@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
Alex Deucher <alexander.deucher@amd.com>,
Mikita Lipski <mikita.lipski@amd.com>
Subject: Re: [PATCH 2/3] drm/dp_mst: Don't show connectors as connected before probing available PBN
Date: Thu, 5 Mar 2020 20:29:42 +0200 [thread overview]
Message-ID: <20200305182942.GP13686@intel.com> (raw)
In-Reply-To: <73f52c392431cd21a80a118dd2fd1986e2c535df.camel@redhat.com>
On Thu, Mar 05, 2020 at 01:13:36PM -0500, Lyude Paul wrote:
> On Thu, 2020-03-05 at 15:11 +0200, Ville Syrjälä wrote:
> > On Wed, Mar 04, 2020 at 05:36:12PM -0500, Lyude Paul wrote:
> > > It's next to impossible for us to do connector probing on topologies
> > > without occasionally racing with userspace, since creating a connector
> > > itself causes a hotplug event which we have to send before probing the
> > > available PBN of a connector. Even if we didn't have this hotplug event
> > > sent, there's still always a chance that userspace started probing
> > > connectors before we finished probing the topology.
> > >
> > > This can be a problem when validating a new MST state since the
> > > connector will be shown as connected briefly, but without any available
> > > PBN - causing any atomic state which would enable said connector to fail
> > > with -ENOSPC. So, let's simply workaround this by telling userspace new
> > > MST connectors are disconnected until we've finished probing their PBN.
> > > Since we always send a hotplug event at the end of the link address
> > > probing process, userspace will still know to reprobe the connector when
> > > we're ready.
> > >
> > > Signed-off-by: Lyude Paul <lyude@redhat.com>
> > > Fixes: cd82d82cbc04 ("drm/dp_mst: Add branch bandwidth validation to MST
> > > atomic check")
> > > Cc: Mikita Lipski <mikita.lipski@amd.com>
> > > Cc: Alex Deucher <alexander.deucher@amd.com>
> > > Cc: Sean Paul <seanpaul@google.com>
> > > Cc: Hans de Goede <hdegoede@redhat.com>
> > > ---
> > > drivers/gpu/drm/drm_dp_mst_topology.c | 13 +++++++++++++
> > > 1 file changed, 13 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > > index 207eef08d12c..7b0ff0cff954 100644
> > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > > @@ -4033,6 +4033,19 @@ drm_dp_mst_detect_port(struct drm_connector
> > > *connector,
> > > ret = connector_status_connected;
> > > break;
> > > }
> > > +
> > > + /* We don't want to tell userspace the port is actually plugged into
> > > + * anything until we've finished probing it's available_pbn, otherwise
> >
> > "its"
> >
> > Why is the connector even registered before we've finished the probe?
> >
> Oops, I'm not sure how I did this by accident but the explanation I gave in
> the commit message was uh, completely wrong. I must have forgotten that I made
> sure we didn't expose connectors before probing their PBN back when I started
> my MST cleanup....
>
> So: despite what I said before it's not actually when new connectors are
> created, it's when downstream hotplugs happen which means that the conenctor's
> always going to be there before we probe the available_pbn.
Not sure I understand. You're saying this is going to change for already
existing connectors when something else gets plugged in, and either we
zero it out during the probe or it always was zero to begin with for
whatever reason?
> I did just notice
> though that we send a hotplug on connection status notifications even before
> we've finished the PBN probe, so I might be able to improve on that as well.
> We still definitely want to report the connector as disconnected before we
> have the available PBN though, in case another probe was already going before
> we got the connection status notification.
>
> I'll make sure to fixup the explanation in the commit message on the next
> respin
>
> > > + * userspace will see racy atomic check failures
> > > + *
> > > + * Since we always send a hotplug at the end of probing topology
> > > + * state, we can just let userspace reprobe this connector later.
> > > + */
> > > + if (ret == connector_status_connected && !port->available_pbn) {
> > > + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] not ready yet (PBN not
> > > probed)\n",
> > > + connector->base.id, connector->name);
> > > + ret = connector_status_disconnected;
> > > + }
> > > out:
> > > drm_dp_mst_topology_put_port(port);
> > > return ret;
> > > --
> > > 2.24.1
> > >
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> --
> Cheers,
> Lyude Paul (she/her)
> Associate Software Engineer at Red Hat
--
Ville Syrjälä
Intel
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>
Cc: Sean Paul <seanpaul@google.com>, David Airlie <airlied@linux.ie>,
nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org,
amd-gfx@lists.freedesktop.org,
Hans de Goede <hdegoede@redhat.com>,
dri-devel@lists.freedesktop.org,
Thomas Zimmermann <tzimmermann@suse.de>,
Alex Deucher <alexander.deucher@amd.com>,
Mikita Lipski <mikita.lipski@amd.com>
Subject: Re: [PATCH 2/3] drm/dp_mst: Don't show connectors as connected before probing available PBN
Date: Thu, 5 Mar 2020 20:29:42 +0200 [thread overview]
Message-ID: <20200305182942.GP13686@intel.com> (raw)
In-Reply-To: <73f52c392431cd21a80a118dd2fd1986e2c535df.camel@redhat.com>
On Thu, Mar 05, 2020 at 01:13:36PM -0500, Lyude Paul wrote:
> On Thu, 2020-03-05 at 15:11 +0200, Ville Syrjälä wrote:
> > On Wed, Mar 04, 2020 at 05:36:12PM -0500, Lyude Paul wrote:
> > > It's next to impossible for us to do connector probing on topologies
> > > without occasionally racing with userspace, since creating a connector
> > > itself causes a hotplug event which we have to send before probing the
> > > available PBN of a connector. Even if we didn't have this hotplug event
> > > sent, there's still always a chance that userspace started probing
> > > connectors before we finished probing the topology.
> > >
> > > This can be a problem when validating a new MST state since the
> > > connector will be shown as connected briefly, but without any available
> > > PBN - causing any atomic state which would enable said connector to fail
> > > with -ENOSPC. So, let's simply workaround this by telling userspace new
> > > MST connectors are disconnected until we've finished probing their PBN.
> > > Since we always send a hotplug event at the end of the link address
> > > probing process, userspace will still know to reprobe the connector when
> > > we're ready.
> > >
> > > Signed-off-by: Lyude Paul <lyude@redhat.com>
> > > Fixes: cd82d82cbc04 ("drm/dp_mst: Add branch bandwidth validation to MST
> > > atomic check")
> > > Cc: Mikita Lipski <mikita.lipski@amd.com>
> > > Cc: Alex Deucher <alexander.deucher@amd.com>
> > > Cc: Sean Paul <seanpaul@google.com>
> > > Cc: Hans de Goede <hdegoede@redhat.com>
> > > ---
> > > drivers/gpu/drm/drm_dp_mst_topology.c | 13 +++++++++++++
> > > 1 file changed, 13 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > > index 207eef08d12c..7b0ff0cff954 100644
> > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > > @@ -4033,6 +4033,19 @@ drm_dp_mst_detect_port(struct drm_connector
> > > *connector,
> > > ret = connector_status_connected;
> > > break;
> > > }
> > > +
> > > + /* We don't want to tell userspace the port is actually plugged into
> > > + * anything until we've finished probing it's available_pbn, otherwise
> >
> > "its"
> >
> > Why is the connector even registered before we've finished the probe?
> >
> Oops, I'm not sure how I did this by accident but the explanation I gave in
> the commit message was uh, completely wrong. I must have forgotten that I made
> sure we didn't expose connectors before probing their PBN back when I started
> my MST cleanup....
>
> So: despite what I said before it's not actually when new connectors are
> created, it's when downstream hotplugs happen which means that the conenctor's
> always going to be there before we probe the available_pbn.
Not sure I understand. You're saying this is going to change for already
existing connectors when something else gets plugged in, and either we
zero it out during the probe or it always was zero to begin with for
whatever reason?
> I did just notice
> though that we send a hotplug on connection status notifications even before
> we've finished the PBN probe, so I might be able to improve on that as well.
> We still definitely want to report the connector as disconnected before we
> have the available PBN though, in case another probe was already going before
> we got the connection status notification.
>
> I'll make sure to fixup the explanation in the commit message on the next
> respin
>
> > > + * userspace will see racy atomic check failures
> > > + *
> > > + * Since we always send a hotplug at the end of probing topology
> > > + * state, we can just let userspace reprobe this connector later.
> > > + */
> > > + if (ret == connector_status_connected && !port->available_pbn) {
> > > + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] not ready yet (PBN not
> > > probed)\n",
> > > + connector->base.id, connector->name);
> > > + ret = connector_status_disconnected;
> > > + }
> > > out:
> > > drm_dp_mst_topology_put_port(port);
> > > return ret;
> > > --
> > > 2.24.1
> > >
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> --
> Cheers,
> Lyude Paul (she/her)
> Associate Software Engineer at Red Hat
--
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-03-05 18:29 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-04 22:36 [PATCH 0/3] drm/dp_mst: Fix bandwidth checking regressions from DSC patches Lyude Paul
2020-03-04 22:36 ` Lyude Paul
2020-03-04 22:36 ` Lyude Paul
2020-03-04 22:36 ` [PATCH 1/3] drm/dp_mst: Rename drm_dp_mst_is_dp_mst_end_device() to be less redundant Lyude Paul
2020-03-04 22:36 ` Lyude Paul
2020-03-04 22:36 ` Lyude Paul
2020-03-04 22:36 ` [PATCH 2/3] drm/dp_mst: Don't show connectors as connected before probing available PBN Lyude Paul
2020-03-04 22:36 ` Lyude Paul
2020-03-04 22:36 ` Lyude Paul
2020-03-05 13:11 ` Ville Syrjälä
2020-03-05 13:11 ` Ville Syrjälä
2020-03-05 13:11 ` Ville Syrjälä
2020-03-05 18:13 ` Lyude Paul
2020-03-05 18:13 ` Lyude Paul
2020-03-05 18:13 ` Lyude Paul
2020-03-05 18:29 ` Ville Syrjälä [this message]
2020-03-05 18:29 ` Ville Syrjälä
2020-03-05 18:29 ` Ville Syrjälä
2020-03-05 18:52 ` Lyude Paul
2020-03-05 18:52 ` Lyude Paul
2020-03-05 18:52 ` Lyude Paul
2020-03-05 19:44 ` Lyude Paul
2020-03-05 19:44 ` Lyude Paul
2020-03-05 19:44 ` Lyude Paul
2020-03-06 20:03 ` Lyude Paul
2020-03-06 20:03 ` Lyude Paul
2020-03-06 20:03 ` Lyude Paul
2020-03-06 20:03 ` Lyude Paul
2020-03-06 21:22 ` Lyude Paul
2020-03-06 21:22 ` Lyude Paul
2020-03-06 21:22 ` Lyude Paul
2020-03-04 22:36 ` [PATCH 3/3] drm/dp_mst: Rewrite and fix bandwidth limit checks Lyude Paul
2020-03-04 22:36 ` Lyude Paul
2020-03-04 22:36 ` Lyude Paul
2020-03-05 16:41 ` [PATCH 0/3] drm/dp_mst: Fix bandwidth checking regressions from DSC patches Hans de Goede
2020-03-05 16:41 ` Hans de Goede
2020-03-05 16:41 ` Hans de Goede
2020-03-05 16:41 ` Hans de Goede
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=20200305182942.GP13686@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lyude@redhat.com \
--cc=mikita.lipski@amd.com \
--cc=nouveau@lists.freedesktop.org \
--cc=seanpaul@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.