Skip to contentSkip to conversation

Improve robustnes during initialization

PATCH Superseded Marc Dietrich 3 participants 14 messages Apr 5, 2024 – Apr 6, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Marc Dietrich

author maintainer
#0 lore raw

cover Improve robustnes during initialization

This series against 6.9-rc2 improves robustnes of the keyboard and touchpad initialization with the goal to eliminate the ugly delay it the i2c client controller ISR.

Marc Dietrich (4):
staging: nvec: make keyboard init synchronous
staging: nvec: make touchpad init synchronous
staging: nvec: make i2c controller register writes robust
staging: nvec: update TODO

 drivers/staging/nvec/TODO       |  1 -
 drivers/staging/nvec/nvec.c     | 39 +++++++++++++++++++--------------
 drivers/staging/nvec/nvec_kbd.c | 14 ++++++++----
 drivers/staging/nvec/nvec_ps2.c | 31 +++++++++++++++++---------
 4 files changed, 53 insertions(+), 32 deletions(-)

--
2.43.0

author maintainer
#1 lore raw

PATCH 1/4 staging: nvec: make keyboard init synchronous

Improve initialization stability by waiting for command completion before sending the next one.

---
 drivers/staging/nvec/nvec_kbd.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/staging/nvec/nvec_kbd.c +10 -4
index f9a1da952c0a..6b203d28b8a9 100644
@@ -113,6 +113,7 @@ static int nvec_kbd_probe(struct platform_device *pdev)
 		cnfg_wake[] = { NVEC_KBD, CNFG_WAKE, true, true },
 		cnfg_wake_key_reporting[] = { NVEC_KBD, CNFG_WAKE_KEY_REPORTING,
 						true };
+	struct nvec_msg *msg;
 
 	j = 0;
 
@@ -148,15 +149,20 @@ static int nvec_kbd_probe(struct platform_device *pdev)
 	nvec_register_notifier(nvec, &keys_dev.notifier, 0);
 
 	/* Enable keyboard */
-	nvec_write_async(nvec, enable_kbd, 2);
+	nvec_write_sync(nvec, enable_kbd, 2, &msg);
+	nvec_msg_free(nvec, msg);
 
 	/* configures wake on special keys */
-	nvec_write_async(nvec, cnfg_wake, 4);
+	nvec_write_sync(nvec, cnfg_wake, 4, &msg);
+	nvec_msg_free(nvec, msg);
+
 	/* enable wake key reporting */
-	nvec_write_async(nvec, cnfg_wake_key_reporting, 3);
+	nvec_write_sync(nvec, cnfg_wake_key_reporting, 3, &msg);
+	nvec_msg_free(nvec, msg);
 
 	/* Disable caps lock LED */
-	nvec_write_async(nvec, clear_leds, sizeof(clear_leds));
+	nvec_write_sync(nvec, clear_leds, sizeof(clear_leds), &msg);
+	nvec_msg_free(nvec, msg);
 
 	return 0;
 }

--
2.43.0

#2 lore raw

Re: [PATCH 1/4] staging: nvec: make keyboard init synchronous

Quoted 32 lines · Marc Dietrich

Improve initialization stability by waiting for command completion before sending the next one.

---
 drivers/staging/nvec/nvec_kbd.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/staging/nvec/nvec_kbd.c +5 -2
index f9a1da952c0a..6b203d28b8a9 100644
@@ -113,6 +113,7 @@ static int nvec_kbd_probe(struct platform_device *pdev)
 		cnfg_wake[] = { NVEC_KBD, CNFG_WAKE, true, true },
 		cnfg_wake_key_reporting[] = { NVEC_KBD, CNFG_WAKE_KEY_REPORTING,
 						true };
+	struct nvec_msg *msg;
 
 	j = 0;
 
@@ -148,15 +149,20 @@ static int nvec_kbd_probe(struct platform_device *pdev)
 	nvec_register_notifier(nvec, &keys_dev.notifier, 0);
 
 	/* Enable keyboard */
-	nvec_write_async(nvec, enable_kbd, 2);
+	nvec_write_sync(nvec, enable_kbd, 2, &msg);
+	nvec_msg_free(nvec, msg);
 
 	/* configures wake on special keys */
-	nvec_write_async(nvec, cnfg_wake, 4);
+	nvec_write_sync(nvec, cnfg_wake, 4, &msg);
+	nvec_msg_free(nvec, msg);

