diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-06-24 15:46:31 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-06-24 19:43:48 -0400 |
commit | a7d529ae2158b5300e4aa16c21f1828bc864449b (patch) | |
tree | 8a4442da3d52682945579ce76a9c075cf41a110b /drivers/net/sfc/enum.h | |
parent | 4017dbdc14af1903dc9fcba4d08b89c02325069d (diff) |
sfc: Allow resets to be upgraded; use atomic ops for safety
Currently an attempt to schedule any reset is ignored if a reset
is already pending. This ignores the relative scopes - if the
requested reset is greater in scope then the scheduled reset should
be upgraded accordingly.
There are also some race conditions which could lead to a reset
request being lost. Deal with them by using atomic operations on a
bitmask. This also makes tests on reset_pending easier to get right.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/sfc/enum.h')
-rw-r--r-- | drivers/net/sfc/enum.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/sfc/enum.h b/drivers/net/sfc/enum.h index 384cfe3b1be1..d725a8fbe1a6 100644 --- a/drivers/net/sfc/enum.h +++ b/drivers/net/sfc/enum.h | |||
@@ -134,6 +134,8 @@ enum efx_loopback_mode { | |||
134 | * other valuesspecify reasons, which efx_schedule_reset() will choose | 134 | * other valuesspecify reasons, which efx_schedule_reset() will choose |
135 | * a method for. | 135 | * a method for. |
136 | * | 136 | * |
137 | * Reset methods are numbered in order of increasing scope. | ||
138 | * | ||
137 | * @RESET_TYPE_INVISIBLE: don't reset the PHYs or interrupts | 139 | * @RESET_TYPE_INVISIBLE: don't reset the PHYs or interrupts |
138 | * @RESET_TYPE_ALL: reset everything but PCI core blocks | 140 | * @RESET_TYPE_ALL: reset everything but PCI core blocks |
139 | * @RESET_TYPE_WORLD: reset everything, save & restore PCI config | 141 | * @RESET_TYPE_WORLD: reset everything, save & restore PCI config |
@@ -147,7 +149,6 @@ enum efx_loopback_mode { | |||
147 | * @RESET_TYPE_MC_FAILURE: MC reboot/assertion | 149 | * @RESET_TYPE_MC_FAILURE: MC reboot/assertion |
148 | */ | 150 | */ |
149 | enum reset_type { | 151 | enum reset_type { |
150 | RESET_TYPE_NONE = -1, | ||
151 | RESET_TYPE_INVISIBLE = 0, | 152 | RESET_TYPE_INVISIBLE = 0, |
152 | RESET_TYPE_ALL = 1, | 153 | RESET_TYPE_ALL = 1, |
153 | RESET_TYPE_WORLD = 2, | 154 | RESET_TYPE_WORLD = 2, |