Skip to contentSkip to conversation

mei: vsc: Unregister interrupt handler for system suspend

PATCH Superseded Sakari Ailus 2 participants 5 messages Mar 18, 2024 – Mar 20, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mei: vsc: Unregister interrupt handler for system suspend

Unregister the MEI VSC interrupt handler before system suspend and re-register it at system resume time. This mirrors implementation of other MEI devices.

This patch fixes the bug that causes continuous stream of MEI VSC errors after system resume.

Fixes 386a766c4169 ("mei: Add MEI hardware support for IVSC device")
Cc [email protected] # for 6.8
---
 drivers/misc/mei/platform-vsc.c | 17 ++++++-
 drivers/misc/mei/vsc-tp.c       | 84 +++++++++++++++++++++++----------
 drivers/misc/mei/vsc-tp.h       |  3 ++
 3 files changed, 78 insertions(+), 26 deletions(-)
drivers/misc/mei/platform-vsc.c +16 -1
index 8d303c6c0000..8db0fcf24e70 100644
@@ -402,25 +402,40 @@ static int mei_vsc_remove(struct platform_device *pdev)
 static int mei_vsc_suspend(struct device *dev)
 {
 	struct mei_device *mei_dev = dev_get_drvdata(dev);
+	struct mei_vsc_hw *hw = mei_dev_to_vsc_hw(mei_dev);
 
 	mei_stop(mei_dev);
 
+	mei_disable_interrupts(mei_dev);
+
+	vsc_tp_free_irq(hw->tp);
+
 	return 0;
 }
 
 static int mei_vsc_resume(struct device *dev)
 {
 	struct mei_device *mei_dev = dev_get_drvdata(dev);
+	struct mei_vsc_hw *hw = mei_dev_to_vsc_hw(mei_dev);
 	int ret;
 
-	ret = mei_restart(mei_dev);
+	ret = vsc_tp_request_irq(hw->tp);
 	if (ret)
 		return ret;
 
+	ret = mei_restart(mei_dev);
+	if (ret)
+		goto err_free;
+
 	/* start timer if stopped in suspend */
 	schedule_delayed_work(&mei_dev->timer_work, HZ);
 
 	return 0;
+
+err_free:
+	vsc_tp_free_irq(hw->tp);
+
+	return ret;
 }
 
 static DEFINE_SIMPLE_DEV_PM_OPS(mei_vsc_pm_ops, mei_vsc_suspend, mei_vsc_resume);
drivers/misc/mei/vsc-tp.c +59 -25

120 lines not on this page · raw message

drivers/misc/mei/vsc-tp.h +3 -0
index f9513ddc3e40..14ca195cbddc 100644
@@ -37,6 +37,9 @@ int vsc_tp_xfer(struct vsc_tp *tp, u8 cmd, const void *obuf, size_t olen,
 int vsc_tp_register_event_cb(struct vsc_tp *tp, vsc_tp_event_cb_t event_cb,
 			     void *context);
 
+int vsc_tp_request_irq(struct vsc_tp *tp);
+void vsc_tp_free_irq(struct vsc_tp *tp);
+
 void vsc_tp_intr_enable(struct vsc_tp *tp);
 void vsc_tp_intr_disable(struct vsc_tp *tp);
 void vsc_tp_intr_synchronize(struct vsc_tp *tp);
Signature · 1 line
2.39.2
#1 lore raw
Quoted 12 lines · Sakari Ailus

Unregister the MEI VSC interrupt handler before system suspend and re-register it at system resume time. This mirrors implementation of other MEI devices.

This patch fixes the bug that causes continuous stream of MEI VSC errors after system resume.

Fixes 386a766c4169 ("mei: Add MEI hardware support for IVSC device")
Cc [email protected] # for 6.8
Quoted 5 lines
---
 drivers/misc/mei/platform-vsc.c | 17 ++++++-
 drivers/misc/mei/vsc-tp.c       | 84 +++++++++++++++++++++++----------
 drivers/misc/mei/vsc-tp.h       |  3 ++
 3 files changed, 78 insertions(+), 26 deletions(-)

What is the git commit id of this in Linus's tree?

thanks,

greg k-h

#2 lore raw

Hi Greg,

Quoted 19 lines · Greg Kroah-Hartman
Quoted 12 lines · Sakari Ailus

Unregister the MEI VSC interrupt handler before system suspend and re-register it at system resume time. This mirrors implementation of other MEI devices.

This patch fixes the bug that causes continuous stream of MEI VSC errors after system resume.

Fixes 386a766c4169 ("mei: Add MEI hardware support for IVSC device")
Cc [email protected] # for 6.8
Quoted 5 lines
---
 drivers/misc/mei/platform-vsc.c | 17 ++++++-
 drivers/misc/mei/vsc-tp.c       | 84 +++++++++++++++++++++++----------
 drivers/misc/mei/vsc-tp.h       |  3 ++
 3 files changed, 78 insertions(+), 26 deletions(-)
Quoted 1 line

What is the git commit id of this in Linus's tree?

This one isn't in Linus's (or any other maintainer) tree yet.

Signature · 3 lines
Regards,

Sakari Ailus
#3 lore raw
Quoted 22 lines · Sakari Ailus

Hi Greg,

Quoted 19 lines · Greg Kroah-Hartman
Quoted 17 lines · Sakari Ailus

Unregister the MEI VSC interrupt handler before system suspend and re-register it at system resume time. This mirrors implementation of other MEI devices.

This patch fixes the bug that causes continuous stream of MEI VSC errors after system resume.

Fixes 386a766c4169 ("mei: Add MEI hardware support for IVSC device")
Cc [email protected] # for 6.8
---
 drivers/misc/mei/platform-vsc.c | 17 ++++++-
 drivers/misc/mei/vsc-tp.c       | 84 +++++++++++++++++++++++----------
 drivers/misc/mei/vsc-tp.h       |  3 ++
 3 files changed, 78 insertions(+), 26 deletions(-)
Quoted 3 lines
Quoted 1 line

What is the git commit id of this in Linus's tree?

This one isn't in Linus's (or any other maintainer) tree yet.

Then why was it sent only for 6.8? Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

thanks,

greg k-h

#4 lore raw
Quoted 23 lines · Greg Kroah-Hartman
Quoted 22 lines · Sakari Ailus

Hi Greg,

Quoted 19 lines · Greg Kroah-Hartman
Quoted 17 lines · Sakari Ailus

Unregister the MEI VSC interrupt handler before system suspend and re-register it at system resume time. This mirrors implementation of other MEI devices.

This patch fixes the bug that causes continuous stream of MEI VSC errors after system resume.

Fixes 386a766c4169 ("mei: Add MEI hardware support for IVSC device")
Cc [email protected] # for 6.8
---
 drivers/misc/mei/platform-vsc.c | 17 ++++++-
 drivers/misc/mei/vsc-tp.c       | 84 +++++++++++++++++++++++----------
 drivers/misc/mei/vsc-tp.h       |  3 ++
 3 files changed, 78 insertions(+), 26 deletions(-)
Quoted 7 lines
Quoted 3 lines
Quoted 1 line

What is the git commit id of this in Linus's tree?

This one isn't in Linus's (or any other maintainer) tree yet.

Then why was it sent only for 6.8? Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

Ah, I think I mistakenly included the stable@vger e-mail address in distribution as the other patch was meant to be sent there. I'll resend this.

Signature · 1 line
Sakari Ailus