drivers/staging/nvec/nvec_kbd.c static int nvec_kbd_probe(struct platform_device *pdev) · line 165

Quoted 10 lines
drivers/staging/nvec/nvec_kbd.c +5 -2
+
 	/* enable wake key reporting */
-	nvec_write_async(nvec, cnfg_wake_key_reporting, 3);
+	nvec_write_sync(nvec, cnfg_wake_key_reporting, 3, &msg);
+	nvec_msg_free(nvec, msg);
 
 	/* Disable caps lock LED */
-	nvec_write_async(nvec, clear_leds, sizeof(clear_leds));
+	nvec_write_sync(nvec, clear_leds, sizeof(clear_leds), &msg);
+	nvec_msg_free(nvec, msg);

I wonder if perhaps some of this duplication can be folded into nvec_write_sync(). It seems a bit unnecessary to have to first get hold of the last message only to immediately free it.

If nvec_write_sync() were allowed to take a NULL as msg parameter, then we could check if this special case and simply do the nvec_msg_free() from there directly. Not sure if it's really worth it, though.

Thierry

#3 lore raw

Re: [PATCH 1/4] staging: nvec: make keyboard init synchronous

In reply to Marc Dietrich
Quoted 3 lines · Marc Dietrich

Improve initialization stability by waiting for command completion before sending the next one.

Presumably you experienced an issue with this in real life. Can you describe what that looked like in your commit message? Should this commit be sent to stable?

regards,
dan carpenter

#4 lore raw

Re: [PATCH 1/4] staging: nvec: make keyboard init synchronous

Quoted 8 lines · Dan Carpenter
Quoted 3 lines · Marc Dietrich

Improve initialization stability by waiting for command completion before sending the next one.

Presumably you experienced an issue with this in real life. Can you describe what that looked like in your commit message? Should this commit be sent to stable?

Actually, some of this information is in the cover letter but the cover letter isn't preserved in the git log so it's better to put it in the commits themselves.

regards,
dan carpenter

author maintainer
#5 lore raw

Re: [PATCH 1/4] staging: nvec: make keyboard init synchronous

Hi Dan,

Quoted 6 lines · Dan Carpenter
Quoted 5 lines · Dan Carpenter
Quoted 3 lines · Marc Dietrich

Improve initialization stability by waiting for command completion before sending the next one.

Quoted 7 lines
Quoted 3 lines

Presumably you experienced an issue with this in real life. Can you describe what that looked like in your commit message? Should this commit be sent to stable?

Actually, some of this information is in the cover letter but the cover letter isn't preserved in the git log so it's better to put it in the commits themselves.

ok, I'm going to send a new version of the series which hopefully addresses yous and Thierry's comments.

Best regards,

Marc

author maintainer
#6 lore raw

PATCH 2/4 staging: nvec: make touchpad init synchronous

In reply to Marc Dietrich

Improve initialization stability by waiting for command completion before sending the next one.

---
 drivers/staging/nvec/nvec_ps2.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)
drivers/staging/nvec/nvec_ps2.c +21 -10
index cb6d71b8dc83..f34016c4a26b 100644
@@ -60,16 +60,6 @@ static void ps2_stopstreaming(struct serio *ser_dev)
 	nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
 }
 
-static int ps2_sendcommand(struct serio *ser_dev, unsigned char cmd)
-{
-	unsigned char buf[] = { NVEC_PS2, SEND_COMMAND, ENABLE_MOUSE, 1 };
-
-	buf[2] = cmd & 0xff;
-
-	dev_dbg(&ser_dev->dev, "Sending ps2 cmd %02x\n", cmd);
-	return nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
-}
-
 static int nvec_ps2_notifier(struct notifier_block *nb,
 			     unsigned long event_type, void *data)
 {
@@ -98,6 +88,27 @@ static int nvec_ps2_notifier(struct notifier_block *nb,
 	return NOTIFY_DONE;
 }
 
+static int ps2_sendcommand(struct serio *ser_dev, unsigned char cmd)
+{
+	unsigned char buf[] = { NVEC_PS2, SEND_COMMAND, ENABLE_MOUSE, 1 };
+	struct nvec_msg *msg;
+	int ret;
+
+	buf[2] = cmd & 0xff;
+
+	dev_dbg(&ser_dev->dev, "Sending ps2 cmd %02x\n", cmd);
+
+	ret = nvec_write_sync(ps2_dev.nvec, buf, sizeof(buf), &msg);
+	if (ret < 0)
+		return ret;
+
+	nvec_ps2_notifier(NULL, NVEC_PS2, msg->data);
+
+	nvec_msg_free(ps2_dev.nvec, msg);
+
+	return 0;
+}
+
 static int nvec_mouse_probe(struct platform_device *pdev)
 {
 	struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);

--
2.43.0

#7 lore raw

Re: [PATCH 2/4] staging: nvec: make touchpad init synchronous

Quoted 44 lines · Marc Dietrich

Improve initialization stability by waiting for command completion before sending the next one.

---
 drivers/staging/nvec/nvec_ps2.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)
