linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: shrikant <shrikant.maurya@techveda.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	sunil.m@techveda.org, karthik@techveda.org, raghu@techveda.org
Subject: Re: [PATCH] drivers: base: power: Fix GFP_KERNEL in spinlock context
Date: Sat, 16 Dec 2017 13:51:08 +0530	[thread overview]
Message-ID: <04001068-2880-d0b8-cf3b-4738b8bb7f2d@techveda.org> (raw)
In-Reply-To: <CAJZ5v0jH-hqMGLckGkqOycVML-HTLmXxDLjw0D4qbC1fET2Q_g@mail.gmail.com>



On Tuesday 12 December 2017 10:25 PM, Rafael J. Wysocki wrote:
> On Tue, Dec 12, 2017 at 2:45 PM,  <shrikant.maurya@techveda.org> wrote:
>> From: Shrikant Maurya <shrikant.maurya@techveda.org>
>>
>> As reported by Jia-Ju Bai (https://lkml.org/lkml/2017/12/11/872):
>> API's are using GFP_KERNEL to allocate memory which may sleep.
>>
>> To ensure atomicity such allocations must be avoided in critical
>> sections under spinlock.
> 
> That's right.
> 
> Which is why wakeup_source_create() should never be called under a spinlock.

Yes.

Better approach is, to move the call to device_init_wakeup() before the spinlock.

> 
> Are you aware of any place that happens in the mainline kernel?

No.

> 
> Thanks,
> Rafael
> 

Thank you Rafeal.
-- 
Shrikant
techveda.org

      reply	other threads:[~2017-12-16  8:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 13:45 [PATCH] drivers: base: power: Fix GFP_KERNEL in spinlock context shrikant.maurya
2017-12-12 14:58 ` Geert Uytterhoeven
2017-12-15  8:45   ` Pavel Machek
2017-12-16  8:15     ` shrikant
2017-12-16  8:14   ` shrikant
2017-12-12 16:55 ` Rafael J. Wysocki
2017-12-16  8:21   ` shrikant [this message]

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=04001068-2880-d0b8-cf3b-4738b8bb7f2d@techveda.org \
    --to=shrikant.maurya@techveda.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=karthik@techveda.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    --cc=raghu@techveda.org \
    --cc=rjw@rjwysocki.net \
    --cc=sunil.m@techveda.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;
as well as URLs for NNTP newsgroup(s).