Skip to content

Commit 6e90af1

Browse files
julianwiedmannZhengShunQian
authored andcommitted
s390/qdio: reset old sbal_state flags
commit 64e03ff upstream. When allocating a new AOB fails, handle_outbound() is still capable of transmitting the selected buffer (just without async completion). But if a previous transfer on this queue slot used async completion, its sbal_state flags field is still set to QDIO_OUTBUF_STATE_FLAG_PENDING. So when the upper layer driver sees this stale flag, it expects an async completion that never happens. Fix this by unconditionally clearing the flags field. Fixes: 104ea55 ("qdio: support asynchronous delivery of storage blocks") Cc: <[email protected]> #v3.2+ Signed-off-by: Julian Wiedmann <[email protected]> Signed-off-by: Martin Schwidefsky <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent aa0cf53 commit 6e90af1

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

arch/s390/include/asm/qdio.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ struct qdio_outbuf_state {
261261
void *user;
262262
};
263263

264-
#define QDIO_OUTBUF_STATE_FLAG_NONE 0x00
265264
#define QDIO_OUTBUF_STATE_FLAG_PENDING 0x01
266265

267266
#define CHSC_AC1_INITIATE_INPUTQ 0x80

drivers/s390/cio/qdio_main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -640,21 +640,20 @@ static inline unsigned long qdio_aob_for_buffer(struct qdio_output_q *q,
640640
unsigned long phys_aob = 0;
641641

642642
if (!q->use_cq)
643-
goto out;
643+
return 0;
644644

645645
if (!q->aobs[bufnr]) {
646646
struct qaob *aob = qdio_allocate_aob();
647647
q->aobs[bufnr] = aob;
648648
}
649649
if (q->aobs[bufnr]) {
650-
q->sbal_state[bufnr].flags = QDIO_OUTBUF_STATE_FLAG_NONE;
651650
q->sbal_state[bufnr].aob = q->aobs[bufnr];
652651
q->aobs[bufnr]->user1 = (u64) q->sbal_state[bufnr].user;
653652
phys_aob = virt_to_phys(q->aobs[bufnr]);
654653
WARN_ON_ONCE(phys_aob & 0xFF);
655654
}
656655

657-
out:
656+
q->sbal_state[bufnr].flags = 0;
658657
return phys_aob;
659658
}
660659

0 commit comments

Comments
 (0)