drivers/staging/nvec/nvec_ps2.c +11 -10
index cb6d71b8dc83..f34016c4a26b 100644
@@ -60,16 +60,6 @@ static void ps2_stopstreaming(struct serio *ser_dev)
 	nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
 }
 
-static int ps2_sendcommand(struct serio *ser_dev, unsigned char cmd)
-{
-	unsigned char buf[] = { NVEC_PS2, SEND_COMMAND, ENABLE_MOUSE, 1 };
-
-	buf[2] = cmd & 0xff;
-
-	dev_dbg(&ser_dev->dev, "Sending ps2 cmd %02x\n", cmd);
-	return nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
-}
-
 static int nvec_ps2_notifier(struct notifier_block *nb,
 			     unsigned long event_type, void *data)
 {
@@ -98,6 +88,27 @@ static int nvec_ps2_notifier(struct notifier_block *nb,
 	return NOTIFY_DONE;
 }
 
+static int ps2_sendcommand(struct serio *ser_dev, unsigned char cmd)
+{
+	unsigned char buf[] = { NVEC_PS2, SEND_COMMAND, ENABLE_MOUSE, 1 };
+	struct nvec_msg *msg;
+	int ret;
+
+	buf[2] = cmd & 0xff;
+
+	dev_dbg(&ser_dev->dev, "Sending ps2 cmd %02x\n", cmd);
+
+	ret = nvec_write_sync(ps2_dev.nvec, buf, sizeof(buf), &msg);

drivers/staging/nvec/nvec_ps2.c static int nvec_ps2_notifier(struct notifier_block *nb, · line 111

Quoted 10 lines
drivers/staging/nvec/nvec_ps2.c +10 -0
+	if (ret < 0)
+		return ret;
+
+	nvec_ps2_notifier(NULL, NVEC_PS2, msg->data);
+
+	nvec_msg_free(ps2_dev.nvec, msg);
+
+	return 0;
+}
+

Is there a particular reason why you've moved the function around? It'd probably make the patch a tiny bit smaller if you kept it in the right spot.

Thierry

author maintainer
#8 lore raw

Re: [PATCH 2/4] staging: nvec: make touchpad init synchronous

Hello Thierry,

Quoted 51 lines · Thierry Reding
Quoted 50 lines · Marc Dietrich

Improve initialization stability by waiting for command completion before sending the next one.

---
 drivers/staging/nvec/nvec_ps2.c | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)
drivers/staging/nvec/nvec_ps2.c +17 -10
index cb6d71b8dc83..f34016c4a26b 100644
@@ -60,16 +60,6 @@ static void ps2_stopstreaming(struct serio *ser_dev)
 	nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
 }
 
