summaryrefslogtreecommitdiff
path: root/drivers/scsi/atari_NCR5380.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2016-01-03 08:05:21 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2016-01-07 05:42:56 +0300
commit0ad0eff98fec3c940ec199047ff580abaaa5bb1a (patch)
treeedbaaf6760250383f1bf45fe39e48a1422985126 /drivers/scsi/atari_NCR5380.c
parente52bbd5ccf53d2a73e524adb26b6d8a4f810ccb4 (diff)
downloadlinux-0ad0eff98fec3c940ec199047ff580abaaa5bb1a.tar.xz
ncr5380: Introduce unbound workqueue
Allocate a work queue that will permit busy waiting and sleeping. This means NCR5380_init() can potentially fail, so add this error path. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Ondrej Zary <linux@rainbow-software.org> Tested-by: Michael Schmitz <schmitzmic@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/atari_NCR5380.c')
-rw-r--r--drivers/scsi/atari_NCR5380.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 1dd341ef89d4..0b0a225167bc 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -643,7 +643,7 @@ static inline void queue_main(struct NCR5380_hostdata *hostdata)
queue it on the 'immediate' task queue, to be processed
immediately after the current interrupt processing has
finished. */
- schedule_work(&hostdata->main_task);
+ queue_work(hostdata->work_q, &hostdata->main_task);
}
/* else: nothing to do: the running NCR5380_main() will pick up
any newly queued command. */
@@ -832,6 +832,11 @@ static int __init NCR5380_init(struct Scsi_Host *instance, int flags)
hostdata->flags = flags;
INIT_WORK(&hostdata->main_task, NCR5380_main);
+ hostdata->work_q = alloc_workqueue("ncr5380_%d",
+ WQ_UNBOUND | WQ_MEM_RECLAIM,
+ 1, instance->host_no);
+ if (!hostdata->work_q)
+ return -ENOMEM;
prepare_info(instance);
@@ -907,6 +912,7 @@ static void NCR5380_exit(struct Scsi_Host *instance)
struct NCR5380_hostdata *hostdata = shost_priv(instance);
cancel_work_sync(&hostdata->main_task);
+ destroy_workqueue(hostdata->work_q);
}
/**