All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/7] serial: serial_msm: fail probe if settings clocks fails
Date: Mon, 14 May 2018 08:00:09 +1000	[thread overview]
Message-ID: <CAPnjgZ3Hd=h9c63hMH_qnzgybaPKaQ0Ojcsnp=OY3vcP16VKwg@mail.gmail.com> (raw)
In-Reply-To: <20180512101558.24375-3-ramon.fried@gmail.com>

Hi Ramon,

On 12 May 2018 at 20:15, Ramon Fried <ramon.fried@gmail.com> wrote:
> Failure to set the clocks will causes data abort exception when
> trying to write to AHB uart registers.
> This patch ensures that we don't touch these registers if clock
> setting failed.
>
> Signed-off-by: Ramon Fried <ramon.fried@gmail.com>
> ---
>  drivers/serial/serial_msm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c
> index 119e6b9846..250e48c996 100644
> --- a/drivers/serial/serial_msm.c
> +++ b/drivers/serial/serial_msm.c
> @@ -183,8 +183,8 @@ static int msm_serial_probe(struct udevice *dev)
>  {
>         struct msm_serial_data *priv = dev_get_priv(dev);
>
> -       msm_uart_clk_init(dev); /* Ignore return value and hope clock was
> -                                 properly initialized by earlier loaders */
> +       if (msm_uart_clk_init(dev))
> +               return -EINVAL;

Would it not be better to return the error that msm_uart_clk_init()
returns, rather than -EINVAL?
>
>         if (readl(priv->base + UARTDM_SR) & UARTDM_SR_UART_OVERRUN)
>                 writel(UARTDM_CR_CMD_RESET_ERR, priv->base + UARTDM_CR);
> --
> 2.14.1
>

Regards,
Simon

  reply	other threads:[~2018-05-13 22:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-12 10:15 [U-Boot] [PATCH 0/7] *** Qualcomm Snapdraon serial fixes*** Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 1/7] db820c: set clk node to be probed before relocation Ramon Fried
2018-05-13 22:00   ` Simon Glass
2018-05-14  7:06     ` Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 2/7] serial: serial_msm: fail probe if settings clocks fails Ramon Fried
2018-05-13 22:00   ` Simon Glass [this message]
2018-05-14  7:07     ` Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 3/7] serial: serial_msm: initialize uart only before relocation Ramon Fried
2018-05-13 22:00   ` Simon Glass
2018-05-12 10:15 ` [U-Boot] [PATCH 4/7] mach-snapdragon: Fix UART clock flow Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 5/7] mach-snapdragon: Introduce pinctrl driver Ramon Fried
2018-05-13 22:00   ` Simon Glass
2018-05-14  7:10     ` Ramon Fried
2018-05-14 19:51       ` Simon Glass
2018-05-14 21:23         ` Ramon Fried
2018-05-15 16:02           ` Simon Glass
2018-05-15 16:09             ` Ramon Fried
2018-05-15 16:15               ` Simon Glass
2018-05-16  5:37                 ` Ramon Fried
2018-05-12 10:15 ` [U-Boot] [PATCH 6/7] db410: added pinctrl node and serial bindings Ramon Fried
2018-05-13 22:00   ` Simon Glass
2018-05-12 10:15 ` [U-Boot] [PATCH 7/7] serial: serial_msm: added pinmux & config Ramon Fried
2018-05-13 22:00   ` Simon Glass

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='CAPnjgZ3Hd=h9c63hMH_qnzgybaPKaQ0Ojcsnp=OY3vcP16VKwg@mail.gmail.com' \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.