Skip to content

Commit

Permalink
[S390] cio: fix init_count in case of recognition after steal lock
Browse files Browse the repository at this point in the history
After we try to steal a lock on a ccw device in boxed state,
we have to restart device recognition and potentially reprobing.

In this case ccw_device_init_count was erroneously decreased
twice. This patch fixes the issue.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Mar 8, 2010
1 parent 5289802 commit a290156
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/s390/cio/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ static void sch_create_and_recog_new_device(struct subchannel *sch)
static void io_subchannel_register(struct ccw_device *cdev)
{
struct subchannel *sch;
int ret;
int ret, adjust_init_count = 1;
unsigned long flags;

sch = to_subchannel(cdev->dev.parent);
Expand Down Expand Up @@ -793,6 +793,7 @@ static void io_subchannel_register(struct ccw_device *cdev)
cdev->private->dev_id.ssid,
cdev->private->dev_id.devno);
}
adjust_init_count = 0;
goto out;
}
/*
Expand All @@ -818,7 +819,7 @@ static void io_subchannel_register(struct ccw_device *cdev)
cdev->private->flags.recog_done = 1;
wake_up(&cdev->private->wait_q);
out_err:
if (atomic_dec_and_test(&ccw_device_init_count))
if (adjust_init_count && atomic_dec_and_test(&ccw_device_init_count))
wake_up(&ccw_device_init_wq);
}

Expand Down

0 comments on commit a290156

Please sign in to comment.