diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2010-12-24 08:42:46 -0500 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2011-01-04 02:48:33 -0500 |
commit | 386a4153a2c1455e424f280d636efa3c91864466 (patch) | |
tree | b99bc0351da1d37808d633cb8d64c1030dc37479 /drivers/firewire/ohci.c | |
parent | 78dec56d6a56322e1b728d51f3a7def416d36b34 (diff) |
firewire: ohci: cache the context run bit
The DMA context run control bit is entirely controlled by software, so
it is safe to cache it. This allows the driver to avoid doing an
additional MMIO read when queueing an AT packet.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/ohci.c')
-rw-r--r-- | drivers/firewire/ohci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index cfe5afe359c6..3ae84e2c5192 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
@@ -125,6 +125,7 @@ struct context { | |||
125 | struct fw_ohci *ohci; | 125 | struct fw_ohci *ohci; |
126 | u32 regs; | 126 | u32 regs; |
127 | int total_allocation; | 127 | int total_allocation; |
128 | bool running; | ||
128 | bool flushing; | 129 | bool flushing; |
129 | 130 | ||
130 | /* | 131 | /* |
@@ -1174,6 +1175,7 @@ static void context_run(struct context *ctx, u32 extra) | |||
1174 | le32_to_cpu(ctx->last->branch_address)); | 1175 | le32_to_cpu(ctx->last->branch_address)); |
1175 | reg_write(ohci, CONTROL_CLEAR(ctx->regs), ~0); | 1176 | reg_write(ohci, CONTROL_CLEAR(ctx->regs), ~0); |
1176 | reg_write(ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN | extra); | 1177 | reg_write(ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN | extra); |
1178 | ctx->running = true; | ||
1177 | flush_writes(ohci); | 1179 | flush_writes(ohci); |
1178 | } | 1180 | } |
1179 | 1181 | ||
@@ -1202,6 +1204,7 @@ static void context_stop(struct context *ctx) | |||
1202 | 1204 | ||
1203 | ctx->active = false; | 1205 | ctx->active = false; |
1204 | reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN); | 1206 | reg_write(ctx->ohci, CONTROL_CLEAR(ctx->regs), CONTEXT_RUN); |
1207 | ctx->running = false; | ||
1205 | flush_writes(ctx->ohci); | 1208 | flush_writes(ctx->ohci); |
1206 | 1209 | ||
1207 | for (i = 0; i < 10; i++) { | 1210 | for (i = 0; i < 10; i++) { |
@@ -1232,7 +1235,6 @@ static int at_context_queue_packet(struct context *ctx, | |||
1232 | struct descriptor *d, *last; | 1235 | struct descriptor *d, *last; |
1233 | __le32 *header; | 1236 | __le32 *header; |
1234 | int z, tcode; | 1237 | int z, tcode; |
1235 | u32 reg; | ||
1236 | 1238 | ||
1237 | d = context_get_descriptors(ctx, 4, &d_bus); | 1239 | d = context_get_descriptors(ctx, 4, &d_bus); |
1238 | if (d == NULL) { | 1240 | if (d == NULL) { |
@@ -1351,9 +1353,7 @@ static int at_context_queue_packet(struct context *ctx, | |||
1351 | 1353 | ||
1352 | context_append(ctx, d, z, 4 - z); | 1354 | context_append(ctx, d, z, 4 - z); |
1353 | 1355 | ||
1354 | /* If the context isn't already running, start it up. */ | 1356 | if (!ctx->running) |
1355 | reg = reg_read(ctx->ohci, CONTROL_SET(ctx->regs)); | ||
1356 | if ((reg & CONTEXT_RUN) == 0) | ||
1357 | context_run(ctx, 0); | 1357 | context_run(ctx, 0); |
1358 | 1358 | ||
1359 | return 0; | 1359 | return 0; |