@@ -90,13 +90,6 @@ static void guc_ct_buffer_desc_init(struct guc_ct_buffer_desc *desc,
90
90
desc -> owner = CTB_OWNER_HOST ;
91
91
}
92
92
93
- static void guc_ct_buffer_desc_reset (struct guc_ct_buffer_desc * desc )
94
- {
95
- desc -> head = 0 ;
96
- desc -> tail = 0 ;
97
- desc -> is_in_error = 0 ;
98
- }
99
-
100
93
static int guc_action_register_ct_buffer (struct intel_guc * guc ,
101
94
u32 desc_addr ,
102
95
u32 type )
@@ -315,8 +308,7 @@ static u32 ct_get_next_fence(struct intel_guc_ct *ct)
315
308
static int ct_write (struct intel_guc_ct * ct ,
316
309
const u32 * action ,
317
310
u32 len /* in dwords */ ,
318
- u32 fence ,
319
- bool want_response )
311
+ u32 fence )
320
312
{
321
313
struct intel_guc_ct_buffer * ctb = & ct -> ctbs [CTB_SEND ];
322
314
struct guc_ct_buffer_desc * desc = ctb -> desc ;
@@ -360,8 +352,7 @@ static int ct_write(struct intel_guc_ct *ct,
360
352
* DW2+: action data
361
353
*/
362
354
header = (len << GUC_CT_MSG_LEN_SHIFT ) |
363
- (GUC_CT_MSG_WRITE_FENCE_TO_DESC ) |
364
- (want_response ? GUC_CT_MSG_SEND_STATUS : 0 ) |
355
+ GUC_CT_MSG_SEND_STATUS |
365
356
(action [0 ] << GUC_CT_MSG_ACTION_SHIFT );
366
357
367
358
CT_DEBUG (ct , "writing %*ph %*ph %*ph\n" ,
@@ -390,56 +381,6 @@ static int ct_write(struct intel_guc_ct *ct,
390
381
return - EPIPE ;
391
382
}
392
383
393
- /**
394
- * wait_for_ctb_desc_update - Wait for the CT buffer descriptor update.
395
- * @desc: buffer descriptor
396
- * @fence: response fence
397
- * @status: placeholder for status
398
- *
399
- * Guc will update CT buffer descriptor with new fence and status
400
- * after processing the command identified by the fence. Wait for
401
- * specified fence and then read from the descriptor status of the
402
- * command.
403
- *
404
- * Return:
405
- * * 0 response received (status is valid)
406
- * * -ETIMEDOUT no response within hardcoded timeout
407
- * * -EPROTO no response, CT buffer is in error
408
- */
409
- static int wait_for_ctb_desc_update (struct guc_ct_buffer_desc * desc ,
410
- u32 fence ,
411
- u32 * status )
412
- {
413
- int err ;
414
-
415
- /*
416
- * Fast commands should complete in less than 10us, so sample quickly
417
- * up to that length of time, then switch to a slower sleep-wait loop.
418
- * No GuC command should ever take longer than 10ms.
419
- */
420
- #define done (READ_ONCE(desc->fence) == fence)
421
- err = wait_for_us (done , 10 );
422
- if (err )
423
- err = wait_for (done , 10 );
424
- #undef done
425
-
426
- if (unlikely (err )) {
427
- DRM_ERROR ("CT: fence %u failed; reported fence=%u\n" ,
428
- fence , desc -> fence );
429
-
430
- if (WARN_ON (desc -> is_in_error )) {
431
- /* Something went wrong with the messaging, try to reset
432
- * the buffer and hope for the best
433
- */
434
- guc_ct_buffer_desc_reset (desc );
435
- err = - EPROTO ;
436
- }
437
- }
438
-
439
- * status = desc -> status ;
440
- return err ;
441
- }
442
-
443
384
/**
444
385
* wait_for_ct_request_update - Wait for CT request state update.
445
386
* @req: pointer to pending request
@@ -483,8 +424,6 @@ static int ct_send(struct intel_guc_ct *ct,
483
424
u32 response_buf_size ,
484
425
u32 * status )
485
426
{
486
- struct intel_guc_ct_buffer * ctb = & ct -> ctbs [CTB_SEND ];
487
- struct guc_ct_buffer_desc * desc = ctb -> desc ;
488
427
struct ct_request request ;
489
428
unsigned long flags ;
490
429
u32 fence ;
@@ -505,16 +444,13 @@ static int ct_send(struct intel_guc_ct *ct,
505
444
list_add_tail (& request .link , & ct -> requests .pending );
506
445
spin_unlock_irqrestore (& ct -> requests .lock , flags );
507
446
508
- err = ct_write (ct , action , len , fence , !! response_buf );
447
+ err = ct_write (ct , action , len , fence );
509
448
if (unlikely (err ))
510
449
goto unlink ;
511
450
512
451
intel_guc_notify (ct_to_guc (ct ));
513
452
514
- if (response_buf )
515
- err = wait_for_ct_request_update (& request , status );
516
- else
517
- err = wait_for_ctb_desc_update (desc , fence , status );
453
+ err = wait_for_ct_request_update (& request , status );
518
454
if (unlikely (err ))
519
455
goto unlink ;
520
456
0 commit comments