mirror of
https://github.com/torvalds/linux.git
synced 2026-11-13 05:04:29 +01:00
drm/xe: Use guard(spinlock_irqsave) in pagefault handler
It is safer and easier to use guard() instead of explicit lock unlock calls. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patch.msgid.link/20260811200906.10400-2-michal.wajdeczko@intel.com
This commit is contained in:
parent
360b293de2
commit
bcd8734f2a
|
|
@ -864,10 +864,9 @@ static int xe_pagefault_work_index(struct xe_device *xe)
|
|||
int xe_pagefault_handler(struct xe_device *xe, struct xe_pagefault *pf)
|
||||
{
|
||||
struct xe_pagefault_queue *pf_queue = &xe->usm.pf_queue;
|
||||
unsigned long flags;
|
||||
bool full;
|
||||
|
||||
spin_lock_irqsave(&pf_queue->lock, flags);
|
||||
guard(spinlock_irqsave)(&pf_queue->lock);
|
||||
full = xe_pagefault_queue_full(pf_queue);
|
||||
if (!full) {
|
||||
struct xe_pagefault *lpf;
|
||||
|
|
@ -898,7 +897,6 @@ int xe_pagefault_handler(struct xe_device *xe, struct xe_pagefault *pf)
|
|||
drm_warn(&xe->drm,
|
||||
"PageFault Queue full, shouldn't be possible\n");
|
||||
}
|
||||
spin_unlock_irqrestore(&pf_queue->lock, flags);
|
||||
|
||||
return full ? -ENOSPC : 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user