Skip to contentSkip to conversation

mei: me: set internal pg flag to off on hardware reset

PATCH New Tomas Winkler 1 participant 3 messages Jun 6, 2022

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

PATCH 1/3 mei: me: set internal pg flag to off on hardware reset

From: Alexander Usyskin <[email protected]>

Link reset flow is always performed in the runtime resumed state. The internal PG state may be left as ON after the suspend and will not be updated upon the resume if the D0i3 is not supported.

Ensure that the internal PG state is set to the right value on the flow entrance in case the firmware does not support D0i3.

---
 drivers/misc/mei/hw-me.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/misc/mei/hw-me.c +2 -0
index 9870bf717979..befa491e3344 100644
@@ -1154,6 +1154,8 @@ static int mei_me_hw_reset(struct mei_device *dev, bool intr_enable)
 			ret = mei_me_d0i3_exit_sync(dev);
 			if (ret)
 				return ret;
+		} else {
+			hw->pg_state = MEI_PG_OFF;
 		}
 	}
 
Signature · 1 line
2.35.3
#1 lore raw

PATCH 2/3 mei: hbm: drop capability response on early shutdown

From: Alexander Usyskin <[email protected]>

Drop HBM responses also in the early shutdown phase where the usual traffic is allowed.
Extend the rule that drop HBM responses received during the shutdown phase by also in MEI_DEV_POWERING_DOWN state.
This resolves the stall if the driver is stopping in the middle of the link initialization or link reset.

Drop the capabilities response on early shutdown.

Fixes 6d7163f2c49f ("mei: hbm: drop hbm responses on early shutdown")
---
 drivers/misc/mei/hbm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/misc/mei/hbm.c +2 -1
index cebcca6d6d3e..cf2b8261da14 100644
@@ -1351,7 +1351,8 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
 
 		if (dev->dev_state != MEI_DEV_INIT_CLIENTS ||
 		    dev->hbm_state != MEI_HBM_CAP_SETUP) {
-			if (dev->dev_state == MEI_DEV_POWER_DOWN) {
+			if (dev->dev_state == MEI_DEV_POWER_DOWN ||
+			    dev->dev_state == MEI_DEV_POWERING_DOWN) {
 				dev_dbg(dev->dev, "hbm: capabilities response: on shutdown, ignoring\n");
 				return 0;
 			}
Signature · 1 line
2.35.3
#2 lore raw

PATCH 3/3 mei: me: add raptor lake point S DID

In reply to Tomas Winkler

From: Alexander Usyskin <[email protected]>

Add Raptor (Point) Lake S device id.

---
 drivers/misc/mei/hw-me-regs.h | 2 ++
 drivers/misc/mei/pci-me.c     | 2 ++
 2 files changed, 4 insertions(+)
drivers/misc/mei/hw-me-regs.h +2 -0
index 64ce3f830262..15e8e2b322b1 100644
@@ -109,6 +109,8 @@
 #define MEI_DEV_ID_ADP_P      0x51E0  /* Alder Lake Point P */
 #define MEI_DEV_ID_ADP_N      0x54E0  /* Alder Lake Point N */
 
+#define MEI_DEV_ID_RPL_S      0x7A68  /* Raptor Lake Point S */
+
 /*
  * MEI HW Section
  */
drivers/misc/mei/pci-me.c +2 -0
index 33e58821e478..5435604327a7 100644
@@ -116,6 +116,8 @@ static const struct pci_device_id mei_me_pci_tbl[] = {
 	{MEI_PCI_DEVICE(MEI_DEV_ID_ADP_P, MEI_ME_PCH15_CFG)},
 	{MEI_PCI_DEVICE(MEI_DEV_ID_ADP_N, MEI_ME_PCH15_CFG)},
 
+	{MEI_PCI_DEVICE(MEI_DEV_ID_RPL_S, MEI_ME_PCH15_CFG)},
+
 	/* required last entry */
 	{0, }
 };
Signature · 1 line
2.35.3