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,
stable@kernel.org, Riwen Lu <luriwen@kylinos.cn>
Subject: Re: [PATCH v4] gpio: dwapb: mask/unmask IRQ when disable/enale it
Date: Tue, 19 Dec 2023 16:49:18 +0200 [thread overview]
Message-ID: <ZYGtbgmQS0x43l3k@smile.fi.intel.com> (raw)
In-Reply-To: <20231219101620.4617-1-xiongxin@kylinos.cn>
On Tue, Dec 19, 2023 at 06:16:20PM +0800, xiongxin wrote:
Code wise it's fine, but while answering to Serge's email I realized that
the Subject has a typo and additionally you or Bart (if he is fine with that)
can amend:
> In the hardware implementation of the i2c hid driver based on dwapb gpio
I²C HID (alternatively: I2C HID)
here and everywhere else in the commit message unless it's the file or
function name.
> irq,
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 dwapb gpio driver
DesignWare GPIO
> does not synchronize the irq mask register state. In normal use of the
IRQ
> 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
GPIO IRQ
> irq_unmask() to not be called, which causes the gpio irq to be masked
GPIO IRQ
> 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
GPIO IRQ
> before disabling it. After enabling the gpio irq, unmask the irq.
GPIO IRQ
IRQ
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-12-19 14:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-19 10:16 xiongxin
2023-12-19 14:49 ` Andy Shevchenko [this message]
2023-12-20 2:29 ` [PATCH v5] " xiongxin
2023-12-20 14:19 ` Andy Shevchenko
2023-12-21 10:19 ` Bartosz Golaszewski
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=ZYGtbgmQS0x43l3k@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=stable@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®