Re: [PATCH v4 3/9] usb: cdns3: imx: add glue layer runtime pm implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peter,

I love your patch! Perhaps something to improve:

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on balbi-usb/testing/next shawnguo/for-next v5.8-rc3 next-20200703]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Peter-Chen/usb-some-PM-changes-for-cdns3-and-xhci-plat/20200703-143054
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: ia64-randconfig-s031-20200705 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.2-3-gfa153962-dirty
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=ia64 

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


sparse warnings: (new ones prefixed by >>)

>> drivers/usb/cdns3/cdns3-imx.c:256:38: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __iomem *otg_regs @@     got struct cdns3_otg_common_regs *otg_regs @@
>> drivers/usb/cdns3/cdns3-imx.c:256:38: sparse:     expected void [noderef] __iomem *otg_regs
>> drivers/usb/cdns3/cdns3-imx.c:256:38: sparse:     got struct cdns3_otg_common_regs *otg_regs
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@     expected unsigned int [usertype] value @@     got restricted __le32 [usertype] @@
   include/asm-generic/io.h:225:22: sparse:     expected unsigned int [usertype] value
   include/asm-generic/io.h:225:22: sparse:     got restricted __le32 [usertype]
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
   include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32

vim +256 drivers/usb/cdns3/cdns3-imx.c

   249	
   250	static int cdns_imx_platform_suspend(struct device *dev,
   251			bool suspend, bool wakeup)
   252	{
   253		struct cdns3 *cdns = dev_get_drvdata(dev);
   254		struct device *parent = dev->parent;
   255		struct cdns_imx *data = dev_get_drvdata(parent);
 > 256		void __iomem *otg_regs = cdns->otg_regs;
   257		void __iomem *xhci_regs = cdns->xhci_regs;
   258		u32 value;
   259		int ret = 0;
   260	
   261		if (cdns->role != USB_ROLE_HOST)
   262			return 0;
   263	
   264		if (suspend) {
   265			/* SW request low power when all usb ports allow to it ??? */
   266			value = readl(xhci_regs + XECP_PM_PMCSR);
   267			value &= ~PS_MASK;
   268			value |= PS_D1;
   269			writel(value, xhci_regs + XECP_PM_PMCSR);
   270	
   271			/* mdctrl_clk_sel */
   272			value = cdns_imx_readl(data, USB3_CORE_CTRL1);
   273			value |= MDCTRL_CLK_SEL;
   274			cdns_imx_writel(data, USB3_CORE_CTRL1, value);
   275	
   276			/* wait for mdctrl_clk_status */
   277			value = cdns_imx_readl(data, USB3_CORE_STATUS);
   278			ret = readl_poll_timeout(data->noncore + USB3_CORE_STATUS, value,
   279				(value & MDCTRL_CLK_STATUS) == MDCTRL_CLK_STATUS,
   280				10, 100000);
   281			if (ret)
   282				dev_warn(parent, "wait mdctrl_clk_status timeout\n");
   283	
   284			/* wait lpm_clk_req to be 0 */
   285			value = cdns_imx_readl(data, USB3_INT_REG);
   286			ret = readl_poll_timeout(data->noncore + USB3_INT_REG, value,
   287				(value & LPM_CLK_REQ) != LPM_CLK_REQ,
   288				10, 100000);
   289			if (ret)
   290				dev_warn(parent, "wait lpm_clk_req timeout\n");
   291	
   292			/* wait phy_refclk_req to be 0 */
   293			value = cdns_imx_readl(data, USB3_SSPHY_STATUS);
   294			ret = readl_poll_timeout(data->noncore + USB3_SSPHY_STATUS, value,
   295				(value & PHY_REFCLK_REQ) != PHY_REFCLK_REQ,
   296				10, 100000);
   297			if (ret)
   298				dev_warn(parent, "wait phy_refclk_req timeout\n");
   299	
   300			cdns3_set_wakeup(data, wakeup);
   301		} else {
   302			cdns3_set_wakeup(data, false);
   303	
   304			/* SW request D0 */
   305			value = readl(xhci_regs + XECP_PM_PMCSR);
   306			value &= ~PS_MASK;
   307			value |= PS_D0;
   308			writel(value, xhci_regs + XECP_PM_PMCSR);
   309	
   310			/* clr CFG_RXDET_P3_EN */
   311			value = readl(xhci_regs + XECP_AUX_CTRL_REG1);
   312			value &= ~CFG_RXDET_P3_EN;
   313			writel(value, xhci_regs + XECP_AUX_CTRL_REG1);
   314	
   315			/* clear mdctrl_clk_sel */
   316			value = cdns_imx_readl(data, USB3_CORE_CTRL1);
   317			value &= ~MDCTRL_CLK_SEL;
   318			cdns_imx_writel(data, USB3_CORE_CTRL1, value);
   319	
   320			/* wait CLK_125_REQ to be 1 */
   321			value = cdns_imx_readl(data, USB3_INT_REG);
   322			ret = readl_poll_timeout(data->noncore + USB3_INT_REG, value,
   323				(value & CLK_125_REQ) == CLK_125_REQ,
   324				10, 100000);
   325			if (ret)
   326				dev_warn(parent, "wait CLK_125_REQ timeout\n");
   327	
   328			/* wait for mdctrl_clk_status is cleared */
   329			value = cdns_imx_readl(data, USB3_CORE_STATUS);
   330			ret = readl_poll_timeout(data->noncore + USB3_CORE_STATUS, value,
   331				(value & MDCTRL_CLK_STATUS) != MDCTRL_CLK_STATUS,
   332				10, 100000);
   333			if (ret)
   334				dev_warn(parent, "wait mdctrl_clk_status cleared timeout\n");
   335	
   336			/* Wait until OTG_NRDY is 0 */
   337			value = readl(otg_regs + OTGSTS);
   338			ret = readl_poll_timeout(otg_regs + OTGSTS, value,
   339				(value & OTG_NRDY) != OTG_NRDY,
   340				10, 100000);
   341			if (ret)
   342				dev_warn(parent, "wait OTG ready timeout\n");
   343		}
   344	
   345		return ret;
   346	

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux