From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH] tty: serial: msm: Move request_irq to the end of startup Date: Thu, 10 Aug 2017 17:04:55 -0700 Message-ID: <20170811000455.GG2146@codeaurora.org> References: <1502086885-8390-1-git-send-email-neeraju@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:50448 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751440AbdHKAE4 (ORCPT ); Thu, 10 Aug 2017 20:04:56 -0400 Content-Disposition: inline In-Reply-To: <1502086885-8390-1-git-send-email-neeraju@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Neeraj Upadhyay 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 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"); > > msm_uart_irq() > msm_handle_rx_dm() > msm_start_rx_dma() > dma->desc = dma_map_single() > > > Signed-off-by: Neeraj Upadhyay > --- 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 -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project