patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Javier Carrasco <javier.carrasco@wolfvision.net>
Subject: [PATCH 6.9 14/25] usb: typec: tipd: fix event checking for tps25750
Date: Thu, 23 May 2024 15:12:59 +0200	[thread overview]
Message-ID: <20240523130330.927059534@linuxfoundation.org> (raw)
In-Reply-To: <20240523130330.386580714@linuxfoundation.org>

6.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Javier Carrasco <javier.carrasco@wolfvision.net>

commit d64adb0f41e62f91fcfdf0e0d9d5bfa714db0d23 upstream.

In its current form, the interrupt service routine of the tps25750
checks the event flags in the lowest 64 bits of the interrupt event
register (event[0]), but also in the upper part (event[1]).

Given that all flags are defined as BIT() or BIT_ULL(), they are
restricted to the first 64 bits of the INT_EVENT1 register. Including
the upper part of the register can lead to false positives e.g. if the
event 64 bits above the one being checked is set, but the one being
checked is not.

Restrict the flag checking to the first 64 bits of the INT_EVENT1
register.

Fixes: 7e7a3c815d22 ("USB: typec: tps6598x: Add TPS25750 support")
Cc: stable@vger.kernel.org
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
Link: https://lore.kernel.org/r/20240429-tps6598x_fix_event_handling-v3-1-4e8e58dce489@wolfvision.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/typec/tipd/core.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -604,11 +604,11 @@ static irqreturn_t tps25750_interrupt(in
 	if (!tps6598x_read_status(tps, &status))
 		goto err_clear_ints;
 
-	if ((event[0] | event[1]) & TPS_REG_INT_POWER_STATUS_UPDATE)
+	if (event[0] & TPS_REG_INT_POWER_STATUS_UPDATE)
 		if (!tps6598x_read_power_status(tps))
 			goto err_clear_ints;
 
-	if ((event[0] | event[1]) & TPS_REG_INT_DATA_STATUS_UPDATE)
+	if (event[0] & TPS_REG_INT_DATA_STATUS_UPDATE)
 		if (!tps6598x_read_data_status(tps))
 			goto err_clear_ints;
 
@@ -617,7 +617,7 @@ static irqreturn_t tps25750_interrupt(in
 	 * a plug event. Therefore, we need to check
 	 * for pr/dr status change to set TypeC dr/pr accordingly.
 	 */
-	if ((event[0] | event[1]) & TPS_REG_INT_PLUG_EVENT ||
+	if (event[0] & TPS_REG_INT_PLUG_EVENT ||
 	    tps6598x_has_role_changed(tps, status))
 		tps6598x_handle_plug_event(tps, status);
 



  parent reply	other threads:[~2024-05-23 13:18 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-23 13:12 [PATCH 6.9 00/25] 6.9.2-rc1 review Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 01/25] Bluetooth: btusb: Fix the patch for MT7920 the affected to MT7921 Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 02/25] wifi: iwlwifi: Use request_module_nowait Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 03/25] cpufreq: amd-pstate: fix the highest frequency issue which limits performance Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 04/25] drm/amd/display: Fix division by zero in setup_dsc_config Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 05/25] net: ks8851: Fix another TX stall caused by wrong ISR flag handling Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 06/25] x86/percpu: Use __force to cast from __percpu address space Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 07/25] Bluetooth: L2CAP: Fix div-by-zero in l2cap_le_flowctl_init() Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 08/25] KEYS: trusted: Fix memory leak in tpm2_key_encode() Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 09/25] ASoC: Intel: sof_sdw: use generic rtd_init function for Realtek SDW DMICs Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 10/25] binder: fix max_thread type inconsistency Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 11/25] usb: dwc3: Wait unconditionally after issuing EndXfer command Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 12/25] net: usb: ax88179_178a: fix link status when link is set to down/up Greg Kroah-Hartman
2024-05-23 13:12 ` [PATCH 6.9 13/25] usb: typec: ucsi: displayport: Fix potential deadlock Greg Kroah-Hartman
2024-05-23 13:12 ` Greg Kroah-Hartman [this message]
2024-05-23 13:13 ` [PATCH 6.9 15/25] usb: typec: tipd: fix event checking for tps6598x Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 16/25] serial: kgdboc: Fix NMI-safety problems from keyboard reset code Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 17/25] remoteproc: mediatek: Make sure IPI buffer fits in L2TCM Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 18/25] Revert "media: v4l2-ctrls: show all owned controls in log_status" Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 19/25] KEYS: trusted: Do not use WARN when encode fails Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 20/25] admin-guide/hw-vuln/core-scheduling: fix return type of PR_SCHED_CORE_GET Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 21/25] docs: kernel_include.py: Cope with docutils 0.21 Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 22/25] Docs/admin-guide/mm/damon/usage: fix wrong example of DAMOS filter matching sysfs file Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 23/25] Docs/admin-guide/mm/damon/usage: fix wrong schemes effective quota update command Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 24/25] block: add a disk_has_partscan helper Greg Kroah-Hartman
2024-05-23 13:13 ` [PATCH 6.9 25/25] block: add a partscan sysfs attribute for disks Greg Kroah-Hartman
2024-05-23 16:22 ` [PATCH 6.9 00/25] 6.9.2-rc1 review Mark Brown
2024-05-23 17:05 ` SeongJae Park
2024-05-23 21:06 ` Florian Fainelli
2024-05-23 21:18 ` Florian Fainelli
2024-05-24  4:47 ` Bagas Sanjaya
2024-05-24  8:52 ` Ron Economos
2024-05-24  9:32 ` Anders Roxell
2024-05-24 14:34 ` Shuah Khan
2024-05-24 15:20 ` Jon Hunter
2024-05-24 18:47 ` Pavel Machek
2024-05-25  9:35 ` Pascal Ernster
2024-05-25  9:35 ` Pascal Ernster
2024-05-25  9:37 ` Pascal Ernster
2024-05-25 16:26 ` Allen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240523130330.927059534@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=javier.carrasco@wolfvision.net \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).