Skip to content

Commit

Permalink
powerpc/vas: Fix IRQ name allocation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
legoater authored and mpe committed Jan 30, 2021
1 parent 691602a commit 9dd31b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions arch/powerpc/platforms/powernv/vas.c
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -162,6 +166,7 @@ static int init_vas_instance(struct platform_device *pdev)
return 0;

free_vinst:
kfree(vinst->name);
kfree(vinst);
return -ENODEV;

Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/platforms/powernv/vas.h
Expand Up @@ -340,6 +340,7 @@ struct vas_instance {
struct vas_window *rxwin[VAS_COP_TYPE_MAX];
struct vas_window *windows[VAS_WINDOWS_PER_CHIP];

char *name;
char *dbgname;
struct dentry *dbgdir;
};
Expand Down

0 comments on commit 9dd31b1

Please sign in to comment.