Skip to contentSkip to conversation

Fix IRQ flood issue in TI PD controller

PATCH In review Saranya Gopal 3 participants 5 messages Oct 20, 2021

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

cover Fix IRQ flood issue in TI PD controller

Hi,

There was an issue reported that the TI PD controller driver is causing high CPU load due to a flood of interrupts. So, a patch was added in
the i2c-multi-instantiate driver to stop the TI PD driver from loading
in devices with INT3515 ACPI nodes.
We identified that required event interrupts are not being set in the interrupt mask register from the driver to the register of the controller.
We enabled only the necessary events like data status update, power status update and plug events in the interrupt mask register of the TI PD controller. After enabling these events in the interrupt mask register, there is no interrupt flood. This patch series contains the fix for the interrupt flood issue
in the TI PD driver and another patch to re-enable the INT3515 platform device. I prefer this patch series to be taken through usb tree since the fix is in the TI USB PD driver and the second patch is just a revert patch.

Hi Hans,
Could I get your Ack to take this series through the usb tree?

Saranya Gopal (2):
usb: typec: tipd: Enable event interrupts by default Revert "platform/x86: i2c-multi-instantiate: Don't create platform
device for INT3515 ACPI nodes"

 drivers/platform/x86/i2c-multi-instantiate.c | 31 +++++---------------
 drivers/usb/typec/tipd/core.c                |  8 +++++
 2 files changed, 16 insertions(+), 23 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 usb: typec: tipd: Enable event interrupts by default

TI PD controller comes with notification mechanism to inform the host on activity in the PD controller. In the current driver, the required masks are not set. This patch enables the following events in the interrupt mask register:
PowerStatusUpdate - Set whenever contents of the power status reg changes DataStatusUpdate - Set whenever contents of the data status reg changes PlugInsertOrRemoval - Set whenever USB plug status has changed

With this change, the interrupt flooding issue is not seen anymore.

Datasheet: https://www.ti.com/lit/ug/slvuan1a/slvuan1a.pdf

---
 drivers/usb/typec/tipd/core.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/usb/typec/tipd/core.c +8 -0
index 97311a45f666..fb8ef12bbe9c 100644
@@ -750,6 +750,14 @@ static int tps6598x_probe(struct i2c_client *client)
 			return ret;
 
 		irq_handler = cd321x_interrupt;
+	} else {
+		/* Enable power status, data status and plug event interrupts */
+		ret = tps6598x_write64(tps, TPS_REG_INT_MASK1,
+				       TPS_REG_INT_POWER_STATUS_UPDATE |
+				       TPS_REG_INT_DATA_STATUS_UPDATE |
+				       TPS_REG_INT_PLUG_EVENT);
+		if (ret)
+			return ret;
 	}
 
 	ret = tps6598x_read32(tps, TPS_REG_STATUS, &status);
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 Revert "platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes"

In reply to Saranya Gopal

This reverts commit 9bba96275576da0cf78ede62aeb2fc975ed8a32d.

The above commit was added to prevent the tipd driver from loading in devices which have INT3515 ACPI nodes since high CPU load was reported in these devices due to interrupt flood. Now that the issue of interrupt flood in the tipd driver is fixed, re-enable the creation of platform device for INT3515 ACPI nodes.

---
 drivers/platform/x86/i2c-multi-instantiate.c | 31 +++++---------------
 1 file changed, 8 insertions(+), 23 deletions(-)
drivers/platform/x86/i2c-multi-instantiate.c +8 -23
index a50153ecd560..4956a1df5b90 100644
@@ -139,29 +139,13 @@ static const struct i2c_inst_data bsg2150_data[]  = {
 	{}
 };
 
