Re: [PATCH] usb: cdns3: Adds missing __iomem markers

2021-01-11 Thread Peter Chen
On 21-01-11 09:20:31, Pawel Laszczak wrote:
> Hi Peter,
> 
> What about this patch, can you apply it into for-usb-next ?

Done.

Peter
> 
> Thanks
> Pawel
> 
> >
> >Patch adds missing __iomem markers in core.h file
> >and makes some changes in drd.c file related with
> >these markers.
> >
> >The lack of __iomem has reported by sparse checker
> >on parsic architecture.
> >
> >Signed-off-by: Pawel Laszczak 
> >Reported-by: kernel test robot 
> >---
> > drivers/usb/cdns3/core.h | 12 ++--
> > drivers/usb/cdns3/drd.c  | 12 ++--
> > 2 files changed, 12 insertions(+), 12 deletions(-)
> >
> >diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h
> >index f8e350cef699..bfa39795208e 100644
> >--- a/drivers/usb/cdns3/core.h
> >+++ b/drivers/usb/cdns3/core.h
> >@@ -86,12 +86,12 @@ struct cdns {
> > struct resource xhci_res[CDNS_XHCI_RESOURCES_NUM];
> > struct cdns3_usb_regs __iomem   *dev_regs;
> >
> >-struct resource otg_res;
> >-struct cdns3_otg_legacy_regs*otg_v0_regs;
> >-struct cdns3_otg_regs   *otg_v1_regs;
> >-struct cdnsp_otg_regs   *otg_cdnsp_regs;
> >-struct cdns_otg_common_regs *otg_regs;
> >-struct cdns_otg_irq_regs*otg_irq_regs;
> >+struct resource otg_res;
> >+struct cdns3_otg_legacy_regs __iomem*otg_v0_regs;
> >+struct cdns3_otg_regs __iomem   *otg_v1_regs;
> >+struct cdnsp_otg_regs __iomem   *otg_cdnsp_regs;
> >+struct cdns_otg_common_regs __iomem *otg_regs;
> >+struct cdns_otg_irq_reg __iomem *otg_irq_regs;
> > #define CDNS3_CONTROLLER_V0 0
> > #define CDNS3_CONTROLLER_V1 1
> > #define CDNSP_CONTROLLER_V2 2
> >diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c
> >index 605a413db727..0701853b501c 100644
> >--- a/drivers/usb/cdns3/drd.c
> >+++ b/drivers/usb/cdns3/drd.c
> >@@ -27,7 +27,7 @@
> >  */
> > static int cdns_set_mode(struct cdns *cdns, enum usb_dr_mode mode)
> > {
> >-u32 __iomem *override_reg;
> >+void __iomem  *override_reg;
> > u32 reg;
> >
> > switch (mode) {
> >@@ -406,7 +406,7 @@ int cdns_drd_init(struct cdns *cdns)
> > cdns->otg_v1_regs = NULL;
> > cdns->otg_cdnsp_regs = NULL;
> > cdns->otg_regs = regs;
> >-cdns->otg_irq_regs = (struct cdns_otg_irq_regs *)
> >+cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem  *)
> >  >otg_v0_regs->ien;
> > writel(1, >otg_v0_regs->simulate);
> > dev_dbg(cdns->dev, "DRD version v0 (%08x)\n",
> >@@ -416,14 +416,14 @@ int cdns_drd_init(struct cdns *cdns)
> > cdns->otg_v1_regs = regs;
> > cdns->otg_cdnsp_regs = regs;
> >
> >-cdns->otg_regs = (void *)>otg_v1_regs->cmd;
> >+cdns->otg_regs = (void __iomem *)>otg_v1_regs->cmd;
> >
> >-if (cdns->otg_cdnsp_regs->did == OTG_CDNSP_DID) {
> >-cdns->otg_irq_regs = (struct cdns_otg_irq_regs *)
> >+if (readl(cdns->otg_cdnsp_regs->did) == OTG_CDNSP_DID) {
> >+cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem 
> >*)
> >   >otg_cdnsp_regs->ien;
> > cdns->version  = CDNSP_CONTROLLER_V2;
> > } else {
> >-cdns->otg_irq_regs = (struct cdns_otg_irq_regs *)
> >+cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem 
> >*)
> >   >otg_v1_regs->ien;
> > writel(1, >otg_v1_regs->simulate);
> > cdns->version  = CDNS3_CONTROLLER_V1;
> >--
> >2.17.1
> 

-- 

Thanks,
Peter Chen



RE: [PATCH] usb: cdns3: Adds missing __iomem markers

2021-01-11 Thread Pawel Laszczak
Hi Peter,

What about this patch, can you apply it into for-usb-next ?

Thanks
Pawel

>
>Patch adds missing __iomem markers in core.h file
>and makes some changes in drd.c file related with
>these markers.
>
>The lack of __iomem has reported by sparse checker
>on parsic architecture.
>
>Signed-off-by: Pawel Laszczak 
>Reported-by: kernel test robot 
>---
> drivers/usb/cdns3/core.h | 12 ++--
> drivers/usb/cdns3/drd.c  | 12 ++--
> 2 files changed, 12 insertions(+), 12 deletions(-)
>
>diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h
>index f8e350cef699..bfa39795208e 100644
>--- a/drivers/usb/cdns3/core.h
>+++ b/drivers/usb/cdns3/core.h
>@@ -86,12 +86,12 @@ struct cdns {
>   struct resource xhci_res[CDNS_XHCI_RESOURCES_NUM];
>   struct cdns3_usb_regs __iomem   *dev_regs;
>
>-  struct resource otg_res;
>-  struct cdns3_otg_legacy_regs*otg_v0_regs;
>-  struct cdns3_otg_regs   *otg_v1_regs;
>-  struct cdnsp_otg_regs   *otg_cdnsp_regs;
>-  struct cdns_otg_common_regs *otg_regs;
>-  struct cdns_otg_irq_regs*otg_irq_regs;
>+  struct resource otg_res;
>+  struct cdns3_otg_legacy_regs __iomem*otg_v0_regs;
>+  struct cdns3_otg_regs __iomem   *otg_v1_regs;
>+  struct cdnsp_otg_regs __iomem   *otg_cdnsp_regs;
>+  struct cdns_otg_common_regs __iomem *otg_regs;
>+  struct cdns_otg_irq_reg __iomem *otg_irq_regs;
> #define CDNS3_CONTROLLER_V0   0
> #define CDNS3_CONTROLLER_V1   1
> #define CDNSP_CONTROLLER_V2   2
>diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c
>index 605a413db727..0701853b501c 100644
>--- a/drivers/usb/cdns3/drd.c
>+++ b/drivers/usb/cdns3/drd.c
>@@ -27,7 +27,7 @@
>  */
> static int cdns_set_mode(struct cdns *cdns, enum usb_dr_mode mode)
> {
>-  u32 __iomem *override_reg;
>+  void __iomem  *override_reg;
>   u32 reg;
>
>   switch (mode) {
>@@ -406,7 +406,7 @@ int cdns_drd_init(struct cdns *cdns)
>   cdns->otg_v1_regs = NULL;
>   cdns->otg_cdnsp_regs = NULL;
>   cdns->otg_regs = regs;
>-  cdns->otg_irq_regs = (struct cdns_otg_irq_regs *)
>+  cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem  *)
>>otg_v0_regs->ien;
>   writel(1, >otg_v0_regs->simulate);
>   dev_dbg(cdns->dev, "DRD version v0 (%08x)\n",
>@@ -416,14 +416,14 @@ int cdns_drd_init(struct cdns *cdns)
>   cdns->otg_v1_regs = regs;
>   cdns->otg_cdnsp_regs = regs;
>
>-  cdns->otg_regs = (void *)>otg_v1_regs->cmd;
>+  cdns->otg_regs = (void __iomem *)>otg_v1_regs->cmd;
>
>-  if (cdns->otg_cdnsp_regs->did == OTG_CDNSP_DID) {
>-  cdns->otg_irq_regs = (struct cdns_otg_irq_regs *)
>+  if (readl(cdns->otg_cdnsp_regs->did) == OTG_CDNSP_DID) {
>+  cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem 
>*)
> >otg_cdnsp_regs->ien;
>   cdns->version  = CDNSP_CONTROLLER_V2;
>   } else {
>-  cdns->otg_irq_regs = (struct cdns_otg_irq_regs *)
>+  cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem 
>*)
> >otg_v1_regs->ien;
>   writel(1, >otg_v1_regs->simulate);
>   cdns->version  = CDNS3_CONTROLLER_V1;
>--
>2.17.1



Re: [kbuild-all] Re: [PATCH] usb: cdns3: Adds missing __iomem markers

2020-12-15 Thread Rong Chen




On 12/15/20 1:58 PM, Peter Chen wrote:

On 20-12-14 23:35:56, kernel test robot wrote:

Hi Pawel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20201211]
[cannot apply to peter.chen-usb/ci-for-usb-next v5.10 v5.10-rc7 v5.10-rc6 v5.10]

Sorry, I changed the branch name to reflect the branch does not only queue
chipidea USB patches.

next branch: for-usb-next
fixes branch: for-usb-fixes

Peter


Hi Peter,

Thanks for the feedback, we'll update it on the CI system.

Best Regards,
Rong Chen




[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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit-scm.com%2Fdocs%2Fgit-format-patchdata=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Cy3huYNzWiJ57OKmzmaleCT14gcFr8RyYDnqTfZWNG4%3Dreserved=0]

url:
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-ci%2Flinux%2Fcommits%2FPawel-Laszczak%2Fusb-cdns3-Adds-missing-__iomem-markers%2F20201214-205353data=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=x5XoDUUskeGteTFaPjgS24Hrbb712XqMqaIkqwXWu14%3Dreserved=0
base:3cc2bd440f2171f093b3a8480a4b54d8c270ed38
config: riscv-allmodconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
 wget 
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.crossdata=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=jAavg0T3itnjkbHXADvePHHgtYeqiVTBt%2BoatHT0VHU%3Dreserved=0
 -O ~/bin/make.cross
 chmod +x ~/bin/make.cross
 # 
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-ci%2Flinux%2Fcommit%2F315bfcf1e0604de6ecfc1856cf5820876390f16cdata=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=SQ75IXxfld6HMRIFkZ%2F8Z4YqxnFP%2F%2BZ%2BsYZIycNeO%2FA%3Dreserved=0
 git remote add linux-review 
https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-ci%2Flinuxdata=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=ZVS4723WbEO03hbsLXJ%2B%2FmB5EZElulY7lAsMEMatiko%3Dreserved=0
 git fetch --no-tags linux-review 
Pawel-Laszczak/usb-cdns3-Adds-missing-__iomem-markers/20201214-205353
 git checkout 315bfcf1e0604de6ecfc1856cf5820876390f16c
 # save the attached .config to linux build tree
 COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=riscv

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All warnings (new ones prefixed by >>):

In file included from arch/riscv/include/asm/io.h:23,
 from include/linux/io.h:13,
 from include/linux/irq.h:20,
 from include/asm-generic/hardirq.h:17,
 from ./arch/riscv/include/generated/asm/hardirq.h:1,
 from include/linux/hardirq.h:10,
 from include/linux/interrupt.h:11,
 from drivers/usb/cdns3/drd.c:13:
drivers/usb/cdns3/drd.c: In function 'cdns_otg_disable_irq':
drivers/usb/cdns3/drd.c:159:31: error: dereferencing pointer to incomplete 
type 'struct cdns_otg_irq_reg'
  159 |  writel(0, >otg_irq_regs->ien);
  |   ^~
arch/riscv/include/asm/mmio.h:93:76: note: in definition of macro 
'writel_cpu'
   93 | #define writel_cpu(v, c) ((void)__raw_writel((__force 
u32)cpu_to_le32(v), (c)))
  | 
   ^
drivers/usb/cdns3/drd.c:159:2: note: in expansion of macro 'writel'
  159 |  writel(0, >otg_irq_regs->ien);
  |  ^~
drivers/usb/cdns3/drd.c: In function 'cdns_drd_init':
drivers/usb/cdns3/drd.c:409:22: error: assignment to 'struct 
cdns_otg_irq_reg *' from incompatible pointer type 'struct cdns_otg_irq_regs *' 
[-Werror=incompatible-pointer-types]
  409 |   cdns->otg_irq_regs = 

Re: [PATCH] usb: cdns3: Adds missing __iomem markers

2020-12-14 Thread Peter Chen
On 20-12-14 23:35:56, kernel test robot wrote:
> Hi Pawel,
> 
> I love your patch! Perhaps something to improve:
> 
> [auto build test WARNING on next-20201211]
> [cannot apply to peter.chen-usb/ci-for-usb-next v5.10 v5.10-rc7 v5.10-rc6 
> v5.10]

Sorry, I changed the branch name to reflect the branch does not only queue
chipidea USB patches.

next branch: for-usb-next
fixes branch: for-usb-fixes

Peter

> [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://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit-scm.com%2Fdocs%2Fgit-format-patchdata=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=Cy3huYNzWiJ57OKmzmaleCT14gcFr8RyYDnqTfZWNG4%3Dreserved=0]
> 
> url:
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-ci%2Flinux%2Fcommits%2FPawel-Laszczak%2Fusb-cdns3-Adds-missing-__iomem-markers%2F20201214-205353data=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=x5XoDUUskeGteTFaPjgS24Hrbb712XqMqaIkqwXWu14%3Dreserved=0
> base:3cc2bd440f2171f093b3a8480a4b54d8c270ed38
> config: riscv-allmodconfig (attached as .config)
> compiler: riscv64-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
> wget 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.crossdata=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=jAavg0T3itnjkbHXADvePHHgtYeqiVTBt%2BoatHT0VHU%3Dreserved=0
>  -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-ci%2Flinux%2Fcommit%2F315bfcf1e0604de6ecfc1856cf5820876390f16cdata=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=SQ75IXxfld6HMRIFkZ%2F8Z4YqxnFP%2F%2BZ%2BsYZIycNeO%2FA%3Dreserved=0
> git remote add linux-review 
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2F0day-ci%2Flinuxdata=04%7C01%7Cpeter.chen%40nxp.com%7C6ce79474794448ae12b008d8a045f9ce%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637435572341553421%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=ZVS4723WbEO03hbsLXJ%2B%2FmB5EZElulY7lAsMEMatiko%3Dreserved=0
> git fetch --no-tags linux-review 
> Pawel-Laszczak/usb-cdns3-Adds-missing-__iomem-markers/20201214-205353
> git checkout 315bfcf1e0604de6ecfc1856cf5820876390f16c
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
> ARCH=riscv 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot 
> 
> All warnings (new ones prefixed by >>):
> 
>In file included from arch/riscv/include/asm/io.h:23,
> from include/linux/io.h:13,
> from include/linux/irq.h:20,
> from include/asm-generic/hardirq.h:17,
> from ./arch/riscv/include/generated/asm/hardirq.h:1,
> from include/linux/hardirq.h:10,
> from include/linux/interrupt.h:11,
> from drivers/usb/cdns3/drd.c:13:
>drivers/usb/cdns3/drd.c: In function 'cdns_otg_disable_irq':
>drivers/usb/cdns3/drd.c:159:31: error: dereferencing pointer to incomplete 
> type 'struct cdns_otg_irq_reg'
>  159 |  writel(0, >otg_irq_regs->ien);
>  |   ^~
>arch/riscv/include/asm/mmio.h:93:76: note: in definition of macro 
> 'writel_cpu'
>   93 | #define writel_cpu(v, c) ((void)__raw_writel((__force 
> u32)cpu_to_le32(v), (c)))
>  |
> ^
>drivers/usb/cdns3/drd.c:159:2: note: in expansion of macro 'writel'
>  159 |  writel(0, >otg_irq_regs->ien);
>  |  ^~
>drivers/usb/cdns3/drd.c: In function 'cdns_drd_init':
>drivers/usb/cdns3/drd.c:409:22: error: assignment to 'struct 
> cdns_otg_irq_reg *' from incompatible pointer type 'struct cdns_otg_irq_regs 
> *' [-Werror=incompatible-pointer-types]
>  409 |   cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem  *)
>  

Re: [PATCH] usb: cdns3: Adds missing __iomem markers

2020-12-14 Thread kernel test robot
Hi Pawel,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20201211]
[cannot apply to peter.chen-usb/ci-for-usb-next v5.10 v5.10-rc7 v5.10-rc6 v5.10]
[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/Pawel-Laszczak/usb-cdns3-Adds-missing-__iomem-markers/20201214-205353
base:3cc2bd440f2171f093b3a8480a4b54d8c270ed38
config: riscv-allmodconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.0
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
# 
https://github.com/0day-ci/linux/commit/315bfcf1e0604de6ecfc1856cf5820876390f16c
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review 
Pawel-Laszczak/usb-cdns3-Adds-missing-__iomem-markers/20201214-205353
git checkout 315bfcf1e0604de6ecfc1856cf5820876390f16c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All warnings (new ones prefixed by >>):

   In file included from arch/riscv/include/asm/io.h:23,
from include/linux/io.h:13,
from include/linux/irq.h:20,
from include/asm-generic/hardirq.h:17,
from ./arch/riscv/include/generated/asm/hardirq.h:1,
from include/linux/hardirq.h:10,
from include/linux/interrupt.h:11,
from drivers/usb/cdns3/drd.c:13:
   drivers/usb/cdns3/drd.c: In function 'cdns_otg_disable_irq':
   drivers/usb/cdns3/drd.c:159:31: error: dereferencing pointer to incomplete 
type 'struct cdns_otg_irq_reg'
 159 |  writel(0, >otg_irq_regs->ien);
 |   ^~
   arch/riscv/include/asm/mmio.h:93:76: note: in definition of macro 
'writel_cpu'
  93 | #define writel_cpu(v, c) ((void)__raw_writel((__force 
u32)cpu_to_le32(v), (c)))
 |  
  ^
   drivers/usb/cdns3/drd.c:159:2: note: in expansion of macro 'writel'
 159 |  writel(0, >otg_irq_regs->ien);
 |  ^~
   drivers/usb/cdns3/drd.c: In function 'cdns_drd_init':
   drivers/usb/cdns3/drd.c:409:22: error: assignment to 'struct 
