From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796460622; b=fToLd+WT7U/NEJ4qyOdRkGjOA9kXCi4bfFQrkZbjteCUCE5HiQP/j9jhIy3EaPeT4T68 itmhXnUMb2xIl9mCaJo7xW36Zhb+ipF0CJEl9zGuzl/vSRaql+GR0waeYLXTlKP+zqK1V WmhELVwjOgWyY83wSuh3h7IA1jWRu8OcesqUi76Mvg9hfKCjsgbYRT1Dr1S+nzMdDLG/u CihbNKDwXHscqJe34sIXmUYZkjgZxnYAwOEf2E7ve8mGZckRGwJmTZLxwAPsyAsuCdjVO Pbmc+CE/SBm3lLimBnV3UH+qS4hs0aNftUQGZBM4fSGqwGwDVdriZKkFGsHyFqsP0sA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796460622; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=WEX64b3TlV/uKwjMnUOGKk443CdwMomJXYRocD+eqe8=; b=S2Vq/5MuhveK5P1GbiFkaf0riUgJMflR0QuzcyJEEWVn6cuM3U9is5PK+q7B6gy5AhLf whcPhF+5pc06pfCMeGohCrPvYb8VHZAAe54hgjf4NJXHe6P1WYcHssvSm6cE/Sl5LX8gp s7KBhK+wZJB1bya1B7Iz237NzL7trx/G3hcnj4xQ/EOBOL/Rc9wSbn4QuYkfYP7P84IbN ni+oEBeY1b1BJz8suGpCen6A8Bn1kpbMcidoaP3QZY3r+YL+bvw2cIgACIDLWAnRsiEcm 4Ob/xIm/PcuN4hFPlqC0o5kEdRw3kmpU6Pfda+Rd0aWJRhrbHP9aIDKCj3D69lXFzyA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FUdo+AnG; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACB81606A330 for ; Sat, 5 Dec 2026 08:50:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FUdo+AnG Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A73B1F00A07; Sat, 5 Dec 2026 08:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796460622; bh=WEX64b3TlV/uKwjMnUOGKk443CdwMomJXYRocD+eqe8=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=FUdo+AnGwvjg9h582DXdSM0SPpH32on//oNhRUL0L3JRYZjYQ2xWbpWpcgNxKslsG M53+cfqMbNF40gX6Z79eeyzk/mlJPLyPTg5PsZkuH6rpDLq1lMcrNIOhTdRlSy+gtm wA6Io98ij56l2hIX8v2rIE37f1Y39JlTSUsHUk3r+UzZB9+h2ZNNSJtJvHksQCJiVd 9D0VqEkbu3SA9/bOZfb4VRxjMV2KBlIcieR9sQs0k9xtv4j0QcMTbGiytOWdVLQ1+X +G9sjlnUpGl1WlaKh2OechiwJK9DCIjAimUovME002Un/BfBYr0Kz6hjoeUzOEei5E 1aDttEJJagi2Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v4 05/14] thunderbolt: Move rpm_complete bus walk to domain.c Reply-To: sashiko-reviews@lists.linux.dev To: "Chunfeng Yun" Cc: linux-usb@vger.kernel.org In-Reply-To: <20261205083342.4009278-6-chunfeng.yun@mediatek.com> References: <20261205083342.4009278-1-chunfeng.yun@mediatek.com> <20261205083342.4009278-6-chunfeng.yun@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 08:50:22 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Low] thunderbolt: commit message wrongly claims tb_bus_type is private to domain.c - [Low] thunderbolt: tb_domain_complete_rpm() leaks ICM internals into domain core -- commit b67cb4b97423964ddf1ba9a2c60a06a557299bdc Author: Chunfeng Yun thunderbolt: Move rpm_complete bus walk to domain.c This commit moves the rpm_complete bus walk from icm.c into a new tb_domain_complete_rpm() helper in domain.c so icm.c no longer references tb_bus_type directly. > Encapsulate this bus traversal inside domain.c as tb_domain_complete_rpm(= ). > This keeps tb_bus_type private to domain.c and eliminates the need to > export the bus structure. [Severity: Low] Is tb_bus_type actually private to domain.c? It remains a non-static global declared extern in include/linux/thunderbolt.h and used directly by retimer.c, switch.c, and xdomain.c. The commit message should say this keeps tb_bus_type internal to the thunderbolt core module instead. [ ... ] > diff --git a/drivers/thunderbolt/domain.c b/drivers/thunderbolt/domain.c > index 24611f05b3cda..075e0f8af1e8f 100644 > --- a/drivers/thunderbolt/domain.c > +++ b/drivers/thunderbolt/domain.c > @@ -881,6 +881,30 @@ int tb_domain_unregister_unplugged_xdomains(struct t= b *tb) > return ctx.n; > } > =20 > +static int complete_rpm(struct device *dev, void *data) > +{ > + struct tb_switch *sw =3D tb_to_switch(dev); > + > + if (sw && sw->tb =3D=3D data) > + complete(&sw->rpm_complete); > + > + return 0; > +} > + > +/** > + * tb_domain_complete_rpm() - Signal runtime resume completion for route= r and below > + * @tb: Domain the router belongs to > + * @sw: Router to complete runtime resume > + * > + * Signal @sw and routers below for rpm_complete because > + * tb_switch_remove() calls pm_runtime_get_sync() that then waits for it. > + */ > +void tb_domain_complete_rpm(struct tb *tb, struct tb_switch *sw) > +{ > + complete_rpm(&sw->dev, tb); > + bus_for_each_dev(&tb_bus_type, &sw->dev, tb, complete_rpm); > +} [Severity: Low] Does tb_domain_complete_rpm() belong in domain.c when sw->rpm_complete is only initialized in icm.c alloc_switch() and used by icm.c? Moving it here (and later exporting it in commit "thunderbolt: Make PCIe NHI support opt-in") leaks icm.c internals into the generic domain core. The tb parameter is also redundant with sw->tb, and the kerneldoc omits that sw and subsequent switches on the bus must be non-root switches with initialized rpm_complete. Walking the subtree locally in icm.c via tb_switch_for_each_port() and tb_port_has_remote() (matching icm_unplug_children() and tb_switch_remove()) drops the tb_bus_type dependency without adding a domain helper or signaling unrelated switches registered after sw. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205083342.4009= 278-1-chunfeng.yun@mediatek.com?part=3D5