From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751889AbdLPIVQ (ORCPT ); Sat, 16 Dec 2017 03:21:16 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37136 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750883AbdLPIVO (ORCPT ); Sat, 16 Dec 2017 03:21:14 -0500 X-Google-Smtp-Source: ACJfBovINajlefkMtWzpwo8c7WCotFMh4zv0Bj6grwYGPm+H3ttSzPUhj7IxVWjqmXC3TA8i06InKQ== From: shrikant Subject: Re: [PATCH] drivers: base: power: Fix GFP_KERNEL in spinlock context 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 References: <1513086342-3581-1-git-send-email-shrikant.maurya@techveda.org> Message-ID: <04001068-2880-d0b8-cf3b-4738b8bb7f2d@techveda.org> Date: Sat, 16 Dec 2017 13:51:08 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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