]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: configure runtime pm before calling device_add in scsi_add_host_with_dma
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 3 Aug 2016 19:49:03 +0000 (21:49 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 26 Aug 2016 03:39:24 +0000 (23:39 -0400)
commit712e43c2838973aee2d388c3949af18be05e5c90
tree55a2cb62432c4cb7ade2dfce0c14e8605d170c01
parent2bf7784d2c3bf41969a7f0c6398dac792a414658
scsi: configure runtime pm before calling device_add in scsi_add_host_with_dma

Runtime PM should be configured already once we call device_add. See
also the description in this mail thread
https://lists.linuxfoundation.org/pipermail/linux-pm/2009-November/023198.html
or the order of calls e.g. in usb_new_device.

The changed order also helps to avoid scenarios where runtime pm for
&shost->shost_gendev is activated whilst the parent is suspended,
resulting in error message "runtime PM trying to activate child device
hostx but parent yyy is not active".

In addition properly reverse the runtime pm calls in the error path.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hosts.c