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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 28 Sep 2016 10:15:48 +0200
From:   Benjamin Tissoires <benjamin.tissoires@...hat.com>
To:     Jean Delvare <jdelvare@...e.com>, Wolfram Sang <wsa@...-dreams.de>
Cc:     linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v3 09/10] i2c: i801: check if Host Notify is available during interrupt

There is a chance we get called while Host Notify is not available (yet),
so we need to clear the Host Notify bit in those rare case.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@...hat.com>

---

changes in v3:
- renamed from "i2c: i801: warn on i2c_handle_smbus_host_notify() errors"
- removed the warnings and just kept the test
- added some comments on why the errors are not treated

no changes in v2 (comments addressed in the previous patches)

i2c: i2c-i801: remove warnings on the handle host notify

add a comment on i2c-i801
---
 drivers/i2c/busses/i2c-i801.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 422cce2..38e2421 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -580,11 +580,20 @@ static irqreturn_t i801_host_notify_isr(struct i801_priv *priv)
 	unsigned short addr;
 	unsigned int data;
 
+	if (unlikely(!priv->host_notify))
+		goto out;
+
 	addr = inb_p(SMBNTFDADD(priv)) >> 1;
 	data = inw_p(SMBNTFDDAT(priv));
 
+	/*
+	 * We don't notify about missed host notify events when the adapter
+	 * lags behind. The operation is still scheduled and will get
+	 * eventually processed.
+	 */
 	i2c_handle_smbus_host_notify(priv->host_notify, addr, data);
 
+out:
 	/* clear Host Notify bit and return */
 	outb_p(SMBSLVSTS_HST_NTFY_STS, SMBSLVSTS(priv));
 	return IRQ_HANDLED;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