Skip to content

Commit b5caf05

Browse files
hfreudehcahca
authored andcommitted
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 <[email protected]> Reviewed-by: Holger Dengler <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 99b3126 commit b5caf05

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

drivers/s390/crypto/ap_bus.c

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ debug_info_t *ap_dbf_info;
104104
static atomic64_t ap_scan_bus_count; /* counter ap_scan_bus() invocations */
105105
static int ap_scan_bus_time = AP_CONFIG_TIME;
106106
static struct timer_list ap_scan_bus_timer;
107-
static void ap_scan_bus(struct work_struct *);
108-
static DECLARE_WORK(ap_scan_bus_work, ap_scan_bus);
107+
static void ap_scan_bus_wq_callback(struct work_struct *);
108+
static DECLARE_WORK(ap_scan_bus_work, ap_scan_bus_wq_callback);
109109

110110
/*
111111
* Tasklet & timer for AP request polling and interrupts
@@ -2179,12 +2179,13 @@ static bool ap_config_has_new_doms(void)
21792179

21802180
/**
21812181
* ap_scan_bus(): Scan the AP bus for new devices
2182-
* Runs periodically, workqueue timer (ap_scan_bus_time)
2183-
* @unused: Unused pointer.
2182+
* Returns true if any config change has been detected
2183+
* otherwise false.
21842184
*/
2185-
static void ap_scan_bus(struct work_struct *unused)
2185+
static bool ap_scan_bus(void)
21862186
{
2187-
int ap, config_changed = 0;
2187+
bool config_changed;
2188+
int ap;
21882189

21892190
pr_debug(">%s\n", __func__);
21902191

@@ -2235,11 +2236,14 @@ static void ap_scan_bus(struct work_struct *unused)
22352236

22362237
mod_timer(&ap_scan_bus_timer, jiffies + ap_scan_bus_time * HZ);
22372238

2238-
pr_debug("<%s\n", __func__);
2239+
pr_debug("<%s config_changed=%d\n", __func__, config_changed);
2240+
2241+
return config_changed;
22392242
}
22402243

22412244
/*
22422245
* Callback for the ap_scan_bus_timer
2246+
* Runs periodically, workqueue timer (ap_scan_bus_time)
22432247
*/
22442248
static void ap_scan_bus_timer_callback(struct timer_list *unused)
22452249
{
@@ -2250,6 +2254,15 @@ static void ap_scan_bus_timer_callback(struct timer_list *unused)
22502254
queue_work(system_long_wq, &ap_scan_bus_work);
22512255
}
22522256

2257+
/*
2258+
* Callback for the ap_scan_bus_work
2259+
*/
2260+
static void ap_scan_bus_wq_callback(struct work_struct *unused)
2261+
{
2262+
/* now finally do the AP bus scan */
2263+
ap_scan_bus();
2264+
}
2265+
22532266
static int __init ap_debug_init(void)
22542267
{
22552268
ap_dbf_info = debug_register("ap", 2, 1,

0 commit comments

Comments
 (0)