diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2014-11-16 15:08:49 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2014-11-19 05:57:50 -0500 |
commit | 51b04d59c27430a57c347b55478415c342009035 (patch) | |
tree | 498e6a03b0c238e90b1587362f5b1e714ec30890 /drivers/firewire | |
parent | fc14f9c1272f62c3e8d01300f52467c0d9af50f9 (diff) |
firewire: ohci: replace vm_map_ram() with vmap()
vm_map_ram() is intended for short-lived objects, so using it for the AR
buffers could fragment address space, especially on a 32-bit machine.
For an allocation that lives as long as the device, vmap() is the better
choice.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r-- | drivers/firewire/ohci.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index a66a3217f1d9..aff9018d0658 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -689,8 +689,7 @@ static void ar_context_release(struct ar_context *ctx) | |||
689 | { | 689 | { |
690 | unsigned int i; | 690 | unsigned int i; |
691 | 691 | ||
692 | if (ctx->buffer) | 692 | vunmap(ctx->buffer); |
693 | vm_unmap_ram(ctx->buffer, AR_BUFFERS + AR_WRAPAROUND_PAGES); | ||
694 | 693 | ||
695 | for (i = 0; i < AR_BUFFERS; i++) | 694 | for (i = 0; i < AR_BUFFERS; i++) |
696 | if (ctx->pages[i]) { | 695 | if (ctx->pages[i]) { |
@@ -1018,8 +1017,7 @@ static int ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, | |||
1018 | pages[i] = ctx->pages[i]; | 1017 | pages[i] = ctx->pages[i]; |
1019 | for (i = 0; i < AR_WRAPAROUND_PAGES; i++) | 1018 | for (i = 0; i < AR_WRAPAROUND_PAGES; i++) |
1020 | pages[AR_BUFFERS + i] = ctx->pages[i]; | 1019 | pages[AR_BUFFERS + i] = ctx->pages[i]; |
1021 | ctx->buffer = vm_map_ram(pages, AR_BUFFERS + AR_WRAPAROUND_PAGES, | 1020 | ctx->buffer = vmap(pages, ARRAY_SIZE(pages), VM_MAP, PAGE_KERNEL); |
1022 | -1, PAGE_KERNEL); | ||
1023 | if (!ctx->buffer) | 1021 | if (!ctx->buffer) |
1024 | goto out_of_memory; | 1022 | goto out_of_memory; |
1025 | 1023 | ||