-static int ps2_sendcommand(struct serio *ser_dev, unsigned char cmd)
-{
-	unsigned char buf[] = { NVEC_PS2, SEND_COMMAND, ENABLE_MOUSE, 1 };
-
-	buf[2] = cmd & 0xff;
-
-	dev_dbg(&ser_dev->dev, "Sending ps2 cmd %02x\n", cmd);
-	return nvec_write_async(ps2_dev.nvec, buf, sizeof(buf));
-}
-
 static int nvec_ps2_notifier(struct notifier_block *nb,
 			     unsigned long event_type, void *data)
 {
@@ -98,6 +88,27 @@ static int nvec_ps2_notifier(struct notifier_block *nb,
 	return NOTIFY_DONE;
 }
 
+static int ps2_sendcommand(struct serio *ser_dev, unsigned char cmd)
+{
+	unsigned char buf[] = { NVEC_PS2, SEND_COMMAND, ENABLE_MOUSE, 1 };
+	struct nvec_msg *msg;
+	int ret;
+
+	buf[2] = cmd & 0xff;
+
+	dev_dbg(&ser_dev->dev, "Sending ps2 cmd %02x\n", cmd);
+
+	ret = nvec_write_sync(ps2_dev.nvec, buf, sizeof(buf), &msg);
+	if (ret < 0)
+		return ret;
+
+	nvec_ps2_notifier(NULL, NVEC_PS2, msg->data);
+
+	nvec_msg_free(ps2_dev.nvec, msg);
Quoted 8 lines

drivers/staging/nvec/nvec_ps2.c static int nvec_ps2_notifier(struct notifier_block *nb, · line 111

Quoted 4 lines
drivers/staging/nvec/nvec_ps2.c +4 -0
+
+	return 0;
+}
+

Is there a particular reason why you've moved the function around? It'd probably make the patch a tiny bit smaller if you kept it in the right spot.

because I'm calling nvec_ps2_notifier, I either need to to move the function down or add a forward declaration. I prefered moving down because that keeps the code a bit cleaner (with the cost of a slighly bigger patch).

Marc

author maintainer
#9 lore raw

PATCH 3/4 staging: nvec: make i2c controller register writes robust

In reply to Marc Dietrich

The i2c controller needs to read back the data written to its registers. This way we can avoid the long delay in the interrupt handler.

---
 drivers/staging/nvec/nvec.c | 39 +++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 17 deletions(-)
drivers/staging/nvec/nvec.c +22 -17
index 282a664c9176..9914c30b6933 100644
@@ -565,6 +565,20 @@ static void nvec_tx_set(struct nvec_chip *nvec)
 		(uint)nvec->tx->size, nvec->tx->data[1]);
 }
 
+/**
+ * i2c_writel - savely write to an i2c client controller register
+ @ val: value to be written
+ @ reg: register to write to
+ */
+
+static void i2c_writel(u32 val, void *reg)
+{
+	writel_relaxed(val, reg);
+
+	/* read back register to make sure that register writes completed */
+	readl_relaxed(reg);
+}
+
 /**
  * nvec_interrupt - Interrupt handler
  * @irq: The IRQ
@@ -599,7 +613,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 	if ((status & RNW) == 0) {
 		received = readl(nvec->base + I2C_SL_RCVD);
 		if (status & RCVD)
-			writel(0, nvec->base + I2C_SL_RCVD);
+			i2c_writel(0, nvec->base + I2C_SL_RCVD);
 	}
 
 	if (status == (I2C_SL_IRQ | RCVD))
@@ -691,7 +705,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 
 	/* Send data if requested, but not on end of transmission */
 	if ((status & (RNW | END_TRANS)) == RNW)
-		writel(to_send, nvec->base + I2C_SL_RCVD);
+		i2c_writel(to_send, nvec->base + I2C_SL_RCVD);
 
 	/* If we have send the first byte */
 	if (status == (I2C_SL_IRQ | RNW | RCVD))
@@ -708,15 +722,6 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 		status & RCVD ? " RCVD" : "",
 		status & RNW ? " RNW" : "");
 
-	/*
-	 * TODO: replace the udelay with a read back after each writel above
-	 * in order to work around a hardware issue, see i2c-tegra.c
-	 *
-	 * Unfortunately, this change causes an intialisation issue with the
-	 * touchpad, which needs to be fixed first.
-	 */
-	udelay(100);
-
 	return IRQ_HANDLED;
 }
 
@@ -732,15 +737,15 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec)
 
 	val = I2C_CNFG_NEW_MASTER_SFM | I2C_CNFG_PACKET_MODE_EN |
 	    (0x2 << I2C_CNFG_DEBOUNCE_CNT_SHIFT);
-	writel(val, nvec->base + I2C_CNFG);
+	i2c_writel(val, nvec->base + I2C_CNFG);
 
 	clk_set_rate(nvec->i2c_clk, 8 * 80000);
 
-	writel(I2C_SL_NEWSL, nvec->base + I2C_SL_CNFG);
-	writel(0x1E, nvec->base + I2C_SL_DELAY_COUNT);
+	i2c_writel(I2C_SL_NEWSL, nvec->base + I2C_SL_CNFG);
+	i2c_writel(0x1E, nvec->base + I2C_SL_DELAY_COUNT);
 
