]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sfc: Add a PROBED state for EF100 VDPA use.
authorJonathan Cooper <jonathan.s.cooper@amd.com>
Tue, 28 Jun 2022 13:59:08 +0000 (14:59 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jun 2022 12:40:46 +0000 (13:40 +0100)
For VDPA we need to tear down the driver to the point where it
has various control channels like MCDI, but it no longer has
a network device. This adds a state corresponding to
that mode that will be used when VDPA support is added.

Signed-off-by: Jonathan Cooper <jonathan.s.cooper@amd.com>
Co-developed-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: Martin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/ef100_netdev.c
drivers/net/ethernet/sfc/efx_common.c
drivers/net/ethernet/sfc/efx_common.h
drivers/net/ethernet/sfc/net_driver.h

index b9106ce678d9f3b4d4a53bfd53cdc9b521322d7f..3bb9a79bad221273ad6412bd35954392e7eee096 100644 (file)
@@ -291,7 +291,7 @@ void ef100_unregister_netdev(struct efx_nic *efx)
 {
        if (efx_dev_registered(efx)) {
                efx_fini_mcdi_logging(efx);
-               efx->state = STATE_UNINIT;
+               efx->state = STATE_PROBED;
                unregister_netdev(efx->net_dev);
        }
 }
index f6baebd9d6323cc5528831d89bbb28fb5d8828e4..0e0e86a53407cf1e35b5fa10eca5d371bf98c117 100644 (file)
@@ -1222,8 +1222,10 @@ static pci_ers_result_t efx_io_error_detected(struct pci_dev *pdev,
 
                efx_device_detach_sync(efx);
 
-               efx_stop_all(efx);
-               efx_disable_interrupts(efx);
+               if (efx_net_active(efx->state)) {
+                       efx_stop_all(efx);
+                       efx_disable_interrupts(efx);
+               }
 
                status = PCI_ERS_RESULT_NEED_RESET;
        } else {
index c72e819da8fd358d5c3cd495e2edf62e18d600a6..022ba56736a7b44a5378b9b6c8e3faa8084af1fc 100644 (file)
@@ -43,10 +43,11 @@ void efx_start_monitor(struct efx_nic *efx);
 int __efx_reconfigure_port(struct efx_nic *efx);
 int efx_reconfigure_port(struct efx_nic *efx);
 
-#define EFX_ASSERT_RESET_SERIALISED(efx)               \
-       do {                                            \
-               if (efx->state != STATE_UNINIT)         \
-                       ASSERT_RTNL();                  \
+#define EFX_ASSERT_RESET_SERIALISED(efx)                               \
+       do {                                                            \
+               if ((efx)->state != STATE_UNINIT &&                     \
+                   (efx)->state != STATE_PROBED)                       \
+                       ASSERT_RTNL();                                  \
        } while (0)
 
 int efx_try_recovery(struct efx_nic *efx);
index 95069125931a441c30644a9ee62d8e9b8b25c193..546552d5d86f88e667f1e6e2391250c5d08b56d9 100644 (file)
@@ -623,7 +623,8 @@ enum efx_int_mode {
 
 enum nic_state {
        STATE_UNINIT = 0,       /* device being probed/removed */
-       STATE_NET_DOWN,         /* hardware probed and netdev registered */
+       STATE_PROBED,           /* hardware probed */
+       STATE_NET_DOWN,         /* netdev registered */
        STATE_NET_UP,           /* ready for traffic */
        STATE_DISABLED,         /* device disabled due to hardware errors */