s390/ap: new module option ap.useirq
authorHarald Freudenberger <freude@linux.ibm.com>
Tue, 19 Oct 2021 15:51:08 +0000 (17:51 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 26 Oct 2021 13:21:29 +0000 (15:21 +0200)
This patch introduces a new AP module option to be able to
control if the ap bus code is using interrupts or not.
By default if the interrupt support is available it is used.
This option makes it possible to disable interrupt use even
when interrupt support is available.

It should be obvious that this option can't magically enable
interrupt support when the hardware or hypervisor layer does
not support AP interrupts.

On the kernel command line use ap.useirq=0 or ap.useirq=1
to disable or enable (that's the default) interrupt use.

Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/ap_bus.c

index 38d71e0760482f9323c5163274e2e75a7f25ad0a..806d184482a904c65d271b5ec3565862d3a0896e 100644 (file)
@@ -61,6 +61,10 @@ static char *aqm_str;
 module_param_named(aqmask, aqm_str, charp, 0440);
 MODULE_PARM_DESC(aqmask, "AP bus domain mask.");
 
+static int ap_useirq = 1;
+module_param_named(useirq, ap_useirq, int, 0440);
+MODULE_PARM_DESC(useirq, "Use interrupt if available, default is 1 (on).");
+
 atomic_t ap_max_msg_size = ATOMIC_INIT(AP_DEFAULT_MAX_MSG_SIZE);
 EXPORT_SYMBOL(ap_max_msg_size);
 
@@ -1899,7 +1903,7 @@ static int __init ap_module_init(void)
        }
 
        /* enable interrupts if available */
-       if (ap_interrupts_available()) {
+       if (ap_interrupts_available() && ap_useirq) {
                rc = register_adapter_interrupt(&ap_airq);
                ap_irq_flag = (rc == 0);
        }