• Harald Freudenberger's avatar
    s390/ap: introduce mutex to lock the AP bus scan · eacf5b36
    Harald Freudenberger authored
    Rework the invocations around ap_scan_bus():
    - Protect ap_scan_bus() with a mutex to make sure only one
      scan at a time is running.
    - The workqueue invocation which is triggered by either the
      module init or via AP bus scan timer expiration uses this
      mutex and if there is already a scan running, the work
      is simple aborted (as the job is done by another task).
    - The ap_bus_force_rescan() which is invoked by higher level
      layers mostly on failures which indicate a bus scan may
      help is reworked to call ap_scan_bus() direct instead of
      enqueuing work into a system workqueue and waiting for that
      to finish. Of course the mutex is respected and in case of
      another task already running a bus scan the shortcut of
      waiting for this scan to finish and reusing the scan result
      is taken.
    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>
    eacf5b36
ap_bus.h 12.6 KB