Skip to contentSkip to conversation

irqchip/mmp: only touch the PJ4 & FIQ bits on enable/disable

PATCH Superseded Lubomir Rintel 2 participants 4 messages Dec 20, 2018 – Jan 16, 2019 irqchip drivers

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 irqchip/mmp: only touch the PJ4 & FIQ bits on enable/disable

On an OLPC XO 1.75 machine, the "security processor" handles the GPIO 71 and 72 interrupts. Don't reset the "route to SP" bit (4).

I'm just assuming the bit 4 is the "route to SP" bit -- it fixes the SP-based keyboard for me and <mach-mmp/regs-icu.h> defines ICU_INT_ROUTE_SP_IRQ to be 1 << 4. When asked for a data sheet, Marvell was not helpful.

---
I'm not removing the defines from regs-icu.h at the moment. Of the MPP2 defines there, only MMP2_ICU_INT4_MASK ends up actually being used, in one place. That said, the header servers mostly as a documentation, because the documentation for the platform is lacking.

Changes since v3:
- Use #defined instead of integer literals

Changes since v2:
- Correct subsystem maintainers on Cc (irqchip)

Changes since v1:
- Adjusted wording & ack from Pavel

---
 drivers/irqchip/irq-mmp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/irqchip/irq-mmp.c +6 -1
index 25f32e1d7764..65fa5a1d8310 100644
@@ -34,6 +34,10 @@
 #define SEL_INT_PENDING		(1 << 6)
 #define SEL_INT_NUM_MASK	0x3f
 
