Re: [PATCH 1/2] scsi: aacraid: change wait_sem to a completion

2018-12-12 Thread Martin K. Petersen


Arnd,

> The wait_sem member is used like a completion, so we should use the
> respective API. The behavior is unchanged.

Applied to 4.21/scsi-queue. Thank you!

-- 
Martin K. Petersen  Oracle Linux Engineering


RE: [PATCH 1/2] scsi: aacraid: change wait_sem to a completion

2018-12-11 Thread Dave.Carroll
> -Original Message-
> From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
> ow...@vger.kernel.org] On Behalf Of Arnd Bergmann
> Sent: Monday, December 10, 2018 1:33 PM
> To: Adaptec OEM Raid Solutions ; James E.J.
> Bottomley ; Martin K. Petersen
> 
> Cc: Arnd Bergmann ; Raghava Aditya Renukunta
> ; Prasad B Munirathnam
> ; Dave Carroll
> ; Dan Carpenter
> ; Johannes Thumshirn ;
> linux-s...@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH 1/2] 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 
> ---
Reviewed-by: Dave Carroll 


Re: [PATCH 1/2] scsi: aacraid: change wait_sem to a completion

2018-12-10 Thread Johannes Thumshirn
Looks good,
Reviewed-by: Johannes Thumshirn 
-- 
Johannes ThumshirnSUSE Labs Filesystems
jthumsh...@suse.de+49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850


[PATCH 1/2] scsi: aacraid: change wait_sem to a completion

2018-12-10 Thread Arnd Bergmann
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 
---
 drivers/scsi/aacraid/aacraid.h  | 2 +-
 drivers/scsi/aacraid/commctrl.c | 4 ++--
 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 {
u32 unique; // unique value representing 
this context
ulong   jiffies;// used for cleanup - dmb 
changed to ulong
struct list_headnext;   // used to link context's into 
a linked list
-   struct semaphorewait_sem;   // this is used to wait for the 
next fib to arrive.
+   struct completion   completion; // this is used to wait for the 
next fib to arrive.
int wait;   // Set to true when thread is 
in WaitForSingleObject
unsigned long   count;  // total number of FIBs on 
FibList
struct list_headfib_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)
/*
 *  Initialize the mutex used to wait for the next AIF.
 */
-   sema_init(>wait_sem, 0);
+   init_completion(>completion);
fibctx->wait = 0;
/*
 *  Initialize the fibs and set the count of fibs on
@@ -335,7 +335,7 @@ static int next_getadapter_fib(struct aac_dev * dev, void 
__user *arg)
ssleep(1);
}
if (f.wait) {
-   if(down_interruptible(>wait_sem) < 0) {
+   if 
(wait_for_completion_interruptible(>completion) < 0) {
status = -ERESTARTSYS;
} else {
/* 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)
 * Set the event to wake up the
 * thread that will waiting.
 */
-   up(>wait_sem);
+   complete(>completion);
} else {
printk(KERN_WARNING "aifd: didn't allocate NewFib.\n");
kfree(fib);
@@ -2165,7 +2165,7 @@ static void wakeup_fibctx_threads(struct aac_dev *dev,
 * Set the event to wake up the
 * thread that is waiting.
 */
-   up(>wait_sem);
+   complete(>completion);
 
entry = entry->next;
}
-- 
2.20.0