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=1796293125; b=WnnDVP0+vX0z42rl3Cd5g/OaIYOVqUU9nB8c6JqGAnZVmzYU+MSuF3HTDOoI/R9odk4K X0jICI3/QHnpLIECplSezlJW4jE1UxOKnzILAaaATOswLnwKRXPfQRSSq1jJaJDtAGydC GYGyqIkbA3gOej4mzFYQx+BuGPTAmpJ+OB3J8Qv86/cXO1h7jdrkFfLSJGBeu11ZZ6TqS uh3dmG8eXR9OZqnxQl0HMXkBnibk5/5VjapzwZ8aaZKJhUnPGlkP1DZB1NhN3y3Hmx/sF qJXrBJeZW71mQNd7gths5WLt8F3LR8FQwZ/VePgdhTgrwx3K7F/lmhb6cHmPCiff5mQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796293125; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=3DyRdC80AANsCRMColwmx1xjwLa3ZUd1TUPX/KS31ZI=; b=gI1NlDejl0dYJ6qMOCJ6knnTvfLE5fq63BEaeFZ8TKwA53/S9i4rwV+6OI4YxNlH26KJ XKLWdRJ+WoECYpLd4pddOTbN+2vrh+B6TRJltSaXjCnmNVfZlWESeElsbZGG5ZkL4Ssy+ zMcyVMLCMSs/ZK+oL3aytJHSEO9ys6LlmjvxD1eO/IkRmN7Qe/DUbff2E2GgjvQE4hemV pz9/eHaai3hhtaQWcJpilyd+0CVqbc7DKovrHCwnobJNYHVHXQA+OMLg/chMW2sqiMRGT COpdUPfDTXo3bt0qIw3ZzFTOn6/BGKEaZjwU3+28idZwxYvYYwn7PoU8PAKnycIOTSA== 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=myr8bnA0; 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 A9618606A32C for ; Thu, 3 Dec 2026 10:18:45 +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=myr8bnA0 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2962A1F00896; Thu, 3 Dec 2026 10:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796293125; bh=3DyRdC80AANsCRMColwmx1xjwLa3ZUd1TUPX/KS31ZI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=myr8bnA0pIbe2lwxXwZcUF6tHmAAoYf0smtG3JcGAuOgk2mwao0FYOpvkw2r/oLvi hxH4XlsQfJHL4bFCgvG0zAttPbuknRaP/4OSZ3hXJaNtF4pAWYmvDwwJRX54uEFAa0 Z8p5VRbKNB+jjleCHdTcY/KVSuG6lXIc3vTlTjWnSe/VJivpEzB5OFqDsZ1XOGk+MF SxFaDaf100ClL76EjUOvftOG47r338iYGN/C/wHVUeTmyNjU/UihSKZJ7agVsj501y csafuYDxUPty2zmvhi52mpp/jAQtgXzH38IpNO7t5YwLNUf7XeMm/fj9ugUnGISXbM WQFv/S/Zmtcow== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v13 5/5] riscv_cbqri: Add CBQRI capacity allocation platform driver Reply-To: sashiko-reviews@lists.linux.dev To: "Drew Fustini" Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261203-dfustini-atl-sc-cbqri-dt-v13-5-eaa688b1624c@kernel.org> References: <20261203-dfustini-atl-sc-cbqri-dt-v13-0-eaa688b1624c@kernel.org> <20261203-dfustini-atl-sc-cbqri-dt-v13-5-eaa688b1624c@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 10:18:44 +0000 X-Mailing-List: devicetree@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: - [Medium] riscv_cbqri: async probe in cbqri_capacity_driver can race late_initcall - [Medium] riscv_cbqri: cbqri_capacity_of_cache() misses offline clusters at boot -- commit f9a576951d9d7e095fba9697627996ee2c9c8612 Author: Drew Fustini riscv_cbqri: Add CBQRI capacity allocation platform driver This commit adds a platform driver for RISC-V CBQRI capacity controllers described in device tree. It maps the controller's register block, resolves its cache level and id from cacheinfo via the riscv,cbqri-cache phandle, and registers it with the CBQRI core. > diff --git a/drivers/resctrl/cbqri_capacity.c b/drivers/resctrl/cbqri_cap= acity.c > new file mode 100644 > index 0000000000000..9e3920b97d6c3 > --- /dev/null > +++ b/drivers/resctrl/cbqri_capacity.c > @@ -0,0 +1,148 @@ [ ... ] > + cpus_read_lock(); > + for_each_online_cpu(cpu) { > + struct cacheinfo *ci =3D get_cpu_cacheinfo_level(cpu, *cache_level); > + > + if (ci && ci->fw_token =3D=3D cache_np) { > + *cache_id =3D ci->id; > + found =3D true; > + break; > + } > + } > + cpus_read_unlock(); > + > + if (!found) > + return dev_err_probe(dev, -ENODEV, > + "%pOF: no online hart reports an L%u cache with a cache id for = this node\n", > + cache_np, *cache_level); [Severity: Medium] Can this permanently miss capacity controllers for caches whose harts are offline at boot? If a multi-cluster system boots with secondary clusters offline (such as with maxcpus=3D1), for_each_online_cpu() skips them and probe fails with -ENODEV. When those harts are later brought online via CPU hotplug, cbqri_attach_cpu_to_all_ctrls() finds no registered controller for their cache id and leaves them permanently outside resctrl control. Since cache_of_set_id() in drivers/base/cacheinfo.c derives DT cache IDs directly from CPU device-tree nodes, sharing an OF cache-id helper would avoid depending on online harts at probe time. [ ... ] > +static struct platform_driver cbqri_capacity_driver =3D { > + .probe =3D cbqri_capacity_probe, > + .driver =3D { > + .name =3D "cbqri-capacity", > + .of_match_table =3D cbqri_capacity_of_match, > + /* > + * The controller is registered permanently into the > + * CBQRI core for the life of the system. Block unbind > + * so userspace cannot leave a dangling controller. > + */ > + .suppress_bind_attrs =3D true, > + }, > +}; > + > +/* > + * Register at device_initcall so probe runs before the resctrl glue's > + * late_initcall, which copies the cbqri_controllers list. > + */ > +builtin_platform_driver(cbqri_capacity_driver); [Severity: Medium] Can asynchronous probing cause cbqri_capacity_probe() to race with cbqri_arch_late_init()? Because .probe_type is left unset (PROBE_DEFAULT_STRATEGY), booting with driver_async_probe=3D* makes __driver_attach() schedule cbqri_capacity_prob= e() asynchronously and return immediately. do_initcalls() then advances to late_initcall without waiting for async probes: init thread async kworker do_initcalls() (device_initcall) __driver_attach() async_schedule_dev(...) __driver_attach_async_helper() cbqri_capacity_probe() do_initcalls() (late_initcall) cbqri_arch_late_init() cbqri_resctrl_pick_caches() <-- misses unregistered controller riscv_cbqri_register_cc() Any controller that finishes probing after cbqri_resctrl_pick_caches() is permanently ignored by resctrl, causing resctrl setup to either fail with -ENODEV or come up missing cache domains while leaving the late controller and its MMIO mapping unused. Setting .probe_type =3D PROBE_FORCE_SYNCHRONOUS on cbqri_capacity_driver.dr= iver would prevent this race. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203-dfustini-a= tl-sc-cbqri-dt-v13-0-eaa688b1624c@kernel.org?part=3D5