From: Andy Shevchenko <andy@kernel.org>
To: xiongxin <xiongxin@kylinos.cn>
Cc: fancer.lancer@gmail.com, hoan@os.amperecomputing.com,
linus.walleij@linaro.org, brgl@bgdev.pl,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Riwen Lu <luriwen@kylinos.cn>
Subject: Re: [v2] gpio: dwapb: mask/unmask IRQ when disable/enale it
Date: Mon, 18 Dec 2023 13:33:05 +0200 [thread overview]
Message-ID: <ZYAt8Zlv9XMYO5FF@smile.fi.intel.com> (raw)
In-Reply-To: <20231218081246.1921152-1-xiongxin@kylinos.cn>
On Mon, Dec 18, 2023 at 04:12:46PM +0800, xiongxin wrote:
> In the hardware implementation of the i2c hid driver based on dwapb gpio
> irq, 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 dwapb 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.
> Fixes: 7779b3455697 ("gpio: add a driver for the Synopsys DesignWare APB GPIO block")
> Signed-off-by: xiongxin <xiongxin@kylinos.cn>
Your SoB should go last.
> Signed-off-by: Riwen Lu <luriwen@kylinos.cn>
Then at all means what this SoB for? Either it's missing Co-developed-by,
or simply wrong.
> Tested-by: xiongxin <xiongxin@kylinos.cn>
This is assumed to be done by the contributor, but it's harmless to have it.
With the above being sorted out,
Reviewed-by: Andy Shevchenko <andy@kernel.org>
...
To Serge, I give my vote to hwirq as it is aligned with the documentation.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-12-18 11:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 8:12 [v2] gpio: dwapb: mask/unmask IRQ when disable/enale it xiongxin
2023-12-18 10:10 ` Serge Semin
2023-12-18 11:33 ` Andy Shevchenko [this message]
2023-12-18 12:07 ` Serge Semin
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=ZYAt8Zlv9XMYO5FF@smile.fi.intel.com \
--to=andy@kernel.org \
--cc=brgl@bgdev.pl \
--cc=fancer.lancer@gmail.com \
--cc=hoan@os.amperecomputing.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luriwen@kylinos.cn \
--cc=xiongxin@kylinos.cn \
/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.