From: Jani Nikula <jani.nikula@linux.intel.com>
To: imre.deak@intel.com
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/dp/mst: Read the extended DPCD capabilities during system resume
Date: Tue, 14 Jun 2022 17:03:12 +0300 [thread overview]
Message-ID: <87mtefxrz3.fsf@intel.com> (raw)
In-Reply-To: <YqiF3k/gyy2Axtwz@ideak-desk.fi.intel.com>
On Tue, 14 Jun 2022, Imre Deak <imre.deak@intel.com> wrote:
> On Tue, Jun 14, 2022 at 03:32:59PM +0300, Jani Nikula wrote:
>> On Tue, 14 Jun 2022, Imre Deak <imre.deak@intel.com> wrote:
>> > The WD22TB4 Thunderbolt dock at least will revert its DP_MAX_LINK_RATE
>> > from HBR3 to HBR2 after system suspend/resume if the DP_DP13_DPCD_REV
>> > registers are not read subsequently also as required.
>>
>> Does it actually change the behaviour depending on whether the dpcd is
>> read or not, or is this just about the resume path overwriting mgr->dpcd
>> with stuff from DP_DPCD_REV?
>
> Yes, the reading out DP_DP13_DPCD_REV has a side-effect, see
> https://gitlab.freedesktop.org/drm/intel/-/issues/5292#note_1343399
:o
Okay, the commit message is fine as-is.
>
>> drm_dp_mst_topology_mgr_set_mst() does use drm_dp_read_dpcd_caps() for
>> reading the caps, which would normally set mgr->dpcd from
>> DP_DP13_DPCD_REV.
>
> Right, but at that point DP_DP13_DPCD_REV returns HBR2 w/o this change.
>
>> BR,
>> Jani.
>>
>> >
>> > Fix this by reading DP_DP13_DPCD_REV registers as well, matching what is
>> > done during connector detection. While at it also fix up the same call
>> > in drm_dp_mst_dump_topology().
>> >
>> > Cc: Lyude Paul <lyude@redhat.com>
>> > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5292
>> > Signed-off-by: Imre Deak <imre.deak@intel.com>
>> > ---
>> > drivers/gpu/drm/display/drm_dp_mst_topology.c | 7 ++-----
>> > 1 file changed, 2 insertions(+), 5 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
>> > index 67b3b9697da7f..18f2b6075b780 100644
>> > --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
>> > +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
>> > @@ -3860,9 +3860,7 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr,
>> > if (!mgr->mst_primary)
>> > goto out_fail;
>> >
>> > - ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd,
>> > - DP_RECEIVER_CAP_SIZE);
>> > - if (ret != DP_RECEIVER_CAP_SIZE) {
>> > + if (drm_dp_read_dpcd_caps(mgr->aux, mgr->dpcd) < 0) {
>> > drm_dbg_kms(mgr->dev, "dpcd read failed - undocked during suspend?\n");
>> > goto out_fail;
>> > }
>> > @@ -4911,8 +4909,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m,
>> > u8 buf[DP_PAYLOAD_TABLE_SIZE];
>> > int ret;
>> >
>> > - ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, buf, DP_RECEIVER_CAP_SIZE);
>> > - if (ret) {
>> > + if (drm_dp_read_dpcd_caps(mgr->aux, buf) < 0) {
>> > seq_printf(m, "dpcd read failed\n");
>> > goto out;
>> > }
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center
--
Jani Nikula, Intel Open Source Graphics Center
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: imre.deak@intel.com
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/dp/mst: Read the extended DPCD capabilities during system resume
Date: Tue, 14 Jun 2022 17:03:12 +0300 [thread overview]
Message-ID: <87mtefxrz3.fsf@intel.com> (raw)
In-Reply-To: <YqiF3k/gyy2Axtwz@ideak-desk.fi.intel.com>
On Tue, 14 Jun 2022, Imre Deak <imre.deak@intel.com> wrote:
> On Tue, Jun 14, 2022 at 03:32:59PM +0300, Jani Nikula wrote:
>> On Tue, 14 Jun 2022, Imre Deak <imre.deak@intel.com> wrote:
>> > The WD22TB4 Thunderbolt dock at least will revert its DP_MAX_LINK_RATE
>> > from HBR3 to HBR2 after system suspend/resume if the DP_DP13_DPCD_REV
>> > registers are not read subsequently also as required.
>>
>> Does it actually change the behaviour depending on whether the dpcd is
>> read or not, or is this just about the resume path overwriting mgr->dpcd
>> with stuff from DP_DPCD_REV?
>
> Yes, the reading out DP_DP13_DPCD_REV has a side-effect, see
> https://gitlab.freedesktop.org/drm/intel/-/issues/5292#note_1343399
:o
Okay, the commit message is fine as-is.
>
>> drm_dp_mst_topology_mgr_set_mst() does use drm_dp_read_dpcd_caps() for
>> reading the caps, which would normally set mgr->dpcd from
>> DP_DP13_DPCD_REV.
>
> Right, but at that point DP_DP13_DPCD_REV returns HBR2 w/o this change.
>
>> BR,
>> Jani.
>>
>> >
>> > Fix this by reading DP_DP13_DPCD_REV registers as well, matching what is
>> > done during connector detection. While at it also fix up the same call
>> > in drm_dp_mst_dump_topology().
>> >
>> > Cc: Lyude Paul <lyude@redhat.com>
>> > Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5292
>> > Signed-off-by: Imre Deak <imre.deak@intel.com>
>> > ---
>> > drivers/gpu/drm/display/drm_dp_mst_topology.c | 7 ++-----
>> > 1 file changed, 2 insertions(+), 5 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
>> > index 67b3b9697da7f..18f2b6075b780 100644
>> > --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
>> > +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
>> > @@ -3860,9 +3860,7 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr,
>> > if (!mgr->mst_primary)
>> > goto out_fail;
>> >
>> > - ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd,
>> > - DP_RECEIVER_CAP_SIZE);
>> > - if (ret != DP_RECEIVER_CAP_SIZE) {
>> > + if (drm_dp_read_dpcd_caps(mgr->aux, mgr->dpcd) < 0) {
>> > drm_dbg_kms(mgr->dev, "dpcd read failed - undocked during suspend?\n");
>> > goto out_fail;
>> > }
>> > @@ -4911,8 +4909,7 @@ void drm_dp_mst_dump_topology(struct seq_file *m,
>> > u8 buf[DP_PAYLOAD_TABLE_SIZE];
>> > int ret;
>> >
>> > - ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, buf, DP_RECEIVER_CAP_SIZE);
>> > - if (ret) {
>> > + if (drm_dp_read_dpcd_caps(mgr->aux, buf) < 0) {
>> > seq_printf(m, "dpcd read failed\n");
>> > goto out;
>> > }
>>
>> --
>> Jani Nikula, Intel Open Source Graphics Center
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-06-14 14:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-14 9:45 [Intel-gfx] [PATCH] drm/dp/mst: Read the extended DPCD capabilities during system resume Imre Deak
2022-06-14 9:45 ` Imre Deak
2022-06-14 12:32 ` [Intel-gfx] " Jani Nikula
2022-06-14 12:32 ` Jani Nikula
2022-06-14 12:34 ` [Intel-gfx] " Jani Nikula
2022-06-14 12:34 ` Jani Nikula
2022-06-14 12:58 ` [Intel-gfx] " Imre Deak
2022-06-14 12:58 ` Imre Deak
2022-06-14 14:03 ` Jani Nikula [this message]
2022-06-14 14:03 ` Jani Nikula
2022-06-14 14:06 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-06-15 4:25 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-06-16 18:57 ` Imre Deak
2022-06-16 18:57 ` Imre Deak
2022-06-16 19:01 ` [Intel-gfx] " Imre Deak
2022-06-16 19:01 ` Imre Deak
2022-06-16 20:33 ` [Intel-gfx] " Vudum, Lakshminarayana
2022-06-16 20:33 ` Vudum, Lakshminarayana
2022-06-15 20:26 ` [Intel-gfx] [PATCH] " Lyude Paul
2022-06-15 20:26 ` Lyude Paul
2022-06-16 20:40 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for " 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=87mtefxrz3.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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.