-	writel(nvec->i2c_addr >> 1, nvec->base + I2C_SL_ADDR1);
-	writel(0, nvec->base + I2C_SL_ADDR2);
+	i2c_writel(nvec->i2c_addr >> 1, nvec->base + I2C_SL_ADDR1);
+	i2c_writel(0, nvec->base + I2C_SL_ADDR2);
 
 	enable_irq(nvec->irq);
 }
@@ -749,7 +754,7 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec)
 static void nvec_disable_i2c_slave(struct nvec_chip *nvec)
 {
 	disable_irq(nvec->irq);
-	writel(I2C_SL_NEWSL | I2C_SL_NACK, nvec->base + I2C_SL_CNFG);
+	i2c_writel(I2C_SL_NEWSL | I2C_SL_NACK, nvec->base + I2C_SL_CNFG);
 	clk_disable_unprepare(nvec->i2c_clk);
 }
 #endif

--
2.43.0

#10 lore raw

Re: [PATCH 3/4] staging: nvec: make i2c controller register writes robust

Quoted 2 lines · Marc Dietrich

The i2c controller needs to read back the data written to its registers. This way we can avoid the long delay in the interrupt handler.

s/i2c/I2C/ perhaps? Also, looking at the preceding patches it looks to me like the reason why we can drop the udelay() call is not just because we read back, but also because we actually wait for completion. If so, maybe that should also be mentioned.

Quoted 11 lines
---
 drivers/staging/nvec/nvec.c | 39 +++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 17 deletions(-)
drivers/staging/nvec/nvec.c +0 -0
index 282a664c9176..9914c30b6933 100644

drivers/staging/nvec/nvec.c static void nvec_tx_set(struct nvec_chip *nvec) · line 569

Quoted 5 lines
drivers/staging/nvec/nvec.c +2 -0
@@ -565,6 +565,20 @@ static void nvec_tx_set(struct nvec_chip *nvec)
 		(uint)nvec->tx->size, nvec->tx->data[1]);
 }
 
+/**
+ * i2c_writel - savely write to an i2c client controller register

"safely", also "I2C"

drivers/staging/nvec/nvec.c static void nvec_tx_set(struct nvec_chip *nvec) · line 571

Quoted 2 lines
drivers/staging/nvec/nvec.c +2 -0
+ @ val: value to be written
+ @ reg: register to write to

The formatting here looks odd. I think this is supposed to be:

* @val:
* @reg:

Thierry

Quoted 79 lines
drivers/staging/nvec/nvec.c +18 -18
+ */
+
+static void i2c_writel(u32 val, void *reg)
+{
+	writel_relaxed(val, reg);
+
+	/* read back register to make sure that register writes completed */
+	readl_relaxed(reg);
+}
+
 /**
  * nvec_interrupt - Interrupt handler
  * @irq: The IRQ
@@ -599,7 +613,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 	if ((status & RNW) == 0) {
 		received = readl(nvec->base + I2C_SL_RCVD);
 		if (status & RCVD)
-			writel(0, nvec->base + I2C_SL_RCVD);
+			i2c_writel(0, nvec->base + I2C_SL_RCVD);
 	}
 
 	if (status == (I2C_SL_IRQ | RCVD))
@@ -691,7 +705,7 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 
 	/* Send data if requested, but not on end of transmission */
 	if ((status & (RNW | END_TRANS)) == RNW)
-		writel(to_send, nvec->base + I2C_SL_RCVD);
+		i2c_writel(to_send, nvec->base + I2C_SL_RCVD);
 
 	/* If we have send the first byte */
 	if (status == (I2C_SL_IRQ | RNW | RCVD))
@@ -708,15 +722,6 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 		status & RCVD ? " RCVD" : "",
 		status & RNW ? " RNW" : "");
 
-	/*
-	 * TODO: replace the udelay with a read back after each writel above
-	 * in order to work around a hardware issue, see i2c-tegra.c
-	 *
-	 * Unfortunately, this change causes an intialisation issue with the
-	 * touchpad, which needs to be fixed first.
-	 */
-	udelay(100);
-
 	return IRQ_HANDLED;
 }
 
@@ -732,15 +737,15 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec)
 
 	val = I2C_CNFG_NEW_MASTER_SFM | I2C_CNFG_PACKET_MODE_EN |
 	    (0x2 << I2C_CNFG_DEBOUNCE_CNT_SHIFT);
-	writel(val, nvec->base + I2C_CNFG);
+	i2c_writel(val, nvec->base + I2C_CNFG);
 
 	clk_set_rate(nvec->i2c_clk, 8 * 80000);
 
