[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYL4DfamQdj45gxh@smile.fi.intel.com>
Date: Wed, 20 Dec 2023 16:19:57 +0200
From: Andy Shevchenko <andy@...nel.org>
To: xiongxin <xiongxin@...inos.cn>
Cc: fancer.lancer@...il.com, hoan@...amperecomputing.com,
linus.walleij@...aro.org, brgl@...ev.pl, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...nel.org,
Riwen Lu <luriwen@...inos.cn>
Subject: Re: [PATCH v5] gpio: dwapb: mask/unmask IRQ when disable/enale it
On Wed, Dec 20, 2023 at 10:29:01AM +0800, xiongxin wrote:
> In the hardware implementation of the I2C HID driver based on DesignWare
> GPIO IRQ chip, when the user continues to use the I2C HID device in the
> suspend process, the I2C HID interrupt will be masked after the resume
> process is finished.
>
> This is because the disable_irq()/enable_irq() of the DesignWare GPIO
> driver does not synchronize the IRQ mask register state. In normal use
> of the I2C HID procedure, the GPIO IRQ irq_mask()/irq_unmask() functions
> are called in pairs. In case of an exception, i2c_hid_core_suspend()
> calls disable_irq() to disable the GPIO IRQ. With low probability, this
> causes irq_unmask() to not be called, which causes the GPIO IRQ to be
> masked and not unmasked in enable_irq(), raising an exception.
>
> Add synchronization to the masked register state in the
> dwapb_irq_enable()/dwapb_irq_disable() function. mask the GPIO IRQ
> before disabling it. After enabling the GPIO IRQ, unmask the IRQ.
...
> v5:
> * fix typo in patch description
Thank you! This looks perfect!
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists