* [Intel-gfx] [PATCH v2] drm/i915/gt: Pull checking rps->pm_events under the irq_lock
@ 2020-03-10 15:00 Chris Wilson
2020-03-11 0:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gt: Pull checking rps->pm_events under the irq_lock (rev2) Patchwork
2020-03-11 9:04 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2020-03-10 15:00 UTC (permalink / raw)
To: intel-gfx
Avoid angering kcsan by serialising the read of the pm_events with the
write in rps_diable_interrupts.
[ 6268.713419] BUG: KCSAN: data-race in intel_rps_park [i915] / rps_work [i915]
[ 6268.713437]
[ 6268.713449] write to 0xffff8881eda8efac of 4 bytes by task 1127 on cpu 3:
[ 6268.713680] intel_rps_park+0x136/0x260 [i915]
[ 6268.713905] __gt_park+0x61/0xa0 [i915]
[ 6268.714128] ____intel_wakeref_put_last+0x42/0x90 [i915]
[ 6268.714352] __intel_wakeref_put_work+0xd3/0xf0 [i915]
[ 6268.714369] process_one_work+0x3b1/0x690
[ 6268.714384] worker_thread+0x80/0x670
[ 6268.714398] kthread+0x19a/0x1e0
[ 6268.714412] ret_from_fork+0x1f/0x30
[ 6268.714423]
[ 6268.714435] read to 0xffff8881eda8efac of 4 bytes by task 950 on cpu 2:
[ 6268.714664] rps_work+0xc2/0x680 [i915]
[ 6268.714679] process_one_work+0x3b1/0x690
[ 6268.714693] worker_thread+0x80/0x670
[ 6268.714707] kthread+0x19a/0x1e0
[ 6268.714720] ret_from_fork+0x1f/0x30
v2: Mark all reads and writes of rpm->pm_events.
The flow of enabling/disabling rps is stronly ordered, so the writes and
interrrupt generation are also strongly ordered -- just this may not be
visible to the compiler, so provide annotations.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/gt/intel_rps.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/intel_rps.c b/drivers/gpu/drm/i915/gt/intel_rps.c
index 506738dede16..c715c02a54c1 100644
--- a/drivers/gpu/drm/i915/gt/intel_rps.c
+++ b/drivers/gpu/drm/i915/gt/intel_rps.c
@@ -57,7 +57,7 @@ static u32 rps_pm_mask(struct intel_rps *rps, u8 val)
if (val < rps->max_freq_softlimit)
mask |= GEN6_PM_RP_UP_EI_EXPIRED | GEN6_PM_RP_UP_THRESHOLD;
- mask &= rps->pm_events;
+ mask &= READ_ONCE(rps->pm_events);
return rps_pm_sanitize_mask(rps, ~mask);
}
@@ -70,17 +70,19 @@ static void rps_reset_ei(struct intel_rps *rps)
static void rps_enable_interrupts(struct intel_rps *rps)
{
struct intel_gt *gt = rps_to_gt(rps);
+ u32 events;
rps_reset_ei(rps);
if (IS_VALLEYVIEW(gt->i915))
/* WaGsvRC0ResidencyMethod:vlv */
- rps->pm_events = GEN6_PM_RP_UP_EI_EXPIRED;
+ events = GEN6_PM_RP_UP_EI_EXPIRED;
else
- rps->pm_events = (GEN6_PM_RP_UP_THRESHOLD |
- GEN6_PM_RP_DOWN_THRESHOLD |
- GEN6_PM_RP_DOWN_TIMEOUT);
+ events = (GEN6_PM_RP_UP_THRESHOLD |
+ GEN6_PM_RP_DOWN_THRESHOLD |
+ GEN6_PM_RP_DOWN_TIMEOUT);
+ WRITE_ONCE(rps->pm_events, events);
spin_lock_irq(>->irq_lock);
gen6_gt_pm_enable_irq(gt, rps->pm_events);
spin_unlock_irq(>->irq_lock);
@@ -117,8 +119,7 @@ static void rps_disable_interrupts(struct intel_rps *rps)
{
struct intel_gt *gt = rps_to_gt(rps);
- rps->pm_events = 0;
-
+ WRITE_ONCE(rps->pm_events, 0);
set(gt->uncore, GEN6_PMINTRMSK, rps_pm_sanitize_mask(rps, ~0u));
spin_lock_irq(>->irq_lock);
@@ -1459,12 +1460,12 @@ static void rps_work(struct work_struct *work)
u32 pm_iir = 0;
spin_lock_irq(>->irq_lock);
- pm_iir = fetch_and_zero(&rps->pm_iir);
+ pm_iir = fetch_and_zero(&rps->pm_iir) & READ_ONCE(rps->pm_events);
client_boost = atomic_read(&rps->num_waiters);
spin_unlock_irq(>->irq_lock);
/* Make sure we didn't queue anything we're not going to process. */
- if ((pm_iir & rps->pm_events) == 0 && !client_boost)
+ if (!pm_iir && !client_boost)
goto out;
mutex_lock(&rps->lock);
@@ -1560,11 +1561,15 @@ void gen11_rps_irq_handler(struct intel_rps *rps, u32 pm_iir)
void gen6_rps_irq_handler(struct intel_rps *rps, u32 pm_iir)
{
struct intel_gt *gt = rps_to_gt(rps);
+ u32 events;
- if (pm_iir & rps->pm_events) {
+ events = pm_iir & READ_ONCE(rps->pm_events);
+ if (events) {
spin_lock(>->irq_lock);
- gen6_gt_pm_mask_irq(gt, pm_iir & rps->pm_events);
- rps->pm_iir |= pm_iir & rps->pm_events;
+
+ gen6_gt_pm_mask_irq(gt, events);
+ rps->pm_iir |= events;
+
schedule_work(&rps->work);
spin_unlock(>->irq_lock);
}
--
2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gt: Pull checking rps->pm_events under the irq_lock (rev2)
2020-03-10 15:00 [Intel-gfx] [PATCH v2] drm/i915/gt: Pull checking rps->pm_events under the irq_lock Chris Wilson
@ 2020-03-11 0:40 ` Patchwork
2020-03-11 9:04 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2020-03-11 0:40 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/gt: Pull checking rps->pm_events under the irq_lock (rev2)
URL : https://patchwork.freedesktop.org/series/74510/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
76ddbcfdb7a0 drm/i915/gt: Pull checking rps->pm_events under the irq_lock
-:7: WARNING:TYPO_SPELLING: 'diable' may be misspelled - perhaps 'disable'?
#7:
write in rps_diable_interrupts.
-:31: WARNING:TYPO_SPELLING: 'interrrupt' may be misspelled - perhaps 'interrupt'?
#31:
interrrupt generation are also strongly ordered -- just this may not be
total: 0 errors, 2 warnings, 0 checks, 72 lines checked
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/gt: Pull checking rps->pm_events under the irq_lock (rev2)
2020-03-10 15:00 [Intel-gfx] [PATCH v2] drm/i915/gt: Pull checking rps->pm_events under the irq_lock Chris Wilson
2020-03-11 0:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gt: Pull checking rps->pm_events under the irq_lock (rev2) Patchwork
@ 2020-03-11 9:04 ` Patchwork
1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2020-03-11 9:04 UTC (permalink / raw)
To: Chris Wilson; +Cc: intel-gfx
== Series Details ==
Series: drm/i915/gt: Pull checking rps->pm_events under the irq_lock (rev2)
URL : https://patchwork.freedesktop.org/series/74510/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_8112 -> Patchwork_16908
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_16908 absolutely need to be
verified manually.
If you think the reported changes have nothing to do with the changes
introduced in Patchwork_16908, 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_16908/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_16908:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live@late_gt_pm:
- fi-kbl-8809g: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8112/fi-kbl-8809g/igt@i915_selftest@live@late_gt_pm.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16908/fi-kbl-8809g/igt@i915_selftest@live@late_gt_pm.html
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses.
They do not affect the overall result.
* igt@runner@aborted:
- {fi-kbl-7560u}: NOTRUN -> [FAIL][3]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16908/fi-kbl-7560u/igt@runner@aborted.html
Known issues
------------
Here are the changes found in Patchwork_16908 that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][4] ([fdo#111407]) -> [PASS][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8112/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16908/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
#### Warnings ####
* igt@gem_exec_suspend@basic-s4-devices:
- fi-tgl-y: [FAIL][6] ([CI#94]) -> [INCOMPLETE][7] ([CI#94] / [i915#460])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8112/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16908/fi-tgl-y/igt@gem_exec_suspend@basic-s4-devices.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[CI#94]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/94
[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
[fdo#112259]: https://bugs.freedesktop.org/show_bug.cgi?id=112259
[i915#460]: https://gitlab.freedesktop.org/drm/intel/issues/460
Participating hosts (44 -> 38)
------------------------------
Additional (2): fi-skl-6770hq fi-skl-6600u
Missing (8): fi-hsw-4200u fi-hsw-peppy fi-byt-squawks fi-snb-2520m fi-byt-clapper fi-snb-2600 fi-bdw-samus fi-kbl-r
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8112 -> Patchwork_16908
CI-20190529: 20190529
CI_DRM_8112: 032f2fe5c92eb1db6d417738431153c001a41bcc @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5504: d6788bf0404f76b66170e18eb26c85004b5ccb25 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_16908: 76ddbcfdb7a0ba78d7296c88f31ea49f56258ce4 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
76ddbcfdb7a0 drm/i915/gt: Pull checking rps->pm_events under the irq_lock
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_16908/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-11 9:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 15:00 [Intel-gfx] [PATCH v2] drm/i915/gt: Pull checking rps->pm_events under the irq_lock Chris Wilson
2020-03-11 0:40 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gt: Pull checking rps->pm_events under the irq_lock (rev2) Patchwork
2020-03-11 9:04 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).