summaryrefslogtreecommitdiffstats
path: root/drivers/firewire/ohci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/ohci.c')
-rw-r--r--drivers/firewire/ohci.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 8bf89267dc25..ccf52368a073 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -734,7 +734,7 @@ static unsigned int ar_search_last_active_buffer(struct ar_context *ctx,
734 __le16 res_count, next_res_count; 734 __le16 res_count, next_res_count;
735 735
736 i = ar_first_buffer_index(ctx); 736 i = ar_first_buffer_index(ctx);
737 res_count = ACCESS_ONCE(ctx->descriptors[i].res_count); 737 res_count = READ_ONCE(ctx->descriptors[i].res_count);
738 738
739 /* A buffer that is not yet completely filled must be the last one. */ 739 /* A buffer that is not yet completely filled must be the last one. */
740 while (i != last && res_count == 0) { 740 while (i != last && res_count == 0) {
@@ -742,8 +742,7 @@ static unsigned int ar_search_last_active_buffer(struct ar_context *ctx,
742 /* Peek at the next descriptor. */ 742 /* Peek at the next descriptor. */
743 next_i = ar_next_buffer_index(i); 743 next_i = ar_next_buffer_index(i);
744 rmb(); /* read descriptors in order */ 744 rmb(); /* read descriptors in order */
745 next_res_count = ACCESS_ONCE( 745 next_res_count = READ_ONCE(ctx->descriptors[next_i].res_count);
746 ctx->descriptors[next_i].res_count);
747 /* 746 /*
748 * If the next descriptor is still empty, we must stop at this 747 * If the next descriptor is still empty, we must stop at this
749 * descriptor. 748 * descriptor.
@@ -759,8 +758,7 @@ static unsigned int ar_search_last_active_buffer(struct ar_context *ctx,
759 if (MAX_AR_PACKET_SIZE > PAGE_SIZE && i != last) { 758 if (MAX_AR_PACKET_SIZE > PAGE_SIZE && i != last) {
760 next_i = ar_next_buffer_index(next_i); 759 next_i = ar_next_buffer_index(next_i);
761 rmb(); 760 rmb();
762 next_res_count = ACCESS_ONCE( 761 next_res_count = READ_ONCE(ctx->descriptors[next_i].res_count);
763 ctx->descriptors[next_i].res_count);
764 if (next_res_count != cpu_to_le16(PAGE_SIZE)) 762 if (next_res_count != cpu_to_le16(PAGE_SIZE))
765 goto next_buffer_is_active; 763 goto next_buffer_is_active;
766 } 764 }
@@ -2812,7 +2810,7 @@ static int handle_ir_buffer_fill(struct context *context,
2812 u32 buffer_dma; 2810 u32 buffer_dma;
2813 2811
2814 req_count = le16_to_cpu(last->req_count); 2812 req_count = le16_to_cpu(last->req_count);
2815 res_count = le16_to_cpu(ACCESS_ONCE(last->res_count)); 2813 res_count = le16_to_cpu(READ_ONCE(last->res_count));
2816 completed = req_count - res_count; 2814 completed = req_count - res_count;
2817 buffer_dma = le32_to_cpu(last->data_address); 2815 buffer_dma = le32_to_cpu(last->data_address);
2818 2816