Skip to contentSkip to conversation

can: rockchip_canfd: Drop obsolete dependency on COMPILE_TEST

PATCH In review Jean Delvare 3 participants 9 messages Oct 22, 2024 – Nov 25, 2024

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

PATCH 1/1 can: rockchip_canfd: Drop obsolete dependency on COMPILE_TEST

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), OF can be enabled on all architectures. Therefore depending on COMPILE_TEST as an alternative is no longer needed.

---
 drivers/net/can/rockchip/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/rockchip/Kconfig +1 -1
@@ -2,7 +2,7 @@
 
 config CAN_ROCKCHIP_CANFD
 	tristate "Rockchip CAN-FD controller"
-	depends on OF || COMPILE_TEST
+	depends on OF
 	select CAN_RX_OFFLOAD
 	help
 	  Say Y here if you want to use CAN-FD controller found on
Signature · 2 lines
Jean Delvare
SUSE L3 Support
#1 lore raw

Hi Jean,

+cc: Miguel Ojeda <[email protected]>
+cc: Masahiro Yamada <[email protected]>
+cc: Andrew Morton <[email protected]>

Quoted 3 lines · Jean Delvare

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), OF can be enabled on all architectures. Therefore depending on COMPILE_TEST as an alternative is no longer needed.

I understand the motivation behind this patch, but for me, as a maintainer, it becomes more work when I want to do a compile test. Before I would have needed to only select COMPILE_TEST but now, I would need to remember to also select OF for that driver to appear in the menuconfig.

Well, I am not strongly against this simplification, but, wouldn't it be good to make COMPILE_TEST automatically select OF then? Looking at the description of COMPILE_TEST, I read:

If you are a developer and want to build everything available, say Y here.

So having COMPILE_TEST automatically select OF looks sane to me as it goes in the direction of "building everything". If this makes sense, I can send a patch for this. Thoughts?

Quoted 22 lines
---
 drivers/net/can/rockchip/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/rockchip/Kconfig +1 -2
@@ -2,7 +2,7 @@
 
 config CAN_ROCKCHIP_CANFD
        tristate "Rockchip CAN-FD controller"
-       depends on OF || COMPILE_TEST
+       depends on OF
        select CAN_RX_OFFLOAD
        help
          Say Y here if you want to use CAN-FD controller found on
 
 
--

Jean Delvare
SUSE L3 Support

#2 lore raw

Hi Vincent,

Quoted 10 lines · Vincent MAILHOL
Quoted 3 lines · Jean Delvare

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), OF can be enabled on all architectures. Therefore depending on COMPILE_TEST as an alternative is no longer needed.

I understand the motivation behind this patch, but for me, as a maintainer, it becomes more work when I want to do a compile test. Before I would have needed to only select COMPILE_TEST but now, I would need to remember to also select OF for that driver to appear in the menuconfig.

Not sure what your typical process looks like, but if you need to test-build drivers on a regular basis, why don't you have CONFIG_COMPILE_TEST always enabled? Switching back and forth must be a hassle.

About CONFIG_OF, well you probably want it enabled regardless. For one thing, there are at least 940 drivers in the kernel tree which depend on OF, so you are already missing a lot of test build coverage if you have it disabled.

For another, if test-building a driver which would normally depend on OF, but with OF disabled (as you do for rockchip_canfd at the moment, as I understand it), then you may not be building the full driver. Part of the code could be stripped out at build time because the compiler notices that it is unreachable. Apparently this isn't the case of the rockchip_canfd driver though.

Quoted 5 lines

Well, I am not strongly against this simplification, but, wouldn't it be good to make COMPILE_TEST automatically select OF then? Looking at the description of COMPILE_TEST, I read:

If you are a developer and want to build everything available, say Y here.

As a side note, I don't think this is a proper description of how to use this option. If you "want to build everything available" then what you want to do is "make allmodconfig", not manually enabling all drivers in "make menuconfig". The purpose of manually selecting COMPILE_TEST would presumably be to test-build a specific driver or set of drivers.

