Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1594371

Re: [PATCH 07/10] serdev: add serdev_device_wait_until_sent

From Rob Herring <robh+dt@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 07/10] serdev: add serdev_device_wait_until_sent
Date 2017-03-07 16:50 +0100
Message-ID <tipx8-18u-21@gated-at.bofh.it> (permalink)
References <thgFz-sD-7@gated-at.bofh.it> <thgFA-sD-41@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Mar 4, 2017 at 5:58 AM, Sebastian Reichel <sre@kernel.org> wrote:
> Add method, which waits until the transmission buffer has been sent.
>
> Signed-off-by: Sebastian Reichel <sre@kernel.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?

Rob

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] Nokia H4+ support Sebastian Reichel <sre@kernel.org> - 2017-03-04 13:10 +0100
  [PATCH 09/10] serdev: add serdev_device_set_rts Sebastian Reichel <sre@kernel.org> - 2017-03-04 13:10 +0100
    Re: [PATCH 09/10] serdev: add serdev_device_set_rts Rob Herring <robh+dt@kernel.org> - 2017-03-07 17:10 +0100
      Re: [PATCH 09/10] serdev: add serdev_device_set_rts Sebastian Reichel <sre@kernel.org> - 2017-03-07 22:20 +0100
  [PATCH 10/10] Bluetooth: add nokia driver Sebastian Reichel <sre@kernel.org> - 2017-03-04 13:10 +0100
    Re: [PATCH 10/10] Bluetooth: add nokia driver Rob Herring <robh+dt@kernel.org> - 2017-03-07 17:50 +0100
      Re: [PATCH 10/10] Bluetooth: add nokia driver Sebastian Reichel <sre@kernel.org> - 2017-03-07 22:50 +0100
        Re: [PATCH 10/10] Bluetooth: add nokia driver Marcel Holtmann <marcel@holtmann.org> - 2017-03-07 23:00 +0100
          Re: [PATCH 10/10] Bluetooth: add nokia driver Sebastian Reichel <sre@kernel.org> - 2017-03-08 00:10 +0100
        Re: [PATCH 10/10] Bluetooth: add nokia driver Rob Herring <robh+dt@kernel.org> - 2017-03-08 15:40 +0100
  [PATCH 03/10] Bluetooth: hci_uart: add support for word alignment Sebastian Reichel <sre@kernel.org> - 2017-03-04 13:10 +0100
  [PATCH 04/10] Bluetooth: hci_uart: add serdev driver support library Sebastian Reichel <sre@kernel.org> - 2017-03-04 13:10 +0100
  [PATCH 05/10] Bluetooth: hci_serdev: do not open device in hci open Sebastian Reichel <sre@kernel.org> - 2017-03-04 13:10 +0100
  [PATCH 07/10] serdev: add serdev_device_wait_until_sent Sebastian Reichel <sre@kernel.org> - 2017-03-04 13:10 +0100
    Re: [PATCH 07/10] serdev: add serdev_device_wait_until_sent Rob Herring <robh+dt@kernel.org> - 2017-03-07 16:50 +0100
      Re: [PATCH 07/10] serdev: add serdev_device_wait_until_sent Rob Herring <robh+dt@kernel.org> - 2017-03-07 18:00 +0100
      Re: [PATCH 07/10] serdev: add serdev_device_wait_until_sent Sebastian Reichel <sre@kernel.org> - 2017-03-07 18:20 +0100

csiph-web