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/net_driver.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/net_driver.h')
-rw-r--r-- | drivers/net/sfc/net_driver.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index e8d5f03a89fe..c422eb2ce60a 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -645,7 +645,7 @@ struct efx_filter_state; | |||
645 | * @irq_rx_moderation: IRQ moderation time for RX event queues | 645 | * @irq_rx_moderation: IRQ moderation time for RX event queues |
646 | * @msg_enable: Log message enable flags | 646 | * @msg_enable: Log message enable flags |
647 | * @state: Device state flag. Serialised by the rtnl_lock. | 647 | * @state: Device state flag. Serialised by the rtnl_lock. |
648 | * @reset_pending: Pending reset method (normally RESET_TYPE_NONE) | 648 | * @reset_pending: Bitmask for pending resets |
649 | * @tx_queue: TX DMA queues | 649 | * @tx_queue: TX DMA queues |
650 | * @rx_queue: RX DMA queues | 650 | * @rx_queue: RX DMA queues |
651 | * @channel: Channels | 651 | * @channel: Channels |
@@ -728,7 +728,7 @@ struct efx_nic { | |||
728 | u32 msg_enable; | 728 | u32 msg_enable; |
729 | 729 | ||
730 | enum nic_state state; | 730 | enum nic_state state; |
731 | enum reset_type reset_pending; | 731 | unsigned long reset_pending; |
732 | 732 | ||
733 | struct efx_channel *channel[EFX_MAX_CHANNELS]; | 733 | struct efx_channel *channel[EFX_MAX_CHANNELS]; |
734 | char channel_name[EFX_MAX_CHANNELS][IFNAMSIZ + 6]; | 734 | char channel_name[EFX_MAX_CHANNELS][IFNAMSIZ + 6]; |