drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c:96:50: sparse: sparse: cast removes address space '__iomem' of expression
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi lkp experts,
Quoted 38 lines · Zhang Rui
Quoted 37 lines · Chen Yu
Quoted 35 lines · Srinivas Pandruvada
Quoted 34 lines · Chen Yu
Quoted 13 lines · Srinivas Pandruvada
-------- Forwarded Message --------
From: kernel test robot <[email protected]>
To: Srinivas Pandruvada <[email protected]>"sparse warnings: (new ones prefixed by >>)"
Quoted 5 lines
Quoted 5 lines
drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c:
96:5
0: sparse: sparse: cast removes address space '__iomem' of expressionQuoted 5 lines
100 rapl_mmio_priv.reg_unit = (u64)proc_priv-Quoted 1 line
mmio_base+
rapl_regs->reg_unit;The reason for this warning is because
proc_priv->mmio_baseis of__iomem
attribute that can be used by sparse to detect if there is ilegal access(only
device memory region is legal). Removing this attribute would cause
potential
problems. A clean fix would be changing rapl_mmio_priv.reg_unit to
void*__iomem
and remove the (u64) cast, but that would also involve changes in structrapl_if_priv
and structreg_action. What do you think, Rui?
Quoted 10 lines
Quoted 8 lines
And if within this code we know it is a safe cast, the following change
might help to prevent parse from complaining:(quoted diff) +0
-1- rapl_mmio_priv.reg_unit = (u64)proc_priv->mmio_base +
rapl_regs->reg_unit;(quoted diff) +1
-0+ rapl_mmio_priv.reg_unit = (u64 __force)proc_priv->mmio_base +
rapl_regs->reg_unit;we can check with LKP team tomorrow.
It looks like we could not reproduce this sparse issue locally, but it should be a valid report. May I know how we can verify in lkp that a fix works(suppose we propose a patch)?
thanks,
Chenyu
Quoted 2 lines
thanks,
rui
Quoted 54 lines · Chen Yu
Hi lkp experts,
Quoted 52 lines · Zhang Rui
Quoted 51 lines · Chen Yu
Quoted 34 lines · Srinivas Pandruvada
Quoted 33 lines · Chen Yu
Quoted 15 lines · Srinivas Pandruvada
-------- Forwarded Message --------
From: kernel test robot <[email protected]>
To: Srinivas Pandruvada <
srinivas.pandruvada(a)linux.intel.com>"sparse warnings: (new ones prefixed by >>)"
Quoted 7 lines
Quoted 7 lines
drivers/thermal/intel/int340x_thermal/processor_thermal_rapl.c:
96:5
0: sparse: sparse: cast removes address space '__iomem' of
expressionQuoted 6 lines
100 rapl_mmio_priv.reg_unit = (u64)proc_priv-Quoted 1 line
mmio_base+
rapl_regs->reg_unit;The reason for this warning is because
proc_priv->mmio_baseis of__iomem
attribute that can be used by sparse to detect if there is ilegal
access(only
device memory region is legal). Removing this attribute would cause
potentialQuoted 8 lines
Quoted 8 lines
problems. A clean fix would be changing rapl_mmio_priv.reg_unit
to
void*__iomem
and remove the (u64) cast, but that would also involve changes in
structrapl_if_priv
and structreg_action. What do you think, Rui?And if within this code we know it is a safe cast, the following change
might help to prevent parse from complaining:
- rapl_mmio_priv.reg_unit = (u64)proc_priv->mmio_base +rapl_regs->reg_unit;
+ rapl_mmio_priv.reg_unit = (u64 __force)proc_priv-
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
mmio_base+
rapl_regs->reg_unit;we can check with LKP team tomorrow.
It looks like we could not reproduce this sparse issue locally, but it should be a valid report. May I know how we can verify in lkp that a fix works(suppose we propose a patch)?
With 0.6.3 version of sparse this issue can be reproduced.
Thanks,
Srinivas
Quoted 5 lines
thanks,
ChenyuQuoted 2 lines
thanks,
rui