Re: [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU

kernel test robot
2025-12-13T06:23:13Z

Hi Thomas,

kernel test robot noticed the following build errors:

[auto build test ERROR on d358e5254674b70f34c847715ca509e46eb81e6f]

url: https://github.com/intel-lab-lkp/linux/commits/Thomas-Perrot-Schneider-Electric/dt-bindings-vendor-prefixes-Add-AAEON-vendor-prefix/20251212-154458
base: d358e5254674b70f34c847715ca509e46eb81e6f
patch link: https://lore.kernel.org/r/20251212-dev-b4-aaeon-mcu-driver-v1-6-6bd65bc8ef12%40bootlin.com
patch subject: [PATCH 6/8] gpio: aaeon: Add GPIO driver for SRG-IMX8PL MCU
config: arc-randconfig-r132-20251213 (https://download.01.org/0day-ci/archive/20251213/202512131342.1nkKkryD-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251213/202512131342.1nkKkryD-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/202512131342.1nkKkryD-lkp@intel.com/

All errors (new ones prefixed by >>):

`.exit.text' referenced in section `__jump_table' of lib/test_dynamic_debug.o: defined in discarded section `.exit.text' of lib/test_dynamic_debug.o
`.exit.text' referenced in section `__jump_table' of lib/test_dynamic_debug.o: defined in discarded section `.exit.text' of lib/test_dynamic_debug.o
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.o: in function `aaeon_mcu_gpio_get':
>> drivers/gpio/gpio-aaeon-mcu.c:124:(.text+0x4c): undefined reference to `aaeon_mcu_i2c_xfer'
>> arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.c:124:(.text+0x4c): undefined reference to `aaeon_mcu_i2c_xfer'
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.o: in function `aaeon_mcu_gpio_set':
drivers/gpio/gpio-aaeon-mcu.c:139:(.text+0x100): undefined reference to `aaeon_mcu_i2c_xfer'
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.c:139:(.text+0x100): undefined reference to `aaeon_mcu_i2c_xfer'
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.c:150:(.text+0x172): undefined reference to `aaeon_mcu_i2c_xfer'
arc-linux-ld: drivers/gpio/gpio-aaeon-mcu.o:drivers/gpio/gpio-aaeon-mcu.c:150: more undefined references to `aaeon_mcu_i2c_xfer' follow
`.exit.text' referenced in section `__jump_table' of drivers/target/target_core_configfs.o: defined in discarded section `.exit.text' of drivers/target/target_core_configfs.o
`.exit.text' referenced in section `__jump_table' of drivers/target/target_core_configfs.o: defined in discarded section `.exit.text' of drivers/target/target_core_configfs.o

sparse warnings: (new ones prefixed by >>)
>> drivers/gpio/gpio-aaeon-mcu.c:246:1: sparse: sparse: bad integer constant expression
drivers/gpio/gpio-aaeon-mcu.c:246:1: sparse: sparse: static assertion failed: "MODULE_INFO(description, ...) contains embedded NUL byte"
drivers/gpio/gpio-aaeon-mcu.c:247:1: sparse: sparse: bad integer constant expression
drivers/gpio/gpio-aaeon-mcu.c:247:1: sparse: sparse: static assertion failed: "MODULE_INFO(author, ...) contains embedded NUL byte"
drivers/gpio/gpio-aaeon-mcu.c:248:1: sparse: sparse: bad integer constant expression
drivers/gpio/gpio-aaeon-mcu.c:248:1: sparse: sparse: static assertion failed: "MODULE_INFO(file, ...) contains embedded NUL byte"
drivers/gpio/gpio-aaeon-mcu.c:248:1: sparse: sparse: bad integer constant expression
drivers/gpio/gpio-aaeon-mcu.c:248:1: sparse: sparse: static assertion failed: "MODULE_INFO(license, ...) contains embedded NUL byte"

vim +124 drivers/gpio/gpio-aaeon-mcu.c

110
111 static int aaeon_mcu_gpio_get(struct gpio_chip *gc, unsigned int offset)
112 {
113 struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
114 u8 cmd[3], rsp;
115 int ret;
116
117 if (offset < MAX_GPOS)
118 return test_bit(offset, data->gpo_state);
119
120 cmd[0] = AAEON_MCU_READ_GPIO;
121 cmd[1] = offset - 7;
122 cmd[2] = 0x00;
123
> 124 ret = aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
125 if (ret < 0)
126 return ret;
127
128 return rsp;
129 }
130
131 static int aaeon_mcu_gpo_set_cmd(struct aaeon_mcu_gpio *data, unsigned int offset, int value)
132 {
133 u8 cmd[3], rsp;
134
135 cmd[0] = AAEON_MCU_CONTROL_GPO;
136 cmd[1] = offset + 1;
137 cmd[2] = !!value;
138
139 return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
140 }
141
142 static int aaeon_mcu_gpio_set_cmd(struct aaeon_mcu_gpio *data, unsigned int offset, int value)
143 {
144 u8 cmd[3], rsp;
145
146 cmd[0] = AAEON_MCU_WRITE_GPIO;
147 cmd[1] = offset - 7;
148 cmd[2] = !!value;
149
150 return aaeon_mcu_i2c_xfer(data->mfd->i2c_client, cmd, 3, &rsp, 1);
151 }
152
153 static int aaeon_mcu_gpio_set(struct gpio_chip *gc, unsigned int offset,
154 int value)
155 {
156 struct aaeon_mcu_gpio *data = gpiochip_get_data(gc);
157
158 if (offset < MAX_GPOS) {
159 if (aaeon_mcu_gpo_set_cmd(data, offset, value) == 0)
160 assign_bit(offset, data->gpo_state, value);
161 } else {
162 return aaeon_mcu_gpio_set_cmd(data, offset, value);
163 }
164 return 0;
165 }
166
167 static const struct gpio_chip aaeon_mcu_chip = {
168 .label = "gpio-aaeon-mcu",
169 .owner = THIS_MODULE,
170 .get_direction = aaeon_mcu_gpio_get_direction,
171 .direction_input = aaeon_mcu_gpio_direction_input,
172 .direction_output = aaeon_mcu_gpio_direction_output,
173 .get = aaeon_mcu_gpio_get,
174 .set = aaeon_mcu_gpio_set,
175 .base = -1,
176 .ngpio = MAX_GPOS + MAX_GPIOS,
177 .can_sleep = true,
178 };
179
180 static void aaeon_mcu_gpio_reset(struct aaeon_mcu_gpio *data, struct device *dev)
181 {
182 unsigned int i;
183 int ret;
184
185 /* Reset all GPOs */
186 for (i = 0; i < MAX_GPOS; i++) {
187 ret = aaeon_mcu_gpo_set_cmd(data, i, 0);
188 if (ret < 0)
189 dev_warn(dev, "Failed to reset GPO %u state: %d\n", i, ret);
190 clear_bit(i, data->dir_in);
191 }
192
193 /* Reset all GPIOs */
194 for (i = MAX_GPOS; i < MAX_GPOS + MAX_GPIOS; i++) {
195 ret = aaeon_mcu_gpio_config_input_cmd(data, i);
196 if (ret < 0)
197 dev_warn(dev, "Failed to reset GPIO %u state: %d\n", i, ret);
198 set_bit(i, data->dir_in);
199 }
200 }
201
202 static int aaeon_mcu_gpio_probe(struct platform_device *pdev)
203 {
204 struct aaeon_mcu_dev *mfd = dev_get_drvdata(pdev->dev.parent);
205 struct aaeon_mcu_gpio *data;
206
207 data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
208 if (!data)
209 return -ENOMEM;
210
211 data->mfd = mfd;
212 data->gc = aaeon_mcu_chip;
213 data->gc.parent = &pdev->dev;
214
215 /*
216 * Reset all GPIO states to a known configuration. The MCU does not
217 * reset GPIO state on soft reboot, only on power cycle (hard reboot).
218 * Without this reset, GPIOs would retain their previous state across
219 * reboots, which could lead to unexpected behavior.
220 */
221 aaeon_mcu_gpio_reset(data, &pdev->dev);
222
223 platform_set_drvdata(pdev, data);
224
225 return devm_gpiochip_add_data(&pdev->dev, &data->gc,
226 data);
227 }
228
229 static const struct of_device_id aaeon_mcu_gpio_of_match[] = {
230 { .compatible = "aaeon,srg-imx8pl-gpio" },
231 {},
232 };
233
234 MODULE_DEVICE_TABLE(of, aaeon_mcu_gpio_of_match);
235
236 static struct platform_driver aaeon_mcu_gpio_driver = {
237 .driver = {
238 .name = "aaeon-mcu-gpio",
239 .of_match_table = aaeon_mcu_gpio_of_match,
240 },
241 .probe = aaeon_mcu_gpio_probe,
242 };
243
244 module_platform_driver(aaeon_mcu_gpio_driver);
245
> 246 MODULE_DESCRIPTION("GPIO interface for Aaeon MCU");

--
0-DAY CI Kernel Test Service