Re: [PATCH v2 6/8] IB/hns: Replace counting semaphore event_sem with wait_event

2016-10-25 Thread Binoy Jayan
On 25 October 2016 at 18:51, Arnd Bergmann wrote: > On Tuesday, October 25, 2016 6:29:45 PM CEST Binoy Jayan wrote: > > Something like > > static struct hns_roce_cmd_context *hns_roce_try_get_context(struct > hns_roce_cmdq *cmd) > { > struct hns_roce_cmd_context *context = NULL; > >

Re: [PATCH v2 6/8] IB/hns: Replace counting semaphore event_sem with wait_event

2016-10-25 Thread Arnd Bergmann
On Tuesday, October 25, 2016 6:29:45 PM CEST Binoy Jayan wrote: > On 25 October 2016 at 17:58, Arnd Bergmann wrote: > > On Tuesday, October 25, 2016 5:31:57 PM CEST Binoy Jayan wrote: > >> static int __hns_roce_cmd_mbox_wait(struct hns_roce_dev *hr_dev, u64 > >> in_param, > >>

Re: [PATCH v2 6/8] IB/hns: Replace counting semaphore event_sem with wait_event

2016-10-25 Thread Binoy Jayan
On 25 October 2016 at 17:58, Arnd Bergmann wrote: > On Tuesday, October 25, 2016 5:31:57 PM CEST Binoy Jayan wrote: >> static int __hns_roce_cmd_mbox_wait(struct hns_roce_dev *hr_dev, u64 >> in_param, >> u64 out_param, unsigned long in_modifier, >> @@ -198,11

Re: [PATCH v2 6/8] IB/hns: Replace counting semaphore event_sem with wait_event

2016-10-25 Thread Arnd Bergmann
On Tuesday, October 25, 2016 5:31:57 PM CEST Binoy Jayan wrote: > static int __hns_roce_cmd_mbox_wait(struct hns_roce_dev *hr_dev, u64 > in_param, > u64 out_param, unsigned long in_modifier, > @@ -198,11 +218,12 @@ static int __hns_roce_cmd_mbox_wait(struct hns

[PATCH v2 6/8] IB/hns: Replace counting semaphore event_sem with wait_event

2016-10-25 Thread Binoy Jayan
Counting semaphores are going away in the future, so replace the semaphore mthca_cmd::event_sem with a conditional wait_event. Signed-off-by: Binoy Jayan --- drivers/infiniband/hw/hns/hns_roce_cmd.c| 37 + drivers/infiniband/hw/hns/hns_roce_device.h | 2 +- 2 fil