]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
sfc: move initialisation of efx->filter_sem to efx_init_struct()
authorEdward Cree <ecree@solarflare.com>
Tue, 20 Oct 2020 14:35:08 +0000 (15:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:10:56 +0000 (10:10 +0100)
[ Upstream commit 05f90bf3d5df40e1a705527520e5fd56b2b6f09e ]

efx_probe_filters() has not been called yet when EF100 calls into
 efx_mcdi_filter_table_probe(), for which it wants to take the
 filter_sem.

Fixes: a9dc3d5612ce ("sfc_ef100: RX filter table management and related gubbins")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Link: https://lore.kernel.org/r/24fad43e-887d-051e-25e3-506f23f63abf@solarflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/sfc/efx_common.c
drivers/net/ethernet/sfc/rx_common.c

index dfc6032e75f48c051f85445d12a7b79ff9f391e7..ea0f8eb036ae57a5bdd0c733874de4803fcfa8cd 100644 (file)
@@ -1030,6 +1030,7 @@ int efx_init_struct(struct efx_nic *efx,
        efx->num_mac_stats = MC_CMD_MAC_NSTATS;
        BUILD_BUG_ON(MC_CMD_MAC_NSTATS - 1 != MC_CMD_MAC_GENERATION_END);
        mutex_init(&efx->mac_lock);
+       init_rwsem(&efx->filter_sem);
 #ifdef CONFIG_RFS_ACCEL
        mutex_init(&efx->rps_mutex);
        spin_lock_init(&efx->rps_hash_lock);
index 5e29284c89c982eccda9bc2e321cc3ebdadf38c9..19cf7cac1e6e9e8005cc12cc95ddb024f5f770f1 100644 (file)
@@ -797,7 +797,6 @@ int efx_probe_filters(struct efx_nic *efx)
 {
        int rc;
 
-       init_rwsem(&efx->filter_sem);
        mutex_lock(&efx->mac_lock);
        down_write(&efx->filter_sem);
        rc = efx->type->filter_table_probe(efx);