Quoted 3 lines

So having COMPILE_TEST automatically select OF looks sane to me as it goes in the direction of "building everything". If this makes sense, I can send a patch for this. Thoughts?

My initial reaction was that this would be an artificial dependency, which seems wrong.

However, considering that the purpose of COMPILE_TEST is essentially to let the user build drivers from other architectures, and that enabling OF on an architecture which doesn't have it enabled by default essentially lets you select a whole lot of drivers from other architectures... I must admit that both options indeed share a purpose.

But I still have a concern. Some drivers can be built with or without OF (they support both OF and non-OF devices). If someone wants to test-build such a driver on a different architecture (and therefore must enable COMPILE_TEST) and wants to ensure that it builds fine with and without OF, then if COMPILE_TEST selects OF as you suggested, they would no longer be able to test the CONFIG_OF=n case.

So I'm afraid we can't actually do that.

Signature · 2 lines
Jean Delvare
SUSE L3 Support
Reviewed-by
#3 lore raw

Hi Jean,

Quoted 14 lines · Jean Delvare

Hi Vincent,

Quoted 10 lines · Vincent MAILHOL
Quoted 3 lines · Jean Delvare

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), OF can be enabled on all architectures. Therefore depending on COMPILE_TEST as an alternative is no longer needed.

I understand the motivation behind this patch, but for me, as a maintainer, it becomes more work when I want to do a compile test. Before I would have needed to only select COMPILE_TEST but now, I would need to remember to also select OF for that driver to appear in the menuconfig.

Quoted 4 lines

Not sure what your typical process looks like, but if you need to test-build drivers on a regular basis, why don't you have CONFIG_COMPILE_TEST always enabled? Switching back and forth must be a hassle.

The point is that I do not need to test build all drivers on a regular basis. The CAN subsystem is a small tree with not so many activities. And this OF thing is a pitfall (in which I have fallen into it in the past…)

Quoted 4 lines

About CONFIG_OF, well you probably want it enabled regardless. For one thing, there are at least 940 drivers in the kernel tree which depend on OF, so you are already missing a lot of test build coverage if you have it disabled.

The CAN subtree for which I care has only four drivers with OF, only two of which are not automatically selected by COMPILE_TEST:

  $ git grep "depends.* OF" drivers/net/can/
  drivers/net/can/Kconfig: depends on OF || COLDFIRE || COMPILE_TEST
  drivers/net/can/Kconfig: depends on OF && HAS_DMA && HAS_IOMEM
  drivers/net/can/ctucanfd/Kconfig: depends on HAS_IOMEM && OF
  drivers/net/can/rockchip/Kconfig: depends on OF || COMPILE_TEST
Quoted 11 lines

For another, if test-building a driver which would normally depend on OF, but with OF disabled (as you do for rockchip_canfd at the moment, as I understand it), then you may not be building the full driver. Part of the code could be stripped out at build time because the compiler notices that it is unreachable. Apparently this isn't the case of the rockchip_canfd driver though.

Quoted 4 lines

Well, I am not strongly against this simplification, but, wouldn't it be good to make COMPILE_TEST automatically select OF then? Looking at the description of COMPILE_TEST, I read:

Quoted 8 lines
Quoted 1 line

If you are a developer and want to build everything available, say Y here.

As a side note, I don't think this is a proper description of how to use this option. If you "want to build everything available" then what you want to do is "make allmodconfig", not manually enabling all drivers in "make menuconfig". The purpose of manually selecting COMPILE_TEST would presumably be to test-build a specific driver or set of drivers.

Ack. It would be helpful to rephrase that description.

Quoted 14 lines
Quoted 3 lines

So having COMPILE_TEST automatically select OF looks sane to me as it goes in the direction of "building everything". If this makes sense, I can send a patch for this. Thoughts?

My initial reaction was that this would be an artificial dependency, which seems wrong.

