Skip to contentSkip to conversation

Patch "of/address: use atomic allocation in pci_register_io_range()" has been added to the 4.1-stable tree

PATCH [email protected] 1 participant 1 message Jul 31, 2015

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

of/address: use atomic allocation in pci_register_io_range()

to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
of-address-use-atomic-allocation-in-pci_register_io_range.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 294240ffe784e951dc2ef070da04fa31ef6db3a0 Mon Sep 17 00:00:00 2001

From: Jingoo Han <[email protected]>
Date: Thu, 18 Jun 2015 00:12:27 +0900
Subject: of/address: use atomic allocation in pci_register_io_range()

From: Jingoo Han <[email protected]>

commit 294240ffe784e951dc2ef070da04fa31ef6db3a0 upstream.

When kzalloc() is called under spin_lock(), GFP_ATOMIC should be used to avoid sleeping allocation.
The call tree is:
of_pci_range_to_resource()

    --> pci_register_io_range() <-- takes spin_lock(&io_range_lock);
       --> kzalloc()
---
 drivers/of/address.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/address.c +1 -1
@@ -712,7 +712,7 @@ int __weak pci_register_io_range(phys_ad
 	}
 
 	/* add the range to the list */
-	range = kzalloc(sizeof(*range), GFP_KERNEL);
+	range = kzalloc(sizeof(*range), GFP_ATOMIC);
 	if (!range) {
 		err = -ENOMEM;
 		goto end_register;

Patches currently in stable-queue which might be from [email protected] are

queue-4.1/of-address-use-atomic-allocation-in-pci_register_io_range.patch