Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S944578AbcJSPP1 (ORCPT ); Wed, 19 Oct 2016 11:15:27 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:56026 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942886AbcJSPPY (ORCPT ); Wed, 19 Oct 2016 11:15:24 -0400 From: Arnd Bergmann To: Binoy Jayan Cc: Doug Ledford , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, Linux kernel mailing list Subject: Re: [PATCH 6/8] IB/hns: Replace counting semaphore event_sem with wait condition Date: Wed, 19 Oct 2016 17:15:10 +0200 Message-ID: <4225681.X40Xeo72dr@wuerfel> User-Agent: KMail/5.1.3 (Linux/4.4.0-34-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: References: <1476721862-7070-1-git-send-email-binoy.jayan@linaro.org> <5900385.6T4BAIyXjD@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:h+dm3lIQxFXJEuVZzrkoAB2aPUalyOJHU5HmcuCPI/JgT3VvpQq 21QaYsn+fiXyA1saEosKDIg70aWjg8QWA6cctcIsL3w2BhYVXCCmd3QgQ3w5ElDR4T8zuNi n/mZTEcS19IxnHZCHbvdZ89AavA5NjFI8kw5cA6C/ZfoxJPVpY0wbGOKrknqPj+MccITpDb NUZDi6JtNF6KSWQXNF1Pw== X-UI-Out-Filterresults: notjunk:1;V01:K0:LhiS6o+yJ5Y=:Gzb/a2IRrU8qb1oHBOp00f 6Eygt+dumOROQuJQ4lOTcUm7+5eF8aC+flU0J3Ypk8k72/67k1OLsJLrKoPyw3QH/GJfq5S0s ywqzeuIM19UBdlCwnfTwFGMDZWldKdoMZPD0Fnsik05knYVYdHvWwBW0mu0n5Rqgfb1TDbYHa YggB6jApDQfCrqYqz03nZ5481ECrsPOGJmgs965+oSZCXTXC20Cc1d2Xg/6CRjUUE5x2YLai+ g3/RbMHdF9wnxpn+5/3Jg2Xe7C2D0PFkIO3+JzSt2Rk/0gEcEkVIj6/Sb5QHzNPabFtOUwTPR kfsmihtzrlHj+pMraTX/fT4Krzxcgz+waRTxXDdEo95HBQcVtqv3V/S2uKyZ8FpRjHpY+9/cp ExOk2rnGzr17pPyLmsiQruclLaGz9N7NXACr/u183dc2rAXZA53tkMLQNqVd0KkCuwh5b7urT v3wbe0FYGV0QOxX3BRxhxUkgFN9xDrtE2X0YgNOCEIl57NYfkE4xhXSJ1nwHMfSzjQZ+0eOs3 xCX/g6dhs5xS0nkpNLfM2agV0y+NxFRXdJGgbcd1FQw9pEhLnGZBbVTpPQeTs2O9UNx6ODvbK Z7KXRPvBRUIkQnB+p5G+rl8pLvPblZnqCc8gHzW2XOD9oTRzHA0WRO4rBl2clB++maGyWKd7S /IZmUa26r/ISU59csvZrIydFSVq44BSDxF/VbI8UGz52NwCN1dUROwfXpNjFez1LexUt11+0Z 4iJytcAGBSEvehol Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 926 Lines: 27 On Tuesday, October 18, 2016 10:46:45 AM CEST Binoy Jayan wrote: > Thank you for replying for the questions. I''ll look for alternatives > for patches 6,7 and 8 and resend the series. Ok, thanks! I also looked at patch 8 some more and noticed that those four functions all do the exact same sequence: - initialize a mlx5_ib_umr_context on the stack - assign "umrwr.wr.wr_cqe = &umr_context.cqe" - take the semaphore - call ib_post_send with a single ib_send_wr - wait for the mlx5_ib_umr_done() function to get called - if we get back a failure, print a warning and return -EFAULT. - release the semaphore Moving all of these into a shared helper function would be a good cleanup, and it leaves only a single function using the semaphore, which can then be rewritten to use something else. The existing completion in there can be simplified to a wait_event, since we are waiting for the return value to be filled. Arnd