@@ -230,21 +230,25 @@ static struct pm_qos_constraints cpu_latency_constraints = {
230
230
};
231
231
232
232
/**
233
- * pm_qos_request - returns current system wide qos expectation
234
- * @pm_qos_class: Ignored.
235
- *
236
- * This function returns the current target value.
233
+ * cpu_latency_qos_limit - Return current system-wide CPU latency QoS limit.
237
234
*/
238
- s32 pm_qos_request ( int pm_qos_class )
235
+ s32 cpu_latency_qos_limit ( void )
239
236
{
240
237
return pm_qos_read_value (& cpu_latency_constraints );
241
238
}
242
239
243
- int pm_qos_request_active (struct pm_qos_request * req )
240
+ /**
241
+ * cpu_latency_qos_request_active - Check the given PM QoS request.
242
+ * @req: PM QoS request to check.
243
+ *
244
+ * Return: 'true' if @req has been added to the CPU latency QoS list, 'false'
245
+ * otherwise.
246
+ */
247
+ bool cpu_latency_qos_request_active (struct pm_qos_request * req )
244
248
{
245
249
return req -> qos == & cpu_latency_constraints ;
246
250
}
247
- EXPORT_SYMBOL_GPL (pm_qos_request_active );
251
+ EXPORT_SYMBOL_GPL (cpu_latency_qos_request_active );
248
252
249
253
static void cpu_latency_qos_apply (struct pm_qos_request * req ,
250
254
enum pm_qos_req_action action , s32 value )
@@ -255,25 +259,24 @@ static void cpu_latency_qos_apply(struct pm_qos_request *req,
255
259
}
256
260
257
261
/**
258
- * pm_qos_add_request - inserts new qos request into the list
259
- * @req: pointer to a preallocated handle
260
- * @pm_qos_class: Ignored.
261
- * @value: defines the qos request
262
+ * cpu_latency_qos_add_request - Add new CPU latency QoS request.
263
+ * @req: Pointer to a preallocated handle.
264
+ * @value: Requested constraint value.
265
+ *
266
+ * Use @value to initialize the request handle pointed to by @req, insert it as
267
+ * a new entry to the CPU latency QoS list and recompute the effective QoS
268
+ * constraint for that list.
262
269
*
263
- * This function inserts a new entry in the PM_QOS_CPU_DMA_LATENCY list of
264
- * requested QoS performance characteristics. It recomputes the aggregate QoS
265
- * expectations for the PM_QOS_CPU_DMA_LATENCY list and initializes the @req
266
- * handle. Caller needs to save this handle for later use in updates and
267
- * removal.
270
+ * Callers need to save the handle for later use in updates and removal of the
271
+ * QoS request represented by it.
268
272
*/
269
- void pm_qos_add_request (struct pm_qos_request * req ,
270
- int pm_qos_class , s32 value )
273
+ void cpu_latency_qos_add_request (struct pm_qos_request * req , s32 value )
271
274
{
272
- if (!req ) /*guard against callers passing in null */
275
+ if (!req )
273
276
return ;
274
277
275
- if (pm_qos_request_active (req )) {
276
- WARN (1 , KERN_ERR "pm_qos_add_request() called for already added request\n" );
278
+ if (cpu_latency_qos_request_active (req )) {
279
+ WARN (1 , KERN_ERR "%s called for already added request\n" , __func__ );
277
280
return ;
278
281
}
279
282
@@ -282,25 +285,24 @@ void pm_qos_add_request(struct pm_qos_request *req,
282
285
req -> qos = & cpu_latency_constraints ;
283
286
cpu_latency_qos_apply (req , PM_QOS_ADD_REQ , value );
284
287
}
285
- EXPORT_SYMBOL_GPL (pm_qos_add_request );
288
+ EXPORT_SYMBOL_GPL (cpu_latency_qos_add_request );
286
289
287
290
/**
288
- * pm_qos_update_request - modifies an existing qos request
289
- * @req : handle to list element holding a pm_qos request to use
290
- * @value: defines the qos request
291
- *
292
- * Updates an existing qos request for the PM_QOS_CPU_DMA_LATENCY list along
293
- * with updating the target PM_QOS_CPU_DMA_LATENCY value.
291
+ * cpu_latency_qos_update_request - Modify existing CPU latency QoS request.
292
+ * @req : QoS request to update.
293
+ * @new_value: New requested constraint value.
294
294
*
295
- * Attempts are made to make this code callable on hot code paths.
295
+ * Use @new_value to update the QoS request represented by @req in the CPU
296
+ * latency QoS list along with updating the effective constraint value for that
297
+ * list.
296
298
*/
297
- void pm_qos_update_request (struct pm_qos_request * req , s32 new_value )
299
+ void cpu_latency_qos_update_request (struct pm_qos_request * req , s32 new_value )
298
300
{
299
- if (!req ) /*guard against callers passing in null */
301
+ if (!req )
300
302
return ;
301
303
302
- if (!pm_qos_request_active (req )) {
303
- WARN (1 , KERN_ERR "pm_qos_update_request() called for unknown object\n" );
304
+ if (!cpu_latency_qos_request_active (req )) {
305
+ WARN (1 , KERN_ERR "%s called for unknown object\n" , __func__ );
304
306
return ;
305
307
}
306
308
@@ -311,24 +313,22 @@ void pm_qos_update_request(struct pm_qos_request *req, s32 new_value)
311
313
312
314
cpu_latency_qos_apply (req , PM_QOS_UPDATE_REQ , new_value );
313
315
}
314
- EXPORT_SYMBOL_GPL (pm_qos_update_request );
316
+ EXPORT_SYMBOL_GPL (cpu_latency_qos_update_request );
315
317
316
318
/**
317
- * pm_qos_remove_request - modifies an existing qos request
318
- * @req: handle to request list element
319
+ * cpu_latency_qos_remove_request - Remove existing CPU latency QoS request.
320
+ * @req: QoS request to remove.
319
321
*
320
- * Will remove pm qos request from the list of constraints and
321
- * recompute the current target value for PM_QOS_CPU_DMA_LATENCY. Call this
322
- * on slow code paths.
322
+ * Remove the CPU latency QoS request represented by @req from the CPU latency
323
+ * QoS list along with updating the effective constraint value for that list.
323
324
*/
324
- void pm_qos_remove_request (struct pm_qos_request * req )
325
+ void cpu_latency_qos_remove_request (struct pm_qos_request * req )
325
326
{
326
- if (!req ) /*guard against callers passing in null */
327
+ if (!req )
327
328
return ;
328
- /* silent return to keep pcm code cleaner */
329
329
330
- if (!pm_qos_request_active (req )) {
331
- WARN (1 , KERN_ERR "pm_qos_remove_request() called for unknown object\n" );
330
+ if (!cpu_latency_qos_request_active (req )) {
331
+ WARN (1 , KERN_ERR "%s called for unknown object\n" , __func__ );
332
332
return ;
333
333
}
334
334
@@ -337,7 +337,7 @@ void pm_qos_remove_request(struct pm_qos_request *req)
337
337
cpu_latency_qos_apply (req , PM_QOS_REMOVE_REQ , PM_QOS_DEFAULT_VALUE );
338
338
memset (req , 0 , sizeof (* req ));
339
339
}
340
- EXPORT_SYMBOL_GPL (pm_qos_remove_request );
340
+ EXPORT_SYMBOL_GPL (cpu_latency_qos_remove_request );
341
341
342
342
/* User space interface to the CPU latency QoS via misc device. */
343
343
@@ -349,7 +349,7 @@ static int cpu_latency_qos_open(struct inode *inode, struct file *filp)
349
349
if (!req )
350
350
return - ENOMEM ;
351
351
352
- pm_qos_add_request (req , PM_QOS_CPU_DMA_LATENCY , PM_QOS_DEFAULT_VALUE );
352
+ cpu_latency_qos_add_request (req , PM_QOS_DEFAULT_VALUE );
353
353
filp -> private_data = req ;
354
354
355
355
return 0 ;
@@ -361,7 +361,7 @@ static int cpu_latency_qos_release(struct inode *inode, struct file *filp)
361
361
362
362
filp -> private_data = NULL ;
363
363
364
- pm_qos_remove_request (req );
364
+ cpu_latency_qos_remove_request (req );
365
365
kfree (req );
366
366
367
367
return 0 ;
@@ -374,7 +374,7 @@ static ssize_t cpu_latency_qos_read(struct file *filp, char __user *buf,
374
374
unsigned long flags ;
375
375
s32 value ;
376
376
377
- if (!req || !pm_qos_request_active (req ))
377
+ if (!req || !cpu_latency_qos_request_active (req ))
378
378
return - EINVAL ;
379
379
380
380
spin_lock_irqsave (& pm_qos_lock , flags );
@@ -400,7 +400,7 @@ static ssize_t cpu_latency_qos_write(struct file *filp, const char __user *buf,
400
400
return ret ;
401
401
}
402
402
403
- pm_qos_update_request (filp -> private_data , value );
403
+ cpu_latency_qos_update_request (filp -> private_data , value );
404
404
405
405
return count ;
406
406
}
0 commit comments