+#define MMP2_ICU_INT_ROUTE_SP_IRQ	(1 << 4)
+#define MMP2_ICU_INT_ROUTE_PJ4_IRQ	(1 << 5)
+#define MMP2_ICU_INT_ROUTE_PJ4_FIQ	(1 << 6)
+
 struct icu_chip_data {
 	int			nr_irqs;
 	unsigned int		virq_base;
@@ -190,7 +194,8 @@ static const struct mmp_intc_conf mmp_conf = {
 static const struct mmp_intc_conf mmp2_conf = {
 	.conf_enable	= 0x20,
 	.conf_disable	= 0x0,
-	.conf_mask	= 0x7f,
+	.conf_mask	= MMP2_ICU_INT_ROUTE_PJ4_IRQ |
+			  MMP2_ICU_INT_ROUTE_PJ4_FIQ,
 };
 
 static void __exception_irq_entry mmp_handle_irq(struct pt_regs *regs)
Signature · 1 line
2.19.2
#1 lore raw
Quoted 7 lines · Lubomir Rintel

On an OLPC XO 1.75 machine, the "security processor" handles the GPIO 71 and 72 interrupts. Don't reset the "route to SP" bit (4).

I'm just assuming the bit 4 is the "route to SP" bit -- it fixes the SP-based keyboard for me and <mach-mmp/regs-icu.h> defines ICU_INT_ROUTE_SP_IRQ to be 1 << 4. When asked for a data sheet, Marvell was not helpful.

Marc,

I'm wondering if there's any chance this be applied and ideally submitted for 5.0?

This fixes the keyboard on an OLPC XO 1.75 laptop, and, with the MMP platform fixes that went into rc1 it is the last major obstacle to the XO 1.75 machine being generally useful.

Thank you
Lubo

Quoted 47 lines

---
I'm not removing the defines from regs-icu.h at the moment. Of the MPP2 defines there, only MMP2_ICU_INT4_MASK ends up actually being used, in one place. That said, the header servers mostly as a documentation, because the documentation for the platform is lacking.

Changes since v3:
- Use #defined instead of integer literals

Changes since v2:
- Correct subsystem maintainers on Cc (irqchip)

Changes since v1:
- Adjusted wording & ack from Pavel

---
 drivers/irqchip/irq-mmp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/irqchip/irq-mmp.c +6 -1
index 25f32e1d7764..65fa5a1d8310 100644
@@ -34,6 +34,10 @@
 #define SEL_INT_PENDING		(1 << 6)
 #define SEL_INT_NUM_MASK	0x3f
 
+#define MMP2_ICU_INT_ROUTE_SP_IRQ	(1 << 4)
+#define MMP2_ICU_INT_ROUTE_PJ4_IRQ	(1 << 5)
+#define MMP2_ICU_INT_ROUTE_PJ4_FIQ	(1 << 6)
+
 struct icu_chip_data {
 	int			nr_irqs;
 	unsigned int		virq_base;
@@ -190,7 +194,8 @@ static const struct mmp_intc_conf mmp_conf = {
 static const struct mmp_intc_conf mmp2_conf = {
 	.conf_enable	= 0x20,
 	.conf_disable	= 0x0,
-	.conf_mask	= 0x7f,
+	.conf_mask	= MMP2_ICU_INT_ROUTE_PJ4_IRQ |
+			  MMP2_ICU_INT_ROUTE_PJ4_FIQ,
 };
 
 static void __exception_irq_entry mmp_handle_irq(struct pt_regs *regs)
#2 lore raw
In reply to Lubomir Rintel
Quoted 34 lines · Lubomir Rintel

On an OLPC XO 1.75 machine, the "security processor" handles the GPIO 71 and 72 interrupts. Don't reset the "route to SP" bit (4).

I'm just assuming the bit 4 is the "route to SP" bit -- it fixes the SP-based keyboard for me and <mach-mmp/regs-icu.h> defines ICU_INT_ROUTE_SP_IRQ to be 1 << 4. When asked for a data sheet, Marvell was not helpful.

---
I'm not removing the defines from regs-icu.h at the moment. Of the MPP2 defines there, only MMP2_ICU_INT4_MASK ends up actually being used, in one place. That said, the header servers mostly as a documentation, because the documentation for the platform is lacking.

Changes since v3:
- Use #defined instead of integer literals

Changes since v2:
- Correct subsystem maintainers on Cc (irqchip)

Changes since v1:
- Adjusted wording & ack from Pavel

---
 drivers/irqchip/irq-mmp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/irqchip/irq-mmp.c +0 -0
index 25f32e1d7764..65fa5a1d8310 100644

drivers/irqchip/irq-mmp.c line 37

Quoted 4 lines
drivers/irqchip/irq-mmp.c +1 -0
@@ -34,6 +34,10 @@
 #define SEL_INT_PENDING		(1 << 6)
 #define SEL_INT_NUM_MASK	0x3f
 
+#define MMP2_ICU_INT_ROUTE_SP_IRQ	(1 << 4)

Where is this used?

drivers/irqchip/irq-mmp.c static const struct mmp_intc_conf mmp_conf = { · line 198

Quoted 13 lines
drivers/irqchip/irq-mmp.c +5 -1
+#define MMP2_ICU_INT_ROUTE_PJ4_IRQ	(1 << 5)
+#define MMP2_ICU_INT_ROUTE_PJ4_FIQ	(1 << 6)
+
 struct icu_chip_data {
 	int			nr_irqs;
 	unsigned int		virq_base;
@@ -190,7 +194,8 @@ static const struct mmp_intc_conf mmp_conf = {
 static const struct mmp_intc_conf mmp2_conf = {
 	.conf_enable	= 0x20,
 	.conf_disable	= 0x0,
-	.conf_mask	= 0x7f,
+	.conf_mask	= MMP2_ICU_INT_ROUTE_PJ4_IRQ |
+			  MMP2_ICU_INT_ROUTE_PJ4_FIQ,

So the mask changes from 0x7f to 0x60, but the changelog does not mention any of this. It only talks about bit 4 ....

Thanks,

tglx

#3 lore raw
Quoted 39 lines · Thomas Gleixner
Quoted 37 lines · Lubomir Rintel

On an OLPC XO 1.75 machine, the "security processor" handles the GPIO 71 and 72 interrupts. Don't reset the "route to SP" bit (4).

I'm just assuming the bit 4 is the "route to SP" bit -- it fixes the SP-based keyboard for me and <mach-mmp/regs-icu.h> defines ICU_INT_ROUTE_SP_IRQ to be 1 << 4. When asked for a data sheet, Marvell was not helpful.

---
I'm not removing the defines from regs-icu.h at the moment. Of the MPP2 defines there, only MMP2_ICU_INT4_MASK ends up actually being used, in one place. That said, the header servers mostly as a documentation, because the documentation for the platform is lacking.

Changes since v3:
- Use #defined instead of integer literals

Changes since v2:
- Correct subsystem maintainers on Cc (irqchip)

Changes since v1:
- Adjusted wording & ack from Pavel

---
 drivers/irqchip/irq-mmp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/irqchip/irq-mmp.c +0 -0
index 25f32e1d7764..65fa5a1d8310 100644
@@ -34,6 +34,10 @@
 #define SEL_INT_PENDING		(1 << 6)
 #define SEL_INT_NUM_MASK	0x3f
 
Quoted 3 lines

drivers/irqchip/irq-mmp.c line 37

Quoted 1 line
drivers/irqchip/irq-mmp.c +1 -0
+#define MMP2_ICU_INT_ROUTE_SP_IRQ	(1 << 4)

Where is this used?

Nowhere really. I can remove it I guess.

Quoted 8 lines
Quoted 8 lines
drivers/irqchip/irq-mmp.c +3 -0
+#define MMP2_ICU_INT_ROUTE_PJ4_IRQ	(1 << 5)
+#define MMP2_ICU_INT_ROUTE_PJ4_FIQ	(1 << 6)
+
 struct icu_chip_data {
 	int			nr_irqs;
 	unsigned int		virq_base;
@@ -190,7 +194,8 @@ static const struct mmp_intc_conf mmp_conf = {
 static const struct mmp_intc_conf mmp2_conf = {
Quoted 8 lines

drivers/irqchip/irq-mmp.c static const struct mmp_intc_conf mmp_conf = { · line 198

Quoted 5 lines
drivers/irqchip/irq-mmp.c +2 -1
 	.conf_enable	= 0x20,
 	.conf_disable	= 0x0,
-	.conf_mask	= 0x7f,
+	.conf_mask	= MMP2_ICU_INT_ROUTE_PJ4_IRQ |
+			  MMP2_ICU_INT_ROUTE_PJ4_FIQ,

So the mask changes from 0x7f to 0x60, but the changelog does not mention any of this. It only talks about bit 4 ....

The subject line was supposed to say that.

The point was in general not to touch the bit whose meanings are not interesting or not known. I'll try to figure out better wording (and I'm thankful for suggestions).

Quoted 4 lines

Thanks,

tglx

Thank you
Lubo