Skip to contentSkip to conversation

linux-next: build failure after merge of the thunderbolt tree

PATCH Stephen Rothwell 5 participants 8 messages Jun 30, 2020 – Aug 10, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the thunderbolt tree, today's linux-next build (powerpc allyesconfig) failed like this:

Caused by commit

54509f5005ca ("thunderbolt: Add KUnit tests for path walking")

interacting with commit

d4cdd146d0db ("kunit: generalize kunit_resource API beyond allocated resources")

from the kunit-next tree.

I have applied the following merge fix patch.

From: Stephen Rothwell <[email protected]>
Date: Tue, 30 Jun 2020 15:51:50 +1000
Subject: [PATCH] thunderbolt: merge fix for kunix_resource changes

---
 drivers/thunderbolt/test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thunderbolt/test.c +2 -2
index acb8b6256847..a4d78811f7e2 100644
@@ -17,13 +17,13 @@ static int __ida_init(struct kunit_resource *res, void *context)
 	struct ida *ida = context;
 
 	ida_init(ida);
-	res->allocation = ida;
+	res->data = ida;
 	return 0;
 }
 
 static void __ida_destroy(struct kunit_resource *res)
 {
-	struct ida *ida = res->allocation;
+	struct ida *ida = res->data;
 
 	ida_destroy(ida);
 }
Signature · 5 lines
2.27.0

-- 
Cheers,
Stephen Rothwell
Reviewed-by
#1 lore raw
Quoted 16 lines · Stephen Rothwell

Hi all,

After merging the thunderbolt tree, today's linux-next build (powerpc allyesconfig) failed like this:

Caused by commit

54509f5005ca ("thunderbolt: Add KUnit tests for path walking")

interacting with commit

d4cdd146d0db ("kunit: generalize kunit_resource API beyond allocated resources")

from the kunit-next tree.

Quoted 7 lines

I have applied the following merge fix patch.

From: Stephen Rothwell <[email protected]>
Date: Tue, 30 Jun 2020 15:51:50 +1000
Subject: [PATCH] thunderbolt: merge fix for kunix_resource changes

Thanks Stephen, resolution looks good to me! If you need it

Once the kunit and thunderbolt trees are merged there may be some additional things we can do to simplify kunit resource utilization in the thuderbolt tests using the new kunit resource APIs; no hurry with that though. Nice to see the kunit resources code being used!

Alan

#2 lore raw
In reply to Stephen Rothwell
Quoted 8 lines · Stephen Rothwell

Hi all,

After merging the thunderbolt tree, today's linux-next build (powerpc allyesconfig) failed like this:

Caused by commit

Quoted 7 lines

54509f5005ca ("thunderbolt: Add KUnit tests for path walking")

interacting with commit

d4cdd146d0db ("kunit: generalize kunit_resource API beyond allocated resources")

from the kunit-next tree.

Thanks for reporting and fixing. The fix looks good to me.

#3 lore raw
Quoted 11 lines · Mika Westerberg
Quoted 10 lines · Stephen Rothwell

Hi all,

After merging the thunderbolt tree, today's linux-next build (powerpc allyesconfig) failed like this:

Caused by commit

54509f5005ca ("thunderbolt: Add KUnit tests for path walking")

Quoted 7 lines
Quoted 5 lines

interacting with commit

d4cdd146d0db ("kunit: generalize kunit_resource API beyond allocated resources")

from the kunit-next tree.

Thanks for reporting and fixing. The fix looks good to me.

Unfortunately, the fix didn't make it into mainline.

Building x86_64:allyesconfig ... failed
--------------
Error log:
drivers/thunderbolt/test.c: In function '__ida_init':
drivers/thunderbolt/test.c:20:5: error: 'struct kunit_resource' has no member named 'allocation'

   20 |  res->allocation = ida;
      |     ^~

drivers/thunderbolt/test.c: In function '__ida_destroy':
drivers/thunderbolt/test.c:26:23: error: 'struct kunit_resource' has no member named 'allocation'
26 | struct ida *ida = res->allocation;
| ^~
make[3]: *** [drivers/thunderbolt/test.o] Error 1

Guenter

#4 lore raw
In reply to Stephen Rothwell

Hi Linus,

Quoted 52 lines · On Tue, 30 Jun 2020 16:03:46 +1000 Stephen Rothwell <[email protected]>…

After merging the thunderbolt tree, today's linux-next build (powerpc allyesconfig) failed like this:

Caused by commit

