2022-05-04 13:21:06

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the hte tree

Hi all,

After merging the hte tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:

drivers/gpio/gpiolib-cdev.c:572:8: error: unknown type name 'hte_return_t'
572 | static hte_return_t process_hw_ts_thread(void *p)
| ^~~~~~~~~~~~
drivers/gpio/gpiolib-cdev.c:623:8: error: unknown type name 'hte_return_t'
623 | static hte_return_t process_hw_ts(struct hte_ts_data *ts, void *p)
| ^~~~~~~~~~~~
drivers/gpio/gpiolib-cdev.c: In function 'hte_edge_setup':
drivers/gpio/gpiolib-cdev.c:851:41: error: passing argument 2 of 'hte_request_ts_ns' from incompatible pointer type [-Werror=incompatible-pointer-types]
851 | return hte_request_ts_ns(hdesc, process_hw_ts,
| ^~~~~~~~~~~~~
| |
| int (*)(struct hte_ts_data *, void *)
In file included from drivers/gpio/gpiolib-cdev.c:27:
include/linux/hte.h:234:75: note: expected 'hte_ts_cb_t' {aka 'enum hte_return (*)(struct hte_ts_data *, void *)'} but argument is of type 'int (*)(struct hte_ts_data *, void *)'
234 | static inline int hte_request_ts_ns(struct hte_ts_desc *desc, hte_ts_cb_t cb,
| ~~~~~~~~~~~~^~
drivers/gpio/gpiolib-cdev.c:852:34: error: passing argument 3 of 'hte_request_ts_ns' from incompatible pointer type [-Werror=incompatible-pointer-types]
852 | process_hw_ts_thread, line);
| ^~~~~~~~~~~~~~~~~~~~
| |
| int (*)(void *)
In file included from drivers/gpio/gpiolib-cdev.c:27:
include/linux/hte.h:235:53: note: expected 'hte_ts_sec_cb_t' {aka 'enum hte_return (*)(void *)'} but argument is of type 'int (*)(void *)'
235 | hte_ts_sec_cb_t tcb, void *data)
| ~~~~~~~~~~~~~~~~^~~
cc1: some warnings being treated as errors

