[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170307155508.olbiecapfs7ep6xm@earth>
Date: Tue, 7 Mar 2017 16:55:08 +0100
From: Sebastian Reichel <sre@...nel.org>
To: Rob Herring <robh+dt@...nel.org>
Cc: Marcel Holtmann <marcel@...tmann.org>,
Gustavo Padovan <gustavo@...ovan.org>,
Johan Hedberg <johan.hedberg@...il.com>,
Tony Lindgren <tony@...mide.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jslaby@...e.com>,
Mark Rutland <mark.rutland@....com>,
"open list:BLUETOOTH DRIVERS" <linux-bluetooth@...r.kernel.org>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 07/10] serdev: add serdev_device_wait_until_sent
Hi,
On Tue, Mar 07, 2017 at 09:34:49AM -0600, Rob Herring wrote:
> On Sat, Mar 4, 2017 at 5:58 AM, Sebastian Reichel <sre@...nel.org> wrote:
> > Add method, which waits until the transmission buffer has been sent.
> >
> > Signed-off-by: Sebastian Reichel <sre@...nel.org>
> > ---
> > drivers/tty/serdev/core.c | 11 +++++++++++
> > drivers/tty/serdev/serdev-ttyport.c | 15 ++++++++++++++-
> > include/linux/serdev.h | 3 +++
> > 3 files changed, 28 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
> > index f4c6c90add78..a63b74031e22 100644
> > --- a/drivers/tty/serdev/core.c
> > +++ b/drivers/tty/serdev/core.c
> > @@ -173,6 +173,17 @@ void serdev_device_set_flow_control(struct serdev_device *serdev, bool enable)
> > }
> > EXPORT_SYMBOL_GPL(serdev_device_set_flow_control);
> >
> > +void serdev_device_wait_until_sent(struct serdev_device *serdev, long timeout)
> > +{
> > + struct serdev_controller *ctrl = serdev->ctrl;
> > +
> > + if (!ctrl || !ctrl->ops->wait_until_sent)
> > + return;
> > +
> > + ctrl->ops->wait_until_sent(ctrl, timeout);
> > +}
> > +EXPORT_SYMBOL_GPL(serdev_device_wait_until_sent);
> > +
> > static int serdev_drv_probe(struct device *dev)
> > {
> > const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
> > diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> > index d05393594f15..db2bc601e554 100644
> > --- a/drivers/tty/serdev/serdev-ttyport.c
> > +++ b/drivers/tty/serdev/serdev-ttyport.c
> > @@ -14,6 +14,7 @@
> > #include <linux/serdev.h>
> > #include <linux/tty.h>
> > #include <linux/tty_driver.h>
> > +#include <linux/poll.h>
> >
> > #define SERPORT_ACTIVE 1
> >
> > @@ -47,10 +48,13 @@ static void ttyport_write_wakeup(struct tty_port *port)
> > struct serport *serport = serdev_controller_get_drvdata(ctrl);
> >
> > if (!test_and_clear_bit(TTY_DO_WRITE_WAKEUP, &port->tty->flags))
> > - return;
> > + goto out;
> >
> > if (test_bit(SERPORT_ACTIVE, &serport->flags))
> > serdev_controller_write_wakeup(ctrl);
> > +
> > +out:
> > + wake_up_interruptible_poll(&port->tty->write_wait, POLLOUT);
>
> Shouldn't this be separate patch?
That change is needed for tty_wait_until_sent to work correctly, which
starts with a wait_event_interruptible_timeout() on write_wait.
-- Sebastian
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists