[PATCH v7 2/3] drm: bridge: Add support for Cadence MHDP DPI/DP bridge

kernel test robot lkp at intel.com
Wed Jul 22 11:43:16 UTC 2020


Hi Swapnil,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v5.8-rc6 next-20200721]
[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]

url:    https://github.com/0day-ci/linux/commits/Swapnil-Jakhade/drm-Add-support-for-Cadence-MHDP-DPI-DP-bridge-and-J721E-wrapper/20200722-154322
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/bridge/cdns-mhdp-core.c: In function 'cdns_mhdp_fw_activate':
>> drivers/gpu/drm/bridge/cdns-mhdp-core.c:765:10: warning: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744073709551613' to '4294967293' [-Woverflow]
     765 |   writel(~CDNS_APB_INT_MASK_SW_EVENT_INT,
   In file included from include/linux/bits.h:23,
                    from include/linux/bitops.h:5,
                    from include/linux/kernel.h:12,
                    from include/linux/clk.h:13,
                    from drivers/gpu/drm/bridge/cdns-mhdp-core.c:10:
   drivers/gpu/drm/bridge/cdns-mhdp-core.c: In function 'cdns_mhdp_link_training_init':
   include/linux/bits.h:26:28: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
      26 |   __builtin_constant_p((l) > (h)), (l) > (h), 0)))
         |                            ^
   include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                              ^
   include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
      39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |   ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/bridge/cdns-mhdp-core.h:116:35: note: in expansion of macro 'GENMASK'
     116 | #define CDNS_DP_LANE_EN_LANES(x)  GENMASK((x) - 1, 0)
         |                                   ^~~~~~~
   drivers/gpu/drm/bridge/cdns-mhdp-core.c:888:8: note: in expansion of macro 'CDNS_DP_LANE_EN_LANES'
     888 |        CDNS_DP_LANE_EN_LANES(mhdp->link.num_lanes));
         |        ^~~~~~~~~~~~~~~~~~~~~
   include/linux/bits.h:26:40: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
      26 |   __builtin_constant_p((l) > (h)), (l) > (h), 0)))
         |                                        ^
   include/linux/build_bug.h:16:62: note: in definition of macro 'BUILD_BUG_ON_ZERO'
      16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
         |                                                              ^
   include/linux/bits.h:39:3: note: in expansion of macro 'GENMASK_INPUT_CHECK'
      39 |  (GENMASK_INPUT_CHECK(h, l) + __GENMASK(h, l))
         |   ^~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/bridge/cdns-mhdp-core.h:116:35: note: in expansion of macro 'GENMASK'
     116 | #define CDNS_DP_LANE_EN_LANES(x)  GENMASK((x) - 1, 0)
         |                                   ^~~~~~~
   drivers/gpu/drm/bridge/cdns-mhdp-core.c:888:8: note: in expansion of macro 'CDNS_DP_LANE_EN_LANES'
     888 |        CDNS_DP_LANE_EN_LANES(mhdp->link.num_lanes));
         |        ^~~~~~~~~~~~~~~~~~~~~
   drivers/gpu/drm/bridge/cdns-mhdp-core.c: In function 'cdns_mhdp_fill_host_caps':
   drivers/gpu/drm/bridge/cdns-mhdp-core.c:1378:2: error: implicit declaration of function 'phy_get_attrs'; did you mean 'vfs_getattr'? [-Werror=implicit-function-declaration]
    1378 |  phy_get_attrs(mhdp->phy, &attrs);
         |  ^~~~~~~~~~~~~
         |  vfs_getattr
   drivers/gpu/drm/bridge/cdns-mhdp-core.c:1384:19: error: 'struct phy_attrs' has no member named 'max_link_rate'
    1384 |  link_rate = attrs.max_link_rate;
         |                   ^
   drivers/gpu/drm/bridge/cdns-mhdp-core.c: In function 'cdns_mhdp_attach':
   drivers/gpu/drm/bridge/cdns-mhdp-core.c:1709:10: warning: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744073709551613' to '4294967293' [-Woverflow]
    1709 |   writel(~CDNS_APB_INT_MASK_SW_EVENT_INT,
   drivers/gpu/drm/bridge/cdns-mhdp-core.c: In function 'cdns_mhdp_validate_mode_params':
   drivers/gpu/drm/bridge/cdns-mhdp-core.c:2077:16: warning: variable 'pxlfmt' set but not used [-Wunused-but-set-variable]
    2077 |  u32 bpp, bpc, pxlfmt;
         |                ^~~~~~
   drivers/gpu/drm/bridge/cdns-mhdp-core.c:2077:11: warning: variable 'bpc' set but not used [-Wunused-but-set-variable]
    2077 |  u32 bpp, bpc, pxlfmt;
         |           ^~~
   drivers/gpu/drm/bridge/cdns-mhdp-core.c: In function 'cdns_mhdp_irq_handler':
   drivers/gpu/drm/bridge/cdns-mhdp-core.c:2285:6: warning: variable 'apb_stat' set but not used [-Wunused-but-set-variable]
    2285 |  u32 apb_stat, sw_ev0;
         |      ^~~~~~~~
   cc1: some warnings being treated as errors

vim +765 drivers/gpu/drm/bridge/cdns-mhdp-core.c

   686	
   687	static int cdns_mhdp_fw_activate(const struct firmware *fw,
   688					 struct cdns_mhdp_device *mhdp)
   689	{
   690		unsigned int reg;
   691		int ret = 0;
   692	
   693		dev_dbg(mhdp->dev, "%s\n", __func__);
   694	
   695		if (!fw || !fw->data) {
   696			dev_err(mhdp->dev, "%s: No firmware.\n", __func__);
   697			return -EINVAL;
   698		}
   699	
   700		spin_lock(&mhdp->start_lock);
   701		if (mhdp->hw_state != MHDP_HW_INACTIVE) {
   702			spin_unlock(&mhdp->start_lock);
   703			if (mhdp->hw_state != MHDP_HW_STOPPED)
   704				dev_err(mhdp->dev, "%s: Bad HW state: %d\n",
   705					__func__, mhdp->hw_state);
   706			return -EBUSY;
   707		}
   708		mhdp->hw_state = MHDP_HW_LOADING;
   709		spin_unlock(&mhdp->start_lock);
   710	
   711		/* Release uCPU reset and stall it. */
   712		writel(CDNS_CPU_STALL, mhdp->regs + CDNS_APB_CTRL);
   713	
   714		memcpy_toio(mhdp->regs + CDNS_MHDP_IMEM, fw->data, fw->size);
   715	
   716		/* Leave debug mode, release stall */
   717		writel(0, mhdp->regs + CDNS_APB_CTRL);
   718	
   719		/*
   720		 * Wait for the KEEP_ALIVE "message" on the first 8 bits.
   721		 * Updated each sched "tick" (~2ms)
   722		 */
   723		ret = readl_poll_timeout(mhdp->regs + CDNS_KEEP_ALIVE, reg,
   724					 reg & CDNS_KEEP_ALIVE_MASK, 500,
   725					 CDNS_KEEP_ALIVE_TIMEOUT);
   726		if (ret) {
   727			dev_err(mhdp->dev,
   728				"device didn't give any life sign: reg %d\n", reg);
   729			goto error;
   730		}
   731	
   732		ret = cdns_mhdp_check_fw_version(mhdp);
   733		if (ret)
   734			goto error;
   735	
   736		/* Init events to 0 as it's not cleared by FW at boot but on read */
   737		readl(mhdp->regs + CDNS_SW_EVENT0);
   738		readl(mhdp->regs + CDNS_SW_EVENT1);
   739		readl(mhdp->regs + CDNS_SW_EVENT2);
   740		readl(mhdp->regs + CDNS_SW_EVENT3);
   741	
   742		/* Activate uCPU */
   743		ret = cdns_mhdp_set_firmware_active(mhdp, true);
   744		if (ret) {
   745			dev_err(mhdp->dev, "%s: Failed to activate FW: %d\n",
   746				__func__, ret);
   747			goto error;
   748		}
   749	
   750		spin_lock(&mhdp->start_lock);
   751	
   752		mhdp->hw_state = MHDP_HW_READY;
   753		wake_up(&fw_load_wq);
   754		/*
   755		 * Here we must keep the lock while enabling the interrupts
   756		 * since it would otherwise be possible that interrupt enable
   757		 * code is executed after the bridge is detached. The similar
   758		 * situation is not possible in attach()/detach() callbacks
   759		 * since the hw_state changes from MHDP_HW_READY to
   760		 * MHDP_HW_STOPPED happens only due to driver removal when
   761		 * bridge should already be detached.
   762		 */
   763		if (mhdp->bridge_attached)
   764			/* enable SW event interrupts */
 > 765			writel(~CDNS_APB_INT_MASK_SW_EVENT_INT,
   766			       mhdp->regs + CDNS_APB_INT_MASK);
   767	
   768		spin_unlock(&mhdp->start_lock);
   769	
   770		dev_dbg(mhdp->dev, "DP FW activated\n");
   771	
   772		return 0;
   773	error:
   774		spin_lock(&mhdp->start_lock);
   775		mhdp->hw_state = MHDP_HW_INACTIVE;
   776		spin_unlock(&mhdp->start_lock);
   777	
   778		return ret;
   779	}
   780	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 75856 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200722/a6c6faa1/attachment-0001.gz>


More information about the dri-devel mailing list