aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2013-08-28 19:45:48 -0400
committerBen Hutchings <bhutchings@solarflare.com>2013-08-29 13:12:09 -0400
commitc15eed220fd1dd31d7ad2e4893b679331e6f1e74 (patch)
treef6ac93450c6f0f22bcf4010c94f2c32f96bdc58b
parent261e4d96b45476fa7386130a309bc15af9eca2e0 (diff)
sfc: Allow efx_nic_type::dimension_resources to fail
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/sfc/efx.c10
-rw-r--r--drivers/net/ethernet/sfc/falcon.c3
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h2
-rw-r--r--drivers/net/ethernet/sfc/siena.c3
4 files changed, 12 insertions, 6 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 84c47d3f2b53..59aa73ccefed 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1513,9 +1513,11 @@ static int efx_probe_nic(struct efx_nic *efx)
1513 * in MSI-X interrupts. */ 1513 * in MSI-X interrupts. */
1514 rc = efx_probe_interrupts(efx); 1514 rc = efx_probe_interrupts(efx);
1515 if (rc) 1515 if (rc)
1516 goto fail; 1516 goto fail1;
1517 1517
1518 efx->type->dimension_resources(efx); 1518 rc = efx->type->dimension_resources(efx);
1519 if (rc)
1520 goto fail2;
1519 1521
1520 if (efx->n_channels > 1) 1522 if (efx->n_channels > 1)
1521 get_random_bytes(&efx->rx_hash_key, sizeof(efx->rx_hash_key)); 1523 get_random_bytes(&efx->rx_hash_key, sizeof(efx->rx_hash_key));
@@ -1533,7 +1535,9 @@ static int efx_probe_nic(struct efx_nic *efx)
1533 1535
1534 return 0; 1536 return 0;
1535 1537
1536fail: 1538fail2:
1539 efx_remove_interrupts(efx);
1540fail1:
1537 efx->type->remove(efx); 1541 efx->type->remove(efx);
1538 return rc; 1542 return rc;
1539} 1543}
diff --git a/drivers/net/ethernet/sfc/falcon.c b/drivers/net/ethernet/sfc/falcon.c
index ec77611a52e4..a7b30ddbd4e0 100644
--- a/drivers/net/ethernet/sfc/falcon.c
+++ b/drivers/net/ethernet/sfc/falcon.c
@@ -2174,10 +2174,11 @@ out:
2174 return rc; 2174 return rc;
2175} 2175}
2176 2176
2177static void falcon_dimension_resources(struct efx_nic *efx) 2177static int falcon_dimension_resources(struct efx_nic *efx)
2178{ 2178{
2179 efx->rx_dc_base = 0x20000; 2179 efx->rx_dc_base = 0x20000;
2180 efx->tx_dc_base = 0x26000; 2180 efx->tx_dc_base = 0x26000;
2181 return 0;
2181} 2182}
2182 2183
2183/* Probe all SPI devices on the NIC */ 2184/* Probe all SPI devices on the NIC */
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 54900f3c83b1..89974f739bb6 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -1036,7 +1036,7 @@ struct efx_nic_type {
1036 int (*probe)(struct efx_nic *efx); 1036 int (*probe)(struct efx_nic *efx);
1037 void (*remove)(struct efx_nic *efx); 1037 void (*remove)(struct efx_nic *efx);
1038 int (*init)(struct efx_nic *efx); 1038 int (*init)(struct efx_nic *efx);
1039 void (*dimension_resources)(struct efx_nic *efx); 1039 int (*dimension_resources)(struct efx_nic *efx);
1040 void (*fini)(struct efx_nic *efx); 1040 void (*fini)(struct efx_nic *efx);
1041 void (*monitor)(struct efx_nic *efx); 1041 void (*monitor)(struct efx_nic *efx);
1042 enum reset_type (*map_reset_reason)(enum reset_type reason); 1042 enum reset_type (*map_reset_reason)(enum reset_type reason);
diff --git a/drivers/net/ethernet/sfc/siena.c b/drivers/net/ethernet/sfc/siena.c
index 89180d475367..1500405b3a55 100644
--- a/drivers/net/ethernet/sfc/siena.c
+++ b/drivers/net/ethernet/sfc/siena.c
@@ -177,13 +177,14 @@ static int siena_probe_nvconfig(struct efx_nic *efx)
177 return rc; 177 return rc;
178} 178}
179 179
180static void siena_dimension_resources(struct efx_nic *efx) 180static int siena_dimension_resources(struct efx_nic *efx)
181{ 181{
182 /* Each port has a small block of internal SRAM dedicated to 182 /* Each port has a small block of internal SRAM dedicated to
183 * the buffer table and descriptor caches. In theory we can 183 * the buffer table and descriptor caches. In theory we can
184 * map both blocks to one port, but we don't. 184 * map both blocks to one port, but we don't.
185 */ 185 */
186 efx_farch_dimension_resources(efx, FR_CZ_BUF_FULL_TBL_ROWS / 2); 186 efx_farch_dimension_resources(efx, FR_CZ_BUF_FULL_TBL_ROWS / 2);
187 return 0;
187} 188}
188 189
189static unsigned int siena_mem_map_size(struct efx_nic *efx) 190static unsigned int siena_mem_map_size(struct efx_nic *efx)