On 2/12/24 8:12 AM, Ben Cheatham wrote: > > > On 2/10/24 12:31 AM, Dan Williams wrote: [snip] >>> >>> I don't think this is the right fix. CONFIG_CXL_EINJ should be disabled when >>> CONFIG_CXL_BUS is built-in. Looks like the polarity the dependency is >>> backwards. The problem with IS_REACHABLE() is it removes the simple >>> debug option of "send me your .config" to see why some functionality is >>> not turned on. >>> >>> Could you test out flipping the dependency from: >>> >>> depends on ACPI_APEI_EINJ >= CXL_BUS >>> >>> ...to: >>> >>> depends on ACPI_APEI_EINJ <= CXL_BUS >> >> Wait, no y == 2 and m == 1, so: >> >> depends on ACPI_APEI_EINJ >= CXL_BUS >> >> ...is correct, but you need IS_ENABLED(CONFIG_CXL_EINJ), not >> IS_REACHABLE to guard those exports. > > Ok, I'll test it out today and let you know if it works. > Alright, I tested it yesterday and that fix doesn't work. When I change the guard to IS_ENABLED(CONFIG_CXL_EINJ) and set CONFIG_CXL_EINJ=n and CONFIG_ACPI_APEI_EINJ=y/m I get a redefinition error in einj.c. I've found a 4 ways to fix this so far, here they are: 1. Leave the guard as IS_ENABLED(CONFIG_ACPI_APEI_EINJ) and add IS_ENABLED(CONFIG_CXL_EINJ) around any calls to the functions in einj-cxl.h in cxl/core/port.c. 2. Change the guard to IS_ENABLED(CONFIG_CXL_EINJ) || IS_REACHABLE(CONFIG_ACPI_APEI_EINJ) and add a IS_ENABLED(CONFIG_CXL_EINJ) check at the beginning of the einj_cxl_* functions in einj.c. I'm not a fan of this one since it doesn't actually change what's built and just "artificially" gates the functionality. 3. Change the guard to IS_ENABLED(CONFIG_CXL_EINJ) and add a #if IS_ENABLED(CONFIG_CXL_EINJ) guard around the einj_cxl_* functions in einj.c. (I know this is pretty undesirable, but I thought I'd mention it for posterity's sake). 4. Change the Kconfig definition of CXL_EINJ to depends on ACPI_APEI_EINJ = CXL_BUS. My vote is for option 4, but I figured I should ask to see if you (or anyone else reading this thread) likes a different one or has a better idea than the ones I laid out. Thanks, Ben