intel_mid_hsi.c: improving hsi_pm_runtime_get_sync and start tx synchronicity
authorOlivier Stoltz Douchet <olivierx.stoltz-douchet@intel.com>
Tue, 27 Mar 2012 14:42:33 +0000 (16:42 +0200)
committerbuildbot <buildbot@intel.com>
Fri, 27 Apr 2012 08:08:40 +0000 (01:08 -0700)
commit08adb2e63485a1031287ee8756259cd5f0c49d98
tree338ccfc7f7f25b6f04a30028dfb558ab43c254bb
parenta68fc7894183e4882989e54a0de078acc08c82f8
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>
drivers/hsi/clients/hsi_ffl_tty.c
drivers/hsi/controllers/intel_mid_hsi.c