Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755285AbcCNKdk (ORCPT ); Mon, 14 Mar 2016 06:33:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:55322 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752705AbcCNKdc (ORCPT ); Mon, 14 Mar 2016 06:33:32 -0400 Date: Mon, 14 Mar 2016 11:33:25 +0100 Message-ID: From: Takashi Iwai To: "Mauro Carvalho Chehab" Cc: "Sakari Ailus" , , , , , , , , , , , , , , , , , , , , , "Shuah Khan" , , , , , , , , , , , Subject: Re: [PATCH] media: add GFP flag to media_*() that could get called in atomic context In-Reply-To: <20160314071358.27c87dab@recife.lan> References: <1457833689-4926-1-git-send-email-shuahkh@osg.samsung.com> <20160314072236.GO11084@valkosipuli.retiisi.org.uk> <20160314071358.27c87dab@recife.lan> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.5 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1307 Lines: 37 On Mon, 14 Mar 2016 11:13:58 +0100, Mauro Carvalho Chehab wrote: > > Em Mon, 14 Mar 2016 09:22:37 +0200 > Sakari Ailus escreveu: > > > Hi Shuah, > > > > On Sat, Mar 12, 2016 at 06:48:09PM -0700, Shuah Khan wrote: > > > Add GFP flags to media_create_pad_link(), media_create_intf_link(), > > > media_devnode_create(), and media_add_link() that could get called > > > in atomic context to allow callers to pass in the right flags for > > > memory allocation. > > > > > > tree-wide driver changes for media_*() GFP flags change: > > > Change drivers to add gfpflags to interffaces, media_create_pad_link(), > > > media_create_intf_link() and media_devnode_create(). > > > > > > Signed-off-by: Shuah Khan > > > Suggested-by: Mauro Carvalho Chehab > > > > What's the use case for calling the above functions in an atomic context? > > > > ALSA code seems to do a lot of stuff at atomic context. That's what > happens on my test machine when au0828 gets probed before > snd-usb-audio: > http://pastebin.com/LEX5LD5K > > It seems that ALSA USB probe routine (usb_audio_probe) happens in > atomic context. No, usb_audio_probe() doesn't take a lock. But media_device_register_entity() seems taking a spinlock, instead. Takashi