From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38FCD606A31C for ; Mon, 30 Nov 2026 19:04:43 +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=Pd/AxQXD Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3B8010E07E; Mon, 30 Nov 2026 19:04:37 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id BD65810E07E for ; Mon, 30 Nov 2026 19:04:31 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 64FAC4401A; Mon, 30 Nov 2026 19:04:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 051D01F0089C; Mon, 30 Nov 2026 19:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796065471; bh=T4Z6GasstJ3XlARCnwIal5yPGbA7baEyyuJa38rumwA=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=Pd/AxQXD4WX25f8txytoqCbLB8kg83uok5vPpDU08j8JjjNX0G5kKOUVOWx6jn8cJ Nb5Y2C2vEEE32D6ak3MXXFhdU8omFT6UK0C2jbfbD59UZ64xaNvy/iVNo1rqRBA880 l0PWMhxiLEXXUioIyqc8eW3G0EMf9m7d9Whdml726F8F+sfHQbq5LVIwW6kMD3czIV rFd3k1/vU9SXL6keTm4Shx9t1RKxrR8zDy9DmuWmN1phWLQ2ougUGxwEQtDfkzqtQO 2qm3QtUEsYAaysmW46Tl0VSwpxK87HPPYmEifiIayDHvCKXzhFbuybaoCeANI/N20N sPYAPc6h/1Igg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v6 01/10] drm/xe/hwmon: Initialize fan-control backend and table cache To: "Karthik Poosa" , intel-xe@lists.freedesktop.org In-Reply-To: <20261130185050.36979-2-karthik.poosa@intel.com> References: <20261130185050.36979-1-karthik.poosa@intel.com> <20261130185050.36979-2-karthik.poosa@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 19:04:30 +0000 X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "Intel-xe" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Low] drm/xe/hwmon: overwritten return status in xe_hwmon_read_fan_control_info() - [Low] drm/xe/hwmon: commit message claims min PWM read removed in v5 -- commit 3b481ee0a99b1ba8da639e856d7c106898545563 Author: Karthik Poosa drm/xe/hwmon: Initialize fan-control backend and table cache This commit initializes Xe hwmon fan-control support by caching the enabled fan bitmask from PCODE and reading the stock fan control tables for each enabled fan. > Initialize Xe hwmon fan-control support by detecting enabled fans, > reading stock fan control points and min PWM. [Severity: Low] This isn't a bug, but the commit message still mentions reading min PWM, which was dropped from the patch in v5. > diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c > index 171990602f537..72e176011ea7b 100644 > --- a/drivers/gpu/drm/xe/xe_hwmon.c > +++ b/drivers/gpu/drm/xe/xe_hwmon.c [ ... ] > +static int xe_hwmon_read_fan_control_info(struct xe_hwmon *hwmon) > +{ > + int point; > + int fan; > + int ret =3D 0; > + > + for (fan =3D 0; fan < FAN_MAX; fan++) { > + struct fan_control_point stock_fcp[MAX_FAN_CONTROL_POINTS]; > + struct xe_hwmon_fan_info *fi =3D &hwmon->fi[fan]; > + u32 stock_fcp_count =3D 0; > + > + if (!IS_FAN_ENABLED(hwmon, fan)) > + continue; > + > + ret =3D xe_hwmon_pcode_read_fan_control(hwmon, > + FSC_READ_STOCK_FAN_CONTROL_POINTS, > + fan, &stock_fcp_count); > + if (ret || !stock_fcp_count) { > + xe_warn(hwmon->xe, > + "fan %d stock table unavailable, ret=3D%d, point count=3D%u\n", > + fan, ret, ret ? 0 : stock_fcp_count); > + continue; > + } [ ... ] > + memcpy(fi->fan_table[STOCK_FAN_TABLE].fcp, stock_fcp, > + stock_fcp_count * sizeof(stock_fcp[0])); > + fi->fan_table[STOCK_FAN_TABLE].point_count =3D stock_fcp_count; > + } > + return ret; > +} [Severity: Low] Does xe_hwmon_read_fan_control_info() return only the last PCODE read status instead of whether fan control tables are available? Because ret is reused across the loop and not set when stock_fcp_count is 0, an error on an earlier fan is overwritten if a higher-numbered fan succeeds, and returning 0 when all enabled fans report stock_fcp_count =3D=3D 0 suppr= esses the "Fan control tables are not available" warning in xe_hwmon_get_preregistration_info(). Conversely, if fan 0 succeeds and a later fan fails (for example on single-fan DG2 cards where fan_enable_mask is hardcoded to GENMASK(1, 0)), the caller logs that fan control tables are not available even though fan 0's stock table was initialized. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130185050.3697= 9-1-karthik.poosa@intel.com?part=3D1