From mboxrd@z Thu Jan 1 00:00:00 1970 From: shrikant Subject: Re: [PATCH] drivers: base: power: Fix GFP_KERNEL in spinlock context Date: Sat, 16 Dec 2017 13:51:08 +0530 Message-ID: <04001068-2880-d0b8-cf3b-4738b8bb7f2d@techveda.org> References: <1513086342-3581-1-git-send-email-shrikant.maurya@techveda.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:40576 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750850AbdLPIVO (ORCPT ); Sat, 16 Dec 2017 03:21:14 -0500 Received: by mail-pf0-f193.google.com with SMTP id v26so7640290pfl.7 for ; Sat, 16 Dec 2017 00:21:14 -0800 (PST) In-Reply-To: Content-Language: en-US Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Pavel Machek , Len Brown , Greg Kroah-Hartman , Linux PM , Linux Kernel Mailing List , sunil.m@techveda.org, karthik@techveda.org, raghu@techveda.org On Tuesday 12 December 2017 10:25 PM, Rafael J. Wysocki wrote: > On Tue, Dec 12, 2017 at 2:45 PM, wrote: >> From: Shrikant Maurya >> >> 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