Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23381
b: refs/heads/master
c: 5f38433
h: refs/heads/master
i:
  23379: de53f82
v: v3
  • Loading branch information
Michael Holzheu authored and Linus Torvalds committed Mar 24, 2006
1 parent f28c22e commit 0188e7f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4cd190a736a97e302c038bd91357d636369d4c6b
refs/heads/master: 5f38433885245dce82aa53c20a6b2efbe81ae350
1 change: 1 addition & 0 deletions trunk/drivers/s390/char/tape.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ extern void tape_free_request(struct tape_request *);
extern int tape_do_io(struct tape_device *, struct tape_request *);
extern int tape_do_io_async(struct tape_device *, struct tape_request *);
extern int tape_do_io_interruptible(struct tape_device *, struct tape_request *);
extern int tape_cancel_io(struct tape_device *, struct tape_request *);
void tape_hotplug_event(struct tape_device *, int major, int action);

static inline int
Expand Down
32 changes: 27 additions & 5 deletions trunk/drivers/s390/char/tape_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,13 @@ __tape_start_next_request(struct tape_device *device)
*/
if (request->status == TAPE_REQUEST_IN_IO)
return;
/*
* Request has already been stopped. We have to wait until
* the request is removed from the queue in the interrupt
* handling.
*/
if (request->status == TAPE_REQUEST_DONE)
return;

/*
* We wanted to cancel the request but the common I/O layer
Expand Down Expand Up @@ -1023,6 +1030,20 @@ tape_do_io_interruptible(struct tape_device *device,
return rc;
}

/*
* Stop running ccw.
*/
int
tape_cancel_io(struct tape_device *device, struct tape_request *request)
{
int rc;

spin_lock_irq(get_ccwdev_lock(device->cdev));
rc = __tape_cancel_io(device, request);
spin_unlock_irq(get_ccwdev_lock(device->cdev));
return rc;
}

/*
* Tape interrupt routine, called from the ccw_device layer
*/
Expand Down Expand Up @@ -1068,12 +1089,12 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
* error might still apply. So we just schedule the request to be
* started later.
*/
if (irb->scsw.cc != 0 && (irb->scsw.fctl & SCSW_FCTL_START_FUNC)) {
PRINT_WARN("(%s): deferred cc=%i. restaring\n",
cdev->dev.bus_id,
irb->scsw.cc);
if (irb->scsw.cc != 0 && (irb->scsw.fctl & SCSW_FCTL_START_FUNC) &&
(request->status == TAPE_REQUEST_IN_IO)) {
DBF_EVENT(3,"(%08x): deferred cc=%i, fctl=%i. restarting\n",
device->cdev_id, irb->scsw.cc, irb->scsw.fctl);
request->status = TAPE_REQUEST_QUEUED;
schedule_work(&device->tape_dnr);
schedule_delayed_work(&device->tape_dnr, HZ);
return;
}

Expand Down Expand Up @@ -1287,4 +1308,5 @@ EXPORT_SYMBOL(tape_dump_sense_dbf);
EXPORT_SYMBOL(tape_do_io);
EXPORT_SYMBOL(tape_do_io_async);
EXPORT_SYMBOL(tape_do_io_interruptible);
EXPORT_SYMBOL(tape_cancel_io);
EXPORT_SYMBOL(tape_mtop);
15 changes: 7 additions & 8 deletions trunk/drivers/s390/char/tape_std.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,19 @@ tape_std_assign_timeout(unsigned long data)
{
struct tape_request * request;
struct tape_device * device;
int rc;

request = (struct tape_request *) data;
if ((device = request->device) == NULL)
BUG();

spin_lock_irq(get_ccwdev_lock(device->cdev));
if (request->callback != NULL) {
DBF_EVENT(3, "%08x: Assignment timeout. Device busy.\n",
DBF_EVENT(3, "%08x: Assignment timeout. Device busy.\n",
device->cdev_id);
PRINT_ERR("%s: Assignment timeout. Device busy.\n",
device->cdev->dev.bus_id);
ccw_device_clear(device->cdev, (long) request);
}
spin_unlock_irq(get_ccwdev_lock(device->cdev));
rc = tape_cancel_io(device, request);
if(rc)
PRINT_ERR("(%s): Assign timeout: Cancel failed with rc = %i\n",
device->cdev->dev.bus_id, rc);

}

int
Expand Down

0 comments on commit 0188e7f

Please sign in to comment.