OSDN Git Service

msm_serial_hs: Change resource voting and system suspend logic
authorGirish Mahadevan <girishm@codeaurora.org>
Wed, 27 Apr 2016 20:55:27 +0000 (14:55 -0600)
committerGerrit - the friendly Code Review server <code-review@localhost>
Tue, 2 Aug 2016 17:56:01 +0000 (10:56 -0700)
commita674be9d15884d30ebb6b9e9988c436b286841d9
treedfbc94c550e617a85d5a2a57c999cda41510309d
parent9de853543c2edd82036b9f6477e992c83dbc0bc2
msm_serial_hs: Change resource voting and system suspend logic

As part of the resource voting, both the resource_vote and unvote
functions call the toggle_wakeup_interrupt() function which toggles the
state of the wakeup irq unconditionally. This can cause issues in adverse
scenarios. Instead split this out into exclusive enable and disable wakeup
interrupt functions to be called during the resource unvote and vote
respectively.  Also don't make resource votes in the wakeup isr, the
wakeup isr injects a pre-determined byte into the tty flip buffer and
doesn't access the core or setup any transactions and hence doesn't need
to vote for resources.

The driver has registered for the noirq system suspend/resume callbacks.
When executing these callbacks, don't rely on the runtime framework to
check the device's current runtime state before deciding whether to allow
system suspend or not as the runtime framework is disabled at this point.
Instead rely on the power state that the driver maintains internally.

Change-Id: I0e5d6b8a8a69efc2d9c65dc1edc85f13cbc94fc3
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
drivers/tty/serial/msm_serial_hs.c