[Precise][Patch 0/1] tg3: Fix TSO CAP for 5704 devs w / ASF enabled

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Precise][Patch 0/1] tg3: Fix TSO CAP for 5704 devs w / ASF enabled

Joseph Salisbury-3
From: Joseph Salisbury <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1005699


== Precise SRU Justification ==

Network access is unavailable due to this bug.  Some buildd's are unable to upgrade from Lucid to Precise due to this issue.


== Fix ==

commit cf9ecf4b631f649a964fa611f1a5e8874f2a76db
Author: Matt Carlson <[hidden email]>
Date:   Mon Nov 28 09:41:03 2011 +0000

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

== Impact ==

Specific hardware using tg3 cannot be upgraded from Lucid to Precise.

== Test Case ==

A test kernel was built with this patch and tested by the original bug reporter as well as other bug commenter's, also affected by this bug.  This patch now allows network access.




Matt Carlson (1):
  tg3: Fix TSO CAP for 5704 devs w / ASF enabled

 drivers/net/ethernet/broadcom/tg3.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

--
1.7.9.5


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[Precise][PATCH 1/1] tg3: Fix TSO CAP for 5704 devs w / ASF enabled

Joseph Salisbury-3
From: Matt Carlson <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1005699

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 dabc5c670d3f86d15ee4f42ab38ec5bd2682487d, 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: Matt Carlson <[hidden email]>
Signed-off-by: Michael Chan <[hidden email]>
Signed-off-by: David S. Miller <[hidden email]>
(cherry picked from commit cf9ecf4b631f649a964fa611f1a5e8874f2a76db)

Signed-off-by: Joseph Salisbury <[hidden email]>
---
 drivers/net/ethernet/broadcom/tg3.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 7efa8de..0341e5f 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -14013,9 +14013,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
  if (tg3_flag(tp, HW_TSO_1) ||
     tg3_flag(tp, HW_TSO_2) ||
     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);
- else {
+ } else {
  tg3_flag_clear(tp, TSO_CAPABLE);
  tg3_flag_clear(tp, TSO_BUG);
  tp->fw_needed = NULL;
@@ -14289,6 +14293,12 @@ static int __devinit tg3_get_invariants(struct tg3 *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)) {
  /* Allow reads and writes to the
  * APE register and memory space.
--
1.7.9.5


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Ack: [Precise][PATCH 1/1] tg3: Fix TSO CAP for 5704 devs w / ASF enabled

Brad Figg-2
On 06/06/2012 09:22 AM, [hidden email] wrote:

> From: Matt Carlson <[hidden email]>
>
> BugLink: http://bugs.launchpad.net/bugs/1005699
>
> 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 dabc5c670d3f86d15ee4f42ab38ec5bd2682487d, 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: Matt Carlson <[hidden email]>
> Signed-off-by: Michael Chan <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit cf9ecf4b631f649a964fa611f1a5e8874f2a76db)
>
> Signed-off-by: Joseph Salisbury <[hidden email]>
> ---
>  drivers/net/ethernet/broadcom/tg3.c |   14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 7efa8de..0341e5f 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -14013,9 +14013,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
>   if (tg3_flag(tp, HW_TSO_1) ||
>      tg3_flag(tp, HW_TSO_2) ||
>      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);
> - else {
> + } else {
>   tg3_flag_clear(tp, TSO_CAPABLE);
>   tg3_flag_clear(tp, TSO_BUG);
>   tp->fw_needed = NULL;
> @@ -14289,6 +14293,12 @@ static int __devinit tg3_get_invariants(struct tg3 *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)) {
>   /* Allow reads and writes to the
>   * APE register and memory space.

Need to add Joe's SOB before application of the patch to the tree.

--
Brad Figg [hidden email] http://www.canonical.com

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Ack: [Precise][PATCH 1/1] tg3: Fix TSO CAP for 5704 devs w / ASF enabled

Leann Ogasawara
In reply to this post by Joseph Salisbury-3
On 06/06/2012 09:22 AM, [hidden email] wrote:

> From: Matt Carlson <[hidden email]>
>
> BugLink: http://bugs.launchpad.net/bugs/1005699
>
> 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 dabc5c670d3f86d15ee4f42ab38ec5bd2682487d, 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: Matt Carlson <[hidden email]>
> Signed-off-by: Michael Chan <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit cf9ecf4b631f649a964fa611f1a5e8874f2a76db)
>
> Signed-off-by: Joseph Salisbury <[hidden email]>

Positive test results and Joe has also informed me this should be making
it's way to upstream stable as well.

Acked-by: Leann Ogasawara <[hidden email]>

> ---
>  drivers/net/ethernet/broadcom/tg3.c |   14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 7efa8de..0341e5f 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -14013,9 +14013,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
>   if (tg3_flag(tp, HW_TSO_1) ||
>      tg3_flag(tp, HW_TSO_2) ||
>      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);
> - else {
> + } else {
>   tg3_flag_clear(tp, TSO_CAPABLE);
>   tg3_flag_clear(tp, TSO_BUG);
>   tp->fw_needed = NULL;
> @@ -14289,6 +14293,12 @@ static int __devinit tg3_get_invariants(struct tg3 *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)) {
>   /* Allow reads and writes to the
>   * APE register and memory space.


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

Applied: [Precise][PATCH 1/1] tg3: Fix TSO CAP for 5704 devs w / ASF enabled

Brad Figg-2
In reply to this post by Joseph Salisbury-3
On 06/06/2012 09:22 AM, [hidden email] wrote:

> From: Matt Carlson <[hidden email]>
>
> BugLink: http://bugs.launchpad.net/bugs/1005699
>
> 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 dabc5c670d3f86d15ee4f42ab38ec5bd2682487d, 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: Matt Carlson <[hidden email]>
> Signed-off-by: Michael Chan <[hidden email]>
> Signed-off-by: David S. Miller <[hidden email]>
> (cherry picked from commit cf9ecf4b631f649a964fa611f1a5e8874f2a76db)
>
> Signed-off-by: Joseph Salisbury <[hidden email]>
> ---
>  drivers/net/ethernet/broadcom/tg3.c |   14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
> index 7efa8de..0341e5f 100644
> --- a/drivers/net/ethernet/broadcom/tg3.c
> +++ b/drivers/net/ethernet/broadcom/tg3.c
> @@ -14013,9 +14013,13 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
>   if (tg3_flag(tp, HW_TSO_1) ||
>      tg3_flag(tp, HW_TSO_2) ||
>      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);
> - else {
> + } else {
>   tg3_flag_clear(tp, TSO_CAPABLE);
>   tg3_flag_clear(tp, TSO_BUG);
>   tp->fw_needed = NULL;
> @@ -14289,6 +14293,12 @@ static int __devinit tg3_get_invariants(struct tg3 *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)) {
>   /* Allow reads and writes to the
>   * APE register and memory space.


--
Brad Figg [hidden email] http://www.canonical.com

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team