mlx5: postpone freeing the completed command entity to taskqueue
because cancel_delayed_work_sync() might need to sleep, which cannot be done in the interrupt thread where the completion runs. Sponsored by: Nvidia networking MFC after: 1 week
This commit is contained in:
@@ -890,6 +890,7 @@ struct mlx5_cmd_work_ent {
|
|||||||
u16 op;
|
u16 op;
|
||||||
u8 busy;
|
u8 busy;
|
||||||
bool polling;
|
bool polling;
|
||||||
|
struct work_struct freew;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mlx5_pas {
|
struct mlx5_pas {
|
||||||
|
|||||||
@@ -802,6 +802,15 @@ static void cb_timeout_handler(struct work_struct *work)
|
|||||||
mlx5_cmd_comp_handler(dev, 1UL << ent->idx, MLX5_CMD_MODE_EVENTS);
|
mlx5_cmd_comp_handler(dev, 1UL << ent->idx, MLX5_CMD_MODE_EVENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
cmd_free_work(struct work_struct *work)
|
||||||
|
{
|
||||||
|
struct mlx5_cmd_work_ent *ent = container_of(work,
|
||||||
|
struct mlx5_cmd_work_ent, freew);
|
||||||
|
|
||||||
|
free_cmd(ent);
|
||||||
|
}
|
||||||
|
|
||||||
static void complete_command(struct mlx5_cmd_work_ent *ent)
|
static void complete_command(struct mlx5_cmd_work_ent *ent)
|
||||||
{
|
{
|
||||||
struct mlx5_cmd *cmd = ent->cmd;
|
struct mlx5_cmd *cmd = ent->cmd;
|
||||||
@@ -856,7 +865,8 @@ static void complete_command(struct mlx5_cmd_work_ent *ent)
|
|||||||
free_msg(dev, ent->in);
|
free_msg(dev, ent->in);
|
||||||
|
|
||||||
err = err ? err : ent->status;
|
err = err ? err : ent->status;
|
||||||
free_cmd(ent);
|
INIT_WORK(&ent->freew, cmd_free_work);
|
||||||
|
schedule_work(&ent->freew);
|
||||||
callback(err, context);
|
callback(err, context);
|
||||||
} else {
|
} else {
|
||||||
complete(&ent->done);
|
complete(&ent->done);
|
||||||
|
|||||||
Reference in New Issue
Block a user