summaryrefslogtreecommitdiff
path: root/firmware/target/arm/sandisk
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/sandisk')
-rw-r--r--firmware/target/arm/sandisk/ata-c200_e200.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/firmware/target/arm/sandisk/ata-c200_e200.c b/firmware/target/arm/sandisk/ata-c200_e200.c
index ef2bad387b..9a5301884f 100644
--- a/firmware/target/arm/sandisk/ata-c200_e200.c
+++ b/firmware/target/arm/sandisk/ata-c200_e200.c
@@ -162,7 +162,7 @@ static struct sd_card_status sd_status[NUM_VOLUMES] =
162/* Shoot for around 75% usage */ 162/* Shoot for around 75% usage */
163static long sd_stack [(DEFAULT_STACK_SIZE*2 + 0x1c0)/sizeof(long)]; 163static long sd_stack [(DEFAULT_STACK_SIZE*2 + 0x1c0)/sizeof(long)];
164static const char sd_thread_name[] = "ata/sd"; 164static const char sd_thread_name[] = "ata/sd";
165static struct spinlock sd_spin NOCACHEBSS_ATTR; 165static struct mutex sd_mtx NOCACHEBSS_ATTR;
166static struct event_queue sd_queue; 166static struct event_queue sd_queue;
167 167
168/* Posted when card plugged status has changed */ 168/* Posted when card plugged status has changed */
@@ -801,7 +801,7 @@ int ata_read_sectors(IF_MV2(int drive,) unsigned long start, int incount,
801 801
802 /* TODO: Add DMA support. */ 802 /* TODO: Add DMA support. */
803 803
804 spinlock_lock(&sd_spin); 804 mutex_lock(&sd_mtx);
805 805
806 ata_led(true); 806 ata_led(true);
807 807
@@ -888,7 +888,7 @@ ata_read_retry:
888 while (1) 888 while (1)
889 { 889 {
890 ata_led(false); 890 ata_led(false);
891 spinlock_unlock(&sd_spin); 891 mutex_unlock(&sd_mtx);
892 892
893 return ret; 893 return ret;
894 894
@@ -916,7 +916,7 @@ int ata_write_sectors(IF_MV2(int drive,) unsigned long start, int count,
916 const unsigned char *buf, *buf_end; 916 const unsigned char *buf, *buf_end;
917 int bank; 917 int bank;
918 918
919 spinlock_lock(&sd_spin); 919 mutex_lock(&sd_mtx);
920 920
921 ata_led(true); 921 ata_led(true);
922 922
@@ -1016,7 +1016,7 @@ ata_write_retry:
1016 while (1) 1016 while (1)
1017 { 1017 {
1018 ata_led(false); 1018 ata_led(false);
1019 spinlock_unlock(&sd_spin); 1019 mutex_unlock(&sd_mtx);
1020 1020
1021 return ret; 1021 return ret;
1022 1022
@@ -1050,7 +1050,7 @@ static void sd_thread(void)
1050 1050
1051 /* Lock to keep us from messing with this variable while an init 1051 /* Lock to keep us from messing with this variable while an init
1052 may be in progress */ 1052 may be in progress */
1053 spinlock_lock(&sd_spin); 1053 mutex_lock(&sd_mtx);
1054 card_info[1].initialized = 0; 1054 card_info[1].initialized = 0;
1055 sd_status[1].retry = 0; 1055 sd_status[1].retry = 0;
1056 1056
@@ -1073,7 +1073,7 @@ static void sd_thread(void)
1073 if (action != SDA_NONE) 1073 if (action != SDA_NONE)
1074 queue_broadcast(SYS_FS_CHANGED, 0); 1074 queue_broadcast(SYS_FS_CHANGED, 0);
1075 1075
1076 spinlock_unlock(&sd_spin); 1076 mutex_unlock(&sd_mtx);
1077 break; 1077 break;
1078 } /* SD_HOTSWAP */ 1078 } /* SD_HOTSWAP */
1079#endif /* HAVE_HOTSWAP */ 1079#endif /* HAVE_HOTSWAP */
@@ -1150,9 +1150,9 @@ int ata_init(void)
1150 int ret = 0; 1150 int ret = 0;
1151 1151
1152 if (!initialized) 1152 if (!initialized)
1153 spinlock_init(&sd_spin IF_COP(, SPINLOCK_TASK_SWITCH)); 1153 mutex_init(&sd_mtx);
1154 1154
1155 spinlock_lock(&sd_spin); 1155 mutex_lock(&sd_mtx);
1156 1156
1157 ata_led(false); 1157 ata_led(false);
1158 1158
@@ -1215,7 +1215,7 @@ int ata_init(void)
1215#endif 1215#endif
1216 } 1216 }
1217 1217
1218 spinlock_unlock(&sd_spin); 1218 mutex_unlock(&sd_mtx);
1219 1219
1220 return ret; 1220 return ret;
1221} 1221}