Commit e960fa03 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by Greg Kroah-Hartman

s390/qeth: lock read device while queueing next buffer


[ Upstream commit 17bf8c9b ]

For calling ccw_device_start(), issue_next_read() needs to hold the
device's ccwlock.
This is satisfied for the IRQ handler path (where qeth_irq() gets called
under the ccwlock), but we need explicit locking for the initial call by
the MPC initialization.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f9b4ec9f
...@@ -517,8 +517,7 @@ static inline int qeth_is_cq(struct qeth_card *card, unsigned int queue) ...@@ -517,8 +517,7 @@ static inline int qeth_is_cq(struct qeth_card *card, unsigned int queue)
queue == card->qdio.no_in_queues - 1; queue == card->qdio.no_in_queues - 1;
} }
static int __qeth_issue_next_read(struct qeth_card *card)
static int qeth_issue_next_read(struct qeth_card *card)
{ {
int rc; int rc;
struct qeth_cmd_buffer *iob; struct qeth_cmd_buffer *iob;
...@@ -549,6 +548,17 @@ static int qeth_issue_next_read(struct qeth_card *card) ...@@ -549,6 +548,17 @@ static int qeth_issue_next_read(struct qeth_card *card)
return rc; return rc;
} }
static int qeth_issue_next_read(struct qeth_card *card)
{
int ret;
spin_lock_irq(get_ccwdev_lock(CARD_RDEV(card)));
ret = __qeth_issue_next_read(card);
spin_unlock_irq(get_ccwdev_lock(CARD_RDEV(card)));
return ret;
}
static struct qeth_reply *qeth_alloc_reply(struct qeth_card *card) static struct qeth_reply *qeth_alloc_reply(struct qeth_card *card)
{ {
struct qeth_reply *reply; struct qeth_reply *reply;
...@@ -1174,7 +1184,7 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, ...@@ -1174,7 +1184,7 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm,
return; return;
if (channel == &card->read && if (channel == &card->read &&
channel->state == CH_STATE_UP) channel->state == CH_STATE_UP)
qeth_issue_next_read(card); __qeth_issue_next_read(card);
iob = channel->iob; iob = channel->iob;
index = channel->buf_no; index = channel->buf_no;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment