[PATCH v3 2/8] mailbox: arm_mhu: add driver for ARM MHU controller
From: Jassi Brar <hidden>
Date: 2015-01-09 15:29:20
Also in:
linux-devicetree
On 9 January 2015 at 20:54, Russell King - ARM Linux [off-list ref] wrote:
On Fri, Jan 09, 2015 at 06:49:12PM +0530, Jassi Brar wrote:quoted
On 9 January 2015 at 18:21, Russell King - ARM Linux [off-list ref] wrote:quoted
On Fri, Jan 09, 2015 at 07:28:09PM +0800, Vincent Yang wrote:quoted
+static irqreturn_t mhu_rx_interrupt(int irq, void *p) +{ + struct mbox_chan *chan = p; + struct mhu_link *mlink = (struct mhu_link *)chan->con_priv; + u32 val; + + pr_debug("%s:%d\n", __func__, __LINE__); + val = readl_relaxed(mlink->rx_reg + INTR_STAT_OFS); + mbox_chan_received_data(chan, (void *)val); + + writel_relaxed(val, mlink->rx_reg + INTR_CLR_OFS); + + return IRQ_HANDLED;What if 'val' was zero - is the interrupt still "handled" ?This irq shouldn't fire unless RX_STAT register has some non-zero value.You claim this interrupt handler using IRQF_SHARED - what if another user of this interrupt gets stuck? Your handler above will prevent the kernel recovering as it will think that you are validly processing the stuck interrupt each time. If it isn't shared, then don't use IRQF_SHARED. Either way, it is good practice to return IRQ_NONE if there's no work to be done.
OK, will do. thanks.