Skip to contentSkip to conversation

tests/qtest: npcm7xx-emc-test: Skip checking MAC

PATCH In review Patrick Venture 2 participants 6 messages Sep 6, 2022 – Oct 6, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/qtest: npcm7xx-emc-test: Skip checking MAC

The register tests walks all the registers to verify they are initially 0 when appropriate. However, if the MAC address is set in the register
space, this should not be checked against 0.

Change-Id I02426e39bdab33ceedd42c49d233e8680d4ec058
---
 tests/qtest/npcm7xx_emc-test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/qtest/npcm7xx_emc-test.c +2 -1
index 7c435ac915..207d8515b7 100644
@@ -378,7 +378,8 @@ static void test_init(gconstpointer test_data)
 
 #undef CHECK_REG
 
-    for (i = 0; i < NUM_CAMML_REGS; ++i) {
+    /* Skip over the MAC address registers, which is BASE+0 */
+    for (i = 1; i < NUM_CAMML_REGS; ++i) {
         g_assert_cmpuint(emc_read(qts, mod, REG_CAMM_BASE + i * 2), ==,
                          0);
         g_assert_cmpuint(emc_read(qts, mod, REG_CAML_BASE + i * 2), ==,
Signature · 1 line
2.37.2.789.g6183377224-goog
#1 lore raw
Quoted 6 lines · Patrick Venture

The register tests walks all the registers to verify they are initially 0 when appropriate. However, if the MAC address is set in the register
space, this should not be checked against 0.

Change-Id I02426e39bdab33ceedd42c49d233e8680d4ec058

What's that change-id good for?

Quoted 10 lines
---
  tests/qtest/npcm7xx_emc-test.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
tests/qtest/npcm7xx_emc-test.c +0 -0
index 7c435ac915..207d8515b7 100644

tests/qtest/npcm7xx_emc-test.c static void test_init(gconstpointer test_data) · line 385

Quoted 9 lines
tests/qtest/npcm7xx_emc-test.c +2 -1
@@ -378,7 +378,8 @@ static void test_init(gconstpointer test_data)
 
  #undef CHECK_REG
 
-    for (i = 0; i < NUM_CAMML_REGS; ++i) {
+    /* Skip over the MAC address registers, which is BASE+0 */
+    for (i = 1; i < NUM_CAMML_REGS; ++i) {
          g_assert_cmpuint(emc_read(qts, mod, REG_CAMM_BASE + i * 2), ==,
                           0);
          g_assert_cmpuint(emc_read(qts, mod, REG_CAML_BASE + i * 2), ==,

Basically ack, but one question: Where should that non-zero MAC address come from / when did you hit a problem here? If QEMU is started without any mac settings at all (like it is done here), the register never contains a non-zero value, does it?

Thomas

#2 lore raw
Quoted 10 lines · Thomas Huth
Quoted 6 lines · Patrick Venture

The register tests walks all the registers to verify they are initially 0 when appropriate. However, if the MAC address is set in the register
space, this should not be checked against 0.

Change-Id I02426e39bdab33ceedd42c49d233e8680d4ec058

What's that change-id good for?

Oops, sorry about that. I can send out a v2 without it, or during application someone can nicely trim it? :)

Quoted 15 lines

Review

Quoted 7 lines
---
  tests/qtest/npcm7xx_emc-test.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/tests/qtest/npcm7xx_emc-test.c

Quoted 7 lines

index 7c435ac915..207d8515b7 100644

tests/qtest/npcm7xx_emc-test.c +0 -0
@@ -378,7 +378,8 @@ static void test_init(gconstpointer test_data)
 
  #undef CHECK_REG
 
Quoted 13 lines

tests/qtest/npcm7xx_emc-test.c static void test_init(gconstpointer test_data) · line 385

Quoted 6 lines
tests/qtest/npcm7xx_emc-test.c +2 -1
-    for (i = 0; i < NUM_CAMML_REGS; ++i) {
+    /* Skip over the MAC address registers, which is BASE+0 */
+    for (i = 1; i < NUM_CAMML_REGS; ++i) {
          g_assert_cmpuint(emc_read(qts, mod, REG_CAMM_BASE + i * 2), ==,
                           0);
          g_assert_cmpuint(emc_read(qts, mod, REG_CAML_BASE + i * 2), ==,

Basically ack, but one question: Where should that non-zero MAC address come
from / when did you hit a problem here? If QEMU is started without any mac settings at all (like it is done here), the register never contains a non-zero value, does it?

So, there's a bug in the emc device presently where that value isn't set when it should be. I have that bug fixed, but for whatever reason, probably not enough caffeine, I didn't bundle the two patches together.

Quoted 4 lines

Thomas

#3 lore raw
Quoted 12 lines · Patrick Venture

On Mon, Sep 19, 2022 at 5:44 AM Thomas Huth <[email protected] <mailto:[email protected]>> wrote:

On 06/09/2022 18.31, Patrick Venture wrote:
> The register tests walks all the registers to verify they are initially > 0 when appropriate.  However, if the MAC address is set in the register >    space, this should not be checked against 0.
>
> Reviewed-by: Hao Wu <[email protected] <mailto:[email protected]>> > Change-Id: I02426e39bdab33ceedd42c49d233e8680d4ec058

Quoted 4 lines

What's that change-id good for?

Oops, sorry about that.  I can send out a v2 without it, or during application someone can nicely trim it? :)

I can take the patch through my qtest branch - I'll drop the line there.

Quoted 8 lines

Basically ack, but one question: Where should that non-zero MAC address come
from / when did you hit a problem here? If QEMU is started without any mac settings at all (like it is done here), the register never contains a non-zero value, does it?

So, there's a bug in the emc device presently where that value isn't set when it should be.  I have that bug fixed, but for whatever reason, probably not enough caffeine, I didn't bundle the two patches together.

OK, makes sense now, thanks for the explanation!

Thomas

#4 lore raw
Quoted 34 lines · Thomas Huth
Quoted 7 lines · Patrick Venture

On Mon, Sep 19, 2022 at 5:44 AM Thomas Huth <[email protected] <mailto:[email protected]>> wrote:

On 06/09/2022 18.31, Patrick Venture wrote:
> The register tests walks all the registers to verify they are

initially

Quoted 1 line

> 0 when appropriate. However, if the MAC address is set in the

register

Quoted 3 lines

> space, this should not be checked against 0.
>
> Reviewed-by: Hao Wu <[email protected] <mailto:

[email protected]>>

Quoted 7 lines

> Change-Id: I02426e39bdab33ceedd42c49d233e8680d4ec058

What's that change-id good for?

Oops, sorry about that. I can send out a v2 without it, or during application someone can nicely trim it? :)

I can take the patch through my qtest branch - I'll drop the line there.

Quoted 1 line

Basically ack, but one question: Where should that non-zero MAC

address

Quoted 2 lines

come
from / when did you hit a problem here? If QEMU is started without

any mac

Quoted 4 lines

settings at all (like it is done here), the register never contains a non-zero value, does it?

Quoted 7 lines
Quoted 2 lines

So, there's a bug in the emc device presently where that value isn't set when it should be. I have that bug fixed, but for whatever reason,

probably

Quoted 1 line

not enough caffeine, I didn't bundle the two patches together.

OK, makes sense now, thanks for the explanation!

The follow-on patch was just applied to arm.next, so I wanted to check if this was applied to your .next or if you wanted a v2.

Quoted 5 lines

Thomas

#5 lore raw
Quoted 42 lines · Patrick Venture
Quoted 38 lines · Thomas Huth
Quoted 7 lines · Patrick Venture

On Mon, Sep 19, 2022 at 5:44 AM Thomas Huth <[email protected] <mailto:[email protected]>> wrote:

On 06/09/2022 18.31, Patrick Venture wrote:
> The register tests walks all the registers to verify they are

initially

Quoted 1 line

> 0 when appropriate. However, if the MAC address is set in the

register

Quoted 3 lines

> space, this should not be checked against 0.
>
> Reviewed-by: Hao Wu <[email protected] <mailto:

[email protected]>>

Quoted 7 lines

> Change-Id: I02426e39bdab33ceedd42c49d233e8680d4ec058

What's that change-id good for?

Oops, sorry about that. I can send out a v2 without it, or during application someone can nicely trim it? :)

I can take the patch through my qtest branch - I'll drop the line there.

Quoted 1 line

Basically ack, but one question: Where should that non-zero MAC

address

Quoted 2 lines

come
from / when did you hit a problem here? If QEMU is started without

any mac

Quoted 1 line

settings at all (like it is done here), the register never contains

a

Quoted 4 lines

non-zero value, does it?

So, there's a bug in the emc device presently where that value isn't

set

Quoted 1 line

when it should be. I have that bug fixed, but for whatever reason,

Quoted 9 lines
Quoted 5 lines

probably

Quoted 1 line

not enough caffeine, I didn't bundle the two patches together.

OK, makes sense now, thanks for the explanation!

The follow-on patch was just applied to arm.next, so I wanted to check if this was applied to your .next or if you wanted a v2.

Nevermind, sorry for the spam - I already saw it in a PULL but forgot to update my internal tracking. Thanks!

Quoted 7 lines
Quoted 7 lines

Thomas