All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Ensure xe_force_wake_put is always called after xe_force_wake_get
@ 2024-06-04 11:02 Nirmoy Das
  2024-06-04 11:02 ` [PATCH 1/9] drm/xe/display: Always call xe_force_wake_put/get in pairs Nirmoy Das
                   ` (17 more replies)
  0 siblings, 18 replies; 28+ messages in thread
From: Nirmoy Das @ 2024-06-04 11:02 UTC (permalink / raw)
  To: intel-xe; +Cc: Nirmoy Das, Himal Prasad Ghimiray, Matthew Brost, Rodrigo Vivi

Cuurently there is inconsistency how we handle force wake get and put
calls. We have three cases: 
1 Return value of xe_force_wake_get is not checked.
2 Return value of xe_force_wake_get is checked but continue.
3 Return value of xe_force_wake_get is checked but the caller returns
  without calling xe_force_wake_put.

2nd case is perfectly valid but 1st and 3rd cases shouldn't happen. As
xe_force_wake_get() will increment the ref count regardless of success
or failure so xe_force_wake_get() should be followed by a
xe_force_wake_put().

For case 1, the last patch added __must_check attribute and rest of
patches are making sure we always call get and put in pairs even if
xe_force_wake_get() returns error.

Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

Nirmoy Das (9):
  drm/xe/display: Always call xe_force_wake_put/get in pairs
  drm/xe/pat: Always call xe_force_wake_put/get in pairs
  drm/xe/xe_reg_sr: Always call xe_force_wake_put/get in pairs
  drm/xe/xe_gt: Always call xe_force_wake_put/get in pairs
  drm/xe/uc: Always call xe_force_wake_put/get in pairs
  drm/xe: Add xe_force_wake_tryget to simplify forcewake handling
  drm/xe: Use xe_force_wake_tryget when possible
  drm/xe/client: Check return value of xe_force_wake_get
  drm/xe: Add __must_check for xe_force_wake_get

 drivers/gpu/drm/xe/display/xe_hdcp_gsc.c |  2 +-
 drivers/gpu/drm/xe/xe_device.c           |  4 +-
 drivers/gpu/drm/xe/xe_drm_client.c       | 10 +++--
 drivers/gpu/drm/xe/xe_force_wake.c       | 49 +++++++++++++++++++++++-
 drivers/gpu/drm/xe/xe_force_wake.h       |  6 ++-
 drivers/gpu/drm/xe/xe_gsc_proxy.c        |  3 +-
 drivers/gpu/drm/xe/xe_gt.c               | 27 ++++++-------
 drivers/gpu/drm/xe/xe_gt_debugfs.c       | 10 ++---
 drivers/gpu/drm/xe/xe_guc.c              |  2 +-
 drivers/gpu/drm/xe/xe_guc_pc.c           |  8 ++--
 drivers/gpu/drm/xe/xe_huc.c              |  2 +-
 drivers/gpu/drm/xe/xe_pat.c              | 10 ++---
 drivers/gpu/drm/xe/xe_query.c            |  2 +-
 drivers/gpu/drm/xe/xe_reg_sr.c           | 20 ++++------
 drivers/gpu/drm/xe/xe_vram.c             |  2 +-
 15 files changed, 98 insertions(+), 59 deletions(-)

-- 
2.42.0


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2024-06-10  9:59 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-04 11:02 [PATCH 0/9] Ensure xe_force_wake_put is always called after xe_force_wake_get Nirmoy Das
2024-06-04 11:02 ` [PATCH 1/9] drm/xe/display: Always call xe_force_wake_put/get in pairs Nirmoy Das
2024-06-04 11:41   ` Ghimiray, Himal Prasad
2024-06-04 11:02 ` [PATCH 2/9] drm/xe/pat: " Nirmoy Das
2024-06-04 12:54   ` Michal Wajdeczko
2024-06-04 13:06     ` Nirmoy Das
2024-06-04 11:02 ` [PATCH 3/9] drm/xe/xe_reg_sr: " Nirmoy Das
2024-06-04 13:12   ` Michal Wajdeczko
2024-06-04 14:21     ` Nirmoy Das
2024-06-04 21:13       ` Lucas De Marchi
2024-06-05 10:49         ` Nirmoy Das
2024-06-06 17:46           ` Rodrigo Vivi
2024-06-10  9:59             ` Nirmoy Das
2024-06-04 11:02 ` [PATCH 4/9] drm/xe/xe_gt: " Nirmoy Das
2024-06-04 11:02 ` [PATCH 5/9] drm/xe/uc: " Nirmoy Das
2024-06-04 11:02 ` [PATCH 6/9] drm/xe: Add xe_force_wake_tryget to simplify forcewake handling Nirmoy Das
2024-06-04 11:02 ` [PATCH 7/9] drm/xe: Use xe_force_wake_tryget when possible Nirmoy Das
2024-06-04 11:02 ` [PATCH 8/9] drm/xe/client: Check return value of xe_force_wake_get Nirmoy Das
2024-06-04 11:02 ` [PATCH 9/9] drm/xe: Add __must_check for xe_force_wake_get Nirmoy Das
2024-06-04 20:49 ` [PATCH 0/9] Ensure xe_force_wake_put is always called after xe_force_wake_get Lucas De Marchi
2024-06-05  1:06 ` ✓ CI.Patch_applied: success for " Patchwork
2024-06-05  1:07 ` ✓ CI.checkpatch: " Patchwork
2024-06-05  1:08 ` ✓ CI.KUnit: " Patchwork
2024-06-05  1:19 ` ✓ CI.Build: " Patchwork
2024-06-05  1:19 ` ✗ CI.Hooks: failure " Patchwork
2024-06-05  1:21 ` ✓ CI.checksparse: success " Patchwork
2024-06-05  1:48 ` ✓ CI.BAT: " Patchwork
2024-06-05 10:15 ` ✗ CI.FULL: failure " 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.