Skip to content

Commit 306d6bd

Browse files
hfreudehcahca
authored andcommitted
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: 778412a ("s390/ap: rearm APQNs bindings complete completion") Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com> 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>
1 parent d4f9d5a commit 306d6bd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/s390/crypto/ap_bus.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,9 +732,9 @@ static void ap_check_bindings_complete(void)
732732
if (bound == apqns) {
733733
if (!completion_done(&ap_apqn_bindings_complete)) {
734734
complete_all(&ap_apqn_bindings_complete);
735+
ap_send_bindings_complete_uevent();
735736
pr_debug("%s all apqn bindings complete\n", __func__);
736737
}
737-
ap_send_bindings_complete_uevent();
738738
}
739739
}
740740
}
@@ -894,6 +894,12 @@ static int ap_device_probe(struct device *dev)
894894
goto out;
895895
}
896896

897+
/*
898+
* Rearm the bindings complete completion to trigger
899+
* bindings complete when all devices are bound again
900+
*/
901+
reinit_completion(&ap_apqn_bindings_complete);
902+
897903
/* Add queue/card to list of active queues/cards */
898904
spin_lock_bh(&ap_queues_lock);
899905
if (is_queue_dev(dev))

0 commit comments

Comments
 (0)