[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4f2c878-4117-d197-2d0b-fed8df90d4b3@broadcom.com>
Date: Fri, 23 Oct 2020 10:18:23 -0700
From: Ray Jui <ray.jui@...adcom.com>
To: Rayagonda Kokatanur <rayagonda.kokatanur@...adcom.com>,
Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
bcm-kernel-feedback-list@...adcom.com,
Wolfram Sang <wsa@...nel.org>,
Florian Fainelli <f.fainelli@...il.com>,
Brendan Higgins <brendanhiggins@...gle.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Lori Hikichi <lori.hikichi@...adcom.com>,
Dhananjay Phadke <dphadke@...ux.microsoft.com>,
linux-i2c@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 2/6] i2c: iproc: handle only slave interrupts which are
enabled
On 10/11/2020 11:22 AM, Rayagonda Kokatanur wrote:
> Handle only slave interrupts which are enabled.
>
> The IS_OFFSET register contains the interrupt status bits which will be
> set regardless of the enabling of the corresponding interrupt condition.
> One must therefore look at both IS_OFFSET and IE_OFFSET to determine
> whether an interrupt condition is set and enabled.
>
> Fixes: c245d94ed106 ("i2c: iproc: Add multi byte read-write support for slave mode")
> Signed-off-by: Rayagonda Kokatanur <rayagonda.kokatanur@...adcom.com>
> ---
> drivers/i2c/busses/i2c-bcm-iproc.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-bcm-iproc.c b/drivers/i2c/busses/i2c-bcm-iproc.c
> index 834a98caeada..b54f5130d246 100644
> --- a/drivers/i2c/busses/i2c-bcm-iproc.c
> +++ b/drivers/i2c/busses/i2c-bcm-iproc.c
> @@ -507,12 +507,17 @@ static void bcm_iproc_i2c_process_m_event(struct bcm_iproc_i2c_dev *iproc_i2c,
> static irqreturn_t bcm_iproc_i2c_isr(int irq, void *data)
> {
> struct bcm_iproc_i2c_dev *iproc_i2c = data;
> - u32 status = iproc_i2c_rd_reg(iproc_i2c, IS_OFFSET);
> + u32 slave_status;
> + u32 status;
> bool ret;
> - u32 sl_status = status & ISR_MASK_SLAVE;
>
> - if (sl_status) {
> - ret = bcm_iproc_i2c_slave_isr(iproc_i2c, sl_status);
> + status = iproc_i2c_rd_reg(iproc_i2c, IS_OFFSET);
> + /* process only slave interrupt which are enabled */
> + slave_status = status & iproc_i2c_rd_reg(iproc_i2c, IE_OFFSET) &
> + ISR_MASK_SLAVE;
> +
> + if (slave_status) {
> + ret = bcm_iproc_i2c_slave_isr(iproc_i2c, slave_status);
> if (ret)
> return IRQ_HANDLED;
> else
>
Acked-by: Ray Jui <ray.jui@...adcom.com>
Download attachment "smime.p7s" of type "application/pkcs7-signature" (4151 bytes)
Powered by blists - more mailing lists