linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: Johan Hovold <johan@kernel.org>,
	Stefan Wahren <stefan.wahren@i2se.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>, Sebastian Reichel <sre@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Andrey Smirnov <andrew.smirnov@gmail.com>,
	"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] serdev: Restore serdev_device_write_buf for atomic context
Date: Tue, 2 May 2017 15:18:54 +0200	[thread overview]
Message-ID: <20170502131854.GA17710@localhost> (raw)
In-Reply-To: <CAL_Jsq+QOv6G2EFX8RpE1gk2S9M5VrndwQNNCjM0GqZ+2PXz3A@mail.gmail.com>

On Tue, May 02, 2017 at 07:41:34AM -0500, Rob Herring wrote:
> On Tue, May 2, 2017 at 4:06 AM, Johan Hovold <johan@kernel.org> wrote:
> > On Fri, Apr 28, 2017 at 01:47:21PM +0200, Stefan Wahren wrote:
> >> Starting with commit 6fe729c4bdae ("serdev: Add serdev_device_write
> >> subroutine") the function serdev_device_write_buf cannot be used in
> >> atomic context anymore (mutex_lock is sleeping). So restore the old
> >> behavior.
> >
> > Yeah, preventing use in atomic context seems unnecessary, although any
> > clients writing must now deal with serialisation themselves (as before,
> > and as they should).
> 
> We could just remove the mutex for serdev_device_write and always make
> the client responsible for serialization.

That sounds reasonable.

> > Calling wait_for_completion in the non-blocking case was also needlessly
> > inefficient.
> 
> It won't be called because count should be 0.

That's not guaranteed; count would be nonzero whenever the tty
driver does not accept the full buffer and then we'd currently end up
calling wait_for_completion_timeout() with a zero-timeout instead of
just returning immediately.

Johan

  reply	other threads:[~2017-05-02 13:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28 11:47 [PATCH] serdev: Restore serdev_device_write_buf for atomic context Stefan Wahren
2017-05-02  9:06 ` Johan Hovold
2017-05-02 12:41   ` Rob Herring
2017-05-02 13:18     ` Johan Hovold [this message]
2017-05-04 16:22       ` Stefan Wahren
2017-05-04 20:32         ` Rob Herring
2017-05-08 15:18           ` Johan Hovold
2017-05-17 11:38             ` Stefan Wahren
2017-05-17 12:46               ` Greg Kroah-Hartman

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=20170502131854.GA17710@localhost \
    --to=johan@kernel.org \
    --cc=andrew.smirnov@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=robh@kernel.org \
    --cc=sre@kernel.org \
    --cc=stefan.wahren@i2se.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).