Commit cf9ecf4b authored by Matt Carlson's avatar Matt Carlson Committed by David S. Miller

tg3: Fix TSO CAP for 5704 devs w / ASF enabled

On the earliest TSO capable devices, TSO was accomplished through
firmware.  The TSO cannot coexist with ASF management firmware though.
The tg3 driver determines whether or not ASF is enabled by calling
tg3_get_eeprom_hw_cfg(), which checks a particular bit of NIC memory.
Commit dabc5c67, entitled "tg3: Move
TSO_CAPABLE assignment", accidentally moved the code that determines
TSO capabilities earlier than the call to tg3_get_eeprom_hw_cfg().  As a
consequence, the driver was attempting to determine TSO capabilities
before it had all the data it needed to make the decision.

This patch fixes the problem by revisiting and reevaluating the decision
after tg3_get_eeprom_hw_cfg() is called.
Signed-off-by: default avatarMatt Carlson <mcarlson@broadcom.com>
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a00bd469
...@@ -13988,9 +13988,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) ...@@ -13988,9 +13988,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if (tg3_flag(tp, HW_TSO_1) || if (tg3_flag(tp, HW_TSO_1) ||
tg3_flag(tp, HW_TSO_2) || tg3_flag(tp, HW_TSO_2) ||
tg3_flag(tp, HW_TSO_3) || tg3_flag(tp, HW_TSO_3) ||
(tp->fw_needed && !tg3_flag(tp, ENABLE_ASF))) tp->fw_needed) {
/* For firmware TSO, assume ASF is disabled.
* We'll disable TSO later if we discover ASF
* is enabled in tg3_get_eeprom_hw_cfg().
*/
tg3_flag_set(tp, TSO_CAPABLE); tg3_flag_set(tp, TSO_CAPABLE);
else { } else {
tg3_flag_clear(tp, TSO_CAPABLE); tg3_flag_clear(tp, TSO_CAPABLE);
tg3_flag_clear(tp, TSO_BUG); tg3_flag_clear(tp, TSO_BUG);
tp->fw_needed = NULL; tp->fw_needed = NULL;
...@@ -14266,6 +14270,12 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) ...@@ -14266,6 +14270,12 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
*/ */
tg3_get_eeprom_hw_cfg(tp); tg3_get_eeprom_hw_cfg(tp);
if (tp->fw_needed && tg3_flag(tp, ENABLE_ASF)) {
tg3_flag_clear(tp, TSO_CAPABLE);
tg3_flag_clear(tp, TSO_BUG);
tp->fw_needed = NULL;
}
if (tg3_flag(tp, ENABLE_APE)) { if (tg3_flag(tp, ENABLE_APE)) {
/* Allow reads and writes to the /* Allow reads and writes to the
* APE register and memory space. * APE register and memory space.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment