xen/pciback: Don't disable a PCI device that is already disabled.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 5 Mar 2013 18:14:19 +0000 (13:14 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 20 Mar 2013 15:03:29 +0000 (15:03 +0000)
commit7eb2731cfc7a24768ccb2e2548a32d145d339ee5
tree1bf1a799b69b6a78e12853e5b375aa1d119f9323
parent0edb34d87ec58f4f1f9309e4ca9d0fa85be474c3
xen/pciback: Don't disable a PCI device that is already disabled.

commit bdc5c1812cea6efe1aaefb3131fcba28cd0b2b68 upstream.

While shuting down a HVM guest with pci devices passed through we
get this:

pciback 0000:04:00.0: restoring config space at offset 0x4 (was 0x100000, writing 0x100002)
------------[ cut here ]------------
WARNING: at drivers/pci/pci.c:1397 pci_disable_device+0x88/0xa0()
Hardware name: MS-7640
Device pciback
disabling already-disabled device
Modules linked in:
Pid: 53, comm: xenwatch Not tainted 3.9.0-rc1-20130304a+ #1
Call Trace:
 [<ffffffff8106994a>] warn_slowpath_common+0x7a/0xc0
 [<ffffffff81069a31>] warn_slowpath_fmt+0x41/0x50
 [<ffffffff813cf288>] pci_disable_device+0x88/0xa0
 [<ffffffff814554a7>] xen_pcibk_reset_device+0x37/0xd0
 [<ffffffff81454b6f>] ? pcistub_put_pci_dev+0x6f/0x120
 [<ffffffff81454b8d>] pcistub_put_pci_dev+0x8d/0x120
 [<ffffffff814582a9>] __xen_pcibk_release_devices+0x59/0xa0

This fixes the bug.

Reported-and-Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/xen/xen-pciback/pciback_ops.c