However, considering that the purpose of COMPILE_TEST is essentially to let the user build drivers from other architectures, and that enabling OF on an architecture which doesn't have it enabled by default essentially lets you select a whole lot of drivers from other architectures... I must admit that both options indeed share a purpose.

Quoted 8 lines

But I still have a concern. Some drivers can be built with or without OF (they support both OF and non-OF devices). If someone wants to test-build such a driver on a different architecture (and therefore must enable COMPILE_TEST) and wants to ensure that it builds fine with and without OF, then if COMPILE_TEST selects OF as you suggested, they would no longer be able to test the CONFIG_OF=n case.

So I'm afraid we can't actually do that.

Ack, this concern seems valid.

Thanks for your time and your good explanations.
I guess it is now my duty to not forget anymore to also enable OF when doing compile tests. With this said:

Yours sincerely,
Vincent Mailhol

#4 lore raw
In reply to Vincent MAILHOL

Hi Jean, Vincent,

Quoted 10 lines · Vincent MAILHOL
Quoted 3 lines · Jean Delvare

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), OF can be enabled on all architectures. Therefore depending on COMPILE_TEST as an alternative is no longer needed.

I understand the motivation behind this patch, but for me, as a maintainer, it becomes more work when I want to do a compile test. Before I would have needed to only select COMPILE_TEST but now, I would need to remember to also select OF for that driver to appear in the menuconfig.

IMHO these are two different things: to get a working driver, you need to enable OF; to do (may be limited, i.e. may not give a working driver) compile-testing, you need to enable COMPILE_TEST.

So I think commit 51e102ec23b25e6c ("can: rockchip_canfd: Drop obsolete dependency on COMPILE_TEST") should be reverted.

Quoted 9 lines

Well, I am not strongly against this simplification, but, wouldn't it be good to make COMPILE_TEST automatically select OF then? Looking at the description of COMPILE_TEST, I read:

If you are a developer and want to build everything available, say Y here.

So having COMPILE_TEST automatically select OF looks sane to me as it goes in the direction of "building everything". If this makes sense, I can send a patch for this. Thoughts?

Please don't do that! Merely enabling COMPILE_TEST should not enable any additional code in the kernel.

Quoted 4 lines
Quoted 4 lines
drivers/net/can/rockchip/Kconfig +0 -0
@@ -2,7 +2,7 @@
 
Quoted 8 lines

drivers/net/can/rockchip/Kconfig line 8

Quoted 8 lines
drivers/net/can/rockchip/Kconfig +1 -1
 config CAN_ROCKCHIP_CANFD
        tristate "Rockchip CAN-FD controller"
-       depends on OF || COMPILE_TEST
+       depends on OF
        select CAN_RX_OFFLOAD
        help
          Say Y here if you want to use CAN-FD controller found on

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#5 lore raw

Hi Geert,

Quoted 8 lines · Geert Uytterhoeven

Hi Jean, Vincent,

Quoted 5 lines · Vincent MAILHOL
Quoted 3 lines · Jean Delvare

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), OF can be enabled on all architectures. Therefore depending on COMPILE_TEST as an alternative is no longer needed.

Quoted 8 lines
Quoted 5 lines

I understand the motivation behind this patch, but for me, as a maintainer, it becomes more work when I want to do a compile test. Before I would have needed to only select COMPILE_TEST but now, I would need to remember to also select OF for that driver to appear in the menuconfig.

IMHO these are two different things: to get a working driver, you need to enable OF;

True.

Quoted 2 lines

(...) to do (may be limited, i.e. may not give a working driver) compile-testing, you need to enable COMPILE_TEST.

No, you don't *need* it. Enabling COMPILE_TEST is (or was) one way to do compile-testing, but it was not the only way. Which is the reason why it was dropped.

Your reasoning would hold only if building a limited, maybe not-working driver, was a purpose in itself. I personally can't see any value in doing this.

Signature · 2 lines
Jean Delvare
SUSE L3 Support
#6 lore raw

