[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202509260730.o2TJUGJS-lkp@intel.com>
Date: Fri, 26 Sep 2025 07:27:09 +0800
From: kernel test robot <lkp@...el.com>
To: Radu Rendec <rrendec@...hat.com>, Thomas Gleixner <tglx@...utronix.de>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org, Brian Masney <bmasney@...hat.com>,
Eric Chanudet <echanude@...hat.com>
Subject: Re: [PATCH 1/1] samples: Add irqchip test driver
Hi Radu,
kernel test robot noticed the following build errors:
[auto build test ERROR on linus/master]
[also build test ERROR on v6.17-rc7 next-20250925]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Radu-Rendec/samples-Add-irqchip-test-driver/20250924-073245
base: linus/master
patch link: https://lore.kernel.org/r/20250923232905.1510547-2-rrendec%40redhat.com
patch subject: [PATCH 1/1] samples: Add irqchip test driver
config: i386-randconfig-015-20250926 (https://download.01.org/0day-ci/archive/20250926/202509260730.o2TJUGJS-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250926/202509260730.o2TJUGJS-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509260730.o2TJUGJS-lkp@intel.com/
All errors (new ones prefixed by >>):
>> samples/irqchip/irqc_test.c:187:10: error: use of undeclared identifier 'irq_domain_free_irqs_common'; did you mean 'irq_domain_free_irqs'?
187 | .free = irq_domain_free_irqs_common,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| irq_domain_free_irqs
include/linux/irqdomain.h:651:20: note: 'irq_domain_free_irqs' declared here
651 | static inline void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs) { }
| ^
>> samples/irqchip/irqc_test.c:186:3: error: field designator 'alloc' does not refer to any field in type 'const struct irq_domain_ops'
186 | .alloc = root_alloc,
| ~^~~~~~~~~~~~~~~~~~
>> samples/irqchip/irqc_test.c:187:3: error: field designator 'free' does not refer to any field in type 'const struct irq_domain_ops'
187 | .free = irq_domain_free_irqs_common,
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> samples/irqchip/irqc_test.c:188:3: error: field designator 'translate' does not refer to any field in type 'const struct irq_domain_ops'
188 | .translate = irq_domain_translate_onecell,
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> samples/irqchip/irqc_test.c:198:13: error: use of undeclared identifier 'irq_chip_ack_parent'
198 | .irq_ack = irq_chip_ack_parent,
| ^
>> samples/irqchip/irqc_test.c:199:22: error: use of undeclared identifier 'irq_chip_set_affinity_parent'; did you mean 'irq_set_affinity_hint'?
199 | .irq_set_affinity = irq_chip_set_affinity_parent,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| irq_set_affinity_hint
include/linux/interrupt.h:404:19: note: 'irq_set_affinity_hint' declared here
404 | static inline int irq_set_affinity_hint(unsigned int irq,
| ^
>> samples/irqchip/irqc_test.c:219:19: error: no member named 'parent' in 'struct irq_domain'
219 | .fwnode = irqd->parent->fwnode,
| ~~~~ ^
>> samples/irqchip/irqc_test.c:236:20: error: no member named 'parent_data' in 'struct irq_data'
236 | virq + i, d, d->parent_data);
| ~ ^
include/linux/printk.h:587:34: note: expanded from macro 'pr_info'
587 | printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
| ^~~~~~~~~~~
include/linux/printk.h:514:60: note: expanded from macro 'printk'
514 | #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~
include/linux/printk.h:486:19: note: expanded from macro 'printk_index_wrap'
486 | _p_func(_fmt, ##__VA_ARGS__); \
| ^~~~~~~~~~~
>> samples/irqchip/irqc_test.c:237:3: error: call to undeclared function 'irq_domain_set_hwirq_and_chip'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
237 | irq_domain_set_hwirq_and_chip(irqd, virq + i, hwirq + i,
| ^
>> samples/irqchip/irqc_test.c:256:9: error: call to undeclared function 'irq_domain_alloc_irqs_parent'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
256 | return irq_domain_alloc_irqs_parent(irqd, virq, nr_irqs, &parent_fwspec);
| ^
samples/irqchip/irqc_test.c:256:9: note: did you mean 'irq_domain_alloc_irqs'?
include/linux/irqdomain.h:645:19: note: 'irq_domain_alloc_irqs' declared here
645 | static inline int irq_domain_alloc_irqs(struct irq_domain *domain, unsigned int nr_irqs,
| ^
samples/irqchip/irqc_test.c:269:10: error: use of undeclared identifier 'irq_domain_free_irqs_common'; did you mean 'irq_domain_free_irqs'?
269 | .free = irq_domain_free_irqs_common,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| irq_domain_free_irqs
include/linux/irqdomain.h:651:20: note: 'irq_domain_free_irqs' declared here
651 | static inline void irq_domain_free_irqs(unsigned int virq, unsigned int nr_irqs) { }
| ^
samples/irqchip/irqc_test.c:268:3: error: field designator 'alloc' does not refer to any field in type 'const struct irq_domain_ops'
268 | .alloc = hier_alloc,
| ~^~~~~~~~~~~~~~~~~~
samples/irqchip/irqc_test.c:269:3: error: field designator 'free' does not refer to any field in type 'const struct irq_domain_ops'
269 | .free = irq_domain_free_irqs_common,
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
samples/irqchip/irqc_test.c:270:3: error: field designator 'translate' does not refer to any field in type 'const struct irq_domain_ops'
270 | .translate = irq_domain_translate_onecell,
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> samples/irqchip/irqc_test.c:438:14: error: call to undeclared function 'irq_domain_create_hierarchy'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
438 | hier_irqd = irq_domain_create_hierarchy(root_irqd, 0, NUM_TOTAL_IRQS_HIER,
| ^
samples/irqchip/irqc_test.c:438:14: note: did you mean 'irq_domain_create_legacy'?
include/linux/irqdomain.h:324:20: note: 'irq_domain_create_legacy' declared here
324 | struct irq_domain *irq_domain_create_legacy(struct fwnode_handle *fwnode, unsigned int size,
| ^
>> samples/irqchip/irqc_test.c:438:12: error: incompatible integer to pointer conversion assigning to 'struct irq_domain *' from 'int' [-Wint-conversion]
438 | hier_irqd = irq_domain_create_hierarchy(root_irqd, 0, NUM_TOTAL_IRQS_HIER,
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
439 | hier_fwnode, &hier_ops, NULL);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 errors generated.
vim +187 samples/irqchip/irqc_test.c
166
167 /*
168 * Parent IRQ domains *must* use the new API (i.e. alloc/free vs. map) to
169 * support hierarchy, for the following reasons:
170 * - The child .alloc() function calls irq_domain_alloc_irqs_parent().
171 * - The irq_domain_alloc_irqs_hierarchy() is just a thin wrapper around
172 * irq_domain_alloc_irqs_hierarchy().
173 * - Finally, irq_domain_alloc_irqs_hierarchy() explicitly checks that
174 * the (parent) domain implements the alloc() function and returns an
175 * error otherwise.
176 *
177 * Furthermore, Documentation/core-api/irq/irq-domain.rst clearly states that
178 * the new API must be used for all domains to support hierarchy.
179 *
180 * Note: The .free() function is also part of the new API and is mandatory but
181 * there is a default implementation that we can use. If we do not
182 * implement this function and .alloc() fails for whatever reason, we get
183 * an oops as the IRQ framework tries to rollback whatever has been done.
184 */
185 static const struct irq_domain_ops root_ops = {
> 186 .alloc = root_alloc,
> 187 .free = irq_domain_free_irqs_common,
> 188 .translate = irq_domain_translate_onecell,
189 };
190
191 /*
192 * Since hierarchical interrupts are mapped 1:1 in all domains along the path,
193 * CPU affinity is not shared with other interrupts. Use the parent handlers to
194 * set the affinity in the root domain.
195 */
196 static const struct irq_chip hier_chip = {
197 .name = "TEST-HIER-IC",
> 198 .irq_ack = irq_chip_ack_parent,
> 199 .irq_set_affinity = irq_chip_set_affinity_parent,
200 };
201
202 /*
203 * For a GPIO IRQ chip, this is gpiochip_hierarchy_irq_domain_alloc(), and the
204 * ops pointer is set in gpiochip_hierarchy_setup_domain_ops(), called from
205 * gpiochip_hierarchy_add_domain(). See full stack sample below in testirq_init().
206 *
207 * This function is called indirectly by irq_create_fwspec_mapping() through
208 * irq_domain_alloc_irqs_locked().
209 *
210 * How to search for other examples:
211 * grep -rn '\.alloc\>' drivers/gpio/
212 * grep -rn '\<irq_domain_alloc_irqs_parent\>' drivers/irqchip/
213 */
214 static int hier_alloc(struct irq_domain *irqd, unsigned int virq,
215 unsigned int nr_irqs, void *data)
216 {
217 struct irq_fwspec *fwspec = data;
218 struct irq_fwspec parent_fwspec = {
> 219 .fwnode = irqd->parent->fwnode,
220 .param_count = 1,
221 };
222 irq_hw_number_t hwirq;
223 unsigned int type;
224 int ret, i;
225
226 pr_info("[%s] virq = %u, nr_irqs = %u\n", irqd->name, virq, nr_irqs);
227
228 ret = irq_domain_translate_onecell(irqd, fwspec, &hwirq, &type);
229 if (ret)
230 return ret;
231
232 for (i = 0; i < nr_irqs; i++) {
233 struct irq_data *d = irq_get_irq_data(virq + i);
234
235 pr_info("\tvirq = %u, data = %pS, parent = %pS\n",
> 236 virq + i, d, d->parent_data);
> 237 irq_domain_set_hwirq_and_chip(irqd, virq + i, hwirq + i,
238 &hier_chip, NULL);
239 }
240
241 /*
242 * We're not done yet, we still need to allocate interrupts in the
243 * parent domain. If we just "return 0" at this point, the upstream
244 * call to irq_create_fwspec_mapping() fails with -EINVAL.
245 *
246 * By now, the framework has already allocated a struct irq_data for
247 * each virq, for both our domain (hier) and the parent domain (root).
248 * So, irq_get_irq_data(virq) and irq_get_irq_data(virq)->parent_data
249 * are both non-null. The problem is that parent_data->chip is NULL,
250 * and this fails the sanity checks in irq_domain_trim_hierarchy()
251 * (called from irq_domain_alloc_irqs_locked()).
252 */
253
254 parent_fwspec.param[0] = hwirq;
255
> 256 return irq_domain_alloc_irqs_parent(irqd, virq, nr_irqs, &parent_fwspec);
257 }
258
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists