linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix IRQ flood issue in TI PD controller
@ 2021-10-20  2:26 Saranya Gopal
  2021-10-20  2:26 ` [PATCH 1/2] usb: typec: tipd: Enable event interrupts by default Saranya Gopal
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Saranya Gopal @ 2021-10-20  2:26 UTC (permalink / raw)
  To: linux-usb, gregkh, hdegoede
  Cc: heikki.krogerus, andriy.shevchenko, rajaram.regupathy, 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.

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(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] usb: typec: tipd: Enable event interrupts by default
  2021-10-20  2:26 [PATCH 0/2] Fix IRQ flood issue in TI PD controller Saranya Gopal
@ 2021-10-20  2:26 ` Saranya Gopal
  2021-10-20  2:26 ` [PATCH 2/2] Revert "platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes" Saranya Gopal
  2021-10-20 11:54 ` [PATCH 0/2] Fix IRQ flood issue in TI PD controller Hans de Goede
  2 siblings, 0 replies; 5+ messages in thread
From: Saranya Gopal @ 2021-10-20  2:26 UTC (permalink / raw)
  To: linux-usb, gregkh, hdegoede
  Cc: heikki.krogerus, andriy.shevchenko, rajaram.regupathy, Saranya Gopal

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
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Suggested-by: Rajaram Regupathy <rajaram.regupathy@intel.com>
Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
---
 drivers/usb/typec/tipd/core.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 97311a45f666..fb8ef12bbe9c 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] Revert "platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes"
  2021-10-20  2:26 [PATCH 0/2] Fix IRQ flood issue in TI PD controller Saranya Gopal
  2021-10-20  2:26 ` [PATCH 1/2] usb: typec: tipd: Enable event interrupts by default Saranya Gopal
@ 2021-10-20  2:26 ` Saranya Gopal
  2021-10-20 11:54 ` [PATCH 0/2] Fix IRQ flood issue in TI PD controller Hans de Goede
  2 siblings, 0 replies; 5+ messages in thread
From: Saranya Gopal @ 2021-10-20  2:26 UTC (permalink / raw)
  To: linux-usb, gregkh, hdegoede
  Cc: heikki.krogerus, andriy.shevchenko, rajaram.regupathy, 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.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
---
 drivers/platform/x86/i2c-multi-instantiate.c | 31 +++++---------------
 1 file changed, 8 insertions(+), 23 deletions(-)

diff --git a/drivers/platform/x86/i2c-multi-instantiate.c b/drivers/platform/x86/i2c-multi-instantiate.c
index a50153ecd560..4956a1df5b90 100644
--- a/drivers/platform/x86/i2c-multi-instantiate.c
+++ b/drivers/platform/x86/i2c-multi-instantiate.c
@@ -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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Fix IRQ flood issue in TI PD controller
  2021-10-20  2:26 [PATCH 0/2] Fix IRQ flood issue in TI PD controller Saranya Gopal
  2021-10-20  2:26 ` [PATCH 1/2] usb: typec: tipd: Enable event interrupts by default Saranya Gopal
  2021-10-20  2:26 ` [PATCH 2/2] Revert "platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes" Saranya Gopal
@ 2021-10-20 11:54 ` Hans de Goede
  2021-10-20 12:10   ` Greg KH
  2 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2021-10-20 11:54 UTC (permalink / raw)
  To: Saranya Gopal, linux-usb, gregkh
  Cc: heikki.krogerus, andriy.shevchenko, rajaram.regupathy

Hi,

On 10/20/21 04:26, Saranya Gopal wrote:
> 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?

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

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> 
> 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(-)
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Fix IRQ flood issue in TI PD controller
  2021-10-20 11:54 ` [PATCH 0/2] Fix IRQ flood issue in TI PD controller Hans de Goede
@ 2021-10-20 12:10   ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2021-10-20 12:10 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Saranya Gopal, linux-usb, heikki.krogerus, andriy.shevchenko,
	rajaram.regupathy

On Wed, Oct 20, 2021 at 01:54:39PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 10/20/21 04:26, Saranya Gopal wrote:
> > 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?
> 
> Since Heikki has reviewed the revert, I'm fine with this and I'm
> also fine with taking this upstream through the usb tree:
> 
> Acked-by: Hans de Goede <hdegoede@redhat.com>

Thanks, I'll queue it up.

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-20 12:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20  2:26 [PATCH 0/2] Fix IRQ flood issue in TI PD controller Saranya Gopal
2021-10-20  2:26 ` [PATCH 1/2] usb: typec: tipd: Enable event interrupts by default Saranya Gopal
2021-10-20  2:26 ` [PATCH 2/2] Revert "platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes" Saranya Gopal
2021-10-20 11:54 ` [PATCH 0/2] Fix IRQ flood issue in TI PD controller Hans de Goede
2021-10-20 12:10   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).