Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: "andy@kernel.org" <andy@kernel.org>
To: YE Chengfeng <cyeaa@connect.ust.hk>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] gpiolib: cdev: Fix &lr->wait.lock deadlock issue
Date: Mon, 26 Jun 2023 14:03:42 +0300	[thread overview]
Message-ID: <ZJlwjhQT2wfO3Ukn@smile.fi.intel.com> (raw)
In-Reply-To: <TYCP286MB1188A94580A60F47CAF892C88A26A@TYCP286MB1188.JPNP286.PROD.OUTLOOK.COM>

On Mon, Jun 26, 2023 at 10:39:56AM +0000, YE Chengfeng wrote:
> linereq_put_event is called from both interrupt context (e.g.,

When we refer to the functions we use func() format.
This applies to the entire commit message and to the other
patch in the series.

> edge_irq_thread) and process context (process_hw_ts_thread).
> Therefore, interrupt should be disabled before acquiring lock
> &lr->wait.lock inside linereq_put_event to avoid deadlock when
> the lock is held in process context and edge_irq_thread comes.
> 
> Similarly, linereq_read_unlocked running in process context
> also acquies the same lock. It also need to disable interrupt
> otherwise deadlock could happen if the irq edge_irq_thread
> comes to execution while the lock is held.
> 
> Fix the two potential deadlock issues by spin_lock_bh() and
> spin_lock_irq() separately.

...

So, I suggest to fix the commit messages and send a v2 as a real series
(--thread implied).

-- 
With Best Regards,
Andy Shevchenko



  parent reply	other threads:[~2023-06-26 11:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 10:39 [PATCH v2 1/2] gpiolib: cdev: Fix &lr->wait.lock deadlock issue YE Chengfeng
2023-06-26 11:01 ` andy
2023-06-26 11:03 ` andy [this message]
     [not found]   ` <TYCP286MB11884755575685089C1BBDC38A26A@TYCP286MB1188.JPNP286.PROD.OUTLOOK.COM>
2023-06-26 11:14     ` 回复: " andy
2023-06-26 15:03       ` 回复: " YE Chengfeng
  -- strict thread matches above, loose matches on Subject: below --
2023-06-26 14:57 Chengfeng Ye

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=ZJlwjhQT2wfO3Ukn@smile.fi.intel.com \
    --to=andy@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=cyeaa@connect.ust.hk \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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