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.
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user