• Chris Wilson's avatar
    drm/i915/gt: Pull checking rps->pm_events under the irq_lock · 408464b4
    Chris Wilson authored
    Avoid angering kcsan by serialising the read of the pm_events with the
    write in rps_disable_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
    interrupt generation are also strongly ordered -- just this may not be
    visible to the compiler, so provide annotations.
    Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20200311092624.10012-1-chris@chris-wilson.co.uk
    408464b4
intel_rps.c 47 KB