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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Oct 2016 08:03:30 +0000 (10:03 +0200)
commit8523011cec401fcf524cff3b8119ab2fa5c9ac0f
tree5161e1750a08cfaff12930e3ed3ff285eb01714f
parentccb3dd25005d999605637f0203ce67be9373eac2
scsi: configure runtime pm before calling device_add in scsi_add_host_with_dma

commit 0d5644b7d8daa3c1d91acb4367731f568c9c9469 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/hosts.c
This page took 0.024578 seconds and 5 git commands to generate.