-/*
- * Device with _HID INT3515 (TI PD controllers) has some unresolved interrupt
- * issues. The most common problem seen is interrupt flood.
- *
- * There are at least two known causes. Firstly, on some boards, the
- * I2CSerialBus resource index does not match the Interrupt resource, i.e. they
- * are not one-to-one mapped like in the array below. Secondly, on some boards
- * the IRQ line from the PD controller is not actually connected at all. But the
- * interrupt flood is also seen on some boards where those are not a problem, so
- * there are some other problems as well.
- *
- * Because of the issues with the interrupt, the device is disabled for now. If
- * you wish to debug the issues, uncomment the below, and add an entry for the
- * INT3515 device to the i2c_multi_instance_ids table.
- *
- * static const struct i2c_inst_data int3515_data[]  = {
- *	{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
- *	{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
- *	{ "tps6598x", IRQ_RESOURCE_APIC, 2 },
- *	{ "tps6598x", IRQ_RESOURCE_APIC, 3 },
- *	{ }
- * };
- */
+static const struct i2c_inst_data int3515_data[]  = {
+	{ "tps6598x", IRQ_RESOURCE_APIC, 0 },
+	{ "tps6598x", IRQ_RESOURCE_APIC, 1 },
+	{ "tps6598x", IRQ_RESOURCE_APIC, 2 },
+	{ "tps6598x", IRQ_RESOURCE_APIC, 3 },
+	{}
+};
 
 /*
  * Note new device-ids must also be added to i2c_multi_instantiate_ids in
@@ -170,6 +154,7 @@ static const struct i2c_inst_data bsg2150_data[]  = {
 static const struct acpi_device_id i2c_multi_inst_acpi_ids[] = {
 	{ "BSG1160", (unsigned long)bsg1160_data },
 	{ "BSG2150", (unsigned long)bsg2150_data },
+	{ "INT3515", (unsigned long)int3515_data },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, i2c_multi_inst_acpi_ids);
Signature · 1 line
2.17.1
Acked-by on the v1 series
#3 lore raw
In reply to Saranya Gopal

Hi,

Quoted 16 lines · Saranya Gopal

Hi,

There was an issue reported that the TI PD controller driver is causing high CPU load due to a flood of interrupts. So, a patch was added in
the i2c-multi-instantiate driver to stop the TI PD driver from loading
in devices with INT3515 ACPI nodes.
We identified that required event interrupts are not being set in the interrupt mask register from the driver to the register of the controller.
We enabled only the necessary events like data status update, power status update and plug events in the interrupt mask register of the TI PD controller. After enabling these events in the interrupt mask register, there is no interrupt flood. This patch series contains the fix for the interrupt flood issue
in the TI PD driver and another patch to re-enable the INT3515 platform device. I prefer this patch series to be taken through usb tree since the fix is in the TI USB PD driver and the second patch is just a revert patch.

Quoted 2 lines

Hi Hans,
Could I get your Ack to take this series through the usb tree?

Since Heikki has reviewed the revert, I'm fine with this and I'm also fine with taking this upstream through the usb tree:

Regards,

Hans

Quoted 10 lines

Saranya Gopal (2):
usb: typec: tipd: Enable event interrupts by default Revert "platform/x86: i2c-multi-instantiate: Don't create platform
device for INT3515 ACPI nodes"

 drivers/platform/x86/i2c-multi-instantiate.c | 31 +++++---------------
 drivers/usb/typec/tipd/core.c                |  8 +++++
 2 files changed, 16 insertions(+), 23 deletions(-)
maintainer
#4 lore raw
Quoted 19 lines · Hans de Goede

Hi,

Quoted 16 lines · Saranya Gopal

Hi,

There was an issue reported that the TI PD controller driver is causing high CPU load due to a flood of interrupts. So, a patch was added in
the i2c-multi-instantiate driver to stop the TI PD driver from loading
in devices with INT3515 ACPI nodes.
We identified that required event interrupts are not being set in the interrupt mask register from the driver to the register of the controller.
We enabled only the necessary events like data status update, power status update and plug events in the interrupt mask register of the TI PD controller. After enabling these events in the interrupt mask register, there is no interrupt flood. This patch series contains the fix for the interrupt flood issue
in the TI PD driver and another patch to re-enable the INT3515 platform device. I prefer this patch series to be taken through usb tree since the fix is in the TI USB PD driver and the second patch is just a revert patch.

Quoted 7 lines
Quoted 2 lines

Hi Hans,
Could I get your Ack to take this series through the usb tree?

Since Heikki has reviewed the revert, I'm fine with this and I'm also fine with taking this upstream through the usb tree:

Thanks, I'll queue it up.

greg k-h