Index: apps/buffering.c
===================================================================
--- apps/buffering.c	(revision 16877)
+++ apps/buffering.c	(working copy)
@@ -88,7 +88,7 @@
 /* default point to start buffer refill */
 #define BUFFERING_DEFAULT_WATERMARK      (1024*512)
 /* amount of data to read in one read() call */
-#define BUFFERING_DEFAULT_FILECHUNK      (1024*16)
+#define BUFFERING_DEFAULT_FILECHUNK      (1024*32)
 /* point at which the file buffer will fight for CPU time */
 #define BUFFERING_CRITICAL_LEVEL         (1024*128)
 
@@ -1463,7 +1463,7 @@
     queue_init(&buffering_queue, true);
     buffering_thread_p = create_thread( buffering_thread, buffering_stack,
             sizeof(buffering_stack), CREATE_THREAD_FROZEN,
-            buffering_thread_name IF_PRIO(, PRIORITY_BUFFERING)
+            buffering_thread_name IF_PRIO(, PRIORITY_BUFFERING-1)
             IF_COP(, CPU));
 
     queue_enable_queue_send(&buffering_queue, &buffering_queue_sender_list,
Index: firmware/thread.c
===================================================================
--- firmware/thread.c	(revision 16877)
+++ firmware/thread.c	(working copy)
@@ -161,13 +161,6 @@
  * Processor-specific section
  */
 
-#ifdef MAX_PHYS_SECTOR_SIZE
-/* Support a special workaround object for large-sector disks */
-#define IF_NO_SKIP_YIELD(...) __VA_ARGS__
-#else
-#define IF_NO_SKIP_YIELD(...)
-#endif
-
 #if defined(CPU_ARM)
 /*---------------------------------------------------------------------------
  * Start the thread running and terminate it if it returns
@@ -1935,9 +1928,8 @@
 #endif
 
 #ifdef HAVE_PRIORITY_SCHEDULING
-    IF_NO_SKIP_YIELD( if (thread->skip_count != -1) )
     /* Reset the value of thread's skip count */
-        thread->skip_count = 0;
+    thread->skip_count = 0;
 #endif
 
     for (;;)
@@ -1993,7 +1985,6 @@
                  * priority threads are runnable. The highest priority runnable
                  * thread(s) are never skipped. */
                 if (priority <= max ||
-                    IF_NO_SKIP_YIELD( thread->skip_count == -1 || )
                     (diff = priority - max, ++thread->skip_count > diff*diff))
                 {
                     cores[core].running = thread;
@@ -2138,8 +2129,7 @@
         if (bl == NULL)
         {
             /* No inheritance - just boost the thread by aging */
-            IF_NO_SKIP_YIELD( if (thread->skip_count != -1) )
-                thread->skip_count = thread->priority;
+            thread->skip_count = thread->priority;
             current = cores[CURRENT_CORE].running;
         }
         else
Index: firmware/drivers/ata.c
===================================================================
--- firmware/drivers/ata.c	(revision 16877)
+++ firmware/drivers/ata.c	(working copy)
@@ -66,74 +66,6 @@
 #define ATA_POWER_OFF_TIMEOUT 2*HZ
 #endif
 
-#ifdef MAX_PHYS_SECTOR_SIZE
-/* Hack - what's the deal with 5g? */
-struct ata_lock
-{
-    struct thread_entry *thread;
-    int count;
-    volatile unsigned char locked;
-    IF_COP( struct corelock cl; )
-};
-
-static void ata_lock_init(struct ata_lock *l)
-{
-    corelock_init(&l->cl);
-    l->locked = 0;
-    l->count = 0;
-    l->thread = NULL;
-}
-
-static void ata_lock_lock(struct ata_lock *l)
-{
-    struct thread_entry * const current = thread_get_current();
-
-    if (current == l->thread)
-    {
-        l->count++;
-        return;
-    }
-
-    corelock_lock(&l->cl);
-
-    IF_PRIO( current->skip_count = -1; )
-
-    while (l->locked != 0)
-    {
-        corelock_unlock(&l->cl);
-        switch_thread();
-        corelock_lock(&l->cl);
-    }
-
-    l->locked = 1;
-    l->thread = current;
-    corelock_unlock(&l->cl);
-}
-
-static void ata_lock_unlock(struct ata_lock *l)
-{
-    if (l->count > 0)
-    {
-        l->count--;
-        return;
-    }
-
-    corelock_lock(&l->cl);
-
-    IF_PRIO( l->thread->skip_count = 0; )
-
-    l->thread = NULL;
-    l->locked = 0;
-
-    corelock_unlock(&l->cl);
-}
-
-#define mutex           ata_lock
-#define mutex_init      ata_lock_init
-#define mutex_lock      ata_lock_lock
-#define mutex_unlock    ata_lock_unlock
-#endif /* MAX_PHYS_SECTOR_SIZE */
-
 static struct mutex ata_mtx NOCACHEBSS_ATTR;
 int ata_device; /* device 0 (master) or 1 (slave) */
 
