All of lore.kernel.org
 help / color / mirror / Atom feed
From: Basavaraj Natikar <bnatikar@amd.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>,
	"S, Sanath" <Sanath.S@amd.com>
Cc: Mario Limonciello <superm1@kernel.org>,
	"Natikar, Basavaraj" <Basavaraj.Natikar@amd.com>,
	"Martinez, Juan" <Juan.Martinez@amd.com>,
	"westeri@kernel.org" <westeri@kernel.org>,
	"andreas.noever@gmail.com" <andreas.noever@gmail.com>,
	"YehezkelShB@gmail.com" <YehezkelShB@gmail.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5] thunderbolt: Fix tb->lock deadlock during hot-unplug on AMD USB4 routers
Date: Mon, 5 Oct 2026 19:24:31 +0530	[thread overview]
Message-ID: <674079d7-6ea7-438c-ac57-07def94ec92b@amd.com> (raw)
In-Reply-To: <20260915060459.GJ106095@black.igk.intel.com>

Hi Mika,

On 9/15/2026 11:34 AM, Mika Westerberg wrote:

> Hi,
>
> On Tue, Sep 15, 2026 at 04:51:00AM +0000, S, Sanath wrote:
> Ported it and stressed it on two Strix Halo hosts connected back to back.
> REG_CAPS reports hop_count = 3 here, so two usable DMA HopIDs. Observations:
>
>   - Single tunnel it works: 50 x traffic then link down/up, plus 42 x
>     dma_test create / transfer / teardown. One reset per cycle, no ping loss,
>     no errors, and every ring restart had a reset before it.
>
>   - Every reset is preceded by "dangling request in request_queue" and a
>     WARNING from tb_ctl_stop(), 8 of 8 cycles, via tb_domain_pause() <-
>     tb_ring_start() <- tbnet_connected_work().
>
>   - Two tunnels: the networking ring is stopped and restarted with no reset
>     in between, because the check only runs in nhi_alloc_hop() and tbnet
>     reuses its rings across a reconnect. 18 such cycles did not hang, so the
>     unsafe reuse is reachable but I cannot say it hangs.
>
>   - When the check does fire it takes networking down, reproduced twice:
>     "RTNETLINK answers: Cannot allocate memory" plus "out of HopIDs that do
>     not need a host interface reset", until the second tunnel stops.
>
>   - tb_domain_pause() takes tb->lock from tb_ring_start(), while unplug holds
>     tb->lock across tbnet_remove() -> stop_login() ->
>     cancel_work_sync(&net->connected_work).
>
> Moving the reset into a per-NHI work item scheduled from tb_ring_stop() when
> the last DMA ring stops removes the warning and the tb->lock inversion, and
> passes the same tests cleanly. The reuse hole and the lockout still need the
> reset to key off ring reuse rather than ring allocation.
>
> Mika, Can I respin your patch along those lines and post it as a new version?
> Of course. I'm thinking though that should we do the revert for v7.3-rcX
> now and then do the proper fix for v7.4 with your updated patch?

The reworked series is posted here:
https://lore.kernel.org/all/cover.1790854235.git.Basavaraj.Natikar@amd.com/

Thanks,
--
Basavaraj



      parent reply	other threads:[~2026-10-05 13:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 21:42 [PATCH v2] thunderbolt: Fix tb->lock deadlock during hot-unplug on AMD USB4 routers juan.martinez
2026-08-26  3:02 ` Mario Limonciello
2026-08-27 21:57 ` [PATCH v3] " Juan Martinez
2026-08-28  4:43   ` Mario Limonciello
2026-08-28  5:19   ` [PATCH v4] " Juan Martinez
2026-08-28 14:58     ` Mario Limonciello
2026-08-31 11:11     ` Mika Westerberg
2026-08-31 12:55       ` Mario Limonciello
2026-08-31 13:06         ` Mika Westerberg
2026-08-31 13:07           ` Mario Limonciello
2026-08-31 16:16           ` [PATCH v5] " juan.martinez
2026-09-01 22:16             ` Mario Limonciello
2026-09-02  5:48               ` Mika Westerberg
2026-09-09 19:06                 ` Mario Limonciello
2026-09-10 14:19                   ` S, Sanath
2026-09-10 17:24                     ` Mario Limonciello
2026-09-15  4:51                       ` S, Sanath
2026-09-15  6:04                         ` Mika Westerberg
2026-09-15 20:39                           ` Mario Limonciello
2026-10-05 13:54                           ` Basavaraj Natikar [this message]

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=674079d7-6ea7-438c-ac57-07def94ec92b@amd.com \
    --to=bnatikar@amd.com \
    --cc=Basavaraj.Natikar@amd.com \
    --cc=Juan.Martinez@amd.com \
    --cc=Sanath.S@amd.com \
    --cc=YehezkelShB@gmail.com \
    --cc=andreas.noever@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=superm1@kernel.org \
    --cc=westeri@kernel.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.