diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-12-10 16:32:40 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-12-12 20:35:33 -0500 |
commit | dc71eccc175eae4959b06ae697ebef019719063d (patch) | |
tree | 870b7ec08f6d6e0969607197cba9d129081c52ca | |
parent | 719162bd5bb968203397b9b1d0dd30a9797bbd09 (diff) |
scsi: aacraid: change wait_sem to a completion
The wait_sem member is used like a completion, so we should
use the respective API. The behavior is unchanged.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Dave Carroll <david.carroll@microsemi.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/aacraid/aacraid.h | 2 | ||||
-rw-r--r-- | drivers/scsi/aacraid/commctrl.c | 4 | ||||
-rw-r--r-- | drivers/scsi/aacraid/commsup.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h index 39eb415987fc..531a0b9a58f8 100644 --- a/drivers/scsi/aacraid/aacraid.h +++ b/drivers/scsi/aacraid/aacraid.h | |||
@@ -1241,7 +1241,7 @@ struct aac_fib_context { | |||
1241 | u32 unique; // unique value representing this context | 1241 | u32 unique; // unique value representing this context |
1242 | ulong jiffies; // used for cleanup - dmb changed to ulong | 1242 | ulong jiffies; // used for cleanup - dmb changed to ulong |
1243 | struct list_head next; // used to link context's into a linked list | 1243 | struct list_head next; // used to link context's into a linked list |
1244 | struct semaphore wait_sem; // this is used to wait for the next fib to arrive. | 1244 | struct completion completion; // this is used to wait for the next fib to arrive. |
1245 | int wait; // Set to true when thread is in WaitForSingleObject | 1245 | int wait; // Set to true when thread is in WaitForSingleObject |
1246 | unsigned long count; // total number of FIBs on FibList | 1246 | unsigned long count; // total number of FIBs on FibList |
1247 | struct list_head fib_list; // this holds fibs and their attachd hw_fibs | 1247 | struct list_head fib_list; // this holds fibs and their attachd hw_fibs |
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c index 25f6600d6c09..6a6ad9477786 100644 --- a/drivers/scsi/aacraid/commctrl.c +++ b/drivers/scsi/aacraid/commctrl.c | |||
@@ -203,7 +203,7 @@ static int open_getadapter_fib(struct aac_dev * dev, void __user *arg) | |||
203 | /* | 203 | /* |
204 | * Initialize the mutex used to wait for the next AIF. | 204 | * Initialize the mutex used to wait for the next AIF. |
205 | */ | 205 | */ |
206 | sema_init(&fibctx->wait_sem, 0); | 206 | init_completion(&fibctx->completion); |
207 | fibctx->wait = 0; | 207 | fibctx->wait = 0; |
208 | /* | 208 | /* |
209 | * Initialize the fibs and set the count of fibs on | 209 | * Initialize the fibs and set the count of fibs on |
@@ -335,7 +335,7 @@ return_fib: | |||
335 | ssleep(1); | 335 | ssleep(1); |
336 | } | 336 | } |
337 | if (f.wait) { | 337 | if (f.wait) { |
338 | if(down_interruptible(&fibctx->wait_sem) < 0) { | 338 | if (wait_for_completion_interruptible(&fibctx->completion) < 0) { |
339 | status = -ERESTARTSYS; | 339 | status = -ERESTARTSYS; |
340 | } else { | 340 | } else { |
341 | /* Lock again and retry */ | 341 | /* Lock again and retry */ |
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 1e77d96a18f2..7ed51a77e39d 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c | |||
@@ -1828,7 +1828,7 @@ int aac_check_health(struct aac_dev * aac) | |||
1828 | * Set the event to wake up the | 1828 | * Set the event to wake up the |
1829 | * thread that will waiting. | 1829 | * thread that will waiting. |
1830 | */ | 1830 | */ |
1831 | up(&fibctx->wait_sem); | 1831 | complete(&fibctx->completion); |
1832 | } else { | 1832 | } else { |
1833 | printk(KERN_WARNING "aifd: didn't allocate NewFib.\n"); | 1833 | printk(KERN_WARNING "aifd: didn't allocate NewFib.\n"); |
1834 | kfree(fib); | 1834 | kfree(fib); |
@@ -2165,7 +2165,7 @@ static void wakeup_fibctx_threads(struct aac_dev *dev, | |||
2165 | * Set the event to wake up the | 2165 | * Set the event to wake up the |
2166 | * thread that is waiting. | 2166 | * thread that is waiting. |
2167 | */ | 2167 | */ |
2168 | up(&fibctx->wait_sem); | 2168 | complete(&fibctx->completion); |
2169 | 2169 | ||
2170 | entry = entry->next; | 2170 | entry = entry->next; |
2171 | } | 2171 | } |