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


Groups > linux.kernel > #1204715

Re: [PATCHv2 6/8] serial: imx: add runtime pm support

From Fabio Estevam <festevam@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCHv2 6/8] serial: imx: add runtime pm support
Date 2015-08-11 05:10 +0200
Message-ID <pW86R-SW-1@gated-at.bofh.it> (permalink)
References <pW6HL-75p-5@gated-at.bofh.it> <pW6HL-75p-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Aug 10, 2015 at 10:35 PM, Eduardo Valentin <edubezval@gmail.com> wrote:

>  static int imx_poll_get_char(struct uart_port *port)
>  {
> -       if (!(readl_relaxed(port->membase + USR2) & USR2_RDR))
> -               return NO_POLL_CHAR;
> +       int ret;
> +
> +       pm_runtime_get_sync(sport->dev);
> +       if (!(readl_relaxed(port->membase + USR2) & USR2_RDR)) {
> +               ret = NO_POLL_CHAR;
> +               goto mark_last;
> +       }
>
> -       return readl_relaxed(port->membase + URXD0) & URXD_RX_DATA;
> +       ret = readl_relaxed(port->membase + URXD0) & URXD_RX_DATA;
> +
> +mark_last:
> +       pm_runtime_mark_last_busy(sport->dev);
> +       pm_runtime_put_autosuspend(sport->dev);

You should return ret here.

> +static int serial_imx_runtime_resume(struct device *dev)
> +{
> +       struct imx_port *sport = dev_get_drvdata(dev);
> +
> +       clk_enable(sport->clk_per);

clk_enable() may fail.

> +       clk_enable(sport->clk_ipg);

Same here.

> @@ -2096,6 +2212,8 @@ static int imx_serial_port_resume(struct device *dev)
>         struct platform_device *pdev = to_platform_device(dev);
>         struct imx_port *sport = platform_get_drvdata(pdev);
>
> +       clk_prepare_enable(sport->clk_per);

clk_prepare_enable() may fail.

> +       clk_prepare_enable(sport->clk_ipg);

Ditto.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCHv2 0/8] serial: imx: rework pm support and add runtime pm Eduardo Valentin <edubezval@gmail.com> - 2015-08-11 03:40 +0200
  [PATCHv2 2/8] serial: imx: introduce serial_imx_enable_wakeup() Eduardo Valentin <edubezval@gmail.com> - 2015-08-11 03:40 +0200
  [PATCHv2 6/8] serial: imx: add runtime pm support Eduardo Valentin <edubezval@gmail.com> - 2015-08-11 03:40 +0200
    Re: [PATCHv2 6/8] serial: imx: add runtime pm support Fabio Estevam <festevam@gmail.com> - 2015-08-11 05:10 +0200
      Re: [PATCHv2 6/8] serial: imx: add runtime pm support Eduardo Valentin <edubezval@gmail.com> - 2015-08-11 19:00 +0200
    Re: [PATCHv2 6/8] serial: imx: add runtime pm support Kevin Hilman <khilman@kernel.org> - 2015-08-12 21:40 +0200
  [PATCHv2 8/8] serial: imx: use SET_*SYSTEM_PM_OPS helper functions Eduardo Valentin <edubezval@gmail.com> - 2015-08-11 03:40 +0200
  [PATCHv2 1/8] serial: imx: remove unbalanced clk_prepare Eduardo Valentin <edubezval@gmail.com> - 2015-08-11 03:40 +0200
  [PATCHv2 7/8] serial: imx: add pm_qos request Eduardo Valentin <edubezval@gmail.com> - 2015-08-11 03:40 +0200
  [PATCHv2 4/8] serial: imx: save and restore context in the suspend path Eduardo Valentin <edubezval@gmail.com> - 2015-08-11 03:40 +0200
  [PATCHv2 5/8] serial: imx: add a flag to indicate we are in the suspend path Eduardo Valentin <edubezval@gmail.com> - 2015-08-11 03:40 +0200

csiph-web