Skip to contentSkip to conversation

linux-next: build failure in the final build

DISCUSSION Mark Brown 4 participants 8 messages Nov 23

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

Today's -next has a build failure in the final build for arm64 allyesconfig:

In file included from /tmp/next/build/include/linux/phy/phy.h:25,
from /tmp/next/build/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c:15:
/tmp/next/build/include/dt-bindings/phy/phy.h:15:33: error: expected identifier before numeric constant

   15 | #define PHY_TYPE_PCIE           2
      |                                 ^
/tmp/next/build/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c:47:9: note: in expansion of macro 'PHY_TYPE_PCIE'
   47 |         PHY_TYPE_PCIE = 1,
      |         ^~~~~~~~~~~~~
/tmp/next/build/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c:127:27: error: 'PHY_TYPE_PCIE_GEN2' undeclared here (not in a function); did you mean 'PHY_TYPE_PCIE'?
  127 |         .phy_type       = PHY_TYPE_PCIE_GEN2,
      |                           ^~~~~~~~~~~~~~~~~~
      |                           PHY_TYPE_PCIE
/tmp/next/build/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c:135:27: error: 'PHY_TYPE_PCIE_GEN3' undeclared here (not in a function); did you mean 'PHY_TYPE_PCIE'?
  135 |         .phy_type       = PHY_TYPE_PCIE_GEN3,
      |                           ^~~~~~~~~~~~~~~~~~
      |                           PHY_TYPE_PCIE

I did not specifically identify the commit that triggered this, it will be some include file reorganisation which causes PHY_TYPE_PCIE from the DT headers to become visible to the driver, clearly there is a namespacing issue going on here. I have ignored this for today.

#1 lore raw
Quoted 22 lines · Mark Brown

Hi all,

Today's -next has a build failure in the final build for arm64 allyesconfig:

In file included from /tmp/next/build/include/linux/phy/phy.h:25,
from /tmp/next/build/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c:15:
/tmp/next/build/include/dt-bindings/phy/phy.h:15:33: error: expected identifier before numeric constant

   15 | #define PHY_TYPE_PCIE           2
      |                                 ^
/tmp/next/build/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c:47:9: note: in expansion of macro 'PHY_TYPE_PCIE'
   47 |         PHY_TYPE_PCIE = 1,
      |         ^~~~~~~~~~~~~
/tmp/next/build/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c:127:27: error: 'PHY_TYPE_PCIE_GEN2' undeclared here (not in a function); did you mean 'PHY_TYPE_PCIE'?
  127 |         .phy_type       = PHY_TYPE_PCIE_GEN2,
      |                           ^~~~~~~~~~~~~~~~~~
      |                           PHY_TYPE_PCIE
/tmp/next/build/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-28lp.c:135:27: error: 'PHY_TYPE_PCIE_GEN3' undeclared here (not in a function); did you mean 'PHY_TYPE_PCIE'?
  135 |         .phy_type       = PHY_TYPE_PCIE_GEN3,
      |                           ^~~~~~~~~~~~~~~~~~
      |                           PHY_TYPE_PCIE
Quoted 4 lines

I did not specifically identify the commit that triggered this, it will be some include file reorganisation which causes PHY_TYPE_PCIE from the DT headers to become visible to the driver, clearly there is a namespacing issue going on here. I have ignored this for today.

Commit b28eecc89399e5371483f03fecded33a26a8e655 was not really built and exposed all drivers to DT bindings headers. Referencing other headers, including bindings, from kernel-wide headers is another suboptimal choice here.

Greg, that's commit in your tree, how about dropping b28eecc89399e5371483f03fecded33a26a8e655? Authors probably built only defconfig and thought they are done...

That commit was not reviewed by Phy maintainer, so it should not go via USB.

Honestly, I do not understand why author - Krishna - combined there PHY and USB in one spot.

Best regards,
Krzysztof

author maintainer
#2 lore raw
Quoted 11 lines · Krzysztof Kozlowski
Quoted 4 lines · Mark Brown

I did not specifically identify the commit that triggered this, it will be some include file reorganisation which causes PHY_TYPE_PCIE from the DT headers to become visible to the driver, clearly there is a namespacing issue going on here. I have ignored this for today.

Commit b28eecc89399e5371483f03fecded33a26a8e655 was not really built and exposed all drivers to DT bindings headers. Referencing other headers, including bindings, from kernel-wide headers is another suboptimal choice here.

b28eecc89399e (include: linux: phy: Add phy attribute "type" and associated helpers)

Quoted 3 lines

