From aa2ef6bd7b27fd091536fa0bce6f00547ec64b65 Mon Sep 17 00:00:00 2001 From: Simone Date: Fri, 31 Jul 2026 11:25:44 +0200 Subject: [PATCH] i2c-imc-skylake: downstream A/B lever for the shutdown quiescing quiesce_on_shutdown (bool, 0644, default on) turns imc_pci_shutdown() into a no-op when clear, byte for byte the pre-1.0.4 behaviour. It exists for the ws1-mint S5-hang investigation: together with furyd's FURYD_SKIP_CLEAR it lets the serial-console session vary one factor at a time without rebuilding or reloading. Downstream only, like the guard branch: a parameter whose only purpose is A/B-testing one machine is not upstream material. Keep this commit out of the mainline v5 respin. --- i2c-imc-skylake.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/i2c-imc-skylake.c b/i2c-imc-skylake.c index 7500c00..26258ba 100644 --- a/i2c-imc-skylake.c +++ b/i2c-imc-skylake.c @@ -148,6 +148,17 @@ module_param(allow_unsafe_access, bool, 0444); MODULE_PARM_DESC(allow_unsafe_access, "allow access without firmware/SMM arbitration (unsafe)"); +/* + * Runtime-writable so the handback can be A/B tested against the previous + * do-nothing shutdown without rebuilding or reloading: with the parameter + * clear, imc_pci_shutdown() is a no-op, byte for byte the pre-1.0.4 + * behaviour. + */ +static bool quiesce_on_shutdown = true; +module_param(quiesce_on_shutdown, bool, 0644); +MODULE_PARM_DESC(quiesce_on_shutdown, + "hand the engine back to the firmware quiesced at shutdown"); + struct imc_chan { unsigned int cmd, data, stat; int idx; /* channel index 0 or 1 */ @@ -713,6 +724,9 @@ static void imc_pci_shutdown(struct pci_dev *pdev) if (!s) return; + if (!quiesce_on_shutdown) + return; + /* refuse new transfers, then drain the one possibly in flight */ for (i = 0; i < ARRAY_SIZE(s->adap); i++) i2c_mark_adapter_suspended(&s->adap[i]);