All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: add dump_stack() if called in atomic context
@ 2016-03-13  0:37 Shuah Khan
  2016-03-13 11:43 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: Shuah Khan @ 2016-03-13  0:37 UTC (permalink / raw)
  To: mchehab; +Cc: Shuah Khan, linux-media, linux-kernel

Change media_add_link() and media_devnode_create() to dump_stack when
called in atomic context.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Suggested-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
---
 drivers/media/media-entity.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index e95070b..66a5392 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -570,6 +570,9 @@ static struct media_link *media_add_link(struct list_head *head)
 {
 	struct media_link *link;
 
+	if (in_atomic())
+		dump_stack();
+
 	link = kzalloc(sizeof(*link), GFP_KERNEL);
 	if (link == NULL)
 		return NULL;
@@ -891,6 +894,9 @@ struct media_intf_devnode *media_devnode_create(struct media_device *mdev,
 {
 	struct media_intf_devnode *devnode;
 
+	if (in_atomic())
+		dump_stack();
+
 	devnode = kzalloc(sizeof(*devnode), GFP_KERNEL);
 	if (!devnode)
 		return NULL;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: add dump_stack() if called in atomic context
  2016-03-13  0:37 [PATCH] media: add dump_stack() if called in atomic context Shuah Khan
@ 2016-03-13 11:43 ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2016-03-13 11:43 UTC (permalink / raw)
  To: Shuah Khan; +Cc: linux-media, linux-kernel

Em Sat, 12 Mar 2016 17:37:05 -0700
Shuah Khan <shuahkh@osg.samsung.com> escreveu:

> Change media_add_link() and media_devnode_create() to dump_stack when
> called in atomic context.
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
> Suggested-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

Just to be clear: my suggestion is to use this in order to help you to
debug the issues with au0828/snd-usb-audio, that are sometimes producing
those Kernel messages:

[   23.267197] BUG: sleeping function called from invalid context at mm/slub.c:1289

But I don't think that should patch should be merged upstream.

Regards,
Mauro

> ---
>  drivers/media/media-entity.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
> index e95070b..66a5392 100644
> --- a/drivers/media/media-entity.c
> +++ b/drivers/media/media-entity.c
> @@ -570,6 +570,9 @@ static struct media_link *media_add_link(struct list_head *head)
>  {
>  	struct media_link *link;
>  
> +	if (in_atomic())
> +		dump_stack();
> +
>  	link = kzalloc(sizeof(*link), GFP_KERNEL);
>  	if (link == NULL)
>  		return NULL;
> @@ -891,6 +894,9 @@ struct media_intf_devnode *media_devnode_create(struct media_device *mdev,
>  {
>  	struct media_intf_devnode *devnode;
>  
> +	if (in_atomic())
> +		dump_stack();
> +
>  	devnode = kzalloc(sizeof(*devnode), GFP_KERNEL);
>  	if (!devnode)
>  		return NULL;


-- 
Thanks,
Mauro

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-13 11:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-13  0:37 [PATCH] media: add dump_stack() if called in atomic context Shuah Khan
2016-03-13 11:43 ` Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.