diff options
author | Harald Freudenberger <freude@linux.ibm.com> | 2024-01-30 17:15:47 +0100 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2024-03-07 14:41:14 +0100 |
commit | b5caf05ee8795a628992fe7b5ac3e7b9bbd735c5 (patch) | |
tree | da885d8879723b4d320f2519c0d3ba4b1856428f /drivers/s390/crypto | |
parent | 99b3126e46ef8c5c40291b61958f7b9e78b9f162 (diff) | |
download | linux-stable-b5caf05ee8795a628992fe7b5ac3e7b9bbd735c5.tar.gz linux-stable-b5caf05ee8795a628992fe7b5ac3e7b9bbd735c5.tar.bz2 linux-stable-b5caf05ee8795a628992fe7b5ac3e7b9bbd735c5.zip |
s390/ap: rework ap_scan_bus() to return true on config change
The AP scan bus function now returns true if there have
been any config changes detected. This will become
important in a follow up patch which will exploit this
hint for further actions. This also required to have
the AP scan bus timer callback reworked as the function
signature has changed to bool ap_scan_bus(void).
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'drivers/s390/crypto')
-rw-r--r-- | drivers/s390/crypto/ap_bus.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index e04369a12d45..2027baec995c 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -104,8 +104,8 @@ debug_info_t *ap_dbf_info; static atomic64_t ap_scan_bus_count; /* counter ap_scan_bus() invocations */ static int ap_scan_bus_time = AP_CONFIG_TIME; static struct timer_list ap_scan_bus_timer; -static void ap_scan_bus(struct work_struct *); -static DECLARE_WORK(ap_scan_bus_work, ap_scan_bus); +static void ap_scan_bus_wq_callback(struct work_struct *); +static DECLARE_WORK(ap_scan_bus_work, ap_scan_bus_wq_callback); /* * Tasklet & timer for AP request polling and interrupts @@ -2179,12 +2179,13 @@ static bool ap_config_has_new_doms(void) /** * ap_scan_bus(): Scan the AP bus for new devices - * Runs periodically, workqueue timer (ap_scan_bus_time) - * @unused: Unused pointer. + * Returns true if any config change has been detected + * otherwise false. */ -static void ap_scan_bus(struct work_struct *unused) +static bool ap_scan_bus(void) { - int ap, config_changed = 0; + bool config_changed; + int ap; pr_debug(">%s\n", __func__); @@ -2235,11 +2236,14 @@ static void ap_scan_bus(struct work_struct *unused) mod_timer(&ap_scan_bus_timer, jiffies + ap_scan_bus_time * HZ); - pr_debug("<%s\n", __func__); + pr_debug("<%s config_changed=%d\n", __func__, config_changed); + + return config_changed; } /* * Callback for the ap_scan_bus_timer + * Runs periodically, workqueue timer (ap_scan_bus_time) */ static void ap_scan_bus_timer_callback(struct timer_list *unused) { @@ -2250,6 +2254,15 @@ static void ap_scan_bus_timer_callback(struct timer_list *unused) queue_work(system_long_wq, &ap_scan_bus_work); } +/* + * Callback for the ap_scan_bus_work + */ +static void ap_scan_bus_wq_callback(struct work_struct *unused) +{ + /* now finally do the AP bus scan */ + ap_scan_bus(); +} + static int __init ap_debug_init(void) { ap_dbf_info = debug_register("ap", 2, 1, |