All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Neeraj Upadhyay <neeraju@codeaurora.org>
Cc: andy.gross@linaro.org, david.brown@linaro.org,
	gregkh@linuxfoundation.org, jslaby@suse.com,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-serial@vger.kernel.org, sramana@codeaurora.org
Subject: Re: [PATCH] tty: serial: msm: Move request_irq to the end of startup
Date: Thu, 10 Aug 2017 17:04:55 -0700	[thread overview]
Message-ID: <20170811000455.GG2146@codeaurora.org> (raw)
In-Reply-To: <1502086885-8390-1-git-send-email-neeraju@codeaurora.org>

On 08/07, Neeraj Upadhyay wrote:
> Move the request_irq() call to the end of the msm_startup(),
> so that we don't handle interrupts while msm_startup() is
> running. This avoids potential races while initialization
> is in progress. For example, consider below scenario
> where rx handler reads the intermediate value of dma->chan,
> set in msm_request_rx_dma(), and tries to do dma mapping,
> which results in data abort.
> 
> uart_port_startup()
>   msm_startup()
>    request_irq()
>    ...
>    msm_request_rx_dma()
>     ...
>     dma->chan = dma_request_slave_channel_reason(dev, "rx");
>     <UART RX IRQ>
>      msm_uart_irq()
>       msm_handle_rx_dm()
>        msm_start_rx_dma()
>         dma->desc = dma_map_single()
>          <data abort>
> 
> Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
> ---

Or we can write the IMR register with 0 to mask all irqs before
requesting the irq handler be setup? We will unmask the
interrupts we care about anyway when we setup termios.

If not, this change is ok, but I would guess it doesn't fix
spurious irqs from happening while we keep configuring the
hardware.

Feel free to take my reviewed-by though.

Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

      parent reply	other threads:[~2017-08-11  0:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-07  6:21 [PATCH] tty: serial: msm: Move request_irq to the end of startup Neeraj Upadhyay
2017-08-07 19:31 ` Andy Gross
2017-08-11  0:04 ` Stephen Boyd [this message]

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=20170811000455.GG2146@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=neeraju@codeaurora.org \
    --cc=sramana@codeaurora.org \
    /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.