Subject: Re: [PATCH 2/2] MAINTAINERS: Make cxl obsolete

From: Michael Ellerman <[email-masked]>
Date: Fri, 03 May 2024 20:31:24 +1000

Andrew Donnellan <[email-masked]> writes:
> On Fri, 2024-05-03 at 13:15 +1000, Andrew Donnellan wrote:
>> This doesn't seem quite right to me, I don't think we can just
>> redefine
>> CONFIG_CXL as a bool, but I'll do something like this. Probably won't
>> bother for CXLFLASH since they'll see it for CXL anyway, but I might
>> add a warning message on probe to both drivers.
>
> The more I look at how to do this, the more issues I see, though
> perhaps because I personally use olddefconfig more than I use
> oldconfig.
>
> Without changing the default to n, running olddefconfig is liable to
> switch CXL back on in configs where the user has disabled it.

Yes that's true.

> Conversely, if the user has set CXL=y rather than CXL=m, I'm not sure
> if there's any way to make it such that olddefconfig doesn't reset one
> symbol or the other to the default m.
>
> Honestly, I'm very tempted to be a little more aggressive and a) not
> bother with trying to play games with symbols, b) change the default to
> n in this release, c) add a warning printed on probe, and see whether
> anyone complains.

You mean just changing CXL to default n?

The problem is that has no effect on folks with existing configs. Those
of us who build from defconfigs will have it turned off, but any actual
users with existing configs will just still have it enabled.

I'm not really convinced printing warnings does much. I guess an actual
WARN_ON might work, but only if someone is watching the console.

> We could also print a message during the build itself, though that kind
> of noise is liable to break things in other ways?

More likely to break some CI somewhere, and a good chance it isn't even
seen by a human unless they're paying close attention to the build
output.

> It would be kind of nice if kbuild had some way to mark a symbol for
> deprecation which could print a warning during configuration.

Yeah, though it suffers from the same problem that there's a good chance
no one notices.

The below I think works. It does print a warning about CXL changing from
tristate to bool, but that seems harmless.

In all cases olddefconfig will turn CXL off, whether it was on, off
or =m beforehand. A fresh defconfig has it off. The only way to turn it
on is explicitly.

cheers

diff --git a/drivers/misc/cxl/Kconfig b/drivers/misc/cxl/Kconfig
index 5efc4151bf58..e62c16cc7292 100644
--- a/drivers/misc/cxl/Kconfig
+++ b/drivers/misc/cxl/Kconfig
@@ -9,11 +9,18 @@ config CXL_BASE
        select PPC_64S_HASH_MMU

 config CXL
-       tristate "Support for IBM Coherent Accelerators (CXL)"
+       def_bool y
+       depends on DEPRECATED_CXL
+
+config DEPRECATED_CXL
+       tristate "Deprecated support for IBM Coherent Accelerators (CXL)"
        depends on PPC_POWERNV && PCI_MSI && EEH
        select CXL_BASE
-       default m
+       default n
        help
+         The cxl driver is no longer actively maintained and we intend to
+         remove it in a future kernel release.
+
          Select this option to enable driver support for IBM Coherent
          Accelerators (CXL).  CXL is otherwise known as Coherent Accelerator
          Processor Interface (CAPI).  CAPI allows accelerators in FPGAs to be