From patchwork Wed Oct 20 02:26:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saranya Gopal X-Patchwork-Id: 12572011 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CEE3C433EF for ; Wed, 20 Oct 2021 10:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57E77610FF for ; Wed, 20 Oct 2021 10:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230005AbhJTKa0 (ORCPT ); Wed, 20 Oct 2021 06:30:26 -0400 Received: from mga09.intel.com ([134.134.136.24]:6899 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229921AbhJTKaZ (ORCPT ); Wed, 20 Oct 2021 06:30:25 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10142"; a="228621967" X-IronPort-AV: E=Sophos;i="5.87,166,1631602800"; d="scan'208";a="228621967" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2021 03:27:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,166,1631602800"; d="scan'208";a="575280538" Received: from saranya-nuc10i7fnh.iind.intel.com ([10.223.216.64]) by fmsmga002.fm.intel.com with ESMTP; 20 Oct 2021 03:27:56 -0700 From: Saranya Gopal To: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, hdegoede@redhat.com Cc: heikki.krogerus@linux.intel.com, andriy.shevchenko@linux.intel.com, rajaram.regupathy@intel.com, Saranya Gopal Subject: [PATCH 1/2] usb: typec: tipd: Enable event interrupts by default Date: Wed, 20 Oct 2021 07:56:19 +0530 Message-Id: <20211020022620.21012-2-saranya.gopal@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211020022620.21012-1-saranya.gopal@intel.com> References: <20211020022620.21012-1-saranya.gopal@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 Reviewed-by: Heikki Krogerus Suggested-by: Rajaram Regupathy Signed-off-by: Saranya Gopal --- 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); From patchwork Wed Oct 20 02:26:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saranya Gopal X-Patchwork-Id: 12572013 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B885EC433FE for ; Wed, 20 Oct 2021 10:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9716D61004 for ; Wed, 20 Oct 2021 10:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbhJTKa0 (ORCPT ); Wed, 20 Oct 2021 06:30:26 -0400 Received: from mga09.intel.com ([134.134.136.24]:6891 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbhJTKa0 (ORCPT ); Wed, 20 Oct 2021 06:30:26 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10142"; a="228621976" X-IronPort-AV: E=Sophos;i="5.87,166,1631602800"; d="scan'208";a="228621976" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2021 03:28:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,166,1631602800"; d="scan'208";a="575280545" Received: from saranya-nuc10i7fnh.iind.intel.com ([10.223.216.64]) by fmsmga002.fm.intel.com with ESMTP; 20 Oct 2021 03:27:58 -0700 From: Saranya Gopal To: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, hdegoede@redhat.com Cc: heikki.krogerus@linux.intel.com, andriy.shevchenko@linux.intel.com, rajaram.regupathy@intel.com, Saranya Gopal Subject: [PATCH 2/2] Revert "platform/x86: i2c-multi-instantiate: Don't create platform device for INT3515 ACPI nodes" Date: Wed, 20 Oct 2021 07:56:20 +0530 Message-Id: <20211020022620.21012-3-saranya.gopal@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211020022620.21012-1-saranya.gopal@intel.com> References: <20211020022620.21012-1-saranya.gopal@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 Reviewed-by: Heikki Krogerus Signed-off-by: Saranya Gopal --- 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);