tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: a2b4d661a5ca59dd7cf972c1cce8b98422102ab7 commit: fe4466c05ba70c2e354965de9548eb4ab5db783b [2508/2508] usb: cdns3: Add support for DRD CDNSP config: x86_64-randconfig-123-20241130 (https://download.01.org/0day-ci/archive/20241201/202412010531.vH1SzpcJ-lkp@i...) compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241201/202412010531.vH1SzpcJ-lkp@i...)
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/202412010531.vH1SzpcJ-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/usb/cdns3/drd.c:44:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [noderef] [usertype] __iomem *override_reg @@ got restricted __le32 * @@
drivers/usb/cdns3/drd.c:44:38: sparse: expected unsigned int [noderef] [usertype] __iomem *override_reg drivers/usb/cdns3/drd.c:44:38: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:46:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [noderef] [usertype] __iomem *override_reg @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:46:38: sparse: expected unsigned int [noderef] [usertype] __iomem *override_reg drivers/usb/cdns3/drd.c:46:38: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:48:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [noderef] [usertype] __iomem *override_reg @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:48:38: sparse: expected unsigned int [noderef] [usertype] __iomem *override_reg drivers/usb/cdns3/drd.c:48:38: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:67:50: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:67:50: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:67:50: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:69:50: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:69:50: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:69:50: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:92:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:92:25: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:92:25: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:102:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:102:30: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:102:30: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:135:24: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:135:24: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:135:24: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:145:48: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:145:48: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:145:48: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:161:21: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:161:21: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:161:21: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:169:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:169:15: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:169:15: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:169:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:169:15: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:169:15: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:189:21: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:189:21: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:189:21: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:192:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:192:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:192:9: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:192:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:192:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:192:9: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:211:47: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:211:47: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:211:47: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:220:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:220:15: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:220:15: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:220:15: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:220:15: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:220:15: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:246:21: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:246:21: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:246:21: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:248:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:248:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:248:9: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:248:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:248:9: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:248:9: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:266:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:266:25: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:266:25: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:335:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:335:26: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:335:26: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:354:25: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:354:25: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:354:25: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:377:27: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdns3_otg_legacy_regs *otg_v0_regs @@ got void [noderef] __iomem *[assigned] regs @@ drivers/usb/cdns3/drd.c:377:27: sparse: expected struct cdns3_otg_legacy_regs *otg_v0_regs drivers/usb/cdns3/drd.c:377:27: sparse: got void [noderef] __iomem *[assigned] regs drivers/usb/cdns3/drd.c:378:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:378:25: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:378:25: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:382:32: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdns3_otg_common_regs *otg_regs @@ got void [noderef] __iomem *[assigned] regs @@ drivers/usb/cdns3/drd.c:382:32: sparse: expected struct cdns3_otg_common_regs *otg_regs drivers/usb/cdns3/drd.c:382:32: sparse: got void [noderef] __iomem *[assigned] regs drivers/usb/cdns3/drd.c:385:32: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:385:32: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:385:32: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:386:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:386:17: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:386:17: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:390:35: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdns3_otg_regs *otg_v1_regs @@ got void [noderef] __iomem *[assigned] regs @@ drivers/usb/cdns3/drd.c:390:35: sparse: expected struct cdns3_otg_regs *otg_v1_regs drivers/usb/cdns3/drd.c:390:35: sparse: got void [noderef] __iomem *[assigned] regs
drivers/usb/cdns3/drd.c:391:38: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct cdnsp_otg_regs *otg_cdnsp_regs @@ got void [noderef] __iomem *[assigned] regs @@
drivers/usb/cdns3/drd.c:391:38: sparse: expected struct cdnsp_otg_regs *otg_cdnsp_regs drivers/usb/cdns3/drd.c:391:38: sparse: got void [noderef] __iomem *[assigned] regs
drivers/usb/cdns3/drd.c:395:41: sparse: sparse: restricted __le32 degrades to integer
drivers/usb/cdns3/drd.c:402:40: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:402:40: sparse: expected void volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:402:40: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:406:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:406:17: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:406:17: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:406:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:406:17: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:406:17: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:411:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:411:17: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:411:17: sparse: got restricted __le32 * drivers/usb/cdns3/drd.c:440:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got restricted __le32 * @@ drivers/usb/cdns3/drd.c:440:28: sparse: expected void const volatile [noderef] __iomem *addr drivers/usb/cdns3/drd.c:440:28: sparse: got restricted __le32 *
vim +44 drivers/usb/cdns3/drd.c
22 23 /** 24 * cdns3_set_mode - change mode of OTG Core 25 * @cdns: pointer to context structure 26 * @mode: selected mode from cdns_role 27 * 28 * Returns 0 on success otherwise negative errno 29 */ 30 static int cdns3_set_mode(struct cdns3 *cdns, enum usb_dr_mode mode) 31 { 32 u32 __iomem *override_reg; 33 u32 reg; 34 35 switch (mode) { 36 case USB_DR_MODE_PERIPHERAL: 37 break; 38 case USB_DR_MODE_HOST: 39 break; 40 case USB_DR_MODE_OTG: 41 dev_dbg(cdns->dev, "Set controller to OTG mode\n"); 42 43 if (cdns->version == CDNSP_CONTROLLER_V2)
44 override_reg = &cdns->otg_cdnsp_regs->override;
45 else if (cdns->version == CDNS3_CONTROLLER_V1) 46 override_reg = &cdns->otg_v1_regs->override; 47 else 48 override_reg = &cdns->otg_v0_regs->ctrl1; 49 50 reg = readl(override_reg); 51 52 if (cdns->version != CDNS3_CONTROLLER_V0) 53 reg |= OVERRIDE_IDPULLUP; 54 else 55 reg |= OVERRIDE_IDPULLUP_V0; 56 57 writel(reg, override_reg); 58 59 if (cdns->version == CDNS3_CONTROLLER_V1) { 60 /* 61 * Enable work around feature built into the 62 * controller to address issue with RX Sensitivity 63 * est (EL_17) for USB2 PHY. The issue only occures 64 * for 0x0002450D controller version. 65 */ 66 if (cdns->phyrst_a_enable) { 67 reg = readl(&cdns->otg_v1_regs->phyrst_cfg); 68 reg |= PHYRST_CFG_PHYRST_A_ENABLE; 69 writel(reg, &cdns->otg_v1_regs->phyrst_cfg); 70 } 71 } 72 73 /* 74 * Hardware specification says: "ID_VALUE must be valid within 75 * 50ms after idpullup is set to '1" so driver must wait 76 * 50ms before reading this pin. 77 */ 78 usleep_range(50000, 60000); 79 break; 80 default: 81 dev_err(cdns->dev, "Unsupported mode of operation %d\n", mode); 82 return -EINVAL; 83 } 84 85 return 0; 86 } 87