n_gsm: fix wait_event in gsmtty_modem_update when modem reset happened
authorsamix.lebsir <samix.lebsir@intel.com>
Mon, 26 Dec 2011 15:30:35 +0000 (16:30 +0100)
committerbuildbot <buildbot@intel.com>
Tue, 27 Dec 2011 13:31:58 +0000 (05:31 -0800)
commit00c2fa41c46ca06d0f54d598283696e8068dcb7b
tree1546fe64a78f9de74a3d76a47bf3a46b1a5dda8d
parentdb28d169f393ba823dbc03393017f4b1dfbd55e6
n_gsm: fix wait_event in gsmtty_modem_update when modem reset happened

BZ: 14542

Scenario:
When gsmtty_modem_update send CMD_MSC to modem, it would stay in wait_event(ctrl->done) for control response.
If modem reset at this time, mux would never receive response from modem.
Then API open would stay in wait_event for ever, even if gsm_dlci_close.

The patch add "gsm->dead" condition in the wait_event of both gsm_control_send() and gsm_control_wait().
If gsm->dead, both gsm_control_send and gsm_control_wait should wake up from wait_event.

Change-Id: I1ad39a85686d1f1f1b75971c99f9450fa093b7db
Signed-off-by: samix.lebsir <samix.lebsir@intel.com>
Reviewed-on: http://android.intel.com:8080/29981
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/tty/n_gsm.c