cdns_otg_irq_reg *' from incompatible pointer type 'struct cdns_otg_irq_regs *' 
[-Werror=incompatible-pointer-types]
 409 |   cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem  *)
 |  ^
   In file included from include/linux/byteorder/little_endian.h:5,
from arch/riscv/include/uapi/asm/byteorder.h:10,
from include/asm-generic/bitops/le.h:6,
from arch/riscv/include/asm/bitops.h:202,
from include/linux/bitops.h:32,
from include/linux/kernel.h:11,
from drivers/usb/cdns3/drd.c:12:
>> drivers/usb/cdns3/drd.c:421:33: warning: passing argument 1 of '__raw_readl' 
>> makes pointer from integer without a cast [-Wint-conversion]
 421 |   if (readl(cdns->otg_cdnsp_regs->did) == OTG_CDNSP_DID) {
 | ^
 | |
 | __le32 {aka unsigned int}
   include/uapi/linux/byteorder/little_endian.h:34:51: note: in definition of 
macro '__le32_to_cpu'
  34 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
 |   ^
   arch/riscv/include/asm/mmio.h:140:47: note: in expansion of macro 'readl_cpu'
 140 | #define readl(c) ({ u32 __v; __io_br(); __v = readl_cpu(c); 
__io_ar(__v); __v; })
 |   ^
   drivers/usb/cdns3/drd.c:421:7: note: in expansion of macro 'readl'
 421 |   if (readl(cdns->otg_cdnsp_regs->did) == OTG_CDNSP_DID) {
 |   ^
   In file included from arch/riscv/include/asm/io.h:23,
from include/linux/io.h:13,
from include/linux/irq.h:20,
from include/asm-generic/hardirq.h:17,
from ./arch/riscv/include/generated/asm/hardirq.h:1,
from include/linux/hardirq.h:10,
from include/linux/interrupt.h:11,
from drivers/usb/cdns3/drd.c:13:
   arch/riscv/include/asm/mmio.h:63:60: note: expected 'const volatile void *' 
but argument is of type '__le32' {aka 'unsigned int'}
  63 | static inline u32 __raw_readl(const volatile void __iomem *addr)
 |   

[PATCH] usb: cdns3: Adds missing __iomem markers

2020-12-14 Thread Pawel Laszczak
Patch adds missing __iomem markers in core.h file
and makes some changes in drd.c file related with
these markers.

The lack of __iomem has reported by sparse checker
on parsic architecture.

Signed-off-by: Pawel Laszczak 
Reported-by: kernel test robot 
---
 drivers/usb/cdns3/core.h | 12 ++--
 drivers/usb/cdns3/drd.c  | 12 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h
index f8e350cef699..bfa39795208e 100644
--- a/drivers/usb/cdns3/core.h
+++ b/drivers/usb/cdns3/core.h
@@ -86,12 +86,12 @@ struct cdns {
struct resource xhci_res[CDNS_XHCI_RESOURCES_NUM];
struct cdns3_usb_regs __iomem   *dev_regs;
 
-   struct resource otg_res;
-   struct cdns3_otg_legacy_regs*otg_v0_regs;
-   struct cdns3_otg_regs   *otg_v1_regs;
-   struct cdnsp_otg_regs   *otg_cdnsp_regs;
-   struct cdns_otg_common_regs *otg_regs;
-   struct cdns_otg_irq_regs*otg_irq_regs;
+   struct resource otg_res;
+   struct cdns3_otg_legacy_regs __iomem*otg_v0_regs;
+   struct cdns3_otg_regs __iomem   *otg_v1_regs;
+   struct cdnsp_otg_regs __iomem   *otg_cdnsp_regs;
+   struct cdns_otg_common_regs __iomem *otg_regs;
+   struct cdns_otg_irq_reg __iomem *otg_irq_regs;
 #define CDNS3_CONTROLLER_V00
 #define CDNS3_CONTROLLER_V11
 #define CDNSP_CONTROLLER_V22
diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c
index 605a413db727..0701853b501c 100644
--- a/drivers/usb/cdns3/drd.c
+++ b/drivers/usb/cdns3/drd.c
@@ -27,7 +27,7 @@
  */
 static int cdns_set_mode(struct cdns *cdns, enum usb_dr_mode mode)
 {
-   u32 __iomem *override_reg;
+   void __iomem  *override_reg;
u32 reg;
 
switch (mode) {
@@ -406,7 +406,7 @@ int cdns_drd_init(struct cdns *cdns)
cdns->otg_v1_regs = NULL;
cdns->otg_cdnsp_regs = NULL;
cdns->otg_regs = regs;
-   cdns->otg_irq_regs = (struct cdns_otg_irq_regs *)
+   cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem  *)
 >otg_v0_regs->ien;
writel(1, >otg_v0_regs->simulate);
dev_dbg(cdns->dev, "DRD version v0 (%08x)\n",
@@ -416,14 +416,14 @@ int cdns_drd_init(struct cdns *cdns)
cdns->otg_v1_regs = regs;
cdns->otg_cdnsp_regs = regs;
 
-   cdns->otg_regs = (void *)>otg_v1_regs->cmd;
+   cdns->otg_regs = (void __iomem *)>otg_v1_regs->cmd;
 
-   if (cdns->otg_cdnsp_regs->did == OTG_CDNSP_DID) {
-   cdns->otg_irq_regs = (struct cdns_otg_irq_regs *)
+   if (readl(cdns->otg_cdnsp_regs->did) == OTG_CDNSP_DID) {
+   cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem 
*)
  >otg_cdnsp_regs->ien;
cdns->version  = CDNSP_CONTROLLER_V2;
} else {
-   cdns->otg_irq_regs = (struct cdns_otg_irq_regs *)
+   cdns->otg_irq_regs = (struct cdns_otg_irq_regs __iomem 
*)
  >otg_v1_regs->ien;
writel(1, >otg_v1_regs->simulate);
cdns->version  = CDNS3_CONTROLLER_V1;
-- 
2.17.1