@@ -393,19 +393,15 @@ int debug_get_buf_state(struct qdio_q *q, unsigned int bufnr,
393
393
394
394
static inline void qdio_stop_polling (struct qdio_q * q )
395
395
{
396
- if (!q -> u .in .polling )
396
+ if (!q -> u .in .ack_count )
397
397
return ;
398
398
399
- q -> u .in .polling = 0 ;
400
399
qperf_inc (q , stop_polling );
401
400
402
401
/* show the card that we are not polling anymore */
403
- if (is_qebsm (q )) {
404
- set_buf_states (q , q -> u .in .ack_start , SLSB_P_INPUT_NOT_INIT ,
405
- q -> u .in .ack_count );
406
- q -> u .in .ack_count = 0 ;
407
- } else
408
- set_buf_state (q , q -> u .in .ack_start , SLSB_P_INPUT_NOT_INIT );
402
+ set_buf_states (q , q -> u .in .ack_start , SLSB_P_INPUT_NOT_INIT ,
403
+ q -> u .in .ack_count );
404
+ q -> u .in .ack_count = 0 ;
409
405
}
410
406
411
407
static inline void account_sbals (struct qdio_q * q , unsigned int count )
@@ -451,8 +447,7 @@ static inline void inbound_primed(struct qdio_q *q, unsigned int start,
451
447
452
448
/* for QEBSM the ACK was already set by EQBS */
453
449
if (is_qebsm (q )) {
454
- if (!q -> u .in .polling ) {
455
- q -> u .in .polling = 1 ;
450
+ if (!q -> u .in .ack_count ) {
456
451
q -> u .in .ack_count = count ;
457
452
q -> u .in .ack_start = start ;
458
453
return ;
@@ -471,12 +466,12 @@ static inline void inbound_primed(struct qdio_q *q, unsigned int start,
471
466
* or by the next inbound run.
472
467
*/
473
468
new = add_buf (start , count - 1 );
474
- if (q -> u .in .polling ) {
469
+ if (q -> u .in .ack_count ) {
475
470
/* reset the previous ACK but first set the new one */
476
471
set_buf_state (q , new , SLSB_P_INPUT_ACK );
477
472
set_buf_state (q , q -> u .in .ack_start , SLSB_P_INPUT_NOT_INIT );
478
473
} else {
479
- q -> u .in .polling = 1 ;
474
+ q -> u .in .ack_count = 1 ;
480
475
set_buf_state (q , new , SLSB_P_INPUT_ACK );
481
476
}
482
477
@@ -1479,13 +1474,12 @@ static int handle_inbound(struct qdio_q *q, unsigned int callflags,
1479
1474
1480
1475
qperf_inc (q , inbound_call );
1481
1476
1482
- if (!q -> u .in .polling )
1477
+ if (!q -> u .in .ack_count )
1483
1478
goto set ;
1484
1479
1485
1480
/* protect against stop polling setting an ACK for an emptied slsb */
1486
1481
if (count == QDIO_MAX_BUFFERS_PER_Q ) {
1487
1482
/* overwriting everything, just delete polling status */
1488
- q -> u .in .polling = 0 ;
1489
1483
q -> u .in .ack_count = 0 ;
1490
1484
goto set ;
1491
1485
} else if (buf_in_between (q -> u .in .ack_start , bufnr , count )) {
@@ -1495,15 +1489,14 @@ static int handle_inbound(struct qdio_q *q, unsigned int callflags,
1495
1489
diff = sub_buf (diff , q -> u .in .ack_start );
1496
1490
q -> u .in .ack_count -= diff ;
1497
1491
if (q -> u .in .ack_count <= 0 ) {
1498
- q -> u .in .polling = 0 ;
1499
1492
q -> u .in .ack_count = 0 ;
1500
1493
goto set ;
1501
1494
}
1502
1495
q -> u .in .ack_start = add_buf (q -> u .in .ack_start , diff );
1496
+ } else {
1497
+ /* the only ACK will be deleted */
1498
+ q -> u .in .ack_count = 0 ;
1503
1499
}
1504
- else
1505
- /* the only ACK will be deleted, so stop polling */
1506
- q -> u .in .polling = 0 ;
1507
1500
}
1508
1501
1509
1502
set :
0 commit comments