Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62980cb6 authored by Andrew Rybchenko's avatar Andrew Rybchenko Committed by David S. Miller
Browse files

sfc: only fall back to a lower interrupt mode if it is supported



If we fail to probe interrupts with our minimum mode, return that error.

Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6f9f6ec2
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1420,9 +1420,12 @@ static int efx_probe_interrupts(struct efx_nic *efx)
					   xentries, 1, n_channels);
		if (rc < 0) {
			/* Fall back to single channel MSI */
			efx->interrupt_mode = EFX_INT_MODE_MSI;
			netif_err(efx, drv, efx->net_dev,
				  "could not enable MSI-X\n");
			if (efx->type->min_interrupt_mode >= EFX_INT_MODE_MSI)
				efx->interrupt_mode = EFX_INT_MODE_MSI;
			else
				return rc;
		} else if (rc < n_channels) {
			netif_err(efx, drv, efx->net_dev,
				  "WARNING: Insufficient MSI-X vectors"
@@ -1465,7 +1468,10 @@ static int efx_probe_interrupts(struct efx_nic *efx)
		} else {
			netif_err(efx, drv, efx->net_dev,
				  "could not enable MSI\n");
			if (efx->type->min_interrupt_mode >= EFX_INT_MODE_LEGACY)
				efx->interrupt_mode = EFX_INT_MODE_LEGACY;
			else
				return rc;
		}
	}