Skip to content

Commit 76eb09c

Browse files
hghimirarodrigovivi
authored andcommitted
drm/xe: Change return type to void for xe_force_wake_put
There is no need to return an error from xe_force_wake_put(), as a failure implicitly indicates that the domain failed to sleep. v3 - Move kernel-doc to this patch (Badal) v5 - change parameter to unsigned int in xe_force_wake_put() v6 - Remove unneccsary wrapping (Michal) - Remove non required header (Michal) - Mention timeout(Michal) v8 - Fix kernel-doc Cc: Michal Wajdeczko <[email protected]> Cc: Badal Nilawar <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Nirmoy Das <[email protected]> Reviewed-by: Badal Nilawar <[email protected]> Signed-off-by: Himal Prasad Ghimiray <[email protected]> Reviewed-by: Michal Wajdeczko <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 9ee1780 commit 76eb09c

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

drivers/gpu/drm/xe/xe_force_wake.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,17 @@ unsigned int __must_check xe_force_wake_get(struct xe_force_wake *fw,
211211
return ref_incr;
212212
}
213213

214-
int xe_force_wake_put(struct xe_force_wake *fw,
215-
unsigned int fw_ref)
214+
/**
215+
* xe_force_wake_put - Decrement the refcount and put domain to sleep if refcount becomes 0
216+
* @fw: Pointer to the force wake structure
217+
* @fw_ref: return of xe_force_wake_get()
218+
*
219+
* This function reduces the reference counts for domains in fw_ref. If
220+
* refcount for any of the specified domain reaches 0, it puts the domain to sleep
221+
* and waits for acknowledgment for domain to sleep within 50 milisec timeout.
222+
* Warns in case of timeout of ack from domain.
223+
*/
224+
void xe_force_wake_put(struct xe_force_wake *fw, unsigned int fw_ref)
216225
{
217226
struct xe_gt *gt = fw->gt;
218227
struct xe_force_wake_domain *domain;
@@ -225,7 +234,7 @@ int xe_force_wake_put(struct xe_force_wake *fw,
225234
* in error path of individual domains.
226235
*/
227236
if (!fw_ref)
228-
return 0;
237+
return;
229238

230239
if (xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL))
231240
fw_ref = fw->initialized_domains;
@@ -249,5 +258,4 @@ int xe_force_wake_put(struct xe_force_wake *fw,
249258

250259
xe_gt_WARN(gt, ack_fail, "Forcewake domain%s %#x failed to acknowledge sleep request\n",
251260
str_plural(hweight_long(ack_fail)), ack_fail);
252-
return ack_fail;
253261
}

drivers/gpu/drm/xe/xe_force_wake.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ void xe_force_wake_init_engines(struct xe_gt *gt,
1717
struct xe_force_wake *fw);
1818
unsigned int __must_check xe_force_wake_get(struct xe_force_wake *fw,
1919
enum xe_force_wake_domains domains);
20-
int xe_force_wake_put(struct xe_force_wake *fw,
21-
unsigned int fw_ref);
20+
void xe_force_wake_put(struct xe_force_wake *fw, unsigned int fw_ref);
2221

2322
static inline int
2423
xe_force_wake_ref(struct xe_force_wake *fw,

0 commit comments

Comments
 (0)