diff options
| author | Mark Brown <broonie@kernel.org> | 2026-01-28 11:22:06 +0000 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-01-28 11:22:06 +0000 |
| commit | 751ec6dd6773237bf480291ca894a696a2991c62 (patch) | |
| tree | 6ac1b53826f7836b3f7b29f3f17bb45d118535c0 /drivers/net/netdevsim/bpf.c | |
| parent | e540be7d56d740144b1bd6f220b61ffe2f3830d4 (diff) | |
| parent | 04f7516ab70f7b82aae1d2830af2ee6f17f3fe98 (diff) | |
spi: aspeed: Improve handling of shared SPI
Merge series from Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com>:
This patch series improves handling of SPI controllers that are
shared by spi-mem devices and other SPI peripherals.
The primary goal of this series is to support non-spi-mem devices in
the ASPEED FMC/SPI controller driver. It also addresses an issue in
the spi-mem framework observed when different types of SPI devices
operate concurrently on the same controller, ensuring that spi-mem
operations are properly serialized.
Diffstat (limited to 'drivers/net/netdevsim/bpf.c')
| -rw-r--r-- | drivers/net/netdevsim/bpf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c index 49537d3c4120..5f17f68f3c08 100644 --- a/drivers/net/netdevsim/bpf.c +++ b/drivers/net/netdevsim/bpf.c @@ -244,7 +244,9 @@ static int nsim_bpf_create_prog(struct nsim_dev *nsim_dev, &state->state, &nsim_bpf_string_fops); debugfs_create_bool("loaded", 0400, state->ddir, &state->is_loaded); + mutex_lock(&nsim_dev->progs_list_lock); list_add_tail(&state->l, &nsim_dev->bpf_bound_progs); + mutex_unlock(&nsim_dev->progs_list_lock); prog->aux->offload->dev_priv = state; @@ -273,12 +275,16 @@ static int nsim_bpf_translate(struct bpf_prog *prog) static void nsim_bpf_destroy_prog(struct bpf_prog *prog) { struct nsim_bpf_bound_prog *state; + struct nsim_dev *nsim_dev; state = prog->aux->offload->dev_priv; + nsim_dev = state->nsim_dev; WARN(state->is_loaded, "offload state destroyed while program still bound"); debugfs_remove_recursive(state->ddir); + mutex_lock(&nsim_dev->progs_list_lock); list_del(&state->l); + mutex_unlock(&nsim_dev->progs_list_lock); kfree(state); } |
