mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-09 14:50:19 +00:00
s390/qeth: keep cmd alive after IO completion
Current code releases the cmd struct after its initial IO has completed. Any reply processing is done independently, using a separate qeth_reply struct. In preparation for merging the cmd and reply structs together, take an additional reference on the cmd object so that it stays around all the way until qeth_send_control_data() returns. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7c5f8ffb33
commit
32e85a0d83
@ -1742,6 +1742,9 @@ static int qeth_send_control_data(struct qeth_card *card,
|
|||||||
|
|
||||||
qeth_enqueue_reply(card, reply);
|
qeth_enqueue_reply(card, reply);
|
||||||
|
|
||||||
|
/* This pairs with iob->callback, and keeps the iob alive after IO: */
|
||||||
|
qeth_get_cmd(iob);
|
||||||
|
|
||||||
QETH_CARD_TEXT(card, 6, "noirqpnd");
|
QETH_CARD_TEXT(card, 6, "noirqpnd");
|
||||||
spin_lock_irq(get_ccwdev_lock(channel->ccwdev));
|
spin_lock_irq(get_ccwdev_lock(channel->ccwdev));
|
||||||
rc = ccw_device_start_timeout(channel->ccwdev, __ccw_from_cmd(iob),
|
rc = ccw_device_start_timeout(channel->ccwdev, __ccw_from_cmd(iob),
|
||||||
@ -1752,11 +1755,10 @@ static int qeth_send_control_data(struct qeth_card *card,
|
|||||||
CARD_DEVID(card), rc);
|
CARD_DEVID(card), rc);
|
||||||
QETH_CARD_TEXT_(card, 2, " err%d", rc);
|
QETH_CARD_TEXT_(card, 2, " err%d", rc);
|
||||||
qeth_dequeue_reply(card, reply);
|
qeth_dequeue_reply(card, reply);
|
||||||
qeth_put_reply(reply);
|
|
||||||
qeth_put_cmd(iob);
|
qeth_put_cmd(iob);
|
||||||
atomic_set(&channel->irq_pending, 0);
|
atomic_set(&channel->irq_pending, 0);
|
||||||
wake_up(&card->wait_q);
|
wake_up(&card->wait_q);
|
||||||
return rc;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
timeout = wait_for_completion_interruptible_timeout(&reply->received,
|
timeout = wait_for_completion_interruptible_timeout(&reply->received,
|
||||||
@ -1777,7 +1779,10 @@ static int qeth_send_control_data(struct qeth_card *card,
|
|||||||
|
|
||||||
if (!rc)
|
if (!rc)
|
||||||
rc = reply->rc;
|
rc = reply->rc;
|
||||||
|
|
||||||
|
out:
|
||||||
qeth_put_reply(reply);
|
qeth_put_reply(reply);
|
||||||
|
qeth_put_cmd(iob);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user