CHROMIUM: ata: don't wait on ata ports for resume
authorDerek Basehore <dbasehore@chromium.org>
Wed, 8 Aug 2012 20:20:47 +0000 (13:20 -0700)
committerGerrit <chrome-bot@google.com>
Tue, 21 Aug 2012 23:40:54 +0000 (16:40 -0700)
commit84433625e802fe61693de82687675e44ef364a20
tree9b894255f4ee849072ef4f5cbf2584917c8417bb
parent9416603d90e4240f637cc6b1ea4afa3774b8ae04
CHROMIUM: ata: don't wait on ata ports for resume

This change causes dpm_resume to not block on resuming ata ports. This is done
by putting the function calls to wake up the ata ports in a workqueue. I make
sure that there is not a race between suspend and resume by making the suspend
code for ata_port wait until the work for resume is done.

I tested what would happen when the ata ports do not resume (by commenting out
the line that resumes and returning -1). We do wake up, but after ~2 minutes,
the machine reboots. The machine blocks on any io that requires disk. Mouse
clicks do not seem to register.

Without the change, pretty much the same thing occurs (from a user experience),
except that the mouse arrow is not visible.

BUG=chrome-os-partner:11780
TEST=power_Resume, powerd_suspend

Change-Id: Ica746d313349a3d8c5f6ba6912f6a3b18e5c2b3f
Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29672
drivers/ata/libata-core.c
include/linux/libata.h