Re: [PATCH 04/13] a2b: add AD24xx I2C interface driver

kernel test robot
2024-05-18T12:57:20Z

Hi Alvin,

kernel test robot noticed the following build errors:

[auto build test ERROR on c75962170e49f24399141276ae119e6a879f36dc]

url: https://github.com/intel-lab-lkp/linux/commits/Alvin-ipraga/a2b-add-A2B-driver-core/20240517-211849
base: c75962170e49f24399141276ae119e6a879f36dc
patch link: https://lore.kernel.org/r/20240517-a2b-v1-4-b8647554c67b%40bang-olufsen.dk
patch subject: [PATCH 04/13] a2b: add AD24xx I2C interface driver
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240518/202405182015.49MmB9gp-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240518/202405182015.49MmB9gp-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405182015.49MmB9gp-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/a2b/ad24xx-i2c.c:272:3: error: call to undeclared function 'handle_nested_irq'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
272 | handle_nested_irq(virq);
| ^
>> drivers/a2b/ad24xx-i2c.c:281:26: error: call to undeclared function 'irq_data_get_irq_chip_data'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
281 | struct ad24xx_i2c *ad = irq_data_get_irq_chip_data(irq_data);
| ^
>> drivers/a2b/ad24xx-i2c.c:281:21: error: incompatible integer to pointer conversion initializing 'struct ad24xx_i2c *' with an expression of type 'int' [-Wint-conversion]
281 | struct ad24xx_i2c *ad = irq_data_get_irq_chip_data(irq_data);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/a2b/ad24xx-i2c.c:282:34: error: incomplete definition of type 'struct irq_data'
282 | irq_hw_number_t hwirq = irq_data->hwirq;
| ~~~~~~~~^
include/linux/irqdomain.h:44:8: note: forward declaration of 'struct irq_data'
44 | struct irq_data;
| ^
drivers/a2b/ad24xx-i2c.c:289:26: error: call to undeclared function 'irq_data_get_irq_chip_data'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
289 | struct ad24xx_i2c *ad = irq_data_get_irq_chip_data(irq_data);
| ^
drivers/a2b/ad24xx-i2c.c:289:21: error: incompatible integer to pointer conversion initializing 'struct ad24xx_i2c *' with an expression of type 'int' [-Wint-conversion]
289 | struct ad24xx_i2c *ad = irq_data_get_irq_chip_data(irq_data);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/a2b/ad24xx-i2c.c:290:34: error: incomplete definition of type 'struct irq_data'
290 | irq_hw_number_t hwirq = irq_data->hwirq;
| ~~~~~~~~^
include/linux/irqdomain.h:44:8: note: forward declaration of 'struct irq_data'
44 | struct irq_data;
| ^
>> drivers/a2b/ad24xx-i2c.c:295:30: error: variable has incomplete type 'const struct irq_chip'
295 | static const struct irq_chip ad24xx_i2c_irq_chip = {
| ^
include/linux/irqdomain.h:43:8: note: forward declaration of 'struct irq_chip'
43 | struct irq_chip;
| ^
>> drivers/a2b/ad24xx-i2c.c:304:2: error: call to undeclared function 'irq_set_chip_data'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
304 | irq_set_chip_data(irq, irqdomain->host_data);
| ^
>> drivers/a2b/ad24xx-i2c.c:305:2: error: call to undeclared function 'irq_set_chip_and_handler'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
305 | irq_set_chip_and_handler(irq, &ad24xx_i2c_irq_chip, handle_simple_irq);
| ^
>> drivers/a2b/ad24xx-i2c.c:305:54: error: use of undeclared identifier 'handle_simple_irq'
305 | irq_set_chip_and_handler(irq, &ad24xx_i2c_irq_chip, handle_simple_irq);
| ^
>> drivers/a2b/ad24xx-i2c.c:306:2: error: call to undeclared function 'irq_set_nested_thread'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
306 | irq_set_nested_thread(irq, 1);
| ^
>> drivers/a2b/ad24xx-i2c.c:307:2: error: call to undeclared function 'irq_set_noprobe'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
307 | irq_set_noprobe(irq);
| ^
drivers/a2b/ad24xx-i2c.c:315:2: error: call to undeclared function 'irq_set_nested_thread'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
315 | irq_set_nested_thread(irq, 0);
| ^
drivers/a2b/ad24xx-i2c.c:316:2: error: call to undeclared function 'irq_set_chip_and_handler'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
316 | irq_set_chip_and_handler(irq, NULL, NULL);
| ^
drivers/a2b/ad24xx-i2c.c:317:2: error: call to undeclared function 'irq_set_chip_data'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
317 | irq_set_chip_data(irq, NULL);
| ^
16 errors generated.

vim +/handle_nested_irq +272 drivers/a2b/ad24xx-i2c.c

218
219 static irqreturn_t ad24xx_i2c_irq_handler(int irq, void *data)
220 {
221 struct ad24xx_i2c *ad = data;
222 bool handled = false;
223 unsigned long hwirq;
224 unsigned int val;
225 unsigned int virq;
226 int ret;
227
228 /*
229 * The transceiver asserts the IRQ line as long as there are pending
230 * interrupts. Process them all here so that the interrupt can be
231 * configured with an edge trigger.
232 */
233 while (true) {
234 mutex_lock(&ad->mutex);
235 ret = regmap_read(ad->base_regmap, A2B_INTSRC, &val);
236 mutex_unlock(&ad->mutex);
237 if (ret) {
238 dev_err_ratelimited(
239 ad->dev,
240 "failed to read interrupt source: %d\n", ret);
241 break;
242 }
243
244 if (val & A2B_INTSRC_MSTINT_MASK)
245 hwirq = 0;
246 else if (val & A2B_INTSRC_SLVINT_MASK)
247 hwirq = (val & A2B_INTSRC_INODE_MASK) + 1;
248 else
249 break;
250
251 /*
252 * Pending interrupts are only cleared when reading the
253 * interrupt type. Normally this is done in the corresponding
254 * node's interrupt handler, but in case the interrupt is
255 * disabled, it has to be read here.
256 */
257 if (!(BIT(hwirq) & ad->irqs_enabled)) {
258 ret = ad24xx_i2c_get_inttype(&ad->a2b_bus, &val);
259 if (ret)
260 dev_err_ratelimited(
261 ad->dev,
262 "failed to read interrupt type: %d\n",
263 ret);
264 handled = true;
265 continue;
266 }
267
268 virq = irq_find_mapping(ad->irqdomain, hwirq);
269 if (!virq)
270 break;
271
> 272 handle_nested_irq(virq);
273 handled = true;
274 }
275
276 return handled ? IRQ_HANDLED : IRQ_NONE;
277 }
278
279 static void ad24xx_i2c_irq_enable(struct irq_data *irq_data)
280 {
> 281 struct ad24xx_i2c *ad = irq_data_get_irq_chip_data(irq_data);
> 282 irq_hw_number_t hwirq = irq_data->hwirq;
283
284 ad->irqs_enabled |= BIT(hwirq);
285 }
286
287 static void ad24xx_i2c_irq_disable(struct irq_data *irq_data)
288 {
289 struct ad24xx_i2c *ad = irq_data_get_irq_chip_data(irq_data);
290 irq_hw_number_t hwirq = irq_data->hwirq;
291
292 ad->irqs_enabled &= ~BIT(hwirq);
293 }
294
> 295 static const struct irq_chip ad24xx_i2c_irq_chip = {
296 .name = "ad24xx-i2c",
297 .irq_enable = ad24xx_i2c_irq_enable,
298 .irq_disable = ad24xx_i2c_irq_disable,
299 };
300
301 static int ad24xx_i2c_irqdomain_map(struct irq_domain *irqdomain,
302 unsigned int irq, irq_hw_number_t hwirq)
303 {
> 304 irq_set_chip_data(irq, irqdomain->host_data);
> 305 irq_set_chip_and_handler(irq, &ad24xx_i2c_irq_chip, handle_simple_irq);
> 306 irq_set_nested_thread(irq, 1);
> 307 irq_set_noprobe(irq);
308
309 return 0;
310 }
311

--
0-DAY CI Kernel Test Service