lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqLLJw_k2pYuoLkYchu1HBCOL+jcBmvXgcqMuxjQ7Ce-jQ@mail.gmail.com>
Date:   Tue, 7 Mar 2017 10:46:06 -0600
From:   Rob Herring <robh+dt@...nel.org>
To:     Sebastian Reichel <sre@...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

On Tue, Mar 7, 2017 at 9:55 AM, Sebastian Reichel <sre@...nel.org> wrote:
> 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.

Okay.

Acked-by: Rob Herring <robh@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