Something has been missed in the contruction of the git tree :-(

I have dropped the hte tree for today.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2022-05-04 18:32:46

by Thierry Reding

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the hte tree

On Wed, May 04, 2022 at 04:59:56PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> After merging the hte tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
>
> drivers/gpio/gpiolib-cdev.c:572:8: error: unknown type name 'hte_return_t'
> 572 | static hte_return_t process_hw_ts_thread(void *p)
> | ^~~~~~~~~~~~
> drivers/gpio/gpiolib-cdev.c:623:8: error: unknown type name 'hte_return_t'
> 623 | static hte_return_t process_hw_ts(struct hte_ts_data *ts, void *p)
> | ^~~~~~~~~~~~
> drivers/gpio/gpiolib-cdev.c: In function 'hte_edge_setup':
> drivers/gpio/gpiolib-cdev.c:851:41: error: passing argument 2 of 'hte_request_ts_ns' from incompatible pointer type [-Werror=incompatible-pointer-types]
> 851 | return hte_request_ts_ns(hdesc, process_hw_ts,
> | ^~~~~~~~~~~~~
> | |
> | int (*)(struct hte_ts_data *, void *)
> In file included from drivers/gpio/gpiolib-cdev.c:27:
> include/linux/hte.h:234:75: note: expected 'hte_ts_cb_t' {aka 'enum hte_return (*)(struct hte_ts_data *, void *)'} but argument is of type 'int (*)(struct hte_ts_data *, void *)'
> 234 | static inline int hte_request_ts_ns(struct hte_ts_desc *desc, hte_ts_cb_t cb,
> | ~~~~~~~~~~~~^~
> drivers/gpio/gpiolib-cdev.c:852:34: error: passing argument 3 of 'hte_request_ts_ns' from incompatible pointer type [-Werror=incompatible-pointer-types]
> 852 | process_hw_ts_thread, line);
> | ^~~~~~~~~~~~~~~~~~~~
> | |
> | int (*)(void *)
> In file included from drivers/gpio/gpiolib-cdev.c:27:
> include/linux/hte.h:235:53: note: expected 'hte_ts_sec_cb_t' {aka 'enum hte_return (*)(void *)'} but argument is of type 'int (*)(void *)'
> 235 | hte_ts_sec_cb_t tcb, void *data)
> | ~~~~~~~~~~~~~~~~^~~
> cc1: some warnings being treated as errors
>
> Something has been missed in the contruction of the git tree :-(
>
> I have dropped the hte tree for today.

Yeah, oddly I didn't catch that when I was doing the test build. Let me
recheck what went wrong there.

Sorry for the mess,
Thierry


Attachments:
(No filename) (2.44 kB)
signature.asc (849.00 B)
Download all attachments

2022-05-05 23:09:12

by Dipen Patel

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the hte tree

Thanks for the help Thierry.

Best Regards, Dipen Patel

On 5/5/22 7:04 AM, Thierry Reding wrote:
> On Wed, May 04, 2022 at 08:17:50PM -0700, Dipen Patel wrote:
>> Hi Stephen, Thierry,
>>
>> Before sending patches I compiled and tested with or without HTE
>> config successfully, I used gcc arm64 cross compiler. The initial
>> problem kernel boat reported (reproduce step snippet below) used clang
>> as compiler and that gives typedef issue which is what hte_return_t
>> is. Do you know if we have to treat it differently with clang vs gcc
>> or did I miss something?
> It's probably a good idea to do builds with clang at this point since
> apparently it can catch some cases that GCC doesn't. There's some
> documentation on how to do that here:
>
> https://www.kernel.org/doc/html/latest/kbuild/llvm.html
>
> The process is quite similar to using GCC and it has the advantage that
> clang ships with built-in cross-compilers, so less hassle setting things
> up.
>
>> However below failure seems like (correct me if I am wrong) Thierry
>> might have changed typedef to int in one place and possibly not all
>> other places.
> Yes, the hte_return_t failures were my fault. Turns out due to some
> dependencies not being fulfilled my test builds didn't cover gpiolib
> character devices, so I didn't catch those.
>
> I've not got a couple of configurations that I can build and a short
> script that will verify that all the necessary files have been built, so
> that should hopefully catch such issues in the future.
>
> I had also pushed a fixed branch yesterday and it looks like today's
> linux-next built fine for HTE, so it's now included.
>
> Thierry

2022-05-09 05:20:29

by Thierry Reding

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the hte tree

On Wed, May 04, 2022 at 08:17:50PM -0700, Dipen Patel wrote:
> Hi Stephen, Thierry,
>
> Before sending patches I compiled and tested with or without HTE
> config successfully, I used gcc arm64 cross compiler. The initial
> problem kernel boat reported (reproduce step snippet below) used clang
> as compiler and that gives typedef issue which is what hte_return_t
> is. Do you know if we have to treat it differently with clang vs gcc
> or did I miss something?

It's probably a good idea to do builds with clang at this point since
apparently it can catch some cases that GCC doesn't. There's some
documentation on how to do that here:

https://www.kernel.org/doc/html/latest/kbuild/llvm.html

The process is quite similar to using GCC and it has the advantage that
clang ships with built-in cross-compilers, so less hassle setting things
up.

> However below failure seems like (correct me if I am wrong) Thierry
> might have changed typedef to int in one place and possibly not all
> other places.

Yes, the hte_return_t failures were my fault. Turns out due to some
dependencies not being fulfilled my test builds didn't cover gpiolib
character devices, so I didn't catch those.

I've not got a couple of configurations that I can build and a short
script that will verify that all the necessary files have been built, so
that should hopefully catch such issues in the future.

I had also pushed a fixed branch yesterday and it looks like today's
linux-next built fine for HTE, so it's now included.

Thierry


Attachments:
(No filename) (1.51 kB)
signature.asc (849.00 B)
Download all attachments

2022-05-09 09:00:02

by Dipen Patel

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the hte tree

Hi Stephen, Thierry,

Before sending patches I compiled and tested with or without HTE config successfully, I used gcc arm64 cross compiler. The initial problem kernel boat reported (reproduce step snippet below) used clang as compiler and that gives typedef issue which is what hte_return_t is. Do you know if we have to treat it differently with clang vs gcc or did I miss something?

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git hte/for-next
head:   cedbe14082d169f4c1136c70c5170a76bd9a076a
commit: 98935236600d4e179b664ffcfcd54e0ec3a1b4e3 [7/10] gpiolib: cdev: Add hardware timestamp clock type
config: arm-ep93xx_defconfig (https://download.01.org/0day-ci/archive/20220504/[email protected]/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 363b3a645a1e30011cc8da624f13dac5fd915628)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git/commit/?id=98935236600d4e179b664ffcfcd54e0ec3a1b4e3
        git remote add arm-tegra https://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git
        git fetch --no-tags arm-tegra hte/for-next
        git checkout 98935236600d4e179b664ffcfcd54e0ec3a1b4e3
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash


However below failure seems like (correct me if I am wrong) Thierry might have changed typedef to int in one place and possibly not all other places.

On 5/4/22 12:04 AM, Thierry Reding wrote:
> On Wed, May 04, 2022 at 04:59:56PM +1000, Stephen Rothwell wrote:
>> Hi all,
>>
>> After merging the hte tree, today's linux-next build (arm
>> multi_v7_defconfig) failed like this:
>>
>> drivers/gpio/gpiolib-cdev.c:572:8: error: unknown type name 'hte_return_t'
>> 572 | static hte_return_t process_hw_ts_thread(void *p)
>> | ^~~~~~~~~~~~
>> drivers/gpio/gpiolib-cdev.c:623:8: error: unknown type name 'hte_return_t'
>> 623 | static hte_return_t process_hw_ts(struct hte_ts_data *ts, void *p)
>> | ^~~~~~~~~~~~
>> drivers/gpio/gpiolib-cdev.c: In function 'hte_edge_setup':
>> drivers/gpio/gpiolib-cdev.c:851:41: error: passing argument 2 of 'hte_request_ts_ns' from incompatible pointer type [-Werror=incompatible-pointer-types]
>> 851 | return hte_request_ts_ns(hdesc, process_hw_ts,
>> | ^~~~~~~~~~~~~
>> | |
>> | int (*)(struct hte_ts_data *, void *)
>> In file included from drivers/gpio/gpiolib-cdev.c:27:
>> include/linux/hte.h:234:75: note: expected 'hte_ts_cb_t' {aka 'enum hte_return (*)(struct hte_ts_data *, void *)'} but argument is of type 'int (*)(struct hte_ts_data *, void *)'
>> 234 | static inline int hte_request_ts_ns(struct hte_ts_desc *desc, hte_ts_cb_t cb,
>> | ~~~~~~~~~~~~^~
>> drivers/gpio/gpiolib-cdev.c:852:34: error: passing argument 3 of 'hte_request_ts_ns' from incompatible pointer type [-Werror=incompatible-pointer-types]
>> 852 | process_hw_ts_thread, line);
>> | ^~~~~~~~~~~~~~~~~~~~
>> | |
>> | int (*)(void *)
>> In file included from drivers/gpio/gpiolib-cdev.c:27:
>> include/linux/hte.h:235:53: note: expected 'hte_ts_sec_cb_t' {aka 'enum hte_return (*)(void *)'} but argument is of type 'int (*)(void *)'
>> 235 | hte_ts_sec_cb_t tcb, void *data)
>> | ~~~~~~~~~~~~~~~~^~~
>> cc1: some warnings being treated as errors
>>
>> Something has been missed in the contruction of the git tree :-(
>>
>> I have dropped the hte tree for today.
> Yeah, oddly I didn't catch that when I was doing the test build. Let me
> recheck what went wrong there.
>
> Sorry for the mess,
> Thierry