Skip to contentSkip to conversation

irqchip/gic-v3-its: Reference to its_invall_cmd descriptor when building INVALL

PATCH Applied Zenghui Yu 3 participants 3 messages Dec 2, 2019 – Feb 8, 2020

Subsystems (2)
lore
Share & tools
lore

Zenghui Yu

author
#0 lore raw

PATCH 1/1 irqchip/gic-v3-its: Reference to its_invall_cmd descriptor when building INVALL

It looks like an obvious mistake to use its_mapc_cmd descriptor when building the INVALL command block. It so far worked by luck because both its_mapc_cmd.col and its_invall_cmd.col sit at the same offset of the ITS command descriptor, but we should not rely on it.

---
 drivers/irqchip/irq-gic-v3-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +1 -1
index c52cc8d6d6b8..b3fec78b2226 100644
@@ -598,7 +598,7 @@ static struct its_collection *its_build_invall_cmd(struct its_node *its,
 						   struct its_cmd_desc *desc)
 {
 	its_encode_cmd(cmd, GITS_CMD_INVALL);
-	its_encode_collection(cmd, desc->its_mapc_cmd.col->col_id);
+	its_encode_collection(cmd, desc->its_invall_cmd.col->col_id);
 
 	its_fixup_cmd(cmd);
 
Signature · 8 lines
2.19.1



_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#1 lore raw

Hi Zenghui,

Quoted 16 lines · Zenghui Yu

It looks like an obvious mistake to use its_mapc_cmd descriptor when building the INVALL command block. It so far worked by luck because both its_mapc_cmd.col and its_invall_cmd.col sit at the same offset of the ITS command descriptor, but we should not rely on it.

---
 drivers/irqchip/irq-gic-v3-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +0 -0
index c52cc8d6d6b8..b3fec78b2226 100644

drivers/irqchip/irq-gic-v3-its.c static struct its_collection · line 604

Quoted 8 lines
drivers/irqchip/irq-gic-v3-its.c +1 -1
@@ -598,7 +598,7 @@ static struct its_collection
 *its_build_invall_cmd(struct its_node *its,
 						   struct its_cmd_desc *desc)
 {
 	its_encode_cmd(cmd, GITS_CMD_INVALL);
-	its_encode_collection(cmd, desc->its_mapc_cmd.col->col_id);
+	its_encode_collection(cmd, desc->its_invall_cmd.col->col_id);
 
 	its_fixup_cmd(cmd);

Yup, well spotted. Thankfully, there is no impact due to the two structures having similar layouts, but that definitely needs fixing.

I'll queue this for post -rc1.

Thanks,

        M.
Signature · 1 line
Jazz is not dead. It just smells funny...
merge bot Applied
#2 lore raw
In reply to Zenghui Yu
The following commit has been merged into the irq/urgent branch of tip:

The following commit has been merged into the irq/urgent branch of tip:

Commit-ID:     107945227ac5d4c37911c7841b27c64b489ce9a9
Gitweb:        https://git.kernel.org/tip/107945227ac5d4c37911c7841b27c64b489ce9a9
Author:        Zenghui Yu <[email protected]>
AuthorDate:    Mon, 02 Dec 2019 15:10:21 +08:00
Committer:     Marc Zyngier <[email protected]>
CommitterDate: Mon, 03 Feb 2020 10:04:19 

irqchip/gic-v3-its: Reference to its_invall_cmd descriptor when building INVALL

It looks like an obvious mistake to use its_mapc_cmd descriptor when building the INVALL command block. It so far worked by luck because both its_mapc_cmd.col and its_invall_cmd.col sit at the same offset of the ITS command descriptor, but we should not rely on it.

Fixes cc2d3216f53c ("irqchip: GICv3: ITS command queue")
---
 drivers/irqchip/irq-gic-v3-its.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +1 -1
index f717586..e5a25d9 100644
@@ -661,7 +661,7 @@ static struct its_collection *its_build_invall_cmd(struct its_node *its,
 						   struct its_cmd_desc *desc)
 {
 	its_encode_cmd(cmd, GITS_CMD_INVALL);
-	its_encode_collection(cmd, desc->its_mapc_cmd.col->col_id);
+	its_encode_collection(cmd, desc->its_invall_cmd.col->col_id);
 
 	its_fixup_cmd(cmd);