drivers/gpu/drm/bridge/sil-sii8620.c:2355: undefined reference to `extcon_unregister_notifier'

From: kernel test robot
Date: Mon Jul 27 2020 - 00:25:22 EST


Hi Masahiro,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 92ed301919932f777713b9172e525674157e983d
commit: def2fbffe62c00c330c7f41584a356001179c59c kconfig: allow symbols implied by y to become m
date: 5 months ago
config: i386-randconfig-r014-20200727 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
git checkout def2fbffe62c00c330c7f41584a356001179c59c
# save the attached .config to linux build tree
make W=1 ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

ld: drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_remove':
>> drivers/gpu/drm/bridge/sil-sii8620.c:2355: undefined reference to `extcon_unregister_notifier'
ld: drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_extcon_init':
>> drivers/gpu/drm/bridge/sil-sii8620.c:2179: undefined reference to `extcon_find_edev_by_node'
>> ld: drivers/gpu/drm/bridge/sil-sii8620.c:2191: undefined reference to `extcon_register_notifier'
ld: drivers/gpu/drm/bridge/sil-sii8620.o: in function `sii8620_extcon_work':
>> drivers/gpu/drm/bridge/sil-sii8620.c:2139: undefined reference to `extcon_get_state'

vim +2355 drivers/gpu/drm/bridge/sil-sii8620.c

