diff options
author | Cédric Le Goater <clg@kaod.org> | 2020-12-12 17:27:07 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-01-30 03:39:31 +0300 |
commit | 9dd31b11370380c488c8f2d347058617cd3fff99 (patch) | |
tree | edffd8db76a65988e0b8f97f790c076c14e78378 /arch/powerpc/platforms/powernv/vas.c | |
parent | 691602aab9c3cce31d3ff9529c09b7922a5f6224 (diff) | |
download | linux-9dd31b11370380c488c8f2d347058617cd3fff99.tar.xz |
powerpc/vas: Fix IRQ name allocation
The VAS device allocates a generic interrupt to handle page faults but
the IRQ name doesn't show under /proc. This is because it's on
stack. Allocate the name.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20201212142707.2102141-1-clg@kaod.org
Diffstat (limited to 'arch/powerpc/platforms/powernv/vas.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/vas.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c index 598e4cd563fb..b65256a63e87 100644 --- a/arch/powerpc/platforms/powernv/vas.c +++ b/arch/powerpc/platforms/powernv/vas.c @@ -28,12 +28,10 @@ static DEFINE_PER_CPU(int, cpu_vas_id); static int vas_irq_fault_window_setup(struct vas_instance *vinst) { - char devname[64]; int rc = 0; - snprintf(devname, sizeof(devname), "vas-%d", vinst->vas_id); rc = request_threaded_irq(vinst->virq, vas_fault_handler, - vas_fault_thread_fn, 0, devname, vinst); + vas_fault_thread_fn, 0, vinst->name, vinst); if (rc) { pr_err("VAS[%d]: Request IRQ(%d) failed with %d\n", @@ -80,6 +78,12 @@ static int init_vas_instance(struct platform_device *pdev) if (!vinst) return -ENOMEM; + vinst->name = kasprintf(GFP_KERNEL, "vas-%d", vasid); + if (!vinst->name) { + kfree(vinst); + return -ENOMEM; + } + INIT_LIST_HEAD(&vinst->node); ida_init(&vinst->ida); mutex_init(&vinst->mutex); @@ -162,6 +166,7 @@ static int init_vas_instance(struct platform_device *pdev) return 0; free_vinst: + kfree(vinst->name); kfree(vinst); return -ENODEV; |