-	writel(I2C_SL_NEWSL, nvec->base + I2C_SL_CNFG);
-	writel(0x1E, nvec->base + I2C_SL_DELAY_COUNT);
+	i2c_writel(I2C_SL_NEWSL, nvec->base + I2C_SL_CNFG);
+	i2c_writel(0x1E, nvec->base + I2C_SL_DELAY_COUNT);
 
-	writel(nvec->i2c_addr >> 1, nvec->base + I2C_SL_ADDR1);
-	writel(0, nvec->base + I2C_SL_ADDR2);
+	i2c_writel(nvec->i2c_addr >> 1, nvec->base + I2C_SL_ADDR1);
+	i2c_writel(0, nvec->base + I2C_SL_ADDR2);
 
 	enable_irq(nvec->irq);
 }
@@ -749,7 +754,7 @@ static void tegra_init_i2c_slave(struct nvec_chip *nvec)
 static void nvec_disable_i2c_slave(struct nvec_chip *nvec)
 {
 	disable_irq(nvec->irq);
-	writel(I2C_SL_NEWSL | I2C_SL_NACK, nvec->base + I2C_SL_CNFG);
+	i2c_writel(I2C_SL_NEWSL | I2C_SL_NACK, nvec->base + I2C_SL_CNFG);
 	clk_disable_unprepare(nvec->i2c_clk);
 }
 #endif
--

2.43.0

#11 lore raw

Re: [PATCH 3/4] staging: nvec: make i2c controller register writes robust

In reply to Marc Dietrich
Quoted 13 lines · Marc Dietrich

The i2c controller needs to read back the data written to its registers. This way we can avoid the long delay in the interrupt handler.

---
 drivers/staging/nvec/nvec.c | 39 +++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 17 deletions(-)
drivers/staging/nvec/nvec.c +0 -0
index 282a664c9176..9914c30b6933 100644

drivers/staging/nvec/nvec.c static void nvec_tx_set(struct nvec_chip *nvec) · line 574

Quoted 10 lines
drivers/staging/nvec/nvec.c +7 -0
@@ -565,6 +565,20 @@ static void nvec_tx_set(struct nvec_chip *nvec)
 		(uint)nvec->tx->size, nvec->tx->data[1]);
 }
 
+/**
+ * i2c_writel - savely write to an i2c client controller register
+ @ val: value to be written
+ @ reg: register to write to
+ */
+
+static void i2c_writel(u32 val, void *reg)

I'm not a expert at kernel doc or whatever, but this comment isn't in the right format. And delete the blank line between the comment and the function.

/**
* i2c_writel - savely write to an i2c client controller register
* @ val: value to be written
* @ reg: register to write to
*/
static void i2c_writel(u32 val, void *reg)

regards,
dan carpenter

author maintainer
#12 lore raw

PATCH 4/4 staging: nvec: update TODO

In reply to Marc Dietrich

Remove isr delay from the bill.

---
 drivers/staging/nvec/TODO | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/nvec/TODO +0 -1
index 8afde3ccc960..33f9ebe6d59b 100644
@@ -1,5 +1,4 @@
 ToDo list (incomplete, unordered)
 	- move the driver to the new i2c slave framework
 	- finish suspend/resume support
-	- fix udelay in the isr
 	- add atomic ops in order to fix shutoff/reboot problems

--
2.43.0

#13 lore raw
In reply to Marc Dietrich
Quoted 10 lines · Marc Dietrich

This series against 6.9-rc2 improves robustnes of the keyboard and touchpad initialization with the goal to eliminate the ugly delay it the i2c client controller ISR.

Marc Dietrich (4):
staging: nvec: make keyboard init synchronous
staging: nvec: make touchpad init synchronous
staging: nvec: make i2c controller register writes robust
staging: nvec: update TODO

Quoted 5 lines
 drivers/staging/nvec/TODO       |  1 -
 drivers/staging/nvec/nvec.c     | 39 +++++++++++++++++++--------------
 drivers/staging/nvec/nvec_kbd.c | 14 ++++++++----
 drivers/staging/nvec/nvec_ps2.c | 31 +++++++++++++++++---------
 4 files changed, 53 insertions(+), 32 deletions(-)

Overall very nice cleanup, thanks for tackling this. I've left a few minor comments on the individual patches.

Thierry