All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Winkler, Tomas" <tomas.winkler@intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Usyskin, Alexander" <alexander.usyskin@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [char-misc-next RESEND] mei: bus: enable non-blocking RX
Date: Tue, 6 Dec 2016 10:08:20 +0000	[thread overview]
Message-ID: <5B8DA87D05A7694D9FA63FD143655C1B5433778D@hasmsx108.ger.corp.intel.com> (raw)
In-Reply-To: <20161206100503.GA17050@kroah.com>

> 
> On Sat, Dec 03, 2016 at 12:15:25AM +0200, Tomas Winkler wrote:
> > From: Alexander Usyskin <alexander.usyskin@intel.com>
> >
> > 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 <alexander.usyskin@intel.com>
> > Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> > ---
> >  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);
> >  	if (ret < 0)
> >  		return ret;
> >
> > @@ -272,7 +272,7 @@ static int mei_nfc_if_version(struct mei_cl *cl,
> >  		return -ENOMEM;
> >
> >  	ret = 0;
> > -	bytes_recv = __mei_cl_recv(cl, (u8 *)reply, if_version_length);
> > +	bytes_recv = __mei_cl_recv(cl, (u8 *)reply, if_version_length, 0);
> 
> I still don't like this, as here are two examples of you having to somehow
> mentally keep track of the "mode" of what is going on.

I know, but I don't have better solution. We try to keep the code documented as much as possible.  
> 
a> But it's your code, you have to maintain it, not me, good luck!

Fair enough
Tomas 

      reply	other threads:[~2016-12-06 10:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 22:15 [char-misc-next RESEND] mei: bus: enable non-blocking RX Tomas Winkler
2016-12-06 10:05 ` Greg Kroah-Hartman
2016-12-06 10:08   ` Winkler, Tomas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5B8DA87D05A7694D9FA63FD143655C1B5433778D@hasmsx108.ger.corp.intel.com \
    --to=tomas.winkler@intel.com \
    --cc=alexander.usyskin@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.