drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c:1403:12: warning: stack frame size of 1088 bytes in function 'cdns_mhdp_link_up'

From: kernel test robot
Date: Sun Feb 28 2021 - 02:39:35 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5695e51619745d4fe3ec2506a2f0cd982c5e27a4
commit: fb43aa0acdfd600c75b8c877bdf9f6e9893ffc9b drm: bridge: Add support for Cadence MHDP8546 DPI/DP bridge
date: 5 months ago
config: powerpc-randconfig-r026-20210228 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project e0b1df924ae06d6d88582334087d2eacc6702e8f)
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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fb43aa0acdfd600c75b8c877bdf9f6e9893ffc9b
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout fb43aa0acdfd600c75b8c877bdf9f6e9893ffc9b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc

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

All warnings (new ones prefixed by >>):

In file included from drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c:26:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:43:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insb, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:95:1: note: expanded from here
__do_insb
^
arch/powerpc/include/asm/io.h:541:56: note: expanded from macro '__do_insb'
#define __do_insb(p, b, n) readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c:26:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:97:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:542:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c:26:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:99:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:543:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c:26:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:101:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:544:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c:26:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:103:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:545:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c:26:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:604:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:601:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:105:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:546:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
>> drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c:1403:12: warning: stack frame size of 1088 bytes in function 'cdns_mhdp_link_up' [-Wframe-larger-than=]
static int cdns_mhdp_link_up(struct cdns_mhdp_device *mhdp)
^
7 warnings generated.

Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for HOTPLUG_CPU
Depends on SMP && (PPC_PSERIES || PPC_PMAC || PPC_POWERNV || FSL_SOC_BOOKE
Selected by
- PM_SLEEP_SMP && SMP && (ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE && PM_SLEEP


vim +/cdns_mhdp_link_up +1403 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c

1402
> 1403 static int cdns_mhdp_link_up(struct cdns_mhdp_device *mhdp)
1404 {
1405 u8 dpcd[DP_RECEIVER_CAP_SIZE], amp[2];
1406 u32 resp, interval, interval_us;
1407 u8 ext_cap_chk = 0;
1408 unsigned int addr;
1409 int err;
1410
1411 WARN_ON(!mutex_is_locked(&mhdp->link_mutex));
1412
1413 drm_dp_dpcd_readb(&mhdp->aux, DP_TRAINING_AUX_RD_INTERVAL,
1414 &ext_cap_chk);
1415
1416 if (ext_cap_chk & DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT)
1417 addr = DP_DP13_DPCD_REV;
1418 else
1419 addr = DP_DPCD_REV;
1420
1421 err = drm_dp_dpcd_read(&mhdp->aux, addr, dpcd, DP_RECEIVER_CAP_SIZE);
1422 if (err < 0) {
1423 dev_err(mhdp->dev, "Failed to read receiver capabilities\n");
1424 return err;
1425 }
1426
1427 mhdp->link.revision = dpcd[0];
1428 mhdp->link.rate = drm_dp_bw_code_to_link_rate(dpcd[1]);
1429 mhdp->link.num_lanes = dpcd[2] & DP_MAX_LANE_COUNT_MASK;
1430
1431 if (dpcd[2] & DP_ENHANCED_FRAME_CAP)
1432 mhdp->link.capabilities |= DP_LINK_CAP_ENHANCED_FRAMING;
1433
1434 dev_dbg(mhdp->dev, "Set sink device power state via DPCD\n");
1435 cdns_mhdp_link_power_up(&mhdp->aux, &mhdp->link);
1436
1437 cdns_mhdp_fill_sink_caps(mhdp, dpcd);
1438
1439 mhdp->link.rate = cdns_mhdp_max_link_rate(mhdp);
1440 mhdp->link.num_lanes = cdns_mhdp_max_num_lanes(mhdp);
1441
1442 /* Disable framer for link training */
1443 err = cdns_mhdp_reg_read(mhdp, CDNS_DP_FRAMER_GLOBAL_CONFIG, &resp);
1444 if (err < 0) {
1445 dev_err(mhdp->dev,
1446 "Failed to read CDNS_DP_FRAMER_GLOBAL_CONFIG %d\n",
1447 err);
1448 return err;
1449 }
1450
1451 resp &= ~CDNS_DP_FRAMER_EN;
1452 cdns_mhdp_reg_write(mhdp, CDNS_DP_FRAMER_GLOBAL_CONFIG, resp);
1453
1454 /* Spread AMP if required, enable 8b/10b coding */
1455 amp[0] = cdns_mhdp_get_ssc_supported(mhdp) ? DP_SPREAD_AMP_0_5 : 0;
1456 amp[1] = DP_SET_ANSI_8B10B;
1457 drm_dp_dpcd_write(&mhdp->aux, DP_DOWNSPREAD_CTRL, amp, 2);
1458
1459 if (mhdp->host.fast_link & mhdp->sink.fast_link) {
1460 dev_err(mhdp->dev, "fastlink not supported\n");
1461 return -EOPNOTSUPP;
1462 }
1463
1464 interval = dpcd[DP_TRAINING_AUX_RD_INTERVAL] & DP_TRAINING_AUX_RD_MASK;
1465 interval_us = cdns_mhdp_get_training_interval_us(mhdp, interval);
1466 if (!interval_us ||
1467 cdns_mhdp_link_training(mhdp, interval_us)) {
1468 dev_err(mhdp->dev, "Link training failed. Exiting.\n");
1469 return -EIO;
1470 }
1471
1472 mhdp->link_up = true;
1473
1474 return 0;
1475 }
1476

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

Attachment: .config.gz
Description: application/gzip