ata_hard_reset should be synchronized.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17397 a1c6a512-1295-4272-9138-f99709370657
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 1dd0513..4f4fb4c 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -956,6 +956,8 @@
{
int ret;
+ mutex_lock(&ata_mtx);
+
ata_reset();
/* state HRR2 */
@@ -965,6 +967,8 @@
/* Massage the return code so it is 0 on success and -1 on failure */
ret = ret?0:-1;
+ mutex_unlock(&ata_mtx);
+
return ret;
}