* [PATCH] drm/i915/hwmon: Don't use FIELD_PREP
@ 2022-10-31 5:10 ` Ashutosh Dixit
0 siblings, 0 replies; 4+ messages in thread
From: Ashutosh Dixit @ 2022-10-31 5:10 UTC (permalink / raw)
To: intel-gfx
Cc: dri-devel, gwan-gyeong.mun, Jani Nikula, Andi Shyti,
Anshuman Gupta, llvm, ndesaulniers
FIELD_PREP and REG_FIELD_PREP have checks requiring a compile time constant
mask. When the mask comes in as the argument of a function these checks can
can fail depending on the compiler (gcc vs clang), optimization level,
etc. Use a simpler local version of FIELD_PREP which skips these
checks. The checks are not needed because the mask is formed using
REG_GENMASK (so is actually a compile time constant).
Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/7354
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
drivers/gpu/drm/i915/i915_hwmon.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c
index 9e97814930254..a3ec9a73a4e49 100644
--- a/drivers/gpu/drm/i915/i915_hwmon.c
+++ b/drivers/gpu/drm/i915/i915_hwmon.c
@@ -62,6 +62,12 @@ struct i915_hwmon {
int scl_shift_time;
};
+/* FIELD_PREP and REG_FIELD_PREP require a compile time constant mask */
+static u32 hwm_field_prep(u32 mask, u32 val)
+{
+ return (val << __bf_shf(mask)) & mask;
+}
+
static void
hwm_locked_with_pm_intel_uncore_rmw(struct hwm_drvdata *ddat,
i915_reg_t reg, u32 clear, u32 set)
@@ -112,7 +118,7 @@ hwm_field_scale_and_write(struct hwm_drvdata *ddat, i915_reg_t rgadr,
nval = DIV_ROUND_CLOSEST_ULL((u64)lval << nshift, scale_factor);
bits_to_clear = field_msk;
- bits_to_set = FIELD_PREP(field_msk, nval);
+ bits_to_set = hwm_field_prep(field_msk, nval);
hwm_locked_with_pm_intel_uncore_rmw(ddat, rgadr,
bits_to_clear, bits_to_set);
--
2.38.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] drm/i915/hwmon: Don't use FIELD_PREP
@ 2022-10-31 5:10 ` Ashutosh Dixit
0 siblings, 0 replies; 4+ messages in thread
From: Ashutosh Dixit @ 2022-10-31 5:10 UTC (permalink / raw)
To: intel-gfx
Cc: Andi Shyti, Anshuman Gupta, llvm, ndesaulniers, gwan-gyeong.mun,
dri-devel
FIELD_PREP and REG_FIELD_PREP have checks requiring a compile time constant
mask. When the mask comes in as the argument of a function these checks can
can fail depending on the compiler (gcc vs clang), optimization level,
etc. Use a simpler local version of FIELD_PREP which skips these
checks. The checks are not needed because the mask is formed using
REG_GENMASK (so is actually a compile time constant).
Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/7354
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
drivers/gpu/drm/i915/i915_hwmon.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c
index 9e97814930254..a3ec9a73a4e49 100644
--- a/drivers/gpu/drm/i915/i915_hwmon.c
+++ b/drivers/gpu/drm/i915/i915_hwmon.c
@@ -62,6 +62,12 @@ struct i915_hwmon {
int scl_shift_time;
};
+/* FIELD_PREP and REG_FIELD_PREP require a compile time constant mask */
+static u32 hwm_field_prep(u32 mask, u32 val)
+{
+ return (val << __bf_shf(mask)) & mask;
+}
+
static void
hwm_locked_with_pm_intel_uncore_rmw(struct hwm_drvdata *ddat,
i915_reg_t reg, u32 clear, u32 set)
@@ -112,7 +118,7 @@ hwm_field_scale_and_write(struct hwm_drvdata *ddat, i915_reg_t rgadr,
nval = DIV_ROUND_CLOSEST_ULL((u64)lval << nshift, scale_factor);
bits_to_clear = field_msk;
- bits_to_set = FIELD_PREP(field_msk, nval);
+ bits_to_set = hwm_field_prep(field_msk, nval);
hwm_locked_with_pm_intel_uncore_rmw(ddat, rgadr,
bits_to_clear, bits_to_set);
--
2.38.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Intel-gfx] [PATCH] drm/i915/hwmon: Don't use FIELD_PREP
@ 2022-10-31 5:10 ` Ashutosh Dixit
0 siblings, 0 replies; 4+ messages in thread
From: Ashutosh Dixit @ 2022-10-31 5:10 UTC (permalink / raw)
To: intel-gfx; +Cc: Andi Shyti, llvm, ndesaulniers, dri-devel
FIELD_PREP and REG_FIELD_PREP have checks requiring a compile time constant
mask. When the mask comes in as the argument of a function these checks can
can fail depending on the compiler (gcc vs clang), optimization level,
etc. Use a simpler local version of FIELD_PREP which skips these
checks. The checks are not needed because the mask is formed using
REG_GENMASK (so is actually a compile time constant).
Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/7354
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
---
drivers/gpu/drm/i915/i915_hwmon.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_hwmon.c b/drivers/gpu/drm/i915/i915_hwmon.c
index 9e97814930254..a3ec9a73a4e49 100644
--- a/drivers/gpu/drm/i915/i915_hwmon.c
+++ b/drivers/gpu/drm/i915/i915_hwmon.c
@@ -62,6 +62,12 @@ struct i915_hwmon {
int scl_shift_time;
};
+/* FIELD_PREP and REG_FIELD_PREP require a compile time constant mask */
+static u32 hwm_field_prep(u32 mask, u32 val)
+{
+ return (val << __bf_shf(mask)) & mask;
+}
+
static void
hwm_locked_with_pm_intel_uncore_rmw(struct hwm_drvdata *ddat,
i915_reg_t reg, u32 clear, u32 set)
@@ -112,7 +118,7 @@ hwm_field_scale_and_write(struct hwm_drvdata *ddat, i915_reg_t rgadr,
nval = DIV_ROUND_CLOSEST_ULL((u64)lval << nshift, scale_factor);
bits_to_clear = field_msk;
- bits_to_set = FIELD_PREP(field_msk, nval);
+ bits_to_set = hwm_field_prep(field_msk, nval);
hwm_locked_with_pm_intel_uncore_rmw(ddat, rgadr,
bits_to_clear, bits_to_set);
--
2.38.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/hwmon: Don't use FIELD_PREP
2022-10-31 5:10 ` Ashutosh Dixit
(?)
(?)
@ 2022-10-31 6:12 ` Patchwork
-1 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2022-10-31 6:12 UTC (permalink / raw)
To: Dixit, Ashutosh; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 9100 bytes --]
== Series Details ==
Series: drm/i915/hwmon: Don't use FIELD_PREP
URL : https://patchwork.freedesktop.org/series/110301/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_12320 -> Patchwork_110301v1
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_110301v1 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_110301v1, please notify your bug team to allow them
to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/index.html
Participating hosts (40 -> 38)
------------------------------
Additional (2): fi-kbl-soraka fi-icl-u2
Missing (4): fi-ctg-p8600 fi-rkl-11600 fi-bdw-samus fi-elk-e7500
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_110301v1:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@guc:
- fi-kbl-soraka: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-kbl-soraka/igt@i915_selftest@live@guc.html
Known issues
------------
Here are the changes found in Patchwork_110301v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_gttfill@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][2] ([fdo#109271]) +9 similar issues
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-kbl-soraka/igt@gem_exec_gttfill@basic.html
* igt@gem_huc_copy@huc-copy:
- fi-icl-u2: NOTRUN -> [SKIP][3] ([i915#2190])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-icl-u2/igt@gem_huc_copy@huc-copy.html
- fi-kbl-soraka: NOTRUN -> [SKIP][4] ([fdo#109271] / [i915#2190])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-kbl-soraka/igt@gem_huc_copy@huc-copy.html
* igt@gem_lmem_swapping@basic:
- fi-kbl-soraka: NOTRUN -> [SKIP][5] ([fdo#109271] / [i915#4613]) +3 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-kbl-soraka/igt@gem_lmem_swapping@basic.html
* igt@i915_selftest@live@gt_pm:
- fi-kbl-soraka: NOTRUN -> [DMESG-FAIL][6] ([i915#1886])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-kbl-soraka/igt@i915_selftest@live@gt_pm.html
* igt@kms_busy@basic@flip:
- fi-icl-u2: NOTRUN -> [DMESG-WARN][7] ([i915#4890])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-icl-u2/igt@kms_busy@basic@flip.html
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-hsw-4770: NOTRUN -> [SKIP][8] ([fdo#109271] / [fdo#111827])
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-hsw-4770/igt@kms_chamelium@common-hpd-after-suspend.html
- bat-adlp-4: NOTRUN -> [SKIP][9] ([fdo#111827])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/bat-adlp-4/igt@kms_chamelium@common-hpd-after-suspend.html
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-soraka: NOTRUN -> [SKIP][10] ([fdo#109271] / [fdo#111827]) +7 similar issues
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-kbl-soraka/igt@kms_chamelium@hdmi-hpd-fast.html
* igt@kms_pipe_crc_basic@suspend-read-crc:
- bat-adlp-4: NOTRUN -> [SKIP][11] ([i915#3546])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/bat-adlp-4/igt@kms_pipe_crc_basic@suspend-read-crc.html
* igt@runner@aborted:
- fi-icl-u2: NOTRUN -> [FAIL][12] ([i915#4312])
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-icl-u2/igt@runner@aborted.html
#### Possible fixes ####
* igt@gem_exec_gttfill@basic:
- fi-pnv-d510: [FAIL][13] ([i915#7229]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12320/fi-pnv-d510/igt@gem_exec_gttfill@basic.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-pnv-d510/igt@gem_exec_gttfill@basic.html
* igt@gem_huc_copy@huc-copy:
- {bat-dg2-9}: [FAIL][15] ([i915#7029]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12320/bat-dg2-9/igt@gem_huc_copy@huc-copy.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/bat-dg2-9/igt@gem_huc_copy@huc-copy.html
- {bat-dg2-8}: [FAIL][17] ([i915#7029]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12320/bat-dg2-8/igt@gem_huc_copy@huc-copy.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/bat-dg2-8/igt@gem_huc_copy@huc-copy.html
* igt@i915_selftest@live@gt_heartbeat:
- fi-bxt-dsi: [DMESG-FAIL][19] ([i915#5334]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12320/fi-bxt-dsi/igt@i915_selftest@live@gt_heartbeat.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-bxt-dsi/igt@i915_selftest@live@gt_heartbeat.html
* igt@i915_selftest@live@hangcheck:
- fi-hsw-4770: [INCOMPLETE][21] ([i915#4785]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12320/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-hsw-4770/igt@i915_selftest@live@hangcheck.html
* igt@i915_selftest@live@migrate:
- bat-adlp-4: [INCOMPLETE][23] ([i915#7308] / [i915#7348]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12320/bat-adlp-4/igt@i915_selftest@live@migrate.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/bat-adlp-4/igt@i915_selftest@live@migrate.html
* igt@i915_selftest@live@slpc:
- {bat-rpls-1}: [DMESG-FAIL][25] ([i915#6367] / [i915#6997]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12320/bat-rpls-1/igt@i915_selftest@live@slpc.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/bat-rpls-1/igt@i915_selftest@live@slpc.html
- {bat-adln-1}: [DMESG-FAIL][27] ([i915#6997]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12320/bat-adln-1/igt@i915_selftest@live@slpc.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/bat-adln-1/igt@i915_selftest@live@slpc.html
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size:
- fi-bsw-kefka: [FAIL][29] ([i915#6298]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12320/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/fi-bsw-kefka/igt@kms_cursor_legacy@basic-busy-flip-before-cursor@atomic-transitions-varying-size.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1886]: https://gitlab.freedesktop.org/drm/intel/issues/1886
[i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4785]: https://gitlab.freedesktop.org/drm/intel/issues/4785
[i915#4890]: https://gitlab.freedesktop.org/drm/intel/issues/4890
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#5537]: https://gitlab.freedesktop.org/drm/intel/issues/5537
[i915#6298]: https://gitlab.freedesktop.org/drm/intel/issues/6298
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6997]: https://gitlab.freedesktop.org/drm/intel/issues/6997
[i915#7029]: https://gitlab.freedesktop.org/drm/intel/issues/7029
[i915#7229]: https://gitlab.freedesktop.org/drm/intel/issues/7229
[i915#7308]: https://gitlab.freedesktop.org/drm/intel/issues/7308
[i915#7346]: https://gitlab.freedesktop.org/drm/intel/issues/7346
[i915#7348]: https://gitlab.freedesktop.org/drm/intel/issues/7348
Build changes
-------------
* Linux: CI_DRM_12320 -> Patchwork_110301v1
CI-20190529: 20190529
CI_DRM_12320: 4679e20be07ab65a9288fc583aa390fd244356ed @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7030: 79f028ce7a0e5003e108055e25f0333e14fd1aca @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_110301v1: 4679e20be07ab65a9288fc583aa390fd244356ed @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
15a9aab1506e drm/i915/hwmon: Don't use FIELD_PREP
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_110301v1/index.html
[-- Attachment #2: Type: text/html, Size: 10558 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-31 6:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 5:10 [PATCH] drm/i915/hwmon: Don't use FIELD_PREP Ashutosh Dixit
2022-10-31 5:10 ` [Intel-gfx] " Ashutosh Dixit
2022-10-31 5:10 ` Ashutosh Dixit
2022-10-31 6:12 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
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.