Hi Sakari, FYI, the error/warning still remains. tree: https://github.com/jsarha/linux topic/chromeos-4.19-s0ix head: 430bdaa0a8c38697780f45a148964d71951df11f commit: 314217a6c4fba0dc2b0c2d7900e33fea534acbba [5514/9999] UPSTREAM: media: v4l: fwnode: Let the caller provide V4L2 fwnode endpoint config: mips-buildonly-randconfig-r004-20221128 compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 6e4cea55f0d1104408b26ac574566a0e4de48036) 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 mips cross compiling tool for clang build # apt-get install binutils-mipsel-linux-gnu # https://github.com/jsarha/linux/commit/314217a6c4fba0dc2b0c2d7900e33fea534acbba git remote add jsarha https://github.com/jsarha/linux git fetch --no-tags jsarha topic/chromeos-4.19-s0ix git checkout 314217a6c4fba0dc2b0c2d7900e33fea534acbba # 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=mips SHELL=/bin/bash M=drivers/media/i2c If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from drivers/media/i2c/tc358743.c:15: In file included from include/linux/kernel.h:11: In file included from include/linux/bitops.h:19: In file included from arch/mips/include/asm/bitops.h:19: In file included from arch/mips/include/uapi/asm/byteorder.h:15: In file included from include/linux/byteorder/little_endian.h:11: include/linux/byteorder/generic.h:195:16: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned int') [-Wsign-compare] for (i = 0; i < len; i++) ~ ^ ~~~ include/linux/byteorder/generic.h:203:16: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned int') [-Wsign-compare] for (i = 0; i < len; i++) ~ ^ ~~~ In file included from drivers/media/i2c/tc358743.c:16: In file included from include/linux/module.h:10: In file included from include/linux/stat.h:19: In file included from include/linux/time.h:6: In file included from include/linux/seqlock.h:36: In file included from include/linux/spinlock.h:51: In file included from include/linux/preempt.h:81: In file included from ./arch/mips/include/generated/asm/preempt.h:1: In file included from include/asm-generic/preempt.h:5: include/linux/thread_info.h:141:29: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned int') [-Wsign-compare] if (unlikely(sz >= 0 && sz < bytes)) { ~~ ^ ~~~~~ include/linux/compiler.h:77:42: note: expanded from macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ In file included from drivers/media/i2c/tc358743.c:16: In file included from include/linux/module.h:10: In file included from include/linux/stat.h:19: In file included from include/linux/time.h:6: In file included from include/linux/seqlock.h:36: In file included from include/linux/spinlock.h:88: In file included from arch/mips/include/asm/spinlock.h:13: In file included from ./arch/mips/include/generated/asm/qrwlock.h:1: include/asm-generic/qrwlock.h:75:36: warning: comparison of integers of different signs: 'int' and 'u32' (aka 'unsigned int') [-Wsign-compare] cnts, cnts | _QW_LOCKED) == cnts); ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ include/linux/compiler.h:76:40: note: expanded from macro 'likely' # define likely(x) __builtin_expect(!!(x), 1) ^ In file included from drivers/media/i2c/tc358743.c:16: In file included from include/linux/module.h:13: In file included from include/linux/kmod.h:22: In file included from include/linux/umh.h:4: In file included from include/linux/gfp.h:6: include/linux/mmzone.h:984:44: warning: comparison of integers of different signs: 'int' and 'enum zone_type' [-Wsign-compare] if (likely(!nodes && zonelist_zone_idx(z) <= highest_zoneidx)) ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~ include/linux/compiler.h:76:40: note: expanded from macro 'likely' # define likely(x) __builtin_expect(!!(x), 1) ^ In file included from drivers/media/i2c/tc358743.c:29: In file included from include/media/cec.h:16: In file included from include/linux/kthread.h:7: In file included from include/linux/cgroup.h:28: include/linux/cgroup-defs.h:464:16: warning: field 'cgrp' with variable sized type 'struct cgroup' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end] struct cgroup cgrp; ^ In file included from drivers/media/i2c/tc358743.c:29: In file included from include/media/cec.h:19: In file included from include/media/rc-core.h:21: In file included from include/linux/kfifo.h:56: In file included from include/linux/scatterlist.h:8: In file included from include/linux/mm.h:26: In file included from include/linux/page_ref.h:7: include/linux/page-flags.h:162:21: warning: comparison of integers of different signs: 'const unsigned long' and 'long' [-Wsign-compare] return page->flags == PAGE_POISON_PATTERN; ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~ In file included from drivers/media/i2c/tc358743.c:29: In file included from include/media/cec.h:19: In file included from include/media/rc-core.h:21: In file included from include/linux/kfifo.h:56: In file included from include/linux/scatterlist.h:8: In file included from include/linux/mm.h:1170: include/linux/vmstat.h:221:2: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] for_each_online_cpu(cpu) ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/cpumask.h:778:36: note: expanded from macro 'for_each_online_cpu' #define for_each_online_cpu(cpu) for_each_cpu((cpu), cpu_online_mask) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/cpumask.h:243:9: note: expanded from macro 'for_each_cpu' (cpu) < nr_cpu_ids;) ~~~ ^ ~~~~~~~~~~ drivers/media/i2c/tc358743.c:62:2: warning: missing field 'reserved' initializer [-Wmissing-field-initializers] V4L2_INIT_BT_TIMINGS(640, 1920, 350, 1200, 13000000, 165000000, ^ include/uapi/linux/v4l2-dv-timings.h:26:29: note: expanded from macro 'V4L2_INIT_BT_TIMINGS' { .bt = { _width , ## args } } ^ drivers/media/i2c/tc358743.c:163:16: warning: comparison of integers of different signs: 'int' and 'u32' (aka 'unsigned int') [-Wsign-compare] for (i = 0; i < n; i++) ~ ^ ~ >> drivers/media/i2c/tc358743.c:1921:7: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] ret = ret; ~~~ ^ ~~~ drivers/media/i2c/tc358743.c:2034:3: warning: missing field 'hdmi_vic' initializer [-Wmissing-field-initializers] V4L2_DV_BT_CEA_640X480P59_94; ^ include/uapi/linux/v4l2-dv-timings.h:36:2: note: expanded from macro 'V4L2_DV_BT_CEA_640X480P59_94' V4L2_INIT_BT_TIMINGS(640, 480, 0, 0, \ ^ include/uapi/linux/v4l2-dv-timings.h:26:29: note: expanded from macro 'V4L2_INIT_BT_TIMINGS' { .bt = { _width , ## args } } ^ 12 warnings generated. Assembler messages: Fatal error: invalid -march= option: `mips32' clang-16: error: assembler command failed with exit code 1 (use -v to see invocation) vim +/int +1921 drivers/media/i2c/tc358743.c 1894 1895 static int tc358743_probe_of(struct tc358743_state *state) 1896 { 1897 struct device *dev = &state->i2c_client->dev; 1898 struct v4l2_fwnode_endpoint endpoint = { .bus_type = 0 }; 1899 struct device_node *ep; 1900 struct clk *refclk; 1901 u32 bps_pr_lane; 1902 int ret; 1903 1904 refclk = devm_clk_get(dev, "refclk"); 1905 if (IS_ERR(refclk)) { 1906 if (PTR_ERR(refclk) != -EPROBE_DEFER) 1907 dev_err(dev, "failed to get refclk: %ld\n", 1908 PTR_ERR(refclk)); 1909 return PTR_ERR(refclk); 1910 } 1911 1912 ep = of_graph_get_next_endpoint(dev->of_node, NULL); 1913 if (!ep) { 1914 dev_err(dev, "missing endpoint node\n"); 1915 return -EINVAL; 1916 } 1917 1918 ret = v4l2_fwnode_endpoint_alloc_parse(of_fwnode_handle(ep), &endpoint); 1919 if (ret) { 1920 dev_err(dev, "failed to parse endpoint\n"); > 1921 ret = ret; 1922 goto put_node; 1923 } 1924 1925 if (endpoint.bus_type != V4L2_MBUS_CSI2_DPHY || 1926 endpoint.bus.mipi_csi2.num_data_lanes == 0 || 1927 endpoint.nr_of_link_frequencies == 0) { 1928 dev_err(dev, "missing CSI-2 properties in endpoint\n"); 1929 ret = -EINVAL; 1930 goto free_endpoint; 1931 } 1932 1933 if (endpoint.bus.mipi_csi2.num_data_lanes > 4) { 1934 dev_err(dev, "invalid number of lanes\n"); 1935 ret = -EINVAL; 1936 goto free_endpoint; 1937 } 1938 1939 state->bus = endpoint.bus.mipi_csi2; 1940 1941 ret = clk_prepare_enable(refclk); 1942 if (ret) { 1943 dev_err(dev, "Failed! to enable clock\n"); 1944 goto free_endpoint; 1945 } 1946 1947 state->pdata.refclk_hz = clk_get_rate(refclk); 1948 state->pdata.ddc5v_delay = DDC5V_DELAY_100_MS; 1949 state->pdata.enable_hdcp = false; 1950 /* A FIFO level of 16 should be enough for 2-lane 720p60 at 594 MHz. */ 1951 state->pdata.fifo_level = 16; 1952 /* 1953 * The PLL input clock is obtained by dividing refclk by pll_prd. 1954 * It must be between 6 MHz and 40 MHz, lower frequency is better. 1955 */ 1956 switch (state->pdata.refclk_hz) { 1957 case 26000000: 1958 case 27000000: 1959 case 42000000: 1960 state->pdata.pll_prd = state->pdata.refclk_hz / 6000000; 1961 break; 1962 default: 1963 dev_err(dev, "unsupported refclk rate: %u Hz\n", 1964 state->pdata.refclk_hz); 1965 goto disable_clk; 1966 } 1967 1968 /* 1969 * The CSI bps per lane must be between 62.5 Mbps and 1 Gbps. 1970 * The default is 594 Mbps for 4-lane 1080p60 or 2-lane 720p60. 1971 */ 1972 bps_pr_lane = 2 * endpoint.link_frequencies[0]; 1973 if (bps_pr_lane < 62500000U || bps_pr_lane > 1000000000U) { 1974 dev_err(dev, "unsupported bps per lane: %u bps\n", bps_pr_lane); 1975 goto disable_clk; 1976 } 1977 1978 /* The CSI speed per lane is refclk / pll_prd * pll_fbd */ 1979 state->pdata.pll_fbd = bps_pr_lane / 1980 state->pdata.refclk_hz * state->pdata.pll_prd; 1981 1982 /* 1983 * FIXME: These timings are from REF_02 for 594 Mbps per lane (297 MHz 1984 * link frequency). In principle it should be possible to calculate 1985 * them based on link frequency and resolution. 1986 */ 1987 if (bps_pr_lane != 594000000U) 1988 dev_warn(dev, "untested bps per lane: %u bps\n", bps_pr_lane); 1989 state->pdata.lineinitcnt = 0xe80; 1990 state->pdata.lptxtimecnt = 0x003; 1991 /* tclk-preparecnt: 3, tclk-zerocnt: 20 */ 1992 state->pdata.tclk_headercnt = 0x1403; 1993 state->pdata.tclk_trailcnt = 0x00; 1994 /* ths-preparecnt: 3, ths-zerocnt: 1 */ 1995 state->pdata.ths_headercnt = 0x0103; 1996 state->pdata.twakeup = 0x4882; 1997 state->pdata.tclk_postcnt = 0x008; 1998 state->pdata.ths_trailcnt = 0x2; 1999 state->pdata.hstxvregcnt = 0; 2000 2001 state->reset_gpio = devm_gpiod_get_optional(dev, "reset", 2002 GPIOD_OUT_LOW); 2003 if (IS_ERR(state->reset_gpio)) { 2004 dev_err(dev, "failed to get reset gpio\n"); 2005 ret = PTR_ERR(state->reset_gpio); 2006 goto disable_clk; 2007 } 2008 2009 if (state->reset_gpio) 2010 tc358743_gpio_reset(state); 2011 2012 ret = 0; 2013 goto free_endpoint; 2014 2015 disable_clk: 2016 clk_disable_unprepare(refclk); 2017 free_endpoint: 2018 v4l2_fwnode_endpoint_free(&endpoint); 2019 put_node: 2020 of_node_put(ep); 2021 return ret; 2022 } 2023 #else 2024 static inline int tc358743_probe_of(struct tc358743_state *state) 2025 { 2026 return -ENODEV; 2027 } 2028 #endif 2029 -- 0-DAY CI Kernel Test Service https://01.org/lkp