intel_mid_hsi.c: improving hsi_pm_runtime_get_sync and start tx synchronicity
BZ: 30613
The purpose of this patch is two fold: making the hsi_pm_runtime_get_sync()
function call synchronous to the PM management as well as start TX callback
functions.
This patch is actually waiting for the hsi_pm_resume() callback event
completion in the hsi_pm_runtime_get_sync() and start_tx() functions to ensure
that the IP is actually resumed upon the completion of these functions. Relying
solely on the wake_lock and pm_runtime_get_sync is not sufficient for this
purpose because of some race conditions between the Linux PM runtime state
machine and Android's PM state machine.
The TX path of the FFL modem protocol driver has been updated to manage the
synchronous start TX call. Since the TTY write function can be called in non
sleepable contexts, the start TX is actually called in a separate work, outside
the ffl_tty_write() function. Using the single threaded TX worqueue to manage
the start TX and stop TX is also serialiasing this management and easing the
stop TX to start TX pulse delay implementation.
This patch is also the opportunity to switch to a 3-workqueue modem protocol
implementation instead of the exisiting 5 workqueues (without considering the
start TX and stop TX workqueue), which is making much more sense.
Change-Id: I414757e6312c6648f6007ad17ac160bde758441b
Signed-off-by: Olivier Stoltz Douchet <olivierx.stoltz-douchet@intel.com>
Reviewed-on: http://android.intel.com:8080/40948
Reviewed-by: Roulliere, Pierre <pierre.roulliere@intel.com>
Reviewed-by: Predon, Frederic <frederic.predon@intel.com>
Reviewed-by: Lucas, Guillaume <guillaume.lucas@intel.com>
Reviewed-by: Lebsir, SamiX <samix.lebsir@intel.com>
Tested-by: Lebsir, SamiX <samix.lebsir@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>