s390/ap: clarify AP scan bus related functions and variables

BugLink: https://bugs.launchpad.net/bugs/2050019

This patch tries to clarify the functions and variables
around the AP scan bus job. All these variables and
functions start with ap_scan_bus and are declared in
one place now.

No functional changes in this patch - only renaming and
move of code or declarations.

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>
(cherry picked from commit 99b3126e46ef8c5c40291b61958f7b9e78b9f162)
Signed-off-by: Frank Heimes <frank.heimes@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
This commit is contained in:
Harald Freudenberger
2024-01-30 16:50:05 +01:00
committed by Paolo Pisati
parent bfd7332254
commit 64b46a827e
+24 -19
View File
@@ -83,9 +83,6 @@ EXPORT_SYMBOL(ap_perms);
DEFINE_MUTEX(ap_perms_mutex);
EXPORT_SYMBOL(ap_perms_mutex);
/* # of bus scans since init */
static atomic64_t ap_scan_bus_count;
/* # of bindings complete since init */
static atomic64_t ap_bindings_complete_count = ATOMIC64_INIT(0);
@@ -101,12 +98,13 @@ static struct ap_config_info *ap_qci_info_old;
debug_info_t *ap_dbf_info;
/*
* Workqueue timer for bus rescan.
* AP bus rescan related things.
*/
static struct timer_list ap_config_timer;
static int ap_config_time = AP_CONFIG_TIME;
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_work, ap_scan_bus);
static DECLARE_WORK(ap_scan_bus_work, ap_scan_bus);
/*
* Tasklet & timer for AP request polling and interrupts
@@ -1019,9 +1017,9 @@ void ap_bus_force_rescan(void)
return;
/* processing a asynchronous bus rescan */
del_timer(&ap_config_timer);
queue_work(system_long_wq, &ap_scan_work);
flush_work(&ap_scan_work);
del_timer(&ap_scan_bus_timer);
queue_work(system_long_wq, &ap_scan_bus_work);
flush_work(&ap_scan_bus_work);
}
EXPORT_SYMBOL(ap_bus_force_rescan);
@@ -1250,7 +1248,7 @@ static BUS_ATTR_RO(ap_interrupts);
static ssize_t config_time_show(const struct bus_type *bus, char *buf)
{
return sysfs_emit(buf, "%d\n", ap_config_time);
return sysfs_emit(buf, "%d\n", ap_scan_bus_time);
}
static ssize_t config_time_store(const struct bus_type *bus,
@@ -1260,8 +1258,8 @@ static ssize_t config_time_store(const struct bus_type *bus,
if (sscanf(buf, "%d\n", &time) != 1 || time < 5 || time > 120)
return -EINVAL;
ap_config_time = time;
mod_timer(&ap_config_timer, jiffies + ap_config_time * HZ);
ap_scan_bus_time = time;
mod_timer(&ap_scan_bus_timer, jiffies + ap_scan_bus_time * HZ);
return count;
}
@@ -2180,7 +2178,7 @@ static bool ap_config_has_new_doms(void)
/**
* ap_scan_bus(): Scan the AP bus for new devices
* Runs periodically, workqueue timer (ap_config_time)
* Runs periodically, workqueue timer (ap_scan_bus_time)
* @unused: Unused pointer.
*/
static void ap_scan_bus(struct work_struct *unused)
@@ -2234,14 +2232,21 @@ static void ap_scan_bus(struct work_struct *unused)
ap_check_bindings_complete();
mod_timer(&ap_config_timer, jiffies + ap_config_time * HZ);
mod_timer(&ap_scan_bus_timer, jiffies + ap_scan_bus_time * HZ);
pr_debug("<%s\n", __func__);
}
static void ap_config_timeout(struct timer_list *unused)
/*
* Callback for the ap_scan_bus_timer
*/
static void ap_scan_bus_timer_callback(struct timer_list *unused)
{
queue_work(system_long_wq, &ap_scan_work);
/*
* schedule work into the system long wq which when
* the work is finally executed, calls the AP bus scan.
*/
queue_work(system_long_wq, &ap_scan_bus_work);
}
static int __init ap_debug_init(void)
@@ -2331,7 +2336,7 @@ static int __init ap_module_init(void)
ap_root_device->bus = &ap_bus_type;
/* Setup the AP bus rescan timer. */
timer_setup(&ap_config_timer, ap_config_timeout, 0);
timer_setup(&ap_scan_bus_timer, ap_scan_bus_timer_callback, 0);
/*
* Setup the high resolution poll timer.
@@ -2349,7 +2354,7 @@ static int __init ap_module_init(void)
goto out_work;
}
queue_work(system_long_wq, &ap_scan_work);
queue_work(system_long_wq, &ap_scan_bus_work);
return 0;