54509f5005ca ("thunderbolt: Add KUnit tests for path walking")

interacting with commit

d4cdd146d0db ("kunit: generalize kunit_resource API beyond allocated resources")

from the kunit-next tree.

I have applied the following merge fix patch.

From: Stephen Rothwell <[email protected]>
Date: Tue, 30 Jun 2020 15:51:50 +1000
Subject: [PATCH] thunderbolt: merge fix for kunix_resource changes

---
 drivers/thunderbolt/test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thunderbolt/test.c +2 -2
index acb8b6256847..a4d78811f7e2 100644
@@ -17,13 +17,13 @@ static int __ida_init(struct kunit_resource *res, void *context)
 	struct ida *ida = context;
 
 	ida_init(ida);
-	res->allocation = ida;
+	res->data = ida;
 	return 0;
 }
 
 static void __ida_destroy(struct kunit_resource *res)
 {
-	struct ida *ida = res->allocation;
+	struct ida *ida = res->data;
 
 	ida_destroy(ida);
 }
Signature · 5 lines
2.27.0

-- 
Cheers,
Stephen Rothwell

I looks like the above report got lost along the way to you :-(

Here's the patch in case you want to directly apply it:

From: Stephen Rothwell <[email protected]>
Date: Tue, 30 Jun 2020 15:51:50 +1000
Subject: [PATCH] thunderbolt: merge fix for kunix_resource changes

---
 drivers/thunderbolt/test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/thunderbolt/test.c +2 -2
index acb8b6256847..a4d78811f7e2 100644
@@ -17,13 +17,13 @@ static int __ida_init(struct kunit_resource *res, void *context)
 	struct ida *ida = context;
 
 	ida_init(ida);
-	res->allocation = ida;
+	res->data = ida;
 	return 0;
 }
 
 static void __ida_destroy(struct kunit_resource *res)
 {
-	struct ida *ida = res->allocation;
+	struct ida *ida = res->data;
 
 	ida_destroy(ida);
 }
Signature · 2 lines
Cheers,
Stephen Rothwell
#5 lore raw
Quoted 2 lines · Stephen Rothwell

I looks like the above report got lost along the way to you :-(

Hmm. Why didn't I see this as a build failure?

Oh. Because the USB4_KUNIT_TEST stuff requires everything to be built in. And I have them as modules.

That's a bit unfortunate. I see the commentary in commit 54509f5005ca ("thunderbolt: Add KUnit tests for path walking") about how this is fine because only developers run the tests, but it has this very unfortunate side issue of not getting a lot of build coverage either.

Quoted 1 line

Here's the patch in case you want to directly apply it:

Will do. Thanks,

Linus

#6 lore raw

Hi Linus,

Quoted 9 lines · On Sun, 9 Aug 2020 11:04:28 -0700 Linus Torvalds…
Quoted 2 lines · Stephen Rothwell

I looks like the above report got lost along the way to you :-(

Hmm. Why didn't I see this as a build failure?

Oh. Because the USB4_KUNIT_TEST stuff requires everything to be built in. And I have them as modules.

Yeah, I only saw it because I do an allyesconfig build late in my day.

Quoted 3 lines
Quoted 1 line

Here's the patch in case you want to directly apply it:

Will do. Thanks,

Thanks.

Signature · 2 lines
Cheers,
Stephen Rothwell
#7 lore raw

Hi all,

Quoted 6 lines · Stephen Rothwell

Hi Linus,

Quoted 3 lines · On Sun, 9 Aug 2020 11:04:28 -0700 Linus Torvalds…
Quoted 1 line · Stephen Rothwell
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

I looks like the above report got lost along the way to you :-(

Hmm. Why didn't I see this as a build failure?

Oh. Because the USB4_KUNIT_TEST stuff requires everything to be built in. And I have them as modules.

Yeah, I only saw it because I do an allyesconfig build late in my day.

Sorry about this. I was not sure how to deal with this as Thunderbolt goes through Greg's USB tree, so I just ended up mentioning it in my pull request without actually including the complete patch.

The reason for the built in dependency is that KUnit adds its own module_init() in kunit_test_suite() so that causes linker error since the TBT driver does the same. I guess the better alternative would be to not use kunit_test_suite() and instead make calls to __kunit_test_suites_init() and __kunit_test_suites_exit() in the driver's nhi_init()/nhi_exit().

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Here's the patch in case you want to directly apply it:

Will do. Thanks,

Thanks.

Thanks!