Commit 306d6bda authored by Harald Freudenberger's avatar Harald Freudenberger Committed by Heiko Carstens

s390/ap: Fix bind complete udev event sent after each AP bus scan

With the mentioned commit (see the fixes tag) on every AP bus scan an
uevent "AP bus change bindings complete" is emitted.  Furthermore if an AP
device switched from one driver to another, for example by manipulating the
apmask, there was never a "bindings complete" uevent generated.

The "bindings complete" event should be sent once when all AP devices have
been bound to device drivers and again if unbind/bind actions take place
and finally all AP devices are bound again. Therefore implement this.

Fixes: 778412ab ("s390/ap: rearm APQNs bindings complete completion")
Reported-by: default avatarMarc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
Reviewed-by: default avatarHolger Dengler <dengler@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent d4f9d5a9
......@@ -732,9 +732,9 @@ static void ap_check_bindings_complete(void)
if (bound == apqns) {
if (!completion_done(&ap_apqn_bindings_complete)) {
complete_all(&ap_apqn_bindings_complete);
ap_send_bindings_complete_uevent();
pr_debug("%s all apqn bindings complete\n", __func__);
}
ap_send_bindings_complete_uevent();
}
}
}
......@@ -894,6 +894,12 @@ static int ap_device_probe(struct device *dev)
goto out;
}
/*
* Rearm the bindings complete completion to trigger
* bindings complete when all devices are bound again
*/
reinit_completion(&ap_apqn_bindings_complete);
/* Add queue/card to list of active queues/cards */
spin_lock_bh(&ap_queues_lock);
if (is_queue_dev(dev))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment