Skip to contentSkip to conversation

mailbox: zynqmp: Remove invalid __percpu annotation in zynqmp_ipi_probe()

PATCH In review Uros Bizjak 3 participants 5 messages Dec 14, 2024 – Jan 16, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mailbox: zynqmp: Remove invalid __percpu annotation in zynqmp_ipi_probe()

struct zynqmp_ipi_pdata __percpu *pdata is not a per-cpu variable, so it should not be annotated with __percpu annotation.

Remove invalid __percpu annotation to fix several

zynqmp-ipi-mailbox.c:920:15: warning: incorrect type in assignment (different address spaces)
zynqmp-ipi-mailbox.c:920:15: expected struct zynqmp_ipi_pdata [noderef] __percpu *pdata
zynqmp-ipi-mailbox.c:920:15: got void *
zynqmp-ipi-mailbox.c:927:56: warning: incorrect type in argument 3 (different address spaces)
zynqmp-ipi-mailbox.c:927:56: expected unsigned int [usertype] *out_value
zynqmp-ipi-mailbox.c:927:56: got unsigned int [noderef] __percpu *
...

and several

drivers/mailbox/zynqmp-ipi-mailbox.c:924:9: warning: dereference of noderef expression
...

sparse warnings.

There were no changes in the resulting object file.

Fixes 6ffb1635341b ("mailbox: zynqmp: handle SGI for shared IPI")
Cc Jassi Brar <[email protected]>
Cc Michal Simek <[email protected]>
Cc Tanmay Shah <[email protected]>

---
v2: - Fix typo in commit message
- Add Fixes and Cc: stable.

---
 drivers/mailbox/zynqmp-ipi-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/zynqmp-ipi-mailbox.c +1 -1
index aa5249da59b2..0c143beaafda 100644
@@ -905,7 +905,7 @@ static int zynqmp_ipi_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct device_node *nc, *np = pdev->dev.of_node;
-	struct zynqmp_ipi_pdata __percpu *pdata;
+	struct zynqmp_ipi_pdata *pdata;
 	struct of_phandle_args out_irq;
 	struct zynqmp_ipi_mbox *mbox;
 	int num_mboxes, ret = -EINVAL;
Signature · 1 line
2.42.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 40 lines · Uros Bizjak

struct zynqmp_ipi_pdata __percpu *pdata is not a per-cpu variable, so it should not be annotated with __percpu annotation.

Remove invalid __percpu annotation to fix several

zynqmp-ipi-mailbox.c:920:15: warning: incorrect type in assignment (different address spaces)
zynqmp-ipi-mailbox.c:920:15: expected struct zynqmp_ipi_pdata [noderef] __percpu *pdata
zynqmp-ipi-mailbox.c:920:15: got void *
zynqmp-ipi-mailbox.c:927:56: warning: incorrect type in argument 3 (different address spaces)
zynqmp-ipi-mailbox.c:927:56: expected unsigned int [usertype] *out_value
zynqmp-ipi-mailbox.c:927:56: got unsigned int [noderef] __percpu *
...

and several

drivers/mailbox/zynqmp-ipi-mailbox.c:924:9: warning: dereference of noderef expression
...

sparse warnings.

There were no changes in the resulting object file.

Fixes 6ffb1635341b ("mailbox: zynqmp: handle SGI for shared IPI")
Cc Jassi Brar <[email protected]>
Cc Michal Simek <[email protected]>
Cc Tanmay Shah <[email protected]>

---
v2: - Fix typo in commit message
- Add Fixes and Cc: stable.

---
  drivers/mailbox/zynqmp-ipi-mailbox.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/zynqmp-ipi-mailbox.c +0 -0
index aa5249da59b2..0c143beaafda 100644

drivers/mailbox/zynqmp-ipi-mailbox.c static int zynqmp_ipi_probe(struct platform_device *pdev) · line 911

Quoted 8 lines
drivers/mailbox/zynqmp-ipi-mailbox.c +1 -1
@@ -905,7 +905,7 @@ static int zynqmp_ipi_probe(struct platform_device *pdev)
  {
  	struct device *dev = &pdev->dev;
  	struct device_node *nc, *np = pdev->dev.of_node;
-	struct zynqmp_ipi_pdata __percpu *pdata;
+	struct zynqmp_ipi_pdata *pdata;
  	struct of_phandle_args out_irq;
  	struct zynqmp_ipi_mbox *mbox;
  	int num_mboxes, ret = -EINVAL;

Tanmay: Please take a look

I think this patch is correct. Pdata structure is allocated only once not for every CPU and marking here is not correct. Information from zynqmp_ipi_pdata are likely fixed and the same for every CPU. Only IRQ handling is done per cpu basis but that's it.

Thanks,
Michal

Reviewed-by
#2 lore raw
Quoted 62 lines · Michal Simek
Quoted 48 lines · Uros Bizjak

struct zynqmp_ipi_pdata __percpu *pdata is not a per-cpu variable, so it should not be annotated with __percpu annotation.

Remove invalid __percpu annotation to fix several

zynqmp-ipi-mailbox.c:920:15: warning: incorrect type in assignment (different address spaces) zynqmp-ipi-mailbox.c:920:15:    expected struct zynqmp_ipi_pdata [noderef] __percpu *pdata zynqmp-ipi-mailbox.c:920:15:    got void *
zynqmp-ipi-mailbox.c:927:56: warning: incorrect type in argument 3 (different address spaces) zynqmp-ipi-mailbox.c:927:56:    expected unsigned int [usertype] *out_value zynqmp-ipi-mailbox.c:927:56:    got unsigned int [noderef] __percpu *
...

and several

drivers/mailbox/zynqmp-ipi-mailbox.c:924:9: warning: dereference of noderef expression
...

sparse warnings.

There were no changes in the resulting object file.

Fixes 6ffb1635341b ("mailbox: zynqmp: handle SGI for shared IPI")
Cc Jassi Brar <[email protected]>
Cc Michal Simek <[email protected]>
Cc Tanmay Shah <[email protected]>

---
v2: - Fix typo in commit message
     - Add Fixes and Cc: stable.
---
  drivers/mailbox/zynqmp-ipi-mailbox.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/zynqmp-ipi-mailbox.c +1 -1
index aa5249da59b2..0c143beaafda 100644
@@ -905,7 +905,7 @@ static int zynqmp_ipi_probe(struct platform_device 
 *pdev)
   {
       struct device *dev = &pdev->dev;
       struct device_node *nc, *np = pdev->dev.of_node;
-    struct zynqmp_ipi_pdata __percpu *pdata;
+    struct zynqmp_ipi_pdata *pdata;
       struct of_phandle_args out_irq;
       struct zynqmp_ipi_mbox *mbox;
Quoted 1 line

      int num_mboxes, ret = -EINVAL;

Tanmay: Please take a look

I think this patch is correct. Pdata structure is allocated only once not for every CPU and marking here is not correct. Information from zynqmp_ipi_pdata are likely fixed and the same for every CPU. Only IRQ handling is done per cpu basis but that's it.

Thanks,
Michal

#3 lore raw
Quoted 2 lines · Tanmay Shah

Is there anything else expected from me to move this patch forward?

Uros.

Quoted 74 lines · Michal Simek
Quoted 71 lines · Uros Bizjak
Quoted 54 lines

struct zynqmp_ipi_pdata __percpu *pdata is not a per-cpu variable, so it should not be annotated with __percpu annotation.

Remove invalid __percpu annotation to fix several

zynqmp-ipi-mailbox.c:920:15: warning: incorrect type in assignment (different address spaces)
zynqmp-ipi-mailbox.c:920:15: expected struct zynqmp_ipi_pdata
[noderef] __percpu *pdata
zynqmp-ipi-mailbox.c:920:15: got void *
zynqmp-ipi-mailbox.c:927:56: warning: incorrect type in argument 3 (different address spaces)
zynqmp-ipi-mailbox.c:927:56: expected unsigned int [usertype]
*out_value
zynqmp-ipi-mailbox.c:927:56: got unsigned int [noderef] __percpu *
...

and several

drivers/mailbox/zynqmp-ipi-mailbox.c:924:9: warning: dereference of noderef expression
...

sparse warnings.

There were no changes in the resulting object file.

Fixes 6ffb1635341b ("mailbox: zynqmp: handle SGI for shared IPI")
Cc Jassi Brar <[email protected]>
Cc Michal Simek <[email protected]>
Cc Tanmay Shah <[email protected]>

---
v2: - Fix typo in commit message
- Add Fixes and Cc: stable.

---
  drivers/mailbox/zynqmp-ipi-mailbox.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/ renamed from drivers/mailbox/zynqmp-ipi-mailbox.c +0 -0

zynqmp-ipi-mailbox.c
index aa5249da59b2..0c143beaafda 100644

drivers/mailbox/zynqmp-ipi-mailbox.c +1 -1
@@ -905,7 +905,7 @@ static int zynqmp_ipi_probe(struct platform_device
 *pdev)
  {
      struct device *dev = &pdev->dev;
      struct device_node *nc, *np = pdev->dev.of_node;
-    struct zynqmp_ipi_pdata __percpu *pdata;
+    struct zynqmp_ipi_pdata *pdata;
      struct of_phandle_args out_irq;
      struct zynqmp_ipi_mbox *mbox;
Quoted 1 line
      int num_mboxes, ret = -EINVAL;

Tanmay: Please take a look

I think this patch is correct. Pdata structure is allocated only once not for every CPU and marking here is not correct. Information from zynqmp_ipi_pdata are likely fixed and the same for every CPU. Only IRQ handling is done per cpu basis but that's it.

Thanks,
Michal

#4 lore raw
Quoted 8 lines · Uros Bizjak
Quoted 2 lines · Tanmay Shah

Is there anything else expected from me to move this patch forward?

Uros.

Not from my side. I am not sure workflow for this subsystem but, I believe this needs RB from Jassi. (subsystem maintainer).

Quoted 74 lines
Quoted 74 lines · Michal Simek
Quoted 71 lines · Uros Bizjak
Quoted 54 lines

struct zynqmp_ipi_pdata __percpu *pdata is not a per-cpu variable, so it should not be annotated with __percpu annotation.

Remove invalid __percpu annotation to fix several

zynqmp-ipi-mailbox.c:920:15: warning: incorrect type in assignment (different address spaces)
zynqmp-ipi-mailbox.c:920:15: expected struct zynqmp_ipi_pdata
[noderef] __percpu *pdata
zynqmp-ipi-mailbox.c:920:15: got void *
zynqmp-ipi-mailbox.c:927:56: warning: incorrect type in argument 3 (different address spaces)
zynqmp-ipi-mailbox.c:927:56: expected unsigned int [usertype]
*out_value
zynqmp-ipi-mailbox.c:927:56: got unsigned int [noderef] __percpu *
...

and several

drivers/mailbox/zynqmp-ipi-mailbox.c:924:9: warning: dereference of noderef expression
...

sparse warnings.

There were no changes in the resulting object file.

Fixes 6ffb1635341b ("mailbox: zynqmp: handle SGI for shared IPI")
Cc Jassi Brar <[email protected]>
Cc Michal Simek <[email protected]>
Cc Tanmay Shah <[email protected]>

---
v2: - Fix typo in commit message
- Add Fixes and Cc: stable.

---
   drivers/mailbox/zynqmp-ipi-mailbox.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/ renamed from drivers/mailbox/zynqmp-ipi-mailbox.c +0 -0

zynqmp-ipi-mailbox.c
index aa5249da59b2..0c143beaafda 100644

drivers/mailbox/zynqmp-ipi-mailbox.c +1 -1
@@ -905,7 +905,7 @@ static int zynqmp_ipi_probe(struct platform_device
 *pdev)
   {
       struct device *dev = &pdev->dev;
       struct device_node *nc, *np = pdev->dev.of_node;
-    struct zynqmp_ipi_pdata __percpu *pdata;
+    struct zynqmp_ipi_pdata *pdata;
       struct of_phandle_args out_irq;
       struct zynqmp_ipi_mbox *mbox;
Quoted 1 line
       int num_mboxes, ret = -EINVAL;

Tanmay: Please take a look

I think this patch is correct. Pdata structure is allocated only once not for every CPU and marking here is not correct. Information from zynqmp_ipi_pdata are likely fixed and the same for every CPU. Only IRQ handling is done per cpu basis but that's it.

Thanks,
Michal