aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-05-16 02:10:10 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2011-06-02 07:58:33 -0400
commitdd6254e5c0efe01ad255188898cb3dadf98cb56d (patch)
tree3417d788024a41ad5f28689fc1ef5095ae2a4b7f /drivers/firewire
parentbf337b15c28ae25904a73e7e2e0de2f9c4f0e9f8 (diff)
firewire: ohci: remove superfluous posted write flushes
The call to flush_writes() in context_stop() is superfluous because another register read is done immediately afterwards. The call to flush_writes() in ar_context_run() does not need to be done individually for each AR context, so move it to ohci_enable(). This also makes ohci_enable() clearer because it no longer depends on a side effect of ar_context_run() to flush its own register writes. Finally, the setting of a context's wake bit does not need to be flushed because neither the driver logic nor the API require the CPU to wait for this action. This removes the last MMIO reads from the packet queueing code paths. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/ohci.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 438e6c831170..e291edaa5eef 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -629,7 +629,6 @@ static void ar_context_link_page(struct ar_context *ctx, unsigned int index)
629 ctx->last_buffer_index = index; 629 ctx->last_buffer_index = index;
630 630
631 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_WAKE); 631 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_WAKE);
632 flush_writes(ctx->ohci);
633} 632}
634 633
635static void ar_context_release(struct ar_context *ctx) 634static void ar_context_release(struct ar_context *ctx)
@@ -1001,7 +1000,6 @@ static void ar_context_run(struct ar_context *ctx)
1001 1000
1002 reg_write(ctx->ohci, COMMAND_PTR(ctx->regs), ctx->descriptors_bus | 1); 1001 reg_write(ctx->ohci, COMMAND_PTR(ctx->regs), ctx->descriptors_bus | 1);
1003 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN); 1002 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN);
1004 flush_writes(ctx->ohci);
1005} 1003}
1006 1004
1007static struct descriptor *find_branch_descriptor(struct descriptor *d, int z) 1005static struct descriptor *find_branch_descriptor(struct descriptor *d, int z)
@@ -1201,7 +1199,6 @@ static void context_stop(struct context *ctx)
1201 1199
1202 reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN); 1200 reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN);
1203 ctx->running = false; 1201 ctx->running = false;
1204 flush_writes(ctx->ohci);
1205 1202
1206 for (i = 0; i < 10; i++) { 1203 for (i = 0; i < 10; i++) {
1207 reg = reg_read(ctx->ohci, CONTROL_SET(ctx->regs)); 1204 reg = reg_read(ctx->ohci, CONTROL_SET(ctx->regs));
@@ -1345,12 +1342,10 @@ static int at_context_queue_packet(struct context *ctx,
1345 1342
1346 context_append(ctx, d, z, 4 - z); 1343 context_append(ctx, d, z, 4 - z);
1347 1344
1348 if (ctx->running) { 1345 if (ctx->running)
1349 reg_write(ohci, CONTROL_SET(ctx->regs), CONTEXT_WAKE); 1346 reg_write(ohci, CONTROL_SET(ctx->regs), CONTEXT_WAKE);
1350 flush_writes(ohci); 1347 else
1351 } else {
1352 context_run(ctx, 0); 1348 context_run(ctx, 0);
1353 }
1354 1349
1355 return 0; 1350 return 0;
1356} 1351}
@@ -2196,7 +2191,9 @@ static int ohci_enable(struct fw_card *card,
2196 OHCI1394_LinkControl_rcvPhyPkt); 2191 OHCI1394_LinkControl_rcvPhyPkt);
2197 2192
2198 ar_context_run(&ohci->ar_request_ctx); 2193 ar_context_run(&ohci->ar_request_ctx);
2199 ar_context_run(&ohci->ar_response_ctx); /* also flushes writes */ 2194 ar_context_run(&ohci->ar_response_ctx);
2195
2196 flush_writes(ohci);
2200 2197
2201 /* We are ready to go, reset bus to finish initialization. */ 2198 /* We are ready to go, reset bus to finish initialization. */
2202 fw_schedule_bus_reset(&ohci->card, false, true); 2199 fw_schedule_bus_reset(&ohci->card, false, true);
@@ -3128,7 +3125,6 @@ static void ohci_flush_queue_iso(struct fw_iso_context *base)
3128 &container_of(base, struct iso_context, base)->context; 3125 &container_of(base, struct iso_context, base)->context;
3129 3126
3130 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_WAKE); 3127 reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_WAKE);
3131 flush_writes(ctx->ohci);
3132} 3128}
3133 3129
3134static const struct fw_card_driver ohci_driver = { 3130static const struct fw_card_driver ohci_driver = {