Revert "firewire: core: use mutex to coordinate concurrent calls to flush completions"
This reverts commit d9605d67562505e27dcc0f71af418118d3db91e5, since this commit is on the following reverted changes. Link: https://lore.kernel.org/r/20240912133038.238786-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
This commit is contained in:
parent
f877f1d81b
commit
c45b9a07b6
@ -157,7 +157,6 @@ struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
|
|||||||
ctx->callback.sc = callback;
|
ctx->callback.sc = callback;
|
||||||
ctx->callback_data = callback_data;
|
ctx->callback_data = callback_data;
|
||||||
INIT_WORK(&ctx->work, flush_completions_work);
|
INIT_WORK(&ctx->work, flush_completions_work);
|
||||||
mutex_init(&ctx->flushing_completions_mutex);
|
|
||||||
|
|
||||||
trace_isoc_outbound_allocate(ctx, channel, speed);
|
trace_isoc_outbound_allocate(ctx, channel, speed);
|
||||||
trace_isoc_inbound_single_allocate(ctx, channel, header_size);
|
trace_isoc_inbound_single_allocate(ctx, channel, header_size);
|
||||||
@ -174,8 +173,6 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx)
|
|||||||
trace_isoc_inbound_multiple_destroy(ctx);
|
trace_isoc_inbound_multiple_destroy(ctx);
|
||||||
|
|
||||||
ctx->card->driver->free_iso_context(ctx);
|
ctx->card->driver->free_iso_context(ctx);
|
||||||
|
|
||||||
mutex_destroy(&ctx->flushing_completions_mutex);
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(fw_iso_context_destroy);
|
EXPORT_SYMBOL(fw_iso_context_destroy);
|
||||||
|
|
||||||
@ -229,7 +226,7 @@ EXPORT_SYMBOL(fw_iso_context_queue_flush);
|
|||||||
* to process the context asynchronously, fw_iso_context_schedule_flush_completions() is available
|
* to process the context asynchronously, fw_iso_context_schedule_flush_completions() is available
|
||||||
* instead.
|
* instead.
|
||||||
*
|
*
|
||||||
* Context: Process context due to mutex_trylock().
|
* Context: Process context.
|
||||||
*/
|
*/
|
||||||
int fw_iso_context_flush_completions(struct fw_iso_context *ctx)
|
int fw_iso_context_flush_completions(struct fw_iso_context *ctx)
|
||||||
{
|
{
|
||||||
@ -237,11 +234,7 @@ int fw_iso_context_flush_completions(struct fw_iso_context *ctx)
|
|||||||
trace_isoc_inbound_single_flush_completions(ctx);
|
trace_isoc_inbound_single_flush_completions(ctx);
|
||||||
trace_isoc_inbound_multiple_flush_completions(ctx);
|
trace_isoc_inbound_multiple_flush_completions(ctx);
|
||||||
|
|
||||||
scoped_cond_guard(mutex_try, /* nothing to do */, &ctx->flushing_completions_mutex) {
|
return ctx->card->driver->flush_iso_completions(ctx);
|
||||||
return ctx->card->driver->flush_iso_completions(ctx);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(fw_iso_context_flush_completions);
|
EXPORT_SYMBOL(fw_iso_context_flush_completions);
|
||||||
|
|
||||||
|
@ -166,6 +166,7 @@ struct iso_context {
|
|||||||
struct context context;
|
struct context context;
|
||||||
void *header;
|
void *header;
|
||||||
size_t header_length;
|
size_t header_length;
|
||||||
|
unsigned long flushing_completions;
|
||||||
u32 mc_buffer_bus;
|
u32 mc_buffer_bus;
|
||||||
u16 mc_completed;
|
u16 mc_completed;
|
||||||
u16 last_timestamp;
|
u16 last_timestamp;
|
||||||
@ -3578,23 +3579,31 @@ static void ohci_flush_queue_iso(struct fw_iso_context *base)
|
|||||||
static int ohci_flush_iso_completions(struct fw_iso_context *base)
|
static int ohci_flush_iso_completions(struct fw_iso_context *base)
|
||||||
{
|
{
|
||||||
struct iso_context *ctx = container_of(base, struct iso_context, base);
|
struct iso_context *ctx = container_of(base, struct iso_context, base);
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
// Note that tasklet softIRQ is not used to process isochronous context anymore.
|
if (!test_and_set_bit_lock(0, &ctx->flushing_completions)) {
|
||||||
context_tasklet((unsigned long)&ctx->context);
|
// Note that tasklet softIRQ is not used to process isochronous context anymore.
|
||||||
|
context_tasklet((unsigned long)&ctx->context);
|
||||||
|
|
||||||
switch (base->type) {
|
switch (base->type) {
|
||||||
case FW_ISO_CONTEXT_TRANSMIT:
|
case FW_ISO_CONTEXT_TRANSMIT:
|
||||||
case FW_ISO_CONTEXT_RECEIVE:
|
case FW_ISO_CONTEXT_RECEIVE:
|
||||||
if (ctx->header_length != 0)
|
if (ctx->header_length != 0)
|
||||||
flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH);
|
flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH);
|
||||||
return 0;
|
break;
|
||||||
case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL:
|
case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL:
|
||||||
if (ctx->mc_completed != 0)
|
if (ctx->mc_completed != 0)
|
||||||
flush_ir_buffer_fill(ctx);
|
flush_ir_buffer_fill(ctx);
|
||||||
return 0;
|
break;
|
||||||
default:
|
default:
|
||||||
return -ENOSYS;
|
ret = -ENOSYS;
|
||||||
|
}
|
||||||
|
|
||||||
|
clear_bit_unlock(0, &ctx->flushing_completions);
|
||||||
|
smp_mb__after_atomic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct fw_card_driver ohci_driver = {
|
static const struct fw_card_driver ohci_driver = {
|
||||||
|
@ -512,7 +512,6 @@ union fw_iso_callback {
|
|||||||
struct fw_iso_context {
|
struct fw_iso_context {
|
||||||
struct fw_card *card;
|
struct fw_card *card;
|
||||||
struct work_struct work;
|
struct work_struct work;
|
||||||
struct mutex flushing_completions_mutex;
|
|
||||||
int type;
|
int type;
|
||||||
int channel;
|
int channel;
|
||||||
int speed;
|
int speed;
|
||||||
|
Loading…
Reference in New Issue
Block a user