Skip to content

Commit

Permalink
qeth: ungrouping a device must not be interruptible
Browse files Browse the repository at this point in the history
Problem:
A recovery thread must not be active when device is removed.
In qeth_remove_device() an interruptible wait operation is used
to wait until a qeth recovery thread is finished. If a user really
interrupts the ungroup operation of a qeth device while a recovery
is running, cio and qeth are out of sync (device already removed
from cio, but kept in qeth). A following module unload of qeth
results in a kernel OOPS here.

Solution:
Do not allow interruption of ungroup operation to guarantee
finishing of a potentially running qeth recovery thread.

Signed-off-by: Ursula Braun <braunu@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Ursula Braun authored and Jeff Garzik committed Aug 31, 2007
1 parent 3052246 commit d0a34f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/s390/net/qeth_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ qeth_set_offline(struct ccwgroup_device *cgdev)
}

static int
qeth_wait_for_threads(struct qeth_card *card, unsigned long threads);
qeth_threads_running(struct qeth_card *card, unsigned long threads);


static void
Expand All @@ -576,8 +576,7 @@ qeth_remove_device(struct ccwgroup_device *cgdev)
if (!card)
return;

if (qeth_wait_for_threads(card, 0xffffffff))
return;
wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);

if (cgdev->state == CCWGROUP_ONLINE){
card->use_hard_stop = 1;
Expand Down

0 comments on commit d0a34f9

Please sign in to comment.