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 CE1FC606A31A for ; Wed, 2 Dec 2026 13:05:59 +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=Uvf1itLE Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9214810E5C8; Wed, 2 Dec 2026 13:05:54 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC4EA10E5C8 for ; Wed, 2 Dec 2026 13:05:48 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id BA6ED618E9; Wed, 2 Dec 2026 13:05:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60EE61F00926; Wed, 2 Dec 2026 13:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796216747; bh=LdJWX0v4aUUY5qa33BTvN9RUBorPLb0aNaqgDhZKk74=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=Uvf1itLERqgGuFMryAesrLCcR5keRFy5dNz5WTHKTmH8OaihfU1sEyko0qRAA21Kn s0dxTlFxEiAhl3g151Lw1dfIWpqGljolIPF5v/8q86ly3+lShsgBwGu5vMrLOzRosD Sc2JrTZy7qJIDyP3V5k5jhUH1fKcBSn/M3hCjfv/SUBnTbPdX8qg6tWKJWwe3WikC0 uPvJXCYwJI9f9zPVMppy97gpuQAulAI7PythPQQxZkDEJnm0aHYPm984xnpmd4k8Mx zBcIOtWmMHhjYxcQuWMvPwjc/1gbuXAXiXqq3kY+M82qZC57WQSAXxKecmUqlNP791 oCIGQN4bkHrHg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v7 01/10] drm/xe/hwmon: Initialize fan-control backend and table cache To: "Karthik Poosa" , intel-xe@lists.freedesktop.org In-Reply-To: <20261202125637.1581881-2-karthik.poosa@intel.com> References: <20261202125637.1581881-1-karthik.poosa@intel.com> <20261202125637.1581881-2-karthik.poosa@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 13:05:46 +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 1 potential issue to consider: - [Low] drm/xe/hwmon: spurious warning on DG2 in xe_hwmon_get_preregistration_info() -- commit 038329fd7e943a8ca271fe720ffbfae8ffd4a54f Author: Karthik Poosa drm/xe/hwmon: Initialize fan-control backend and table cache This commit initializes Xe hwmon fan-control support by detecting enabled fans through a bitmask and caching firmware stock fan control points. > diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c > index 171990602f537..af74f96ade517 100644 > --- a/drivers/gpu/drm/xe/xe_hwmon.c > +++ b/drivers/gpu/drm/xe/xe_hwmon.c [ ... ] > @@ -1082,17 +1123,112 @@ static int xe_hwmon_pcode_write_i1(const struct = xe_hwmon *hwmon, u32 uval) > (uval & POWER_SETUP_I1_DATA_MASK)); > } > =20 > -static int xe_hwmon_pcode_read_fan_control(const struct xe_hwmon *hwmon,= u32 subcmd, u32 *uval) > +static int xe_hwmon_pcode_read_fan_control(const struct xe_hwmon *hwmon,= u32 subcmd, u8 fan_num, > + u32 *uval) > { > struct xe_tile *root_tile =3D xe_device_get_root_tile(hwmon->xe); > =20 > + return xe_pcode_read(root_tile, PCODE_MBOX(FAN_SPEED_CONTROL, subcmd, f= an_num), uval, NULL); > +} > + > +static int xe_hwmon_get_fan_enable_mask(struct xe_hwmon *hwmon) > +{ > + int ret; > + > /* Platforms that don't return correct value */ > - if (hwmon->xe->info.platform =3D=3D XE_DG2 && subcmd =3D=3D FSC_READ_NU= M_FANS) { > - *uval =3D 2; > + if (hwmon->xe->info.platform =3D=3D XE_DG2) { > + hwmon->fan_enable_mask =3D GENMASK(1, 0); > return 0; > } > =20 > - return xe_pcode_read(root_tile, PCODE_MBOX(FAN_SPEED_CONTROL, subcmd, 0= ), uval, NULL); > + ret =3D xe_hwmon_pcode_read_fan_control(hwmon, FSC_READ_NUM_FANS, 0, > + &hwmon->fan_enable_mask); > + if (ret) { > + hwmon->fan_enable_mask =3D 0; > + xe_warn(hwmon->xe, "failed to read number of fans, ret=3D%d\n", ret); > + return ret; > + } > + > + /* Check if fan mask exceeds FAN_MAX and log a warning if it does */ > + if (hwmon->fan_enable_mask & ~GENMASK(FAN_MAX - 1, 0)) { > + xe_warn(hwmon->xe, "Fan enable mask exceeds %d supported fans, clampin= g\n", > + FAN_MAX); > + hwmon->fan_enable_mask &=3D GENMASK(FAN_MAX - 1, 0); > + } > + > + xe_info(hwmon->xe, "Number of fans detected: %u\n", hweight32(hwmon->fa= n_enable_mask)); > + > + return 0; > +} > + > +static int xe_hwmon_read_fan_control_info(struct xe_hwmon *hwmon) > +{ > + bool found =3D false; > + int point; > + int ret; > + int fan; > + > + if (hwmon->xe->info.platform =3D=3D XE_DG2) > + return -ENODATA; [ ... ] > @@ -1865,11 +1996,18 @@ xe_hwmon_get_preregistration_info(struct xe_hwmon= *hwmon) > if (xe_hwmon_is_visible(hwmon, hwmon_energy, hwmon_energy_input, chann= el)) > xe_hwmon_energy_get(hwmon, channel, &energy); > =20 > - /* Initialize 'struct xe_hwmon_fan_info' with initial fan register read= ing. */ > - for (channel =3D 0; channel < FAN_MAX; channel++) > - if (xe_hwmon_is_visible(hwmon, hwmon_fan, hwmon_fan_input, channel)) > - xe_hwmon_fan_input_read(hwmon, channel, &fan_speed); > + if (hwmon->xe->info.has_fan_control) { > + xe_hwmon_get_fan_enable_mask(hwmon); > + > + /* Initialize 'struct xe_hwmon_fan_info' with initial fan register rea= ding. */ > + for (channel =3D 0; channel < FAN_MAX; channel++) > + if (IS_FAN_ENABLED(hwmon, channel)) > + xe_hwmon_fan_input_read(hwmon, channel, &fan_speed); > =20 > + /* Fan control tables initialization */ > + if (xe_hwmon_read_fan_control_info(hwmon)) > + xe_warn(hwmon->xe, "Fan control tables are not available\n"); > + } [Severity: Low] Will xe_hwmon_get_preregistration_info() emit a spurious xe_warn() on every XE_DG2 probe? dg2_desc in drivers/gpu/drm/xe/xe_pci.c sets has_fan_control =3D true, and xe_hwmon_read_fan_control_info() returns -ENODATA on XE_DG2, causing every probe on DG2 to log "Fan control tables are not available". The same warning is also logged when xe_hwmon_get_fan_enable_mask() fails or reports 0 enabled fans, because its return value and fan_enable_mask are not checked before calling xe_hwmon_read_fan_control_info(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202125637.1581= 881-1-karthik.poosa@intel.com?part=3D1