lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 18 Sep 2021 14:09:31 +0200
From:   Sven Peter <sven@...npeter.dev>
To:     Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc:     Sven Peter <sven@...npeter.dev>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Guido Günther <agx@...xcpu.org>,
        "Bryan O'Donoghue" <bryan.odonoghue@...aro.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
        Hector Martin <marcan@...can.st>,
        Mohamed Mediouni <mohamed.mediouni@...amail.com>,
        Stan Skowronek <stan@...ellium.com>,
        Mark Kettenis <mark.kettenis@...all.nl>,
        Alexander Graf <graf@...zon.com>,
        Alyssa Rosenzweig <alyssa@...enzweig.io>
Subject: [RFT PATCH 6/9] usb: typec: tipd: Setup IntMask explicitly

Right now the code relies on the bootloader to set up the interrupt mask
correctly. This usually works but let's make sure to do it explicitly to
guarantee it will always work.

Signed-off-by: Sven Peter <sven@...npeter.dev>
---
 drivers/usb/typec/tipd/core.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index d191e7435018..2058e8cca631 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -728,6 +728,24 @@ static int tps6598x_probe(struct i2c_client *client)
 			dev_err(&client->dev, "failed to register partner\n");
 	}
 
+	if (tps->hw->use_int1) {
+		ret = tps6598x_write64(tps, TPS_REG_INT_MASK1,
+					tps->hw->irq_power_status_update |
+					tps->hw->irq_data_status_update |
+					tps->hw->irq_plug_event);
+		if (ret)
+			goto err_role_put;
+	}
+
+	if (tps->hw->use_int2) {
+		ret = tps6598x_write64(tps, TPS_REG_INT_MASK2,
+					tps->hw->irq_power_status_update |
+					tps->hw->irq_data_status_update |
+					tps->hw->irq_plug_event);
+		if (ret)
+			goto err_role_put;
+	}
+
 	ret = devm_request_threaded_irq(&client->dev, client->irq, NULL,
 					tps6598x_interrupt,
 					IRQF_SHARED | IRQF_ONESHOT,
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