From patchwork Mon Apr 29 13:35:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13646994 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2103.outbound.protection.outlook.com [40.107.7.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DAD576402; Mon, 29 Apr 2024 13:36:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.103 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714397782; cv=fail; b=J3PBto5wcwFiJSmTy++QmGnLHiE4xH26ov2Ekig7e385Mi1/O5V+BsCcT+e1irFadqoCcbGuMuvS/nf+8xVHfuEMVW769i+dqbVtdLXHHEJfNnNyQRC3ukIAV3NYbWVxIlS4cGVvioB1e4QMVvlq5ANVYUFW7IsLpYomGQ4zirA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714397782; c=relaxed/simple; bh=bgOHDWll20OXbxbVCnkRidPFr3wlVbZXxMT8U2i82b8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=EuRhSygEGzAdvuCigcDyruyxu1p6O+wg6JkVGpoDoLULvX0cAIrNOWODamGIxEplNMpNrI3DgZcf0u++QWwagP06Im/b7fD780LoPJoR0iE4P2awrnae5lm65dfcqTH7kea4QsKfTzhVA47ktLBOUaYJWZNammNUNFY6dwNcYRI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net; spf=pass smtp.mailfrom=wolfvision.net; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b=SqVmu+kX; arc=fail smtp.client-ip=40.107.7.103 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wolfvision.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=wolfvision.net header.i=@wolfvision.net header.b="SqVmu+kX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KK62in1NjPVzAp1XayJBhqpH1YRag3qwPCBXMD2RSaH2a01Q7Qgt1jlgGVxTIwRfE+VJwkIGzU1tXMxLFJCANauDlRO9Sr23YNfUDMz9qt8YE6iWR5obpSmnJmMKxhZPbVPV57w3aDXJmfPvylTTYF+GulNgGbRXFSvRbgtUxaMm9rivu1hfFJ0QBHoz6mkDATQQbHjs7rD62/p5ipN53QC+jZY7ohAemcOVTBX2qIPqmfdawtdsFYAzieR6IRxFobzAX7lNNvkX9XOGm73hXn5YCpV7x8Frn1kzRso0B2gNJJq0Uf+l7rTSX1KCqIyzZq73h0sdqKJ2NA++8r5HIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gASvPyVMsR2M8oPAZmb+jwmiIGkcsvi1O5hbrVZn3wY=; b=FqUcdbx+0YIxIo6k4wyk3pqgnTmq934EwpjDuKFrZ5mtsMPxZ24O9oqZWnY1B6PGwC0vbgoSFBX4RPaAf8kNDqfyJQGSdKhMVt15KJ98ObjFMIidzXIrXN3XbCqNhE2Sg9v4OznMrzvbbWgX+fKCR8Up/wS61jS3h9OhC+A6rVQwCNJxT90/QaG8yHARk8R9UWSxH4Cusm8qCd2mB7ghQcXupTxWaPGwwg/OxwwVXK3BDqhsNiOSaDh1wtxUkCKFjXIo0idl+gtxNQONv8Xx2gUWLQ3O04wkhz5MEffH6NwVHYk5zDy6O01xX3Zt15PS3uRl5+FmMUtPrjcIsnscsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wolfvision.net; dmarc=pass action=none header.from=wolfvision.net; dkim=pass header.d=wolfvision.net; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wolfvision.net; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gASvPyVMsR2M8oPAZmb+jwmiIGkcsvi1O5hbrVZn3wY=; b=SqVmu+kXC3HC6F/UUcGe/X5FG39Pt/GPORlCBP5I+xUx/edubgN24ng+3R16X0gT6zCn1wDhv24tqNgOrDZuEF8bWiYwy3Le9Q8ePV1DV+6XYpwyL53XimjUc4TMRMxZEuHviKLjWLDasXK3unw1366n8FqhjKlUsntv8M0w5Ag= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=wolfvision.net; Received: from VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) by AS8PR08MB6087.eurprd08.prod.outlook.com (2603:10a6:20b:29c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.34; Mon, 29 Apr 2024 13:36:11 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6621:68a6:ab00:c040]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::6621:68a6:ab00:c040%6]) with mapi id 15.20.7519.021; Mon, 29 Apr 2024 13:36:11 +0000 From: Javier Carrasco Date: Mon, 29 Apr 2024 15:35:58 +0200 Subject: [PATCH v3 2/3] usb: typec: tipd: fix event checking for tps6598x Message-Id: <20240429-tps6598x_fix_event_handling-v3-2-4e8e58dce489@wolfvision.net> References: <20240429-tps6598x_fix_event_handling-v3-0-4e8e58dce489@wolfvision.net> In-Reply-To: <20240429-tps6598x_fix_event_handling-v3-0-4e8e58dce489@wolfvision.net> To: Heikki Krogerus , Greg Kroah-Hartman , Abdel Alkuor Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Javier Carrasco , stable@vger.kernel.org X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1714397770; l=5423; i=javier.carrasco@wolfvision.net; s=20240320; h=from:subject:message-id; bh=bgOHDWll20OXbxbVCnkRidPFr3wlVbZXxMT8U2i82b8=; b=z3u4gdGc2Bv7xGUIeLJnRhDRcJ0D8jOUrRdSj8+UcsaXhAqgxXb42MF9KfqZlZz4aF4KT1Zec DDsqMzdgV9ABkZZNL9iBbO0uINbPIGMhL0aCZ+Zf4+zXyiqXGhIB+U1 X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=Vxk2/0sGIxM8rsKnceszFuSuHVfQwa1Yo8+is7BX2nY= X-ClientProxiedBy: VE1PR03CA0005.eurprd03.prod.outlook.com (2603:10a6:802:a0::17) To VE1PR08MB4974.eurprd08.prod.outlook.com (2603:10a6:803:111::15) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR08MB4974:EE_|AS8PR08MB6087:EE_ X-MS-Office365-Filtering-Correlation-Id: 35938dd5-6487-4789-53d1-08dc68515518 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: =?utf-8?q?PkUfvzGO1ZKd5s7l+0hPqi246ThPxWj?= =?utf-8?q?zA8GlC9zKxwhnlgCyhxXxJB/fizIsdW7phtYHYmnLllPiIySnWFsHaNtpmp+M8A9F?= =?utf-8?q?gL9ZybbTMzVLeVHqIT4Cfnn5b2m41bq144c2Rx6DsviLDe2fu6Mc2mtAjTiJ2gTXD?= =?utf-8?q?Pom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s2snHNniV4rXSKCQdmyRY92WH70RfLowv3sL+Z6?= =?utf-8?q?Zh0BOI20uYRdWYU48cm69zpiyBs1LYFUBDS+zvNXfveBMVg0ROc7trNkBX+WjDtfm?= =?utf-8?q?FiO6/XCK8CbDgdCWZtvoHd3wlQbuVl00gc9VUnt5v9w/CQSCdOVvxCsaewa1OaV9o?= =?utf-8?q?6y/TCtbl0MJYOOfCPWct4v8r3T4CIFt+cqsg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4974.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?SuYY0qIgoahu8RrmE8K3ikkK8RT5?= =?utf-8?q?85p11e8QrvWkyNHVf8JwHZiLJCcsr6IUOeYmTXjXuyZo9hkvRSCe7O0R6EiAw3rGB?= =?utf-8?q?zV5wK6SbB4K54TVduMy/b2S6WzgOgVu7hwi9vuM6WWV4HUf2UpHjWWynnb4NZEJDq?= =?utf-8?q?3ioJBJeAJJo4bol7SzTIpj1pgK9hfI3R+vi650Wc4KgiwTwtUlWZLoTicJSSsFiZe?= =?utf-8?q?lwO2ctHLhM2546K5b7kp0MuLEPLcgqqU56Jp+SQHK1xUol1ffXaPLbyt+9Rcbj38g?= =?utf-8?q?/G1F+RPEVFkg9yGkwVi3TQ3rCxyAmjGMDr0TOhOofI6lxjZ5x9o69P8htDbVgjbsu?= =?utf-8?q?LsJlteifPqeW9l7qUQ4uDO7dgFvB1GD1dyjViTqdAxfAf33/iRx6aV2qtmOuJMBKN?= =?utf-8?q?vfvp4Eigvo0E50NWxQZLy5LsPdeLQXMaSaFDrbojXRNKYHCqJ6UvDMnA9+vZQJuc3?= =?utf-8?q?xgU3HLx7ELW1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+Pf9WWa5AuZDACPCkNeeu+ozk90vzCPhFmKTW?= =?utf-8?q?69j24+Xu38JEsvI/CIPjT0j64A0g5uwdiLbXFtr24cP4thfFopF9SJpAupsC1tGri?= =?utf-8?q?oQp5/uC025wnuEZ7HaAf4GNq6PtdhFd4MqchQTu/22A3udGzs30NI7WJfr/YXPGiE?= =?utf-8?q?4TwERxTy6gfBO5IRVMdbgEqzQ56XVmFhi2ZgVRG7Z2iWwkbPspg3Ehs=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 35938dd5-6487-4789-53d1-08dc68515518 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Apr 2024 13:36:11.0973 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: e94ec9da-9183-471e-83b3-51baa8eb804f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: j94+CeNgWGtxS7o2fYqW/fC2YP5o3acYRQgJ86r+JzNulWA6HGnGqddaCrp0/rYhOhbg7BMWmlCItujdZTkLvUt9jX2n3xtVS2bDzPcmsNY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6087 The current interrupt service routine of the tps6598x only reads the first 64 bits of the INT_EVENT1 and INT_EVENT2 registers, which means that any event above that range will be ignored, leaving interrupts unattended. Moreover, those events will not be cleared, and the device will keep the interrupt enabled. This issue has been observed while attempting to load patches, and the 'ReadyForPatch' field (bit 81) of INT_EVENT1 was set. Given that older versions of the tps6598x (1, 2 and 6) provide 8-byte registers, a mechanism based on the upper byte of the version register (0x0F) has been included. The manufacturer has confirmed [1] that this byte is always 0 for older versions, and either 0xF7 (DH parts) or 0xF9 (DK parts) is returned in newer versions (7 and 8). Read the complete INT_EVENT registers to handle all interrupts generated by the device and account for the hardware version to select the register size. Link: https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/1346521/tps65987d-register-command-to-distinguish-between-tps6591-2-6-and-tps65987-8 [1] Fixes: 0a4c005bd171 ("usb: typec: driver for TI TPS6598x USB Power Delivery controllers") Cc: stable@vger.kernel.org Signed-off-by: Javier Carrasco --- drivers/usb/typec/tipd/core.c | 45 ++++++++++++++++++++++++++++----------- drivers/usb/typec/tipd/tps6598x.h | 11 ++++++++++ 2 files changed, 43 insertions(+), 13 deletions(-) diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c index 7c2f01344860..191f86da283d 100644 --- a/drivers/usb/typec/tipd/core.c +++ b/drivers/usb/typec/tipd/core.c @@ -28,6 +28,7 @@ #define TPS_REG_MODE 0x03 #define TPS_REG_CMD1 0x08 #define TPS_REG_DATA1 0x09 +#define TPS_REG_VERSION 0x0F #define TPS_REG_INT_EVENT1 0x14 #define TPS_REG_INT_EVENT2 0x15 #define TPS_REG_INT_MASK1 0x16 @@ -636,49 +637,67 @@ static irqreturn_t tps25750_interrupt(int irq, void *data) static irqreturn_t tps6598x_interrupt(int irq, void *data) { + int intev_len = TPS_65981_2_6_INTEVENT_LEN; struct tps6598x *tps = data; - u64 event1 = 0; - u64 event2 = 0; + u64 event1[2] = { }; + u64 event2[2] = { }; + u32 version; u32 status; int ret; mutex_lock(&tps->lock); - ret = tps6598x_read64(tps, TPS_REG_INT_EVENT1, &event1); - ret |= tps6598x_read64(tps, TPS_REG_INT_EVENT2, &event2); + ret = tps6598x_read32(tps, TPS_REG_VERSION, &version); + if (ret) + dev_warn(tps->dev, "%s: failed to read version (%d)\n", + __func__, ret); + + if (TPS_VERSION_HW_VERSION(version) == TPS_VERSION_HW_65987_8_DH || + TPS_VERSION_HW_VERSION(version) == TPS_VERSION_HW_65987_8_DK) + intev_len = TPS_65987_8_INTEVENT_LEN; + + ret = tps6598x_block_read(tps, TPS_REG_INT_EVENT1, event1, intev_len); + + ret = tps6598x_block_read(tps, TPS_REG_INT_EVENT1, event1, intev_len); if (ret) { - dev_err(tps->dev, "%s: failed to read events\n", __func__); + dev_err(tps->dev, "%s: failed to read event1\n", __func__); goto err_unlock; } - trace_tps6598x_irq(event1, event2); + ret = tps6598x_block_read(tps, TPS_REG_INT_EVENT2, event2, intev_len); + if (ret) { + dev_err(tps->dev, "%s: failed to read event2\n", __func__); + goto err_unlock; + } + trace_tps6598x_irq(event1[0], event2[0]); - if (!(event1 | event2)) + if (!(event1[0] | event1[1] | event2[0] | event2[1])) goto err_unlock; if (!tps6598x_read_status(tps, &status)) goto err_clear_ints; - if ((event1 | event2) & TPS_REG_INT_POWER_STATUS_UPDATE) + if ((event1[0] | event2[0]) & TPS_REG_INT_POWER_STATUS_UPDATE) if (!tps6598x_read_power_status(tps)) goto err_clear_ints; - if ((event1 | event2) & TPS_REG_INT_DATA_STATUS_UPDATE) + if ((event1[0] | event2[0]) & TPS_REG_INT_DATA_STATUS_UPDATE) if (!tps6598x_read_data_status(tps)) goto err_clear_ints; /* Handle plug insert or removal */ - if ((event1 | event2) & TPS_REG_INT_PLUG_EVENT) + if ((event1[0] | event2[0]) & TPS_REG_INT_PLUG_EVENT) tps6598x_handle_plug_event(tps, status); err_clear_ints: - tps6598x_write64(tps, TPS_REG_INT_CLEAR1, event1); - tps6598x_write64(tps, TPS_REG_INT_CLEAR2, event2); + tps6598x_block_write(tps, TPS_REG_INT_CLEAR1, event1, intev_len); + tps6598x_block_write(tps, TPS_REG_INT_CLEAR2, event2, intev_len); err_unlock: mutex_unlock(&tps->lock); - if (event1 | event2) + if (event1[0] | event1[1] | event2[0] | event2[1]) return IRQ_HANDLED; + return IRQ_NONE; } diff --git a/drivers/usb/typec/tipd/tps6598x.h b/drivers/usb/typec/tipd/tps6598x.h index 89b24519463a..9b23e9017452 100644 --- a/drivers/usb/typec/tipd/tps6598x.h +++ b/drivers/usb/typec/tipd/tps6598x.h @@ -253,4 +253,15 @@ #define TPS_PTCC_DEV 2 #define TPS_PTCC_APP 3 +/* Version Register */ +#define TPS_VERSION_HW_VERSION_MASK GENMASK(31, 24) +#define TPS_VERSION_HW_VERSION(x) TPS_FIELD_GET(TPS_VERSION_HW_VERSION_MASK, (x)) +#define TPS_VERSION_HW_65981_2_6 0x00 +#define TPS_VERSION_HW_65987_8_DH 0xF7 +#define TPS_VERSION_HW_65987_8_DK 0xF9 + +/* Int Event Register length */ +#define TPS_65981_2_6_INTEVENT_LEN 8 +#define TPS_65987_8_INTEVENT_LEN 11 + #endif /* __TPS6598X_H__ */