* [PATCH] thunderbolt: Add only on-board retimers when !CONFIG_USB4_DEBUGFS_MARGINING
@ 2024-10-28 10:51 Mika Westerberg
2024-10-28 11:12 ` Chia-Lin Kao (AceLan)
0 siblings, 1 reply; 3+ messages in thread
From: Mika Westerberg @ 2024-10-28 10:51 UTC (permalink / raw)
To: linux-usb
Cc: Yehezkel Bernat, Michael Jamet, Lukas Wunner, Andreas Noever,
AceLan Kao, Mika Westerberg
Normally there is no need to enumerate retimers on the other side of the
cable. This is only needed in special cases where user wants to run
receiver lane margining against the downstream facing port of a retimer.
Furthermore this might confuse the userspace tools such as fwupd because
it cannot read the information it expects from these retimers.
Fix this by changing the retimer enumeration code to add only on-board
retimers when CONFIG_USB4_DEBUGFS_MARGINING is not enabled.
Reported-by: AceLan Kao <acelan.kao@canonical.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219420
Cc: stable@vger.kernel.org
Fixes: ff6ab055e070 ("thunderbolt: Add receiver lane margining support for retimers")
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
Hi AceLan,
I changed the patch slightly. I wonder if you could try it again?
Thanks!
drivers/thunderbolt/retimer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c
index 7db9869a9f3f..89d2919d0193 100644
--- a/drivers/thunderbolt/retimer.c
+++ b/drivers/thunderbolt/retimer.c
@@ -532,6 +532,8 @@ int tb_retimer_scan(struct tb_port *port, bool add)
}
ret = 0;
+ if (!IS_ENABLED(CONFIG_USB4_DEBUGFS_MARGINING))
+ max = min(last_idx, max);
/* Add retimers if they do not exist already */
for (i = 1; i <= max; i++) {
--
2.45.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] thunderbolt: Add only on-board retimers when !CONFIG_USB4_DEBUGFS_MARGINING
2024-10-28 10:51 [PATCH] thunderbolt: Add only on-board retimers when !CONFIG_USB4_DEBUGFS_MARGINING Mika Westerberg
@ 2024-10-28 11:12 ` Chia-Lin Kao (AceLan)
2024-10-29 5:50 ` Mika Westerberg
0 siblings, 1 reply; 3+ messages in thread
From: Chia-Lin Kao (AceLan) @ 2024-10-28 11:12 UTC (permalink / raw)
To: Mika Westerberg
Cc: linux-usb, Yehezkel Bernat, Michael Jamet, Lukas Wunner,
Andreas Noever
On Mon, Oct 28, 2024 at 12:51:21PM +0200, Mika Westerberg wrote:
> Normally there is no need to enumerate retimers on the other side of the
> cable. This is only needed in special cases where user wants to run
> receiver lane margining against the downstream facing port of a retimer.
> Furthermore this might confuse the userspace tools such as fwupd because
> it cannot read the information it expects from these retimers.
>
> Fix this by changing the retimer enumeration code to add only on-board
> retimers when CONFIG_USB4_DEBUGFS_MARGINING is not enabled.
>
> Reported-by: AceLan Kao <acelan.kao@canonical.com>
> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219420
> Cc: stable@vger.kernel.org
> Fixes: ff6ab055e070 ("thunderbolt: Add receiver lane margining support for retimers")
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
> Hi AceLan,
>
> I changed the patch slightly. I wonder if you could try it again?
Yes, this revision also fixes the issue.
Thanks.
Tested-by: AceLan Kao <acelan.kao@canonical.com>
>
> Thanks!
>
> drivers/thunderbolt/retimer.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c
> index 7db9869a9f3f..89d2919d0193 100644
> --- a/drivers/thunderbolt/retimer.c
> +++ b/drivers/thunderbolt/retimer.c
> @@ -532,6 +532,8 @@ int tb_retimer_scan(struct tb_port *port, bool add)
> }
>
> ret = 0;
> + if (!IS_ENABLED(CONFIG_USB4_DEBUGFS_MARGINING))
> + max = min(last_idx, max);
>
> /* Add retimers if they do not exist already */
> for (i = 1; i <= max; i++) {
> --
> 2.45.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] thunderbolt: Add only on-board retimers when !CONFIG_USB4_DEBUGFS_MARGINING
2024-10-28 11:12 ` Chia-Lin Kao (AceLan)
@ 2024-10-29 5:50 ` Mika Westerberg
0 siblings, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2024-10-29 5:50 UTC (permalink / raw)
To: Chia-Lin Kao (AceLan)
Cc: linux-usb, Yehezkel Bernat, Michael Jamet, Lukas Wunner,
Andreas Noever
On Mon, Oct 28, 2024 at 07:12:51PM +0800, Chia-Lin Kao (AceLan) wrote:
> On Mon, Oct 28, 2024 at 12:51:21PM +0200, Mika Westerberg wrote:
> > Normally there is no need to enumerate retimers on the other side of the
> > cable. This is only needed in special cases where user wants to run
> > receiver lane margining against the downstream facing port of a retimer.
> > Furthermore this might confuse the userspace tools such as fwupd because
> > it cannot read the information it expects from these retimers.
> >
> > Fix this by changing the retimer enumeration code to add only on-board
> > retimers when CONFIG_USB4_DEBUGFS_MARGINING is not enabled.
> >
> > Reported-by: AceLan Kao <acelan.kao@canonical.com>
> > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219420
> > Cc: stable@vger.kernel.org
> > Fixes: ff6ab055e070 ("thunderbolt: Add receiver lane margining support for retimers")
> > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > ---
> > Hi AceLan,
> >
> > I changed the patch slightly. I wonder if you could try it again?
> Yes, this revision also fixes the issue.
> Thanks.
>
> Tested-by: AceLan Kao <acelan.kao@canonical.com>
Thanks for testing!
Applied to thunderbolt.git/fixes.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-29 5:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-28 10:51 [PATCH] thunderbolt: Add only on-board retimers when !CONFIG_USB4_DEBUGFS_MARGINING Mika Westerberg
2024-10-28 11:12 ` Chia-Lin Kao (AceLan)
2024-10-29 5:50 ` Mika Westerberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox