From: Dave Jones Date: Mon, 12 Dec 2005 08:37:40 +0000 (-0800) Subject: [PATCH] ACPI: fix sleeping whilst atomic warnings on resume X-Git-Tag: v2.6.15-rc6~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a64882e795cc1d890e3359d0aa143af1cf67e8d4;p=platform%2Fkernel%2Flinux-3.10.git [PATCH] ACPI: fix sleeping whilst atomic warnings on resume This has been broken for months. On resume, we call acpi_pci_link_set() with interrupts off, so we get a warning when we try to do a kmalloc of non atomic memory. The actual allocation is just 2 long's (plus extra byte for some reason I can't fathom), so a simple conversion to GFP_ATOMIC is probably the safest way to fix this. The error looks like this.. Debug: sleeping function called from invalid context at mm/slab.c:2486 in_atomic():0, irqs_disabled():1 [] kmem_cache_alloc+0x40/0x56 [] acpi_pci_link_set+0x3f/0x17f [] irqrouter_resume+0x1e/0x3c [] __sysdev_resume+0x11/0x6b [] sysdev_resume+0x34/0x52 [] device_power_up+0x5/0xa Signed-off-by: Dave Jones Cc: "Brown, Len" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c index 82292b7..78927c0 100644 --- a/drivers/acpi/pci_link.c +++ b/drivers/acpi/pci_link.c @@ -316,7 +316,7 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq) if (!link || !irq) return_VALUE(-EINVAL); - resource = kmalloc(sizeof(*resource) + 1, GFP_KERNEL); + resource = kmalloc(sizeof(*resource) + 1, GFP_ATOMIC); if (!resource) return_VALUE(-ENOMEM);