Hi Jean,

Quoted 16 lines · Jean Delvare
Quoted 6 lines · Geert Uytterhoeven
Quoted 5 lines · Vincent MAILHOL
Quoted 3 lines · Jean Delvare

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), OF can be enabled on all architectures. Therefore depending on COMPILE_TEST as an alternative is no longer needed.

Quoted 8 lines
Quoted 5 lines

I understand the motivation behind this patch, but for me, as a maintainer, it becomes more work when I want to do a compile test. Before I would have needed to only select COMPILE_TEST but now, I would need to remember to also select OF for that driver to appear in the menuconfig.

IMHO these are two different things: to get a working driver, you need to enable OF;

Quoted 8 lines

True.

Quoted 2 lines

(...) to do (may be limited, i.e. may not give a working driver) compile-testing, you need to enable COMPILE_TEST.

No, you don't *need* it. Enabling COMPILE_TEST is (or was) one way to do compile-testing, but it was not the only way. Which is the reason why it was dropped.

You could still do it the other way, by enabling CONFIG_OF.

Quoted 3 lines

Your reasoning would hold only if building a limited, maybe not-working driver, was a purpose in itself. I personally can't see any value in doing this.

It may help detecting more configuration issues using randconfig.

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#7 lore raw
Quoted 19 lines · Geert Uytterhoeven
Quoted 18 lines · Jean Delvare
Quoted 6 lines · Geert Uytterhoeven
Quoted 5 lines · Vincent MAILHOL
Quoted 3 lines · Jean Delvare

Since commit 0166dc11be91 ("of: make CONFIG_OF user selectable"), OF can be enabled on all architectures. Therefore depending on COMPILE_TEST as an alternative is no longer needed.

Quoted 8 lines
Quoted 5 lines

I understand the motivation behind this patch, but for me, as a maintainer, it becomes more work when I want to do a compile test. Before I would have needed to only select COMPILE_TEST but now, I would need to remember to also select OF for that driver to appear in the menuconfig.

IMHO these are two different things: to get a working driver, you need to enable OF;

True.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

(...) to do (may be limited, i.e. may not give a working driver) compile-testing, you need to enable COMPILE_TEST.

No, you don't *need* it. Enabling COMPILE_TEST is (or was) one way to do compile-testing, but it was not the only way. Which is the reason why it was dropped.

You could still do it the other way, by enabling CONFIG_OF.

And you still need to enable COMPILE_TEST, to get around the ARCH_ROCKCHIP dependency...

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#8 lore raw
In reply to Geert Uytterhoeven

Hi Geert,

Quoted 6 lines · Geert Uytterhoeven
Quoted 3 lines · Jean Delvare

Your reasoning would hold only if building a limited, maybe not-working driver, was a purpose in itself. I personally can't see any value in doing this.

It may help detecting more configuration issues using randconfig.

Maybe I would agree if build time, energy and engineering time were free and unlimited resources.

In our world though, the time spent by a test build farm to build a known-crippled driver would be better used to start the next test build earlier. This makes for better quality coverage. Or the energy used to do that could also be saved altogether.

And this suboptimal use of build time and energy is only the best case. The worst case is if the randconfig case causes a "false positive" build error or warning. This will generate a report, which will be sent to mailing lists, read by human beings and investigated, wasting engineering time.

I'm not making this up, this is in fact exactly what happened and led me to investigate a first "depends on OF || COMPILE_TEST" case a few years ago. I found out that the build warning would only possibly trigger if COMPILE_TEST was selected and OF was not. It would never trigger with any configuration options combination not including COMPILE_TEST. Fixing it would require adding #ifdefs and using macros. But why should we make the code more complex, less readable, to prevent a warning which can never happen in a non-test scenario? And more importantly, why should we allocate engineering time to look into such issues, when there are so many more useful tasks to work on?

Signature · 2 lines
Jean Delvare
SUSE L3 Support