688838442147d9 Maciej Purski 2018-02-27 2162
688838442147d9 Maciej Purski 2018-02-27 2163 static int sii8620_extcon_init(struct sii8620 *ctx)
688838442147d9 Maciej Purski 2018-02-27 2164 {
688838442147d9 Maciej Purski 2018-02-27 2165 struct extcon_dev *edev;
688838442147d9 Maciej Purski 2018-02-27 2166 struct device_node *musb, *muic;
688838442147d9 Maciej Purski 2018-02-27 2167 int ret;
688838442147d9 Maciej Purski 2018-02-27 2168
688838442147d9 Maciej Purski 2018-02-27 2169 /* get micro-USB connector node */
688838442147d9 Maciej Purski 2018-02-27 2170 musb = of_graph_get_remote_node(ctx->dev->of_node, 1, -1);
688838442147d9 Maciej Purski 2018-02-27 2171 /* next get micro-USB Interface Controller node */
688838442147d9 Maciej Purski 2018-02-27 2172 muic = of_get_next_parent(musb);
688838442147d9 Maciej Purski 2018-02-27 2173
688838442147d9 Maciej Purski 2018-02-27 2174 if (!muic) {
688838442147d9 Maciej Purski 2018-02-27 2175 dev_info(ctx->dev, "no extcon found, switching to 'always on' mode\n");
688838442147d9 Maciej Purski 2018-02-27 2176 return 0;
688838442147d9 Maciej Purski 2018-02-27 2177 }
688838442147d9 Maciej Purski 2018-02-27 2178
688838442147d9 Maciej Purski 2018-02-27 @2179 edev = extcon_find_edev_by_node(muic);
688838442147d9 Maciej Purski 2018-02-27 2180 of_node_put(muic);
688838442147d9 Maciej Purski 2018-02-27 2181 if (IS_ERR(edev)) {
688838442147d9 Maciej Purski 2018-02-27 2182 if (PTR_ERR(edev) == -EPROBE_DEFER)
688838442147d9 Maciej Purski 2018-02-27 2183 return -EPROBE_DEFER;
688838442147d9 Maciej Purski 2018-02-27 2184 dev_err(ctx->dev, "Invalid or missing extcon\n");
688838442147d9 Maciej Purski 2018-02-27 2185 return PTR_ERR(edev);
688838442147d9 Maciej Purski 2018-02-27 2186 }
688838442147d9 Maciej Purski 2018-02-27 2187
688838442147d9 Maciej Purski 2018-02-27 2188 ctx->extcon = edev;
688838442147d9 Maciej Purski 2018-02-27 2189 ctx->extcon_nb.notifier_call = sii8620_extcon_notifier;
688838442147d9 Maciej Purski 2018-02-27 2190 INIT_WORK(&ctx->extcon_wq, sii8620_extcon_work);
688838442147d9 Maciej Purski 2018-02-27 @2191 ret = extcon_register_notifier(edev, EXTCON_DISP_MHL, &ctx->extcon_nb);
688838442147d9 Maciej Purski 2018-02-27 2192 if (ret) {
688838442147d9 Maciej Purski 2018-02-27 2193 dev_err(ctx->dev, "failed to register notifier for MHL\n");
688838442147d9 Maciej Purski 2018-02-27 2194 return ret;
688838442147d9 Maciej Purski 2018-02-27 2195 }
688838442147d9 Maciej Purski 2018-02-27 2196
688838442147d9 Maciej Purski 2018-02-27 2197 return 0;
688838442147d9 Maciej Purski 2018-02-27 2198 }
688838442147d9 Maciej Purski 2018-02-27 2199
ce6e153f414a73 Andrzej Hajda 2016-10-10 2200 static inline struct sii8620 *bridge_to_sii8620(struct drm_bridge *bridge)
ce6e153f414a73 Andrzej Hajda 2016-10-10 2201 {
ce6e153f414a73 Andrzej Hajda 2016-10-10 2202 return container_of(bridge, struct sii8620, bridge);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2203 }
ce6e153f414a73 Andrzej Hajda 2016-10-10 2204
e25f1f7c94e16d Maciej Purski 2017-08-24 2205 static int sii8620_attach(struct drm_bridge *bridge)
e25f1f7c94e16d Maciej Purski 2017-08-24 2206 {
e25f1f7c94e16d Maciej Purski 2017-08-24 2207 struct sii8620 *ctx = bridge_to_sii8620(bridge);
e25f1f7c94e16d Maciej Purski 2017-08-24 2208
e25f1f7c94e16d Maciej Purski 2017-08-24 2209 sii8620_init_rcp_input_dev(ctx);
e25f1f7c94e16d Maciej Purski 2017-08-24 2210
e25f1f7c94e16d Maciej Purski 2017-08-24 2211 return sii8620_clear_error(ctx);
e25f1f7c94e16d Maciej Purski 2017-08-24 2212 }
e25f1f7c94e16d Maciej Purski 2017-08-24 2213
e25f1f7c94e16d Maciej Purski 2017-08-24 2214 static void sii8620_detach(struct drm_bridge *bridge)
e25f1f7c94e16d Maciej Purski 2017-08-24 2215 {
e25f1f7c94e16d Maciej Purski 2017-08-24 2216 struct sii8620 *ctx = bridge_to_sii8620(bridge);
e25f1f7c94e16d Maciej Purski 2017-08-24 2217
710abfe8ead247 Ronald Tschalär 2019-04-19 2218 if (!IS_ENABLED(CONFIG_RC_CORE))
710abfe8ead247 Ronald Tschalär 2019-04-19 2219 return;
710abfe8ead247 Ronald Tschalär 2019-04-19 2220
e25f1f7c94e16d Maciej Purski 2017-08-24 2221 rc_unregister_device(ctx->rc_dev);
e25f1f7c94e16d Maciej Purski 2017-08-24 2222 }
e25f1f7c94e16d Maciej Purski 2017-08-24 2223
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2224 static int sii8620_is_packing_required(struct sii8620 *ctx,
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2225 const struct drm_display_mode *mode)
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2226 {
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2227 int max_pclk, max_pclk_pp_mode;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2228
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2229 if (sii8620_is_mhl3(ctx)) {
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2230 max_pclk = MHL3_MAX_PCLK;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2231 max_pclk_pp_mode = MHL3_MAX_PCLK_PP_MODE;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2232 } else {
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2233 max_pclk = MHL1_MAX_PCLK;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2234 max_pclk_pp_mode = MHL1_MAX_PCLK_PP_MODE;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2235 }
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2236
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2237 if (mode->clock < max_pclk)
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2238 return 0;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2239 else if (mode->clock < max_pclk_pp_mode)
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2240 return 1;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2241 else
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2242 return -1;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2243 }
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2244
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2245 static enum drm_mode_status sii8620_mode_valid(struct drm_bridge *bridge,
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2246 const struct drm_display_mode *mode)
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2247 {
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2248 struct sii8620 *ctx = bridge_to_sii8620(bridge);
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2249 int pack_required = sii8620_is_packing_required(ctx, mode);
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2250 bool can_pack = ctx->devcap[MHL_DCAP_VID_LINK_MODE] &
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2251 MHL_DCAP_VID_LINK_PPIXEL;
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2252
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2253 switch (pack_required) {
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2254 case 0:
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2255 return MODE_OK;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2256 case 1:
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2257 return (can_pack) ? MODE_OK : MODE_CLOCK_HIGH;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2258 default:
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2259 return MODE_CLOCK_HIGH;
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2260 }
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2261 }
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2262
ce6e153f414a73 Andrzej Hajda 2016-10-10 2263 static bool sii8620_mode_fixup(struct drm_bridge *bridge,
ce6e153f414a73 Andrzej Hajda 2016-10-10 2264 const struct drm_display_mode *mode,
ce6e153f414a73 Andrzej Hajda 2016-10-10 2265 struct drm_display_mode *adjusted_mode)
ce6e153f414a73 Andrzej Hajda 2016-10-10 2266 {
ce6e153f414a73 Andrzej Hajda 2016-10-10 2267 struct sii8620 *ctx = bridge_to_sii8620(bridge);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2268
bf1722cab55a32 Andrzej Hajda 2017-02-01 2269 mutex_lock(&ctx->lock);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2270
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2271 ctx->use_packed_pixel = sii8620_is_packing_required(ctx, adjusted_mode);
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2272
ce6e153f414a73 Andrzej Hajda 2016-10-10 2273 mutex_unlock(&ctx->lock);
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2274
ecba7cfa3afbe4 Maciej Purski 2018-02-02 2275 return true;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2276 }
ce6e153f414a73 Andrzej Hajda 2016-10-10 2277
ce6e153f414a73 Andrzej Hajda 2016-10-10 2278 static const struct drm_bridge_funcs sii8620_bridge_funcs = {
e25f1f7c94e16d Maciej Purski 2017-08-24 2279 .attach = sii8620_attach,
e25f1f7c94e16d Maciej Purski 2017-08-24 2280 .detach = sii8620_detach,
ce6e153f414a73 Andrzej Hajda 2016-10-10 2281 .mode_fixup = sii8620_mode_fixup,
e7c2e4d368e2ef Marek Szyprowski 2017-11-09 2282 .mode_valid = sii8620_mode_valid,
ce6e153f414a73 Andrzej Hajda 2016-10-10 2283 };
ce6e153f414a73 Andrzej Hajda 2016-10-10 2284
ce6e153f414a73 Andrzej Hajda 2016-10-10 2285 static int sii8620_probe(struct i2c_client *client,
ce6e153f414a73 Andrzej Hajda 2016-10-10 2286 const struct i2c_device_id *id)
ce6e153f414a73 Andrzej Hajda 2016-10-10 2287 {
ce6e153f414a73 Andrzej Hajda 2016-10-10 2288 struct device *dev = &client->dev;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2289 struct sii8620 *ctx;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2290 int ret;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2291
ce6e153f414a73 Andrzej Hajda 2016-10-10 2292 ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2293 if (!ctx)
ce6e153f414a73 Andrzej Hajda 2016-10-10 2294 return -ENOMEM;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2295
ce6e153f414a73 Andrzej Hajda 2016-10-10 2296 ctx->dev = dev;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2297 mutex_init(&ctx->lock);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2298 INIT_LIST_HEAD(&ctx->mt_queue);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2299
ce6e153f414a73 Andrzej Hajda 2016-10-10 2300 ctx->clk_xtal = devm_clk_get(dev, "xtal");
ce6e153f414a73 Andrzej Hajda 2016-10-10 2301 if (IS_ERR(ctx->clk_xtal)) {
ce6e153f414a73 Andrzej Hajda 2016-10-10 2302 dev_err(dev, "failed to get xtal clock from DT\n");
ce6e153f414a73 Andrzej Hajda 2016-10-10 2303 return PTR_ERR(ctx->clk_xtal);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2304 }
ce6e153f414a73 Andrzej Hajda 2016-10-10 2305
ce6e153f414a73 Andrzej Hajda 2016-10-10 2306 if (!client->irq) {
ce6e153f414a73 Andrzej Hajda 2016-10-10 2307 dev_err(dev, "no irq provided\n");
ce6e153f414a73 Andrzej Hajda 2016-10-10 2308 return -EINVAL;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2309 }
ce6e153f414a73 Andrzej Hajda 2016-10-10 2310 irq_set_status_flags(client->irq, IRQ_NOAUTOEN);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2311 ret = devm_request_threaded_irq(dev, client->irq, NULL,
ce6e153f414a73 Andrzej Hajda 2016-10-10 2312 sii8620_irq_thread,
ce6e153f414a73 Andrzej Hajda 2016-10-10 2313 IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
ce6e153f414a73 Andrzej Hajda 2016-10-10 2314 "sii8620", ctx);
e0ba12ea5e1329 Andrzej Hajda 2017-02-22 2315 if (ret < 0) {
e0ba12ea5e1329 Andrzej Hajda 2017-02-22 2316 dev_err(dev, "failed to install IRQ handler\n");
e0ba12ea5e1329 Andrzej Hajda 2017-02-22 2317 return ret;
e0ba12ea5e1329 Andrzej Hajda 2017-02-22 2318 }
ce6e153f414a73 Andrzej Hajda 2016-10-10 2319
ce6e153f414a73 Andrzej Hajda 2016-10-10 2320 ctx->gpio_reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2321 if (IS_ERR(ctx->gpio_reset)) {
ce6e153f414a73 Andrzej Hajda 2016-10-10 2322 dev_err(dev, "failed to get reset gpio from DT\n");
ce6e153f414a73 Andrzej Hajda 2016-10-10 2323 return PTR_ERR(ctx->gpio_reset);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2324 }
ce6e153f414a73 Andrzej Hajda 2016-10-10 2325
ce6e153f414a73 Andrzej Hajda 2016-10-10 2326 ctx->supplies[0].supply = "cvcc10";
ce6e153f414a73 Andrzej Hajda 2016-10-10 2327 ctx->supplies[1].supply = "iovcc18";
ce6e153f414a73 Andrzej Hajda 2016-10-10 2328 ret = devm_regulator_bulk_get(dev, 2, ctx->supplies);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2329 if (ret)
ce6e153f414a73 Andrzej Hajda 2016-10-10 2330 return ret;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2331
688838442147d9 Maciej Purski 2018-02-27 2332 ret = sii8620_extcon_init(ctx);
688838442147d9 Maciej Purski 2018-02-27 2333 if (ret < 0) {
688838442147d9 Maciej Purski 2018-02-27 2334 dev_err(ctx->dev, "failed to initialize EXTCON\n");
688838442147d9 Maciej Purski 2018-02-27 2335 return ret;
688838442147d9 Maciej Purski 2018-02-27 2336 }
688838442147d9 Maciej Purski 2018-02-27 2337
ce6e153f414a73 Andrzej Hajda 2016-10-10 2338 i2c_set_clientdata(client, ctx);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2339
ce6e153f414a73 Andrzej Hajda 2016-10-10 2340 ctx->bridge.funcs = &sii8620_bridge_funcs;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2341 ctx->bridge.of_node = dev->of_node;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2342 drm_bridge_add(&ctx->bridge);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2343
688838442147d9 Maciej Purski 2018-02-27 2344 if (!ctx->extcon)
ce6e153f414a73 Andrzej Hajda 2016-10-10 2345 sii8620_cable_in(ctx);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2346
ce6e153f414a73 Andrzej Hajda 2016-10-10 2347 return 0;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2348 }
ce6e153f414a73 Andrzej Hajda 2016-10-10 2349
ce6e153f414a73 Andrzej Hajda 2016-10-10 2350 static int sii8620_remove(struct i2c_client *client)
ce6e153f414a73 Andrzej Hajda 2016-10-10 2351 {
ce6e153f414a73 Andrzej Hajda 2016-10-10 2352 struct sii8620 *ctx = i2c_get_clientdata(client);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2353
688838442147d9 Maciej Purski 2018-02-27 2354 if (ctx->extcon) {
688838442147d9 Maciej Purski 2018-02-27 @2355 extcon_unregister_notifier(ctx->extcon, EXTCON_DISP_MHL,
688838442147d9 Maciej Purski 2018-02-27 2356 &ctx->extcon_nb);
688838442147d9 Maciej Purski 2018-02-27 2357 flush_work(&ctx->extcon_wq);
688838442147d9 Maciej Purski 2018-02-27 2358 if (ctx->cable_state > 0)
688838442147d9 Maciej Purski 2018-02-27 2359 sii8620_cable_out(ctx);
688838442147d9 Maciej Purski 2018-02-27 2360 } else {
688838442147d9 Maciej Purski 2018-02-27 2361 sii8620_cable_out(ctx);
688838442147d9 Maciej Purski 2018-02-27 2362 }
e25f1f7c94e16d Maciej Purski 2017-08-24 2363 drm_bridge_remove(&ctx->bridge);
ce6e153f414a73 Andrzej Hajda 2016-10-10 2364
ce6e153f414a73 Andrzej Hajda 2016-10-10 2365 return 0;
ce6e153f414a73 Andrzej Hajda 2016-10-10 2366 }
ce6e153f414a73 Andrzej Hajda 2016-10-10 2367

:::::: The code at line 2355 was first introduced by commit
:::::: 688838442147d9dd94c2ef7c2c31a35cf150c5fa drm/bridge/sii8620: use micro-USB cable detection logic to detect MHL

:::::: TO: Maciej Purski <m.purski@xxxxxxxxxxx>
:::::: CC: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip