summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/sfc/ef10.c
diff options
context:
space:
mode:
authorEdward Cree2015-07-21 16:09:31 +0200
committerDavid S. Miller2015-07-22 07:21:31 +0200
commit832dc9ed43da8eb2033d90b46c1041e1d6947907 (patch)
tree96d6f91d99258465e30a935ddb0fd0729f29cea8 /drivers/net/ethernet/sfc/ef10.c
parentsfc: enable cascaded multicast filters in MCFW (diff)
downloadkernel-qcow2-linux-832dc9ed43da8eb2033d90b46c1041e1d6947907.tar.gz
kernel-qcow2-linux-832dc9ed43da8eb2033d90b46c1041e1d6947907.tar.xz
kernel-qcow2-linux-832dc9ed43da8eb2033d90b46c1041e1d6947907.zip
sfc: cope with ENOSYS from efx_mcdi_get_workarounds()
GET_WORKAROUNDS was only introduced in May 2014, not all firmware will have it. So call sites need to handle ENOSYS. In this case we're probing the bug26807 workaround, which is not implemented in any firmware that doesn't have GET_WORKAROUNDS. So interpret ENOSYS as 'false'. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/ef10.c')
-rw-r--r--drivers/net/ethernet/sfc/ef10.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c
index 119301769dda..44071176859d 100644
--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -2277,20 +2277,27 @@ static int efx_ef10_ev_init(struct efx_channel *channel)
/* Successfully created event queue on channel 0 */
rc = efx_mcdi_get_workarounds(efx, &implemented, &enabled);
- if (rc)
+ if (rc == -ENOSYS) {
+ /* GET_WORKAROUNDS was implemented before the bug26807
+ * workaround, thus the latter must be unavailable in this fw
+ */
+ nic_data->workaround_26807 = false;
+ rc = 0;
+ } else if (rc) {
goto fail;
-
- nic_data->workaround_26807 =
- !!(enabled & MC_CMD_GET_WORKAROUNDS_OUT_BUG26807);
-
- if (implemented & MC_CMD_GET_WORKAROUNDS_OUT_BUG26807 &&
- !nic_data->workaround_26807) {
- rc = efx_mcdi_set_workaround(efx, MC_CMD_WORKAROUND_BUG26807,
- true);
- if (!rc)
- nic_data->workaround_26807 = true;
- else if (rc == -EPERM)
- rc = 0;
+ } else {
+ nic_data->workaround_26807 =
+ !!(enabled & MC_CMD_GET_WORKAROUNDS_OUT_BUG26807);
+
+ if (implemented & MC_CMD_GET_WORKAROUNDS_OUT_BUG26807 &&
+ !nic_data->workaround_26807) {
+ rc = efx_mcdi_set_workaround(efx, MC_CMD_WORKAROUND_BUG26807,
+ true);
+ if (!rc)
+ nic_data->workaround_26807 = true;
+ else if (rc == -EPERM)
+ rc = 0;
+ }
}
if (!rc)