mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 20:03:05 +07:00
cb2d3883c6
During the MSI bitmap test on boot kmemleak spews the following trace: unreferenced object 0xc00000016e86c900 (size 64): comm "swapper/0", pid 1, jiffies 4294893173 (age 518.024s) hex dump (first 32 bytes): 00 00 01 ff 7f ff 7f 37 00 00 00 00 00 00 00 00 .......7........ ff ff ff ff ff ff ff ff 01 ff ff ff ff ff ff ff ................ backtrace: [<c00000000003eebc>] .zalloc_maybe_bootmem+0x3c/0x380 [<c000000000042d6c>] .msi_bitmap_alloc+0x3c/0xb0 [<c000000000a9aff8>] .msi_bitmap_selftest+0x30/0x2b4 [<c0000000000090f4>] .do_one_initcall+0xd4/0x270 [<c000000000a8e250>] .kernel_init_freeable+0x1a0/0x280 [<c000000000009b5c>] .kernel_init+0x1c/0x120 [<c000000000007fbc>] .ret_from_kernel_thread+0x58/0x9c Add a flag to msi_bitmap for tracking allocations from slab and memblock so we can properly free/handle memory in msi_bitmap_free(). Signed-off-by: Denis Kirjanov <kda@linux-powerpc.org> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> [mpe: Reword changelog & use bitmap_from_slab in the if] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
37 lines
1.0 KiB
C
37 lines
1.0 KiB
C
#ifndef _POWERPC_SYSDEV_MSI_BITMAP_H
|
|
#define _POWERPC_SYSDEV_MSI_BITMAP_H
|
|
|
|
/*
|
|
* Copyright 2008, Michael Ellerman, IBM Corporation.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; version 2 of the
|
|
* License.
|
|
*
|
|
*/
|
|
|
|
#include <linux/of.h>
|
|
#include <asm/irq.h>
|
|
|
|
struct msi_bitmap {
|
|
struct device_node *of_node;
|
|
unsigned long *bitmap;
|
|
spinlock_t lock;
|
|
unsigned int irq_count;
|
|
bool bitmap_from_slab;
|
|
};
|
|
|
|
int msi_bitmap_alloc_hwirqs(struct msi_bitmap *bmp, int num);
|
|
void msi_bitmap_free_hwirqs(struct msi_bitmap *bmp, unsigned int offset,
|
|
unsigned int num);
|
|
void msi_bitmap_reserve_hwirq(struct msi_bitmap *bmp, unsigned int hwirq);
|
|
|
|
int msi_bitmap_reserve_dt_hwirqs(struct msi_bitmap *bmp);
|
|
|
|
int msi_bitmap_alloc(struct msi_bitmap *bmp, unsigned int irq_count,
|
|
struct device_node *of_node);
|
|
void msi_bitmap_free(struct msi_bitmap *bmp);
|
|
|
|
#endif /* _POWERPC_SYSDEV_MSI_BITMAP_H */
|