Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mei: speed up the power down flow

When mei driver is powering down due to suspend or shutdown
it will iterate over the mei client bus and disconnect
each client device attached in turn.
The power down flow consist of the link rest, which causes all clients
get disconnected at once, hence the individual disconnection
can be omitted and significantly reduce power down flow.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Tomas Winkler and committed by
Greg Kroah-Hartman
8d52af67 2fc10246

+17 -5
+8 -2
drivers/misc/mei/bus.c
··· 543 543 mutex_lock(&bus->device_lock); 544 544 545 545 if (!mei_cl_is_connected(cl)) { 546 - dev_dbg(bus->dev, "Already disconnected"); 546 + dev_dbg(bus->dev, "Already disconnected\n"); 547 + err = 0; 548 + goto out; 549 + } 550 + 551 + if (bus->dev_state == MEI_DEV_POWER_DOWN) { 552 + dev_dbg(bus->dev, "Device is powering down don't botther with disconnection\n"); 547 553 err = 0; 548 554 goto out; 549 555 } 550 556 551 557 err = mei_cl_disconnect(cl); 552 558 if (err < 0) 553 - dev_err(bus->dev, "Could not disconnect from the ME client"); 559 + dev_err(bus->dev, "Could not disconnect from the ME client\n"); 554 560 555 561 out: 556 562 /* Flush queues and remove any pending read */
+3 -1
drivers/misc/mei/hw-me.c
··· 1260 1260 if (rets == -ENODATA) 1261 1261 break; 1262 1262 1263 - if (rets && dev->dev_state != MEI_DEV_RESETTING) { 1263 + if (rets && 1264 + (dev->dev_state != MEI_DEV_RESETTING || 1265 + dev->dev_state != MEI_DEV_POWER_DOWN)) { 1264 1266 dev_err(dev->dev, "mei_irq_read_handler ret = %d.\n", 1265 1267 rets); 1266 1268 schedule_work(&dev->reset_work);
+3 -1
drivers/misc/mei/hw-txe.c
··· 1127 1127 if (test_and_clear_bit(TXE_INTR_OUT_DB_BIT, &hw->intr_cause)) { 1128 1128 /* Read from TXE */ 1129 1129 rets = mei_irq_read_handler(dev, &cmpl_list, &slots); 1130 - if (rets && dev->dev_state != MEI_DEV_RESETTING) { 1130 + if (rets && 1131 + (dev->dev_state != MEI_DEV_RESETTING || 1132 + dev->dev_state != MEI_DEV_POWER_DOWN)) { 1131 1133 dev_err(dev->dev, 1132 1134 "mei_irq_read_handler ret = %d.\n", rets); 1133 1135
+3 -1
drivers/misc/mei/init.c
··· 310 310 { 311 311 dev_dbg(dev->dev, "stopping the device.\n"); 312 312 313 + mutex_lock(&dev->device_lock); 314 + dev->dev_state = MEI_DEV_POWER_DOWN; 315 + mutex_unlock(&dev->device_lock); 313 316 mei_cl_bus_remove_devices(dev); 314 317 315 318 mei_cancel_work(dev); ··· 322 319 323 320 mutex_lock(&dev->device_lock); 324 321 325 - dev->dev_state = MEI_DEV_POWER_DOWN; 326 322 mei_reset(dev); 327 323 /* move device to disabled state unconditionally */ 328 324 dev->dev_state = MEI_DEV_DISABLED;