Greg, that's commit in your tree, how about dropping b28eecc89399e5371483f03fecded33a26a8e655? Authors probably built only defconfig and thought they are done...

The PHY driver is bool and depends on ARCH_QCOM too which doesn't help, people would need to do a specifically arm/arm64 all*config to hit issues.

#3 lore raw
Quoted 7 lines · Mark Brown
Quoted 3 lines

Greg, that's commit in your tree, how about dropping b28eecc89399e5371483f03fecded33a26a8e655? Authors probably built only defconfig and thought they are done...

The PHY driver is bool and depends on ARCH_QCOM too which doesn't help, people would need to do a specifically arm/arm64 all*config to hit issues.

Sorry, but that's trivial in this particular case. Whenever one touches subsystem wide stuff, author should AT LEAST build that subsystem, which is trivial:

ARCH=arm/arm64 ... make allyesconfig -j12 drivers/phy/

Followed by W=1 clang build. This is bare minimum and is fast. We do not speak here about full allyesconfig build, which requires some build machine, but basic build which my laptop did in 10 seconds (I mean, 10 seconds to spot the error).

Author simply did not built the code they touched (by touching subsystem header).

Best regards,
Krzysztof

author maintainer
#4 lore raw
Quoted 10 lines · Krzysztof Kozlowski
Quoted 3 lines · Mark Brown

The PHY driver is bool and depends on ARCH_QCOM too which doesn't help, people would need to do a specifically arm/arm64 all*config to hit issues.

Sorry, but that's trivial in this particular case. Whenever one touches subsystem wide stuff, author should AT LEAST build that subsystem, which is trivial:

Quoted 6 lines

ARCH=arm/arm64 ... make allyesconfig -j12 drivers/phy/

Followed by W=1 clang build. This is bare minimum and is fast. We do not speak here about full allyesconfig build, which requires some build machine, but basic build which my laptop did in 10 seconds (I mean, 10 seconds to spot the error).

Yeah, the issue here being you have to specifically do arm64 - I know my coverage builds tend to be on x86_64 since my development is on arm64 so it's much more likely to actually turn something up. It would be helpful to have better compile test coverage for these drivers to help avoid such issues, the easier it is to get the code built the better.

Quoted 2 lines

Author simply did not built the code they touched (by touching subsystem header).

Clearly.

#5 lore raw
Quoted 2 lines · Mark Brown

helpful to have better compile test coverage for these drivers to help avoid such issues, the easier it is to get the code built the better.

I'll fix the missing compile test for that driver.

Best regards,
Krzysztof

#6 lore raw
Quoted 7 lines · Krzysztof Kozlowski
Quoted 2 lines · Mark Brown

helpful to have better compile test coverage for these drivers to help avoid such issues, the easier it is to get the code built the better.

I'll fix the missing compile test for that driver.

Apologies. I didn't build it for allyesconfig. I did uncover this issue recently when testing on a different branch where the said driver was enabled. I was planning on sending a proper fix along with v9. There were some fresh comments that came up from maintainer Vinod last week [1].

I was planning on doing two things:
1) Fix up the build error when sending v9.
2) Send on top of phy next [2].

I will take care not to let such things happen from next time from my end. Sorry for the inconvenience caused.

As per mixing phy and usb patches, I know that usb subsystem prefers not mixing up usb patches with others, but in this case, I thought that we must send a complete series instead of sending 4 phy patches and then sending a separate usb patch marking the dependency on phy patches. In that case, I would have had to send usb patch once phy patch was in linux next so that no build error would come up when Greg would have picked usb patch into his tree. Let me know what is preferable in this case.

In case Vinod is fine with the implementation and comments replied to on [1], then this series need not be reverted and the build error can be fixed by Sasha's patch sent today [3]. Else, Greg, please do help revert the series from usb tree. I will rebase v9 on top of phy next after addressing the comments from Vinod.

[1]: https://lore.kernel.org/all/[email protected]/
[2]: https://lore.kernel.org/all/[email protected]/
[3]: https://lore.kernel.org/all/[email protected]/

Regards,
Krishna

#7 lore raw
In reply to Mark Brown
Quoted 4 lines · Mark Brown

I did not specifically identify the commit that triggered this, it will be some include file reorganisation which causes PHY_TYPE_PCIE from the DT headers to become visible to the driver, clearly there is a namespacing issue going on here. I have ignored this for today.

I sent a fix for the driver yesterday. It renames the driver's enum values so they don't clash with the dt-bindings ones:

https://lore.kernel.org/all/[email protected]/

Signature · 2 lines
Thanks,
Sasha