From patchwork Thu Mar 28 16:55:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Carrasco X-Patchwork-Id: 13609151 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2134.outbound.protection.outlook.com [40.107.20.134]) (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 A1D32BA53; Thu, 28 Mar 2024 16:56:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.134 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711644969; cv=fail; b=oqwYsd83E5zoMvVtPXzmEinS341WEzjjW3YbEyjC7cWxDGvCGdMljUT6MjBSA/2kMPTcR+EMKYiP4jHfY31cYXuF1VOtaxN3rdVFPoD+RxDXl8630he1In/hGypla5CGo9MQlv30cDWnfQL/8Py9JpZRzjVLbC0elAjt5KKMCGw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711644969; c=relaxed/simple; bh=Y+1nHQlsCqTF+e88UsG95bmHOye8o5TDSIbzubQbwIo=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=uiY9ec9aL6kHV4SgFoqlSXZShsAA0TjVwyQ2uSkGAoq0haAD/b8sOpvHU9j1n3NDpt5O2zUMt4r8ZmLqUMc1EMI2OKFv0ikH6ya43GXk2b2qmae+QpwYTVMNnYSxSJuSOHp8c9MqztbdjDI/ETt7qh7lHT/ivR3xlDo2n58mg+s= 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=YQea2o48; arc=fail smtp.client-ip=40.107.20.134 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="YQea2o48" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TOMMya0b7zRAFnH1jqVx3bG/J9qz5NGE6ozq+RL14bx48Bczbqf0C8tkGm8fVVNcGjAPLm7tSGkmnn/xpcV+YplDrfmKh7IJ3AbjG8NyJotNYGol0+MfXV+AoUutkjEEQJWR8GBBV3QM1McErPxXyWC7+rTJDqs0SUObI2Wcw1shVodAnSbW9ShHptutmAOacs/SkbAHVrczhe7CDrjTjS0H2FPFbzpTu8Ok9xPNcMAgn0uq+6HuUwEsLxX+6Sh73mt7Q1AKkA23KXJ+ZdfVMGzm7Cp6tEfgefDBDxWLzAhGCRJjiBqHhvpsWsI1eCV51Vc4+S8p7HAlRH1msKEh3A== 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=6Tg7I8tZRCyRWzwjNSEZnzQHbkHz9Y+LTHE0QbazzlU=; b=A3UHJZf7j6UPqzXHHvjUWnO/2Mqypq1QFJfctwLJnWrdAttF7c/T8R4jYBlCKUC8j+/N4Ldz9V5cf6IXUH8UyEi30PzDNgG5a6WVVdoiSLNPAdI/YDsl6/1w953rhrMaOay4+ibK/T1JBr6Mzgs2QbWNwYT7527UWmbNQCMbJWEhE9Yu9aS0yQP3VDK9a7h8+GjAGoBJ8W7eRcYLRG+f6dwvpM8pMDLpFQGGbny/xDg0BI//EMvsJIDPx6oc7G3215eEqUEhyylgbpgSVQzYkYtzgs5JdIFPppwknZ9QEaD+6AtpPVYQwBHZ7sE/zxBEwKEl8Vxn9KPt2CBRHDF4AQ== 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=6Tg7I8tZRCyRWzwjNSEZnzQHbkHz9Y+LTHE0QbazzlU=; b=YQea2o48YvbFEH6E+bYrsXPjJzJJK8UtSwAsYQPU0Kxie7uFyqXlBEjdlMXcmHe2SwuEvn5ZsHb0eRUmx5AGyNd4pPuShXkA605QElxHHRCCohR/Tkma21og1Mh5p4+gpyNatY3rd4eGrsaQTGcnHgVGC9eFaYV5pyf306q4ph4= 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 VI1PR08MB10147.eurprd08.prod.outlook.com (2603:10a6:800:1ce::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.31; Thu, 28 Mar 2024 16:56:03 +0000 Received: from VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::9e35:6de9:e4fc:843f]) by VE1PR08MB4974.eurprd08.prod.outlook.com ([fe80::9e35:6de9:e4fc:843f%7]) with mapi id 15.20.7409.031; Thu, 28 Mar 2024 16:56:03 +0000 From: Javier Carrasco Subject: [PATCH RESEND 0/2] usb: typec: tipd: fix event checking in interrupt service routines Date: Thu, 28 Mar 2024 17:55:50 +0100 Message-Id: <20240328-tps6598x_fix_event_handling-v1-0-502721ff705b@wolfvision.net> X-B4-Tracking: v=1; b=H4sIABahBWYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDYyML3ZKCYjNTS4uK+LTMivjUstS8knigupSczLx0XWNjS4sU4xQLozQ LUyWgCQVFqUBVYNOjlYJcg139XJRia2sBEkR1P3UAAAA= 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=1711644963; l=1586; i=javier.carrasco@wolfvision.net; s=20240320; h=from:subject:message-id; bh=Y+1nHQlsCqTF+e88UsG95bmHOye8o5TDSIbzubQbwIo=; b=vynD2T6S3d2vSiqDJ9OvwB+jo0huZ7sL3CiG/kqzs7e5fQjGT6jgaul3nsCXJWRqMTRGeno12 zT8EZ2/H+4BCx9pFEP+zZr34yhlxcKUGlkTwh0CKZvvWC6yhXKpMrRY X-Developer-Key: i=javier.carrasco@wolfvision.net; a=ed25519; pk=Vxk2/0sGIxM8rsKnceszFuSuHVfQwa1Yo8+is7BX2nY= X-ClientProxiedBy: VI1PR07CA0136.eurprd07.prod.outlook.com (2603:10a6:802:16::23) 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_|VI1PR08MB10147:EE_ X-MS-Office365-Filtering-Correlation-Id: 78943a57-7016-44b6-dfe3-08dc4f47f411 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3fJI+b2yzidJ/iqi6jfYrWN/1RNF0nJt6isnlJ09+fleL2TMAy+YP6rO66GdPcaX1qolW4vOLdNNv1k+1hiB3iD1B0URIiDMkJ41VQk0Xk3iJrYl8xPw3yuPgdjk+wG/lyYmTKksTv+57QlZNvgh+FYywJBfF86f84lN5JB7JgO2Km9DKDuQWlUgrUmldU7HWYBi7gG8qlPx8BBNyD55iauPq8gxp+jXx6vuGVbkygWp4/eEXaw74hg112vkWusfdI1v/ddUi6o/NMIgkKmmP91rOKmabLhGw61uxxiFQk+XTZR5OU6Q0a2UPxn3eZ3tZCqofTPHM7tQuYm8DOlbiulDPb7/6d1+xUCAdHFJuVZZJ5tVUlOmu0FY6rT48CaPie9X66Q/aMRUymmDQuAaw3T7xtInHazUXPqH2MFHJTVitIsQbBr7DtTZ2OGLGYt/YnOewoJB5lCVA9UH+bpiZZiYnyfsDFLgzgs4npJ1n4z8sAWgZ/c5P/BInl69gOKr6JQ1N6YoJdQBZNlivw9oKLiFxiGZssuo7DJprjJr4poUvAxtxVNgarcBCG4Zj1c1iS8F1b7xcyfY8N4ZgVu0iUyaoljN6IaWDVbNNHnY+aMYdHEwl8q4anVwR5u044HpK6AgyQ94uwWi+EhUHcz5i0qoy/I4b+VFBrLlZnnbY3axOPOWc7+uarLalvLej9qBxbf15BfLnTI9bghPC1Mx8lSukPXohspWt5wzAL7n5BQ= 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)(366007)(376005)(1800799015)(52116005)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?IH2DdFjXHr69VxJLR/1MPOZOGlQ4?= =?utf-8?q?ihNbQyUs39bNXELfhtCebYgU+AaGjQTJlJaj+nKHfBXkXYVkIMgP5DQZVFfvR5G5M?= =?utf-8?q?aBLvxmMxP2aRygWb50hQbi7jKgnxkYPFpoTKQsbTx1RpY17NDxg63TIx7W9b8sQod?= =?utf-8?q?hxfupd0BmZBg0H6my3NvK6F8MY9j3qDIwe62QfWT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vIcY6uWwj7b9kgV7jfjAKl?= =?utf-8?q?rer6lxN75YSLJgZXdHNwwPKBfUBX7kBY+JdClAqb2JQvcijqTYGEaBjBKwAFHhnQK?= =?utf-8?q?YZSn1zIeo/KLaeFn9shTdxjJPDinHXbjzzPAd1dLeuymSI3hylAKm1O3wpg08FKJH?= =?utf-8?q?0yNk92I+uY7MJi6BKJCBtKhHDpLsGeCnXXK37gbz4owJ/I4vCKCFpVWUoctAH/2w6?= =?utf-8?q?GDkMouliDSVNcinTjuilY6OlBwLZkY4Cu1yjYSifZKaPinG7+xQSI+MnUIlG8hwWM?= =?utf-8?q?gFStM/j8Cmiam1AQJ7RAI+wFFshZ+3KRC1YScMKsJ5Xq25w9MTdUgolkTgj65hOQh?= =?utf-8?q?1Q6Q9bNCe0HD2ed9Jt6LjiNe9XVjyjt4C10MHiSXE2/rKukt1R5PsJx0j4o3yiJF7?= =?utf-8?q?yt65Pe3qFJT/L0Ms/6cQTb1S4PY8w2HVurfIlt8U70dfx3+SAOE7JLT0aJ4cCrwIO?= =?utf-8?q?hLFz+fVxN5d76JgW8RuWwZZ2NvDpc7FbVu1tqY6rMGf6F2jMQQ/WnRs=3D?= X-OriginatorOrg: wolfvision.net X-MS-Exchange-CrossTenant-Network-Message-Id: 78943a57-7016-44b6-dfe3-08dc4f47f411 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4974.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2024 16:56:03.7560 (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: a430X1iRk3YMKjVGZHQGdpbMLKeI8BMfl/Qj1MBt+uhcrASKffpnTJBJotbMGQwD27WNGQmg90RF6dRDZLg/wcX0GAJ1vUe4aesmqxcp5XI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10147 The ISRs of the tps25750 and tps6598x do not handle generated events properly under all circumstances. The tps6598x ISR does not read all bits of the INT_EVENTX registers, leaving events signaled with bits above 64 unattended. Moreover, these events are not cleared, leaving the interrupt enabled. The tps25750 reads all bits of the INT_EVENT1 register, but the event checking is not right because the same event is checked in two different regions of the same register by means of an OR operation. This series aims to fix both issues by reading all bits of the INT_EVENTX registers, and limiting the event checking to the region where the supported events are defined (currently they are limited to the first 64 bits of the registers, as the are defined as BIT_ULL()). If the need for events above the first 64 bits of the INT_EVENTX registers arises, a different mechanism might be required. But for the current needs, all definitions can be left as they are. Note: resend to add the Cc tag for 'stable' (fixes in the series). Signed-off-by: Javier Carrasco --- Javier Carrasco (2): usb: typec: tipd: fix event checking for tps25750 usb: typec: tipd: fix event checking for tps6598x drivers/usb/typec/tipd/core.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) --- base-commit: 4cece764965020c22cff7665b18a012006359095 change-id: 20240328-tps6598x_fix_event_handling-3398d3d82f85 Best regards,