summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-03-24 18:56:25 +0200
committerBjorn Helgaas <bhelgaas@google.com>2026-03-27 10:18:39 -0500
commitf699bcc8bcdf99565928a7b1fc7ee656f6c81815 (patch)
treee1c50dbc2a6c82ed9c243b689e3593d4cb2dbec8 /kernel
parentedfaa81d5da5fbfe3c73fece3ca0417a04cc4ba2 (diff)
resource: Pass full extent of empty space to resource_alignf callback
__find_resource_space() calculates the full extent of empty space but only passes the aligned space to resource_alignf callback. In some situations, the callback may choose take advantage of the free space before the requested alignment. Pass the full extent of the calculated empty space to resource_alignf callback as an additional parameter. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Tested-by: Xifer <xiferdev@gmail.com> Link: https://patch.msgid.link/20260324165633.4583-3-ilpo.jarvinen@linux.intel.com
Diffstat (limited to 'kernel')
-rw-r--r--kernel/resource.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/resource.c b/kernel/resource.c
index 1e2f1dfc0edd..1b8d3101bdc6 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -759,7 +759,8 @@ static int __find_resource_space(struct resource *root, struct resource *old,
alloc.flags = avail.flags;
if (alignf) {
alloc.start = alignf(constraint->alignf_data,
- &avail, size, constraint->align);
+ &avail, &tmp,
+ size, constraint->align);
} else {
alloc.start = avail.start;
}