From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756856AbcK2UKd convert rfc822-to-8bit (ORCPT ); Tue, 29 Nov 2016 15:10:33 -0500 Received: from mga09.intel.com ([134.134.136.24]:20382 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753933AbcK2UKZ (ORCPT ); Tue, 29 Nov 2016 15:10:25 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,570,1473145200"; d="scan'208";a="906878812" From: "Winkler, Tomas" To: "'Greg Kroah-Hartman'" CC: "Usyskin, Alexander" , "'linux-kernel@vger.kernel.org'" Subject: RE: [char-misc-next 4/4 V2] mei: bus: enable non-blocking RX Thread-Topic: [char-misc-next 4/4 V2] mei: bus: enable non-blocking RX Thread-Index: AQHSQlhEndh2j9GxLUqRVqPQrPrPYKDgF8YAgABipQCADpey8IABMcMAgAAsrcA= Date: Tue, 29 Nov 2016 20:09:38 +0000 Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B54333D99@hasmsx108.ger.corp.intel.com> References: <1479557771-19689-1-git-send-email-tomas.winkler@intel.com> <20161119121812.GA1476@kroah.com> <5B8DA87D05A7694D9FA63FD143655C1B5432CB3D@hasmsx108.ger.corp.intel.com> <5B8DA87D05A7694D9FA63FD143655C1B54333116@hasmsx108.ger.corp.intel.com> <20161129191612.GA31083@kroah.com> In-Reply-To: <20161129191612.GA31083@kroah.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYWUyNjBiZTYtMTU4Ny00NGFhLWJiODQtZWM0NzljNTFhNThmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjhLOGtGb2FraTdGRGMrdzBxWlFHWlFFbHN2cHB6dHUySWY5TGk0U3lxekk9In0= x-originating-ip: [10.184.70.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mon, Nov 28, 2016 at 11:03:20PM +0000, Winkler, Tomas wrote: > > > > > > > > > > > > > > On Sat, Nov 19, 2016 at 02:16:11PM +0200, Tomas Winkler wrote: > > > > > From: Alexander Usyskin > > > > > > > > > > Enable non-blocking receive for drivers on mei bus, this allows > > > > > checking for data availability by mei client drivers. This is > > > > > most effective for fixed address clients, that lacks flow control. > > > > > > > > > > This function adds new API function mei_cldev_recv_nonblock(), > > > > > it retuns -EGAIN if function will block. > > > > > > > > > > Signed-off-by: Alexander Usyskin > > > > > Signed-off-by: Tomas Winkler > > > > > --- > > > > > V2: use _nonblock() function suffix instead of NONBLOCK flag > > > > > > > > > > drivers/misc/mei/bus-fixup.c | 4 ++-- > > > > > drivers/misc/mei/bus.c | 31 +++++++++++++++++++++++++++++-- > > > > > drivers/misc/mei/mei_dev.h | 7 ++++++- > > > > > include/linux/mei_cl_bus.h | 6 ++++-- > > > > > 4 files changed, 41 insertions(+), 7 deletions(-) > > > > > > > > > > diff --git a/drivers/misc/mei/bus-fixup.c > > > > > b/drivers/misc/mei/bus-fixup.c index 7f2cef9011ae..18e05ca7584f > > > > > 100644 > > > > > --- a/drivers/misc/mei/bus-fixup.c > > > > > +++ b/drivers/misc/mei/bus-fixup.c > > > > > @@ -141,7 +141,7 @@ static int mei_osver(struct mei_cl_device > *cldev) > > > > > if (ret < 0) > > > > > return ret; > > > > > > > > > > - ret = __mei_cl_recv(cldev->cl, buf, length); > > > > > + ret = __mei_cl_recv(cldev->cl, buf, length, 0); > > > > > > > > What is 0 here? Again, mode... > > > > > > Yes, it means no change in behavior, but this is an internal function. > > So, it makes no sense, are you not going to have to read this code again in 10 > years? New developers? Make the code make sense please. Sorry Greg, the code does make sense to me, the whole kernel passes nonblock around as flag starting from the syscall (O_NONBLOCK) it doesn't make sense to write two functions that differ in one 'if' statement. I understand that you are in some crusade against flags, but you are not proposing a concrete solution and I don't have one either. I can solve it in the external wrapper, but internally it's just a same function. Thanks Tomas