diff options
author | Haren Myneni <haren@linux.ibm.com> | 2020-04-16 09:00:46 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2020-04-20 09:53:00 +0300 |
commit | 0d17de03ce6a7a9b08c868211f1e9a7cf1ced8c4 (patch) | |
tree | 18e28a0d1019922765f9c8e3f7a7ae84829f4ce3 /arch/powerpc/platforms/powernv/vas.c | |
parent | c20e1e299d936c7f3089c9be99fa784e57da5b7f (diff) | |
download | linux-0d17de03ce6a7a9b08c868211f1e9a7cf1ced8c4.tar.xz |
powerpc/vas: Setup fault window per VAS instance
Setup fault window for each VAS instance. When NX gets a fault on
request buffer, pastes fault CRB in the corresponding fault FIFO and
then raises an interrupt to the OS. The kernel handles this fault
and process faults CRB from this FIFO.
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Signed-off-by: Haren Myneni <haren@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/1587016846.2275.1053.camel@hbabu-laptop
Diffstat (limited to 'arch/powerpc/platforms/powernv/vas.c')
-rw-r--r-- | arch/powerpc/platforms/powernv/vas.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c index 3303cfe4cfda..9013a6344aec 100644 --- a/arch/powerpc/platforms/powernv/vas.c +++ b/arch/powerpc/platforms/powernv/vas.c @@ -24,6 +24,11 @@ static LIST_HEAD(vas_instances); static DEFINE_PER_CPU(int, cpu_vas_id); +static int vas_irq_fault_window_setup(struct vas_instance *vinst) +{ + return vas_setup_fault_window(vinst); +} + static int init_vas_instance(struct platform_device *pdev) { struct device_node *dn = pdev->dev.of_node; @@ -114,6 +119,21 @@ static int init_vas_instance(struct platform_device *pdev) list_add(&vinst->node, &vas_instances); mutex_unlock(&vas_mutex); + /* + * IRQ and fault handling setup is needed only for user space + * send windows. + */ + if (vinst->virq) { + rc = vas_irq_fault_window_setup(vinst); + /* + * Fault window is used only for user space send windows. + * So if vinst->virq is NULL, tx_win_open returns -ENODEV + * for user space. + */ + if (rc) + vinst->virq = 0; + } + vas_instance_init_dbgdir(vinst); dev_set_drvdata(&